Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: How to delete secondary content items attached to a WTDocument using Api?

$
0
0

Hi Vineeth,

 

Here is an example:

 

document = (WTDocument)ContentHelper.service.getContents(document);

String number = document.getNumber();

 

/* Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ). Note this will NOT return the primary content for a FormatContentHolder.*/

Vector contents = ContentHelper.getContentList(document);

int num_of_files = contents.size();

System.out.println("Removing " + num_of_files + " content items from " + number);

 

for (int i = 0; i < num_of_files; i++)

{

ContentItem ci = (ContentItem)contents.elementAt(i);

System.out.println("Removing content item: " + ci.getDescription());

ContentServerHelper.service.deleteContent(document,ci);

}

 

Thanks,

Jarrett


Viewing all articles
Browse latest Browse all 8876

Trending Articles



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