This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 7, 2011, 6:08 AM
6 Posts

I am facing problem in lotus notes view search on a XPage.

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: otus notes view search
  • Replies: 7
 I have a database with more tan 1,20,000 documents. I have a XPage to show all the records in a view based on some search criteria. Ex:- I have a view containing all the Requests. I have to show all the Requests based on Roles of the user logged in. User may be a member of more than one Role. If I write the code on the Search properties of view then the problem is the sorting indicator of the view is gone and the documents are sorted by relevance and also it is taking time to perform db.search. If I write my code on keys properties, I am not able to search records for more than one Role. As the Keys takes single value for each column to searchByKey. 

I have to show the requests belongs to user logged in (User can be a member of multiple roles, so all the requests will be displayed for all the Roles the user is member of). The results will be sorted by Request Number and sorting indicator should be available to user on the column head. Please help me on this. I am struggling with it for quite a long time.
 
Thanks a lot in advance. 
Apr 7, 2011, 7:16 AM
149 Posts
Re: I am facing problem in lotus notes view search on a XPage.
 
Not sure I understand the whole problem....
 
I guess all your documents contain a field with all the roles it belongs to.
is it possible for you to create a categorized view based on the values in the documents role field?

then you could get a collection ot all the  documents using a notesviewnavigator and perform a search on that collection.
 
 
best regards
Thomas Adrian
http://www.notessidan.se
 
Apr 7, 2011, 7:35 AM
6 Posts
Re: I am facing problem in lotus notes view search on a XPage.
Thanks lot Adrian for your suggestion.
I have used NoteseViewEntryCollection and performed the search by GetAllEntriesByKey. But the problem I am facing is that user wants the Sorting indicator on the Column head. Could you please help me how to implement the sorting indicator.
Apr 7, 2011, 10:01 AM
149 Posts
Re: I am facing problem in lotus notes view search on a XPage.
 
well, the only way I could think of is to create your own sorting, you then need to add your own sort buttons
 
- If you are using view control to return and search I guess you can use the "diamond" to control the sort column as well. ( there is a property for sort column)
- if you are using SSJS to do the search you need to sort the collection.
 
 
 
hope it helps.
Thomas
Apr 7, 2011, 10:37 AM
6 Posts
Re: I am facing problem in lotus notes view search on a XPage.
Hello Thomas, 
 
Thank You for the options provided by you.
 
For the first option, if I search a view by writing the code in Search properties of view. Then the "diamond" to control the sort column disappears.
For the second option, I have also tried to sort the collection by writing following SSJS Function.
 
function SortDocumentCollection(vc, strKeyFieldName)
{
 var a=0
 var sortkeyarray=new Array(); 
 
 var ent:NotesViewEntry=vc.getFirstEntry();
 var UNIDStr="";
 while(ent!=null)
 { 
  sortkeyarray[a]=new Array(2);
  sortkeyarray[a][0]=ent.getColumnValues()[0];
  sortkeyarray[a][1]=ent.getUniversalID();
  ent=vc.getNextEntry(ent)
  a=a+1
 }
 
 sortkeyarray.sort();
 sortkeyarray.reverse();
 for(c=0;c<@Elements(sortkeyarray);c++)
 {
  doc=db.getDocumentByUNID(sortkeyarray[c][1])
  sdc.addDocument(doc)
 }
return sdc;
  
 
But it takes hell lot of time to sort data and for 6000+ data (I have around 20000-25000 data to display), it eventually fails and doesn't return any result.
Could you please help me with any faster SSJS method for sorting Collection ore any other way to sort the results.
 
Anirban
Apr 7, 2011, 7:25 AM
21 Posts
Re: I am facing problem in lotus notes view search on a XPage.
Sounds like a 'Repeat within Repeat' problem.
Create a Repeat for the roles, and then within that, a repeat for the documents for that role.
You can put within that tells you which role data you are emitting.
http://www.youatnotes.de/web/youatnotes/wiki-xpages.nsf/dx/Work_with_repeat_controls#%20repeat%20control%20inside%20another%20repeat%20control
Apr 7, 2011, 12:01 PM
6 Posts
Re: I am facing problem in lotus notes view search on a XPage.
Hello Andrew,
 
Thanks a lot for suggestion and providing the link.
I have implemented the solution suggested by you. 
But I am facing problem in providing the user with the facility to sort the documents in repeat control.
Example:- As we have sorting indicator (Diamond shaped) for view.
Apr 7, 2011, 1:22 PM
21 Posts
Re: I am facing problem in lotus notes view search on a XPage.
As you have a lot of documents, manually sorting will take too long on the fly.
What I suggest is that you have two views - essentially the same, but with different sorting. 
Then create your own sort button, and the sort button tells the inner repeat to look at the 2nd view rather than the first.

 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal