Page 1 of 1
Adding new functionality while uploading file
PostPosted:Fri Oct 10, 2014 8:01 am
by mohasinmujawar56
I am using OpenKM 6.3 on Windows machine. I want to add new functionality in OpenKM while uploading file. I have added UI but I am not getting from where OpenKM is saving the values in database. I also have created extra fields in database class: 'NodeDocument' table: 'OKM_NODE_DOCUMENT'. I am not getting how a document is getting added in database.
Can any one tell which files or classes needs to be modified?
Please can anyone help me on this?
Re: Adding new functionality while uploading file
PostPosted:Tue Oct 14, 2014 10:37 am
by jllort
Explain what are you trying to do ?
The involved class you should start looking for is FileUploadServlet.java
Re: Adding new functionality while uploading file
PostPosted:Wed Oct 15, 2014 8:08 am
by mohasinmujawar56
Now I am able to get the data and store it in database. I also added new column in file browser by adding new column in ExtendedScrollTable.java and filebrowser.java. now I want to display the data which user has entered at the time of uploading document. I have created methods to get and set data in GWTDocument.java, and written the code just like you have written for getting author and other details of the document. Can you please tell me which other classes needs to be modified or to be mapped with GWTDocument.java
Re: Adding new functionality while uploading file
PostPosted:Thu Oct 16, 2014 8:51 am
by jllort
Data is already stored into openkm ?
You should take a look at GWTUtil.java where is copyed the Documento to GWTDocument object
Re: Adding new functionality while uploading file
PostPosted:Thu Oct 16, 2014 11:29 am
by mohasinmujawar56
Data is getting stored at the time of document uploading. The problem is I am not able to get data from database.
Do we need to modify both GWTDocument copy(...) and Document copy(...) or only one of these two methods. I have modified both methods but still it is not showing data that is stored at the time of document upload.
Re: Adding new functionality while uploading file
PostPosted:Sat Oct 18, 2014 8:12 am
by jllort
is quite strange use of openkm. should be better create metadata ( property groups
http://wiki.openkm.com/index.php/Proper ... nistration ) and then force all documents to introduce metada with data value. ( for example you can got a report of all documents what do not have metadata field, is quite easy based on OKM_PROPERTY table and OKM_NODE_DOCUMENT ).
Then on GWTUtil you could do some query to get this metadata, for example
OKMPropertyGroup.getInstance().getProperties (String token, String nodePath, String grpName) (
http://doxygen.openkm.com/openkm/d9/d6d ... _1api.html )
This is the most common way to solve it. Also you can add into OKM_NODE_DOCUMENT, but from my point of view this is not the idea of setting document metadata, for it you got PropertyGroups.
Hope this could give you some clue about it.
Other advantage of doing it, is that on future 6.3 release we will include a professional feature what allows to see metadata as an extra filebrows column, without doing anything else, you'll got it on next year release.
Re: Adding new functionality while uploading file
PostPosted:Tue Oct 21, 2014 9:52 am
by mohasinmujawar56
There are two fields that needs to be filled by user and only one field needs to be displayed in file browser. But can you please tell me what will be the problem. Why it is not getting copied to GWTDocument.java?
And one more problem when we are adding property group if we left all fields blank then also it allowing to add property group for that particular file or folder. I can show an error if the fields are empty but I am not able to prevent the property group from getting added. Can you please tell me what code to add and in which file it is to be added?
Re: Adding new functionality while uploading file
PostPosted:Wed Oct 22, 2014 9:22 am
by jllort
In your logic must consider the case when property group is added or not, in negative case then put "";
I do not see the problem, only I suggest take GWTDocument.java value from property group, not database. I propose simply this change, nothing else. The other logic related with it must be very similar.