Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
creating files using CSSDK
Bowker
CSSDK 2.5
Windows 2003
Teamsite 6.5
I'm trying to create a file in the TemplateData directory using CSSDK and keep receiving "the user is not authorized to perform this operation". This doesn't make sense since I created all the files/folders/workareas/... and I connected as MASTER.
If I use the TeamSite GUI I can create the file just fine. The code looks something like this:
String filename = "TemplateData/content/" + files
+ "/data/" + getNewFileName(job.getTaskId()) + ".xml";
CSWorkarea workarea = (CSWorkarea) job.getTask().getArea();
CSAreaRelativePath newFile = new CSAreaRelativePath(filename);
System.out.print("workarea: " + workarea.getVPath());
System.out.print("trying to create: " + newFile);
return workarea.createSimpleFile(newFile).getOutputStream(true);
The output is:
workarea: //ILC2CHA/contentManagement/main/content/WORKAREA/development
trying to create: TemplateData/content/promotion/learnmore/data/1107547216755_754.xml
What I find 'interesting' is that the workarea is //ILC2CHA/contentManagement... I would have expected it to be
//ILC2CHA/iwserver/contentManagement...
Any clue why I'm getting "not authorized..."?
Dan Bowker
Northern Trust
Web Publishing Technology
Find more posts tagged with
Comments
Johnny
Are you running this code from within teamsite UI, or is it an external app?
In reply to:
I would have expected it to be
//ILC2CHA/
iwserver
/contentManagement...
What does iwserver mean and why do you expect it?
TemplateData
- is that the right case?.. does the whole path actually exist?
John Cuiuli
Bowker
This is an external Java application using CSSDK.
The share for the filespec is //ilch2cha/iwserver/
and yes the path does exist. I can create the file manually from within the TS GUI while signed in as an Author.
Dan Bowker
Northern Trust
Web Publishing Technology
Johnny
If this is an external app, can you explain how you are authenticating?
can you dump out what the credentials are so that you can confirm they are the same as the user you mention when using the TeamSite GUI
/iwserver seems to indicate you are talking about a solaris file path, CS uses only TeamSite vpaths - file paths don't make sense in the CS context.
Can you confirm that the case is right?
TemplateData usually looks like templatedata
John Cuiuli
Bowker
The VPath that I'm using is coming from "getVPath" from a workflow. I expect that I'm receiving a valid vpath back.
This is a windows environment.
Yes the case is correct on the TemplateData (and the case of this file dates back to TS 4.0 days)
This external app is a CSSDK application that is authenticating with:
csFactory.getClientForTrustedUser( username, "master", Locale.getDefault(), application, null );
wher username is my username.
Dan Bowker
Northern Trust
Web Publishing Technology
Johnny
Sorry, looks like I've asked all that I can think of.
Maybe you could post the stack trace if there is one.
John Cuiuli