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)
CSHole
mangetak
Hi,
I need to submit a content that has already been deleted. In Javadoc i read about CSHole as an object representig a file that has already deleted. Has anyone used it before. I get poor information on its use.
Thanks in advance
Find more posts tagged with
Comments
Migrateduser
Hi,
If any file has been versioned, (e.g., file1 has been submitted from a workarea to the STAGING area at least once) and it is deleted from a workarea, the file is represented as a 'hole' (CSHole in CSSDK). It has the same VPath as the original file, but it is restricted in the operations that can be performed on it.
CSHole is derived from CSFile, which means that it can be used in whatever method CSFile is accepted; It can be submitted by the CSWorkarea.submitDirect method.
Best Regards,
Narendra
PaulW
how do i get a handle on the CSHole file? I tried casting from the CSFile and that doesn't work.
And based on what you have said, is the best thing for me to get this CSHole handle, and then do somethi ng like the following:
/// CSWorkarea wa= client.getWorkarea(deletedDCR.getVPath(), false);
// CSPathCommentPair file = new CSPathCommentPair(deletedDCR.getVPath().getAreaRelativePath(), "Submit Delete");
// CSPathCommentPair[] files = new CSPathCommentPair[1];
// files[0] = file;
// wa.submitDirect("Submit deleted file. within EricssonDCR.delete()", null, files, CSWorkarea.OVERWRITE_ALL);
Migrateduser
Hi,
Here is a piece of annotated code that might help you.
//get an existing simple file
CSSimpleFile sf = (CSSimpleFile)client.getFile(new CSVPath("/default/main/testbranch/WORKAREA/testworkarea/simple.file"));
//delete this file
sf.delete();
//get the newly created hole. Note that the VPATH is the same as the deleted file
CSHole hole = (CSHole)client.getFile(new CSVPath("/default/main/testbranch/WORKAREA/testworkarea/simple.file"));
//Also note that the file has to be versioned (or in other words, it must have been submitted to STAGING in the past)
Hope this helps.
Best Regards,
Narendra
PaulW
thanks alot for your assistance. I finally got it working. But I noticed my big problem was that when i tried to create a workarea, it wasn't working properly. that is why my submit was failing. I was trying to pass in the files vpath, instead of the vpath to the workarea i wanted to instantiate.
thanks.
Migrateduser
Here's additional code to help you -
//get an existing simple file
CSSimpleFile sf = (CSSimpleFile)client.getFile(new CSVPath("/default/main/testbranch/WORKAREA/testworkarea/simple.file"));
//delete this file
sf.delete();
//get the newly created hole. Note that the VPATH is the same as the deleted file
CSHole hole = (CSHole)client.getFile(new CSVPath("/default/main/testbranch/WORKAREA/testworkarea/simple.file"));
//Also note that the file has to be versioned (or in other words, it must have been submitted to STAGING in the past)
CSPathCommentPair[] toBeSubmitted = new CSPathCommentPair[] {
new CSPathCommentPair(new CSAreaRelativePath("simple.file"), "fileSubmitComment")};
CSWorkarea wa = client.getWorkarea(new CSVPath("/default/main/testbranch/WORKAREA/testworkarea", false);
wa.submitDirect("submitComment", "infoComment", toBeSubmitted, CSWorkarea.OVERWRITE_NONE);
// Note that to submit you need only the area relative path, you do not need the intermediate CSHole...getFile... step
Hope this helps
Best Regards,
Narendra
PaulW
i love you.