Quantcast
Channel: PTC Community : Discussion List - Windchill
Viewing all articles
Browse latest Browse all 5797

In a step of the Workflow i need to change the role(PRIMARY AND SECONDARY) of my files.

$
0
0

Hi guys,

In a step of the Workflow i need to change the role(PRIMARY AND SECONDARY) of my files.

I have a pdf file as primary and one as secondary dwg.

What better way to make my .PDF Being secondary and my primary file  .DWG? via API.

I'm trying to do this with the code below, but am not having success.

 

document = (wt.doc.WTDocument) ref.getObject();                ContentHolder holder = ContentHelper.service.getContents(document);               Vector<?> contents =  ContentHelper.getContentList(holder);               System.out.println("Content: "+contents);               int files = contents.size();               if(files > 0){                    for(int i =0; i < files; i++){                         ContentItem contentItem = (ContentItem) contents.elementAt(i);                         System.out.println("ContentItem: "+contentItem.getRole());                         wt.content.ApplicationData data = ApplicationData.newApplicationData(document);                         System.out.println("FormatName: "+data.getFileName());                         data.setRole(ContentRoleType.toContentRoleType("PRIMARY"));               //          ContentServerHelper.service.updateHolderFormat(document);                         document = (WTDocument) PersistenceHelper.manager.refresh((Persistable)document,true,true);                     } 

Viewing all articles
Browse latest Browse all 5797

Latest Images

Trending Articles


Telangana Ration Card Online Status Ahara Bhadratha Card Online Status


CalCen


Waves Complete v2019.02.14 Incl Emulator-R2R


[RELEASE THREAD]--_A-Team_--Cricket_Dream_5G


MCGEE, SAMUEL O., DECEASED, OF...


WordPress: Reverse Shell


GPGT - chio bu back from market kym


Ondonga king dragged to court


Justin Guy Ballou, III


Krupt Biography, Death, Songs, Photo, Video



Latest Images

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