Page 1 of 1

Category Control

PostPosted:Tue Feb 25, 2014 3:06 pm
by alexandre
Hi,

I trying integrate openKM with a java application, but i have some bugs:

1_ When i try to create a category using:
Code: Select all
OKMProperty_Service okmPropertyService = new OKMProperty_Service();
OKMProperty okmProperty = okmPropertyService.getOKMPropertyPort();
okmProperty.addCategory(token, pathCategory, "Test");
I got an error in taxonomy. So i clear the category table using query and restores the normal condition.

2_ I finnaly create categories by using okmFolder, and in frontend woks well, but i fail to associate this category to an document:
Code: Select all
Document doc = new Document();
doc.setPath("/okm:root/Edital");
byte[] content;
try (FileInputStream fis = new FileInputStream(arquivoLocal)) {
    content = new byte[fis.available()];
    fis.read(content);
}

Folder folder = new Folder();
folder.setPath(pathCategory + "/" + categoria);
doc.getCategories().add(folder);

Document newDoc = okmDocument.create(token, doc, content);

What i doing wrong?

Re: Category Control

PostPosted:Thu Feb 27, 2014 1:32 pm
by alexandre
I sucessfullty associate a category with a document.
I control category using Folder webservice and use Property webservice to associate a dcoment with one category.
Works well but i notice a bug.
If you delete a folder with files associated with a category you can never delete this category. The file doesn't exists anymore, but the association persists.
If exits any query to erase this associatin please inform.

Re: Category Control

PostPosted:Sat Mar 01, 2014 7:55 am
by jllort
Really files exists in trash. The logic is "if you got some existing association with category" in this case you still got associated files in trash, the category can not be removed. Try to purge trash and tell us if that solved the problem.

Re: Category Control

PostPosted:Thu Mar 06, 2014 2:20 pm
by alexandre
After purge the trash i have no problem deleting the category.
Thanks for your help.

Re: Category Control

PostPosted:Thu Apr 03, 2014 8:59 am
by online100
I sucessfullty associate a category with a document.
I control category using Folder webservice and use Property webservice to associate a dcoment with one category.
Works well but i notice a bug.
If you delete a folder with files associated with a category you can never delete this category. The file doesn't exists anymore, but the association persists.
If exits any query to erase this associatin please inform.

Re: Category Control

PostPosted:Fri Apr 04, 2014 3:07 pm
by jllort
It's not a bug, if a feature. Really when you delete document that goes to user trash, and finally it removes it doing empty trash or clean specific object. If you have not purged the document still exists link between document and category. Purge it and you'll get document definitively removed and will be able to delete category.