Home
TeamSite
how to create a file in a workarea
oocha_boy
Does anyone have an example of how to create a file in a work area and then submit it to staging?
Find more posts tagged with
Comments
Migrateduser
Quite simple actually. Just choose File\New File from webdesk and follow the directions for creating a file. You could also create on your machine and choose File\Import Files... to import it to the workarea.
To submit, choose File\Submit (or the submit button), enter any comments and press "Run Job" to execute the out-of-the-box submit workflow.
David M. Doggette
Certified Interwoven Consultant
Gregg Faus
I think he meant the Java way. Source code I would assume.
oocha_boy
Exactly. Source code would be nice. I have gotten halfway now. I have created a file in a work area. Now I need to submit it to staging. If anyone has done this already I would love to see some code. If not I will post mine in a few days(hopefully not that long!).
thanks.
pflory
To submit a file, try something along these lines:
Collection subs = new HashSet();
IWFileBatch.SubmitFileRequestInfo sfri;
IWFileBatch.ResultOfChange submitRes;
sfri = new IWFileBatch.SubmitFileRequestInfo();
sfri.fileComment = "";
sfri.fromFile = sf;
subs.add(sfri);
String waPath = IWPath.extractAreaPath(IWPath.smOutputShortHost, targetDir);
IWWorkArea wa = (IWWorkArea) IWPathNamedObject.lookupByPath(fsServ, waPath);
IWFileBatch.ResultOfChange res = IWFileBatch.submit(fsServ, wa, subs, IWFile.rkmSelf, null, true, false, null, "Submit by xFactora", "File changed", true, true, IWFile.oNone);
}
catch (Exception e) {
System.err.println("Caught exception " + e + ".");
e.printStackTrace();
System.exit(-1);
}
Migrateduser
Can u please send me the code for how to create the file in workarea. Tha java way
iwovGraduate
Please refer to the examples shipped with the OpenAPI SDK. The filesystem example(s) should answer your question.