cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

export and import customize table views in 9.x

ddemay
1-Newbie

export and import customize table views in 9.x

Hello,



Trying to get a feel for how many would be interested in being able to
import and export the table views all of us create when we are in Windchill
and we select a dropdown and then select the "Customize." option to create a
view different from the OOTB columns, sorting, and filtering.



Right now, you cannot do it. I want to be able to design these on a
development/test server before they get created or pushed into production.
Doing this manually of course for complex views with filters etc. can
introduce human error.



A PTC tech support engineer (TSE) told me to file an enhancement request,
but that they believe it'll be coming in the next release. I don't know
about everyone else, but that translates in to several years from now by the
time you complete an upgrade. So, if anyone is interested, I might go ahead
and create my own and share it.



Here is what I have so far:



These customized views are stored in a database table called
TableViewDescriptor.

The configurations of these are stored as database blobs in those tables.

Good news is you can use the supported PTC Java API PersistenceHelper to
read and write these into your system. Ideally, save these configuration
into some kind of xml is ideal.







Here is some snippets I have so far:





import java.util.Iterator;

import java.util.Vector;



import com.ptc.core.htmlcomp.tableview.TableColumnDefinition;

import com.ptc.core.htmlcomp.tableview.TableViewDescriptor;

import com.ptc.core.htmlcomp.tableview.filter.TableFilter;



public class TableViewIXBUtility {



public TableViewIXBUtility() throws Exception

{

TableViewDescriptor tvd =
TableViewDescriptor.newTableViewDescriptor();

Iterator columnDefinitionIter =
tvd.getTableColumnDefinition().iterator();

Object objCol = null;

while (columnDefinitionIter.hasNext())

{

objCol =
columnDefinitionIter.next();



if (objCol instanceof
TableColumnDefinition)

{

TableColumnDefinition
tcd = (TableColumnDefinition)objCol;


//tcd.getViewAttributeName()

//tcd.getSortNumber()

//tcd.getName()


//tcd.isSortDescending();

//tcd.isLocked();

//tcd.isTreeColumn();



}

}



Iterator tblViewCriterionIter =
tvd.getTableViewCriterion().iterator();





TableFilter tblFilter = tvd.getTableFilter();

//TableFilterHelper.

String description = tvd.getDescription();

String descriptionKey = tvd.getDescriptionKey();

int frzCols = tvd.getFrozenColumns();

String tableID = tvd.getTableID();

boolean isPublished = tvd.isPublished();

boolean isSystem = tvd.isSystem();

boolean isTreeView = tvd.isTreeView();

String tblDescContainerName =
tvd.getContainer().getName();

String ownerFullName =
tvd.getOwnership().getOwner().getFullName();



}



}







Regards,



David DeMay







2 REPLIES 2
LiuLiang
4-Participant
(To:ddemay)

I was using oracle command export the table TableViewDescriptor then import to another instance.

But if your customization can pick single table view to export and import (like the import/export in report manager), it will be really cool. Thanks for your efforts.

ddemay
1-Newbie
(To:ddemay)

That's not a bad workaround either.

Hopefully others will chime in...fridays are slow.



Sent from my Verizon Wireless BlackBerry
Top Tags