Set path (upload) in the newly created folder

Nous essayons de faire OpenKM aussi intuitif que possible, mais tout avis est bienvenu.

Moderator: dedisoft

Forum rules
Avant de poser une question, merci de regarder la documentation du wiki ou d'utiliser la fonction recherche du forum. Et rappelez vous que nous n'avons ni boule de cristal ni possibilité de lire dans les pensées, aussi pensez à spécifier quelle version d'OpenKM vous utilisez ainsi que la version du navigateur web et du système d'exploitation. Pour de plus amples informations lisez Comment reporter un bug efficacement (anglais).
Post Reply
jimac
Expert Boarder
Expert Boarder
Posts: 87
Joined: Thu Dec 01, 2016 4:01 am

Set path (upload) in the newly created folder

Post by jimac » Fri Jan 06, 2017 5:33 am

Good Day! :) :D

Is this possible?

When my workflow starts, a folder is automatically created and is renamed by user1 based on what he/she will input in the form.
Then that newly created folder will be the storage for all the users who is tasked to upload a document.

I don't know how to set the upload path of all users (who is tasked to upload a file) in the created folder.

by the way this is my code in the creation of the folder:

Code: Select all

package com.sample.action;

import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
//import com.openkm.bean.form.Input;
import com.openkm.api.OKMFolder;
import com.openkm.bean.form.Input;
import com.openkm.module.db.stuff.DbSessionManager;

 public class foldercreate implements ActionHandler{

	private static final long serialVersionUID = 1L;

	@Override
	public void execute(ExecutionContext context) throws Exception {
		String fldpath = "/okm:root/";
		
		Input sn = (Input) context.getContextInstance().getVariable("sn");
		String in = sn.getValue();
		String systemToken = DbSessionManager.getInstance().getSystemToken();
		OKMFolder.getInstance().createSimple(systemToken,fldpath +in);	
		 context.getToken().signal();
	}  
 }
Thank you! :D :lol:

jllort
Moderator
Moderator
Posts: 9637
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Set path (upload) in the newly created folder

Post by jllort » Mon Jan 09, 2017 8:22 am

In the upload form you can set the uuid of the folder ( the attribute data ( what is expected to be an object of Upload type ) is used for this mapping )

jimac
Expert Boarder
Expert Boarder
Posts: 87
Joined: Thu Dec 01, 2016 4:01 am

Re: Set path (upload) in the newly created folder

Post by jimac » Mon Jan 09, 2017 8:45 am

jllort wrote:In the upload form you can set the uuid of the folder ( the attribute data ( what is expected to be an object of Upload type ) is used for this mapping )

update:


Hello Jllort,

what is the code to get a document that is uploaded in a folder?

in my case:
that particular folder always contain 1 document only.

My plan is, when user1 uploaded a document in folder1, the workflow will start immeadiately ( Iam using automation) then get that document and move it in
the newly created folder.

what I dont know is , how to get that uploaded document in folder1.
Thanks!

jllort
Moderator
Moderator
Posts: 9637
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Set path (upload) in the newly created folder

Post by jllort » Wed Jan 11, 2017 7:33 pm

Take a look at our api documentation at https://docs.openkm.com/apidoc/ look for classes into package com.openkm.api ( specially in your case the method getChildren from OKMDocument class )

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest