[Hippo-cms7-user] Using a workflow to create a new document programatically

Ard Schrijvers a.schrijvers at onehippo.com
Thu Oct 13 13:09:55 CEST 2011


On Thu, Oct 13, 2011 at 12:10 PM, d.clayton <d.clayton at lukkien.com> wrote:
> Hello again list/forums!
>
> I'm trying to create a new document programatically. After looking through
> other forum threads it seems I should be using a workflow to do this. I got
> this far:
>
>                WorkflowPersistenceManager wpm =
> getWorkflowPersistenceManager(writableSession);
>                HippoBean content = getContentBean(request);
>                Workflow wf = wpm.getWorkflow("default", content.getNode());
>                if(wf instanceof FolderWorkflow) {
>                        FolderWorkflow fw = (FolderWorkflow)wf;
>                        wf.add(uh oh)
>
> The documentation for FolderWorkflow.add doesn't seem very clear, and when I
> run that code I get the following:

the warnings below are about automatic export and seem unrelated / not
important. What is the

wf.add(uh oh) ??

Also, did you take a look at the Detail.java class from testsuite?
This has a working example. I also found before that the workflow
misses javadocs. I am not sure if you should use "default" and not
some other. Someone else might chime in here

Regards Ard

>
> [INFO] [talledLocalContainer] 13.10.2011 12:08:52 WARN
> [org.hippoecm.repository.export.Extension.createContentResourceInstruction():189]
> This change needs merge semantics. Can't create instruction.
> [INFO] [talledLocalContainer] 13.10.2011 12:08:52 WARN
> [org.hippoecm.repository.export.ExportModule$ExportEventListener.processEvents():290]
> Unable to create instruction. This change will be lost
>
> How should I create a document in the CMS in Java code?
>
> Thanks!
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/Using-a-workflow-to-create-a-new-document-programatically-tp6888352p6888352.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>



-- 
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com



More information about the Hippo-cms7-user mailing list