• SDK Java 1.1 find() method

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #45114  by PSHREYASHOLLA
 
Hi,

In SDK java 1.1, We are using API com.openkm.sdk4j.OKMWebservices.find(QueryParams) to fetch list of documents based on properties.
We want all the documents to be retrieved which has that corresponding property.

Query is if the Result which is a list is sorted on the document created date?
 #45117  by jllort
 
The result is not based on document creation, is based on lucene score. That means will be retrieved the documents with high score ( from lucene point of view. The score of the document is based on lucene and the query you are executing ).

About search with metadata in this documentation section https://docs.openkm.com/kcenter/view/sd ... dPaginated ( look at the first table in column variable where values is properties there's a sample on how doing it).
 #45120  by PSHREYASHOLLA
 
Hi,
Our requirement is to fetch the list of documents with specified properties and
based on the order of creation.

Basically we want to have the latest records. How to achieve that?
 #45123  by jllort
 
Your case seems a combination of metadata and search by date. With QueryParams bean you have everything you need for it. I suggest firt make the query from UI view ( you will see the spected results ) and then step by step try to reproduce from API. You must use properties map filtering and date range ( from and to fields into the QueryParams ).
 #45127  by PSHREYASHOLLA
 
As I mentioned we are using SDK java 1.1, and this are API calls and there is no UI involved. There will be no date range as well, as We want to fetch all the documents(With specified Properties) uploaded to OpenKM in the order of Creation.
 #45128  by PSHREYASHOLLA
 
As I mentioned we are using SDK java 1.1, and this are API calls and there is no UI involved. There will be no date range as well, as We want to fetch all the documents(With specified Properties) uploaded to OpenKM in the order of Creation. So how can we achieve this
?
 #45129  by jllort
 
As I said, search engine never will return data based on date, it returns based on score. I do not understanding exactly what is the problem you are trying to solve, but for example, you can make a query ( search engine ) to return only document into a single day and then order the list ( simple collections sort ). Also you will be able to retrieve data from direct SQL on tables, but in this case you are outside security manager etc.. if you explain with more detail the type of problem you are trying to solve might be we can give you more clues what going in that way ( if you ask for the solution you have in mind might be we are losing the focus ).
 #45130  by PSHREYASHOLLA
 
In our OpenKM we have created a new property,
Code: Select all
 <property-group label="BMS" name="okg:BMS">
               <input label="PARTY_ID" type="text" name="okp:OPENKM.BMS_PARTY_ID" readonly="true"/>
 </property-group>

We are using SDK java 1.1 and there is no OpenKM UI involved here.

First we are uploading documents using,

OKMWebservices.createDocumentSimple(String docPath, InputStream is);

And then associate the above mentioned property for the each document uploaded using,

OKMWebservices.setPropertyGroupPropertiesSimple(String nodeId, "okg:BMS", Map<String, String> properties)


The documents get uploaded over the period of time and not on a single day.

Suppose over the period of time I have uploaded 10 documents and all 10 documents are set with the same property name/value.

Now the requiremant is to retrieve only the latest 4 documents uploaded(DateTime of uploading) associated with that property.


Example, here we are uploading users Signatures over a period of time with different document names and all these documents will have the same property value associated with it. AT any point of time we need to retrieve the latest 4 signatures(Based on DateTime) of that particular user(Based on the Property).




How can we achieve this?

Please let me know if you want more inputs
 #45137  by jllort
 
From search engine is not possible get list ordered, from this point we can discard it ( if you have some date range might be possible, but if you want from the end of times is not possible ).

An aproach might be:
1- Add a metadata field with date.
2- Create a view in the database or execute a query, using this metadata field to retrieve the involved documents.
3- Execute a query from API ( in the repositoryService you have a method named executeSqlQuery https://github.com/openkm/document-mana ... .java#L305 -> unfortunately we have still not exposed across SDK ). You can an issue to add this improvement in the SDK, really during this year we will extend the REST API in the JAVA SDK.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.