openkm / document-management-system

OpenKM is a Open Source Document Management System
https://www.openkm.com/
GNU General Public License v2.0
708 stars 308 forks source link

com.openkm.sdk4j.OKMWebservices.setPropertyGroupPropertiesSimple(String nodeId, String grpName, Map<String, String> properties) fails with latest OpenKM 6.3.4 Community Edition #65

Closed PSHREYASHOLLA closed 6 years ago

PSHREYASHOLLA commented 6 years ago

We had installed OpenKM 6.3.4 Community Edition from the openKM official website https://www.openkm.com/en/download.html sometime back. Please find the attached Installer jar, named OKMInstaller_Old.jar.

We are using Java SDK 1.1 APIs. We used to upload the document using, com.openkm.sdk4j.OKMWebservices.createDocumentSimple(String docPath, InputStream is)

And then we are associating document properties by calling, com.openkm.sdk4j.OKMWebservices.setPropertyGroupPropertiesSimple(String nodeId, String grpName, Map<String, String> properties).

The above functionality was working fine and we had certified our Application with OpenKM 6.3.4 Community Edition.

But today when I try to install OpenKM 6.3.4 Community Edition from the openKM official website https://www.openkm.com/en/download.html, I get the Installer jar, named OKMInstaller_New.jar. And we are installing OpenKm using the same.

But now the behaviour is different i.e com.openkm.sdk4j.OKMWebservices.createDocumentSimple(String docPath, InputStream is) Is working fine but,

com.openkm.sdk4j.OKMWebservices.setPropertyGroupPropertiesSimple(String nodeId, String grpName, Map<String, String> properties)

Is failing with the error,

com.openkm.rest.GenericException: com.openkm.core.RepositoryException: Property group not assigned to this node

So basically it is expecting com.openkm.sdk4j.OKMWebservices.addGroup(String grpName) to be called before com.openkm.sdk4j.OKMWebservices.setPropertyGroupPropertiesSimple

Please refer discussion here, https://forum.openkm.com/viewtopic.php?f=5&t=21699

darkman97i commented 6 years ago

Confirm to us if the issue corresponses with the next description: When executing the script:

import com.openkm.api,*;
OKMPropertyGroup.getInstance().setPropertySimple(null, "/okm:root/fld1", "okg:test","okp:test.name", "value"); 

It fails in case the node does not have okg:test group, meanwhile in previous version if the node does not have the group, was added by default as part of the process of setting the properties.

PSHREYASHOLLA commented 6 years ago

Yes thats what I was talking about. As you mentioned "if the node does not have the group, was added by default as part of the process of setting the properties". From which version of OpenKM is this fuctionality changed?

darkman97i commented 6 years ago

I'm not sure but we will review it and we'll try to get it running again.

darkman97i commented 6 years ago

@gnujavasergio talk with me about this issue and I will explain what you should be looking in previous code and what should be corrected.