Topic
No replies
SystemAdmin
SystemAdmin
40 Posts
ACCEPTED ANSWER

Pinned topic Stored Search Using RM Java API

‏2009-01-26T22:44:41Z |
I am trying to execute a stored search on FPOS using the RM Java API's.

RMStoredSearches loStoredSearches = aoRMOS.getRMStoredSearches(

new 

int[StoredSearch.TYPE_TEMPLATE], 

null); RMStoredSearch storedSearch = (RMStoredSearch) loStoredSearches.filterByProperty(RMProperty.DOCUMENT_TITLE, PropertyDescriptions.IS_EQUAL, storedSearchName).get(0); String searchXML = 
"<executedata xmlns=\"http://filenet.com/namespaces/wcm/apps/1.0\">"+ 
"<version dtd=\"3.0\"/>"+ 
"<objecttypesdata><objecttypedata><from><class symname=\"folder\" /></from>"+ 
"<templatedata><templatepropitems><templateitem itemid=\"8\">My Record Folder Test</templateitem></templatepropitems></templatedata>"+ 
"</objecttypedata></objecttypesdata></executedata> "; BaseObjects objects = storedSearch.execute(

null);


The stored search xml is:

<storedsearch xmlns=
"http://filenet.com/namespaces/wcm/apps/1.0"> <version dtd=
"3.0" searchobject=
"3"/> <product name=
"Search Designer" version=
"3.0"/> <searchspec versionselection=
"releasedversion"> <searchtype> <template showandorconditions=
"true" showmaxrecords=
"true" showoperators=
"true"/> </searchtype> <objectstores mergeoption=
"union"> <objectstore id=
"{xxxxx-xxxx-xxxx-xxxx-6xxxxxxE}" name=
"FPOS_DEV"/> </objectstores> <searchcriteria> <folders> <folder id=
"{7xxxxxxx-xxxx-xxxx-xxxx-Cxxxxxxx}" itemid=
"7" pathname=
"\Records Management\File Plan" searchsubfolders=
"true" view=
"hidden"> <objectstore id=
"FPOS_DEV"/> </folder> </folders> <searchclauses> <searchclause> <select> <selectprops> <selectprop alignment=
"left" itemid=
"8" name=
"Folder Name" objecttype=
"folder" sortlevel=
"0" sortorder=
"none" symname=
"FolderName"/> </selectprops> </select> <from> <

class symname=
"folder"/> </from> <where> <like> <whereprop editproperty=
"editable" itemid=
"6" name=
"Folder Name" objecttype=
"folder" symname=
"FolderName"><propdesc datatype=
"typestring" haschoices=
"false" hasmarkings=
"false" symname=
"FolderName"/> </whereprop> <literal>CS - Comment Test 3 - 005353</literal> </like> </where> <subclasses> <subclass editproperty=
"readonly" includesubclasses=
"false" itemid=
"11" name=
"xWorks Record Folder" objecttype=
"folder" symname=
"xWorksRecordFolder"/> </subclasses> </searchclause> </searchclauses> </searchcriteria> <options maxrecords=
"100"/> </searchspec> </storedsearch>


I am getting the following error:

ERROR [com.filenet.rm.api.exception.RMException]: Unable to validate the requested stored search XML based on the metadata search criteria. ERROR [com.filenet.rm.api.exception.RMException]: Unable to retrieve the search result, a collection of BaseObjects, based on the search criteria. ERROR [com.filenet.rm.api.exception.RMException]: Unable to get the stored search result which constitutes the BaseObjects collection whose elements can represent the objects of Document/ Folder/ CustomObject, based on the search criteria. ... Caused by: com.filenet.rm.api.exception.RMException: Unable to get the stored search result which constitutes the BaseObjects collection whose elements can represent the objects of Document/ Folder/ CustomObject, based on the search criteria. Unable to retrieve the search result, a collection of BaseObjects, based on the search criteria. Unable to validate the requested stored search XML based on the metadata search criteria. The Node value is 

null in the xml:...


The stored search works fine from within the RecordsManager web application.
We have a mixture of P8 CM 4.0 and RM 3.5. Could this be an issue?

Thanks.