Quantcast
Channel: SCN : Discussion List - SAP Enterprise Portal : Administration and Development
Viewing all articles
Browse latest Browse all 2686

Portal Application to read and delete folders from PCD

$
0
0

Hello Experts,

 

I don't no why, but today I was coping some folders and iViews in the Portal Content Manager. I think accidentally, I paste a folder in it self and the portal started to coping recursively in it self. So I have now thousands of folders and I could not delete them. The Portal Content Manager and the PCD get me a timeout, when doing this. So I started to delete the recursive tree of folders from the last element with, PCD but I get an Internal Error and can not find any explanations. My problem seems related to this post PCD Inspector mass copy error - recursively copy infinitely, but there is no solution mentioned.

 

My last chance is to write my own portal application to delete these folders. But here I stuck to identify if an PCD-Object is a folder and to get his children. By now I have the following code

 

Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put(Constants.REQUESTED_ASPECT, IPcdAttribute.PERSISTENCY_ASPECT);      
InitialContext ictx = null;
try {     ictx = new InitialContext(env);               Stack<IPcdContext> folders = new Stack<IPcdContext>();     IPcdContext myPcdContext = (IPcdContext) ictx.lookup(PCD_ROOT);     folders.push(myPcdContext);     while(!folders.empty()) {          IPcdContext fl = folders.peek();          // how to test if fl is an folder and how to get his children and test them?          // how can I later delete them?   }
} catch (NamingException e) {}

In the official API I could not find any suitable information.

 

I am open for other suggestions, too.

 

Thanks and Best Regards,

Thomas


Viewing all articles
Browse latest Browse all 2686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>