Page 1 of 1

SOLVED how to use the public void move?

PostPosted:Mon Dec 19, 2016 2:42 am
by jimac
in this link https://docs.openkm.com/apidoc/com/okm/ ... ng.String-

it says
Code: Select all
public void move(String token, String docPath, String destPath) throws PathNotFoundException, ItemExistsException, AccessDeniedException, LockException, RepositoryException, DatabaseException, ExtensionException, AutomationException
Description copied from interface: DocumentModule
Move a document to another location in the repository.
Code: Select all
Specified by:
    move in interface DocumentModule
    docPath - The path that identifies an unique document.
    destPath - The destination folder path.
Throws:
    PathNotFoundException - If the dstPath does not exists
    ItemExistsException - If there is already a document in the destination folder with the same name.
    AccessDeniedException - If there is any security problem: you can't modify the document's parent folder or the destination folder because of lack of permissions.
    RepositoryException - If there is any general repository problem.
    LockException

I FOLLOWED the format..
But I dont know what to put inside the public void move
and in the public void execute

plase give me a sample code..to be my guide

please help. thank you!!

Re: how to use the public void move?

PostPosted:Tue Dec 20, 2016 8:52 am
by jllort
Take this code as reference.
Code: Select all
String systemToken = DbSessionManager.getInstance().getSystemToken();
OKMDocument.getInstance().move(systemToken, "/okm:root/doc1.pdf", "/okm:root/folder1);

Re: how to use the public void move?

PostPosted:Tue Dec 20, 2016 9:13 am
by jimac
Good day!

Is there a guide on how to code in workflows??

Re: how to use the public void move?

PostPosted:Tue Dec 20, 2016 9:20 am
by jimac
jllort wrote:Take this code as reference.
Code: Select all
String systemToken = DbSessionManager.getInstance().getSystemToken();
OKMDocument.getInstance().move(systemToken, "/okm:root/doc1.PDF", "/okm:root/folder1);


Good day!

Is there a guide on how to code in workflows??

Re: how to use the public void move?

PostPosted:Wed Dec 21, 2016 1:54 am
by jimac
jllort wrote:Take this code as reference.
Code: Select all
String systemToken = DbSessionManager.getInstance().getSystemToken();
OKMDocument.getInstance().move(systemToken, "/okm:root/doc1.PDF", "/okm:root/folder1);

Good day!

Im wondering what is the cause of this problem.
Please see the attached picture


Re: how to use the public void move?

PostPosted:Thu Dec 22, 2016 12:11 pm
by jllort
If you are using OpenKM portable or you have checkout OpenKM code, from eclipse you add a project in your building path:
Right click on project >Properties > Java Build path > tab Project > button add