How RESTful count property actually work? - xpages

I tried to load ONE data column using RESTful viewItemFileService and use it in dojo filtering select control for selection. The total rows is 50,000 and seems that REST could not handle big data because I set count=1000000. If I set count=500, then it works but the rest of data after 500 not available for selection in dojo filtering control. I would like to see RESTful can load data per count size but it seems no doing that. My code as below. I must missing something.
<xe:restService id="restActivity" jsId="activityStore"
pathInfo="activities">
<xe:this.service>
<xe:viewItemFileService viewName="lkpActivities"
dojoType="dojo.data.ItemFileReadStore" var="rowActivity"
contentType="application/json" compact="true" systemColumns="4"
count="1000000">
<xe:this.columns>
<xe:restViewColumn columnName="Activity"
name="Activity">
</xe:restViewColumn>
</xe:this.columns>
</xe:viewItemFileService>
</xe:this.service>
</xe:restService>
<xe:djFilteringSelect id="djfsActivity"
promptMessage="Please type the first letter of intended activity"
invalidMessage="No activity found. Please type again"
searchAttr="Activity" labelAttr="Activity" store="activityStore"
pageSize="20">
</xe:djFilteringSelect>

Related

Oracle BI Report based on Excel template has no data when called through ReportService?

Oracle BI Publisher 12.2.1.4.0
I have a set of reports that I want to run using runReport Report Service. All the reports are working well when started within browser. The ones based on excel template when run through Report Service has just a header row with column labels. No data at all. Those based on BI template when asked for "xlsx format" through Report Service are all ok.
Those whose templates are created in excel (2019) using Oracle BI Publisher Desktop 12.2.1.4.0 add-on work ok unless called with SOAP envelope runReport action.
I'm doing something wrong, but could not find what. Not sure if the problem is in passing/formating parameters (dates especialy), or something else is missing or wrong in my SOAP:
<?xml version="1.0" encoding="utf-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap-env:Body>
<ns0:RunReport xmlns:ns0="http://xmlns.oracle.com/oxp/service/v2">
<ns0:reportRequest>
<ns0:attributeCalendar>Gregorian</ns0:attributeCalendar>
<ns0:attributeFormat>excel</ns0:attributeFormat>
<ns0:attributeLocale>hr-Hr</ns0:attributeLocale>
<ns0:attributeTemplate>_TO_EXCEL_WEEKS_Cards.xls</ns0:attributeTemplate>
<ns0:flattenXML>true</ns0:flattenXML>
<ns0:parameterNameValues>
<ns0:listOfParamNameValues>
<ns0:item>
<ns0:name>DateFrom</ns0:name>
<ns0:values>
<ns0:item>2022-05-01T00:00:00.000+02:00</ns0:item>
</ns0:values>
</ns0:item>
<ns0:item>
<ns0:name>DateTo</ns0:name>
<ns0:values>
<ns0:item>2022-05-28T00:00:00.000+02:00</ns0:item>
</ns0:values>
</ns0:item>
<ns0:item>
<ns0:name>DateDeliveredTo</ns0:name>
<ns0:values>
<ns0:item>2022-05-28T00:00:00.000+02:00</ns0:item>
</ns0:values>
</ns0:item>
<ns0:item>
<ns0:name>Marcet</ns0:name>
<ns0:values>
<ns0:item>*</ns0:item>
</ns0:values>
</ns0:item>
</ns0:listOfParamNameValues>
</ns0:parameterNameValues>
<ns0:reportAbsolutePath>/MKTP/06-Sell/70_Offer/Reports/70_20_WEEKS_TO_EXCEL_TODAY_2022_REPORT.xdo</ns0:reportAbsolutePath>
<ns0:sizeOfDataChunkDownload>-1</ns0:sizeOfDataChunkDownload>
<ns0:byPassCache>True</ns0:byPassCache>
</ns0:reportRequest>
<ns0:userID>username</ns0:userID>
<ns0:password>password</ns0:password>
</ns0:RunReport>
</soap-env:Body>
</soap-env:Envelope>
I did try different attributeFormat tags (it works only when "excel", otherwise error), tryed to change the flattenXML tag (no data with true or false). Template is very simple with one group of repeating records and the header is always there, so there is not the problem with template name/location.
XDO_METADATA:
Data Constraints:
XDO_?XDOFIELD1? <?DOCTYPE?>
XDO_?XDOFIELD2? <?DOC_ID?>
XDO_?XDOFIELD3? <?STATUS?>
XDO_?XDOFIELD4? <?ORDER_ID?>
XDO_?XDOFIELD5? <?DOC_YEAR?>
XDO_?XDOFIELD6? <?DOC_NUM?>
XDO_?XDOFIELD7? <?DOC_DATE?>
...
...
XDO_GROUP_?XDOG1? <xsl:for-each select=".//G_1"> </xsl:for-each>
All the other reports (pdf-s) working ok whatever way they are run.
Thanks for your time...
Found it. The problem is parameter in BI defined as DATE. Changed it to text, adjusted the WHERE clause in dataset to something like
column Between To_Date(date_param1, 'dd.mm.yyyy') And To_Date(date_param2, 'dd.mm.yyyy')
and shortend the date parameter values in SOAP Envelope. It works now.
Anyway, I would like to know if there is a solution where I could keep my parameters in BI to stay of date type. This is a lot of boring things to do.

xPages REST service to feed a Notes Calendar Store

I am trying to use RESTservice to get data from a resource reservation DB and provide a calendar with filter capability by resource name.
All run fine while I use the rest service without filter
<xe:restService id="restService2" pathInfo="/inoteslegacyjson">
<xe:this.service>
<xe:viewJsonLegacyService count="30000"
databaseName="${compositeData.databaseName}"
viewName="${compositeData.viewName}" defaultColumns="false"
var="entry" contentType="text/plain" compact="false">
<xp:this.columns>
<!-- Cal Date -->
<xe:restViewColumn name="$134"
columnName="StartDateTime">
</xe:restViewColumn>
<!-- Icon -->
<xe:restViewColumn name="$149" columnName="$149"></xe:restViewColumn>
<!-- Start Date -->
<xe:restViewColumn name="$144"
columnName="StartDateTime">
</xe:restViewColumn>
...
But when I put a search syntax like this:
<xe:this.search><![CDATA[#{javascript:
var isResourceFiltered:Boolean;
var strTmp:String=viewScope.resourceName;
isResourceFiltered=(strTmp.compareToIgnoreCase("All")!=0);
print ("Is result filtered:" + isResourceFiltered + ", filter: "+ strTmp);
if (!isResourceFiltered) {
return "";
}
return "ResourceName=" + viewScope.resourceName}]]></xe:this.search>
I cannot see any message in console about Print() and get some errors in page:
calendarDataStore: RequestError: Unable to load /admin/resource.nsf/ResourceCalendarFiltered.xsp/inoteslegacyjson status: 500
or error 400
How does can I filter a calendar view for resource name
(And how make a time slice to get only time period showed in the UI to avoid count="30000"?)
viewScope.resourceName may not be set early enough for it to be used. This could explain the lack of a print statement and the error 500 returned by the calendarDataStore.
Try adding some error handling to verify it's an issue with the component vs an error with your code.
XPages OpenLog Logger (or the corresponding code in OpenNTF Domino API) will catch uncaught exceptions and so would verify coding issues without needing try/catch blocks.
I did a Java Rest service and used FT Search to search between two date ranges. You could also work your search by resource name into that FT Search as well. In my case I did not use a view but did the lookup in Java and built the returned text in my code (to work with FullCalendar, a web based calendar). Works great and is fast.

Piwik custom dimension in segment

We use Piwik cloud (innocraft.com) for analytics and have a custom dimension called channel_perm_id with scope Visit, it's called dimension1 and is transmitted via JS Tracking API. Using the piwik admin panel we can verify that the dimension is set correctly and transmitted by each visitor.
Now we want to query based on this dimension1 aka channel_perm_id:
curl -i https://###.innocraft.cloud/index.php?segment=dimension1==2ceb64954d4e46f49bc6afa310cf92f&token_auth=###&format=xml&date=today&period=day&idSite=8&module=API&method=VisitsSummary.get
The important part is
segment=dimension1==2ceb64954d4e46f49bc6afa310cf92f
which causes this query to return an empty response:
<result>
<nb_uniq_visitors>0</nb_uniq_visitors>
<nb_users>0</nb_users>
<nb_visits>0</nb_visits>
<nb_actions>0</nb_actions>
<nb_visits_converted>0</nb_visits_converted>
<bounce_count>0</bounce_count>
<sum_visit_length>0</sum_visit_length>
<max_actions>0</max_actions>
<bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>0</nb_actions_per_visit>
<avg_time_on_site>0</avg_time_on_site>
</result>
Without the segment parameter the response looks like:
<result>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_users>0</nb_users>
<nb_visits>6</nb_visits>
<nb_actions>0</nb_actions>
<nb_visits_converted>0</nb_visits_converted>
<bounce_count>6</bounce_count>
<sum_visit_length>2469</sum_visit_length>
<max_actions>0</max_actions>
<bounce_rate>100%</bounce_rate>
<nb_actions_per_visit>0</nb_actions_per_visit>
<avg_time_on_site>412</avg_time_on_site>
</result>
It looks like the custom dimension is somehow not aggregated in piwik.
But if we use the Live module (Live.getCounters instead of VisitsSummary.get), the query works fine.
So we think it has something to do with the scope maybe.
Any ideas are highly appreciated!

Marklogic faceted search and collations

I'm setting up a faceted search in MarkLogic. I have the following range indexes configured:
That is, I have two indexes. The first is on namespace http://www.corbas.co.uk/ns/presentations and local name keyword. The second has the local name level. The collation URI for both is http://marklogic.com/collation/en/S1.
When I try to search using the following I see errors related to collations:
xquery version "1.0-ml";
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:search("levels:Intermediate",
<options xmlns="http://marklogic.com/appservices/search">
<return-results>true</return-results>
<return-facets>true</return-facets>
<constraint name="keywords" facet="true">
<range type="xs:string" collation="http://marklogic.com/collation/en/S1">
<element ns="http://www.corbas.co.uk/ns/presentations" name="keyword"/>
</range>
</constraint>
<constraint name="levels" facet="true">
<range type="xs:string" collation="http://marklogic.com/collation/en/S1">
<element ns="http://www.corbas.co.uk/ns/presentations" name="level"/>
</range>
</constraint>
</options>)
I get the following error:
XDMP-ELEMRIDXNOTFOUND: cts:search(fn:collection(),
cts:element-range query(fn:QName("http://www.corbas.co.uk/ns/presentations","level"),
"=", "Intermediate", ("collation=http://marklogic.com/collation/en/S1"), 1),
("score-logtfidf", "faceted", cts:score-order("descending")),
xs:double("1"), ()) -- No string element range index for
{http://www.corbas.co.uk/ns/presentations}level
collation=http://marklogic.com/collation/en/S1
What am I doing wrong?
Strange Message. If it even got that far, then it looks like your database default collation is changed. Does not answer the question. just strange.
Forst off, I would always add the collation to the constraint:
<search:range type="xs:string" facet="true"
collation="http://marklogic.com/collation/en/S1">
Second, I always troubleshoot range index issue from the query console:
use cts:values() to verify that your indexes are in place and in the namespace and collation you expect. This removes other layers and verifies that the index is as you expect.
And another item: MarkLogic range indexes do not exist until content is indexed. Are you sure you have not turned off auto-index on the database and perhaps content is not indexed? That would give you an error.
To be honest, I would have expected a different error message. I would have expected MarkLogic to complain it couldn't find an index for root collation, because you have not added collation attributes on the range elements in the search options.
Maybe adding those will help.
HTH!
It looks to me like your configuration is correct, which suggests to me that the problem is timing. Once you specify what indexes you want, MarkLogic gets to work creating them. If you run a query that requires those indexes before MarkLogic finishes creating them, you get this error. Depending on the amount of content you have, the creation process can be very quick or take hours.
To check the status, point your browser to the Admin UI (http://localhost:8001) and navigate to the configuration page for your database. Click on the Status tab and look for "Reindexing/Refragmenting State"—if MarkLogic is still reindexing, it will tell you so here and you'll get updates on its progress. (You can also get this information through the Management API.)

Retrieve a specific node from a $(xData.responseXML) object

I'm completely stuck in retrieving a specific node from a responseXML object that I got back from the GetUserProfileByName (SharePoint / SPServices). I need a specific PropertyData node (in the example "FirstName") and then retrieve the value of the "FirstName". Retrieving the value is not a problem, retrieving the specific node is...
Below a part from the returned XML (for the sake of the example I stripped some properties):
...
<PropertyData>
<Name>UserProfile_GUID</Name>
<Values>
<ValueData>
<Value xmlns:q1="...">206b47c7-cfdc-...</Value>
</ValueData>
</Values>
</PropertyData>
<PropertyData>
<Name>FirstName</Name>
<Values>
<ValueData>
<Value xsi:type="xsd:string">Maarten</Value>
</ValueData>
</Values>
</PropertyData>
...
Since I know that I need the property FirstName, I do not want to iterate through the entire set of PropertyData nodes until I've the correct one (slow). In XPath I can select FirstName just by saying:
//PropertyData[Name='FirstName']/Values/ValueData/Value
However, I cannot do that in the xData.responseXML object. I tried the following filter, finds and other things (in all kinds of variations):
$(xData.responseXML).SPFilterNode("PropertyData").find("[Name*=FirstName]")
$(xData.responseXML).SPFilterNode("PropertyData").find("[Name*='FirstName']")
$(xData.responseXML).SPFilterNode("PropertyData").filter("[Name*=FirstName]")
$(xData.responseXML).SPFilterNode("PropertyData[Name='FirstName']")
I did many searches, but was not able to find an answer. There were many partial answer which a I all tried, but were not working. Any one a clue...
Thanks in advance!
Maarten
#Maarten
I'm not at my computer right now to test, but try this:
$(xData.responseXML).find("Name:contains('FirstName')").closest("PropertyData")
REVISION 1:
Given your feedback that an additional element is returned (the phonetic field), here is a revised selector to only return the one containing the FirstName element:
$(xData.responseXML)
.find("Name:contains('FirstName')")
.not(":contains('SPS-PhoneticFirstName')")
.closest("PropertyData");
Paul

Resources