• Set path (upload) in the newly created folder

  • Nous essayons de faire OpenKM aussi intuitif que possible, mais tout avis est bienvenu.
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).
 #42946  by jimac
 
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:
 #42967  by jllort
 
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 )
 #42972  by jimac
 
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!

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.