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

Using InfoEngine Group as a table model in Windchill 9

VivekPhadnis
1-Newbie

Using InfoEngine Group as a table model in Windchill 9

JCA Experts,
Is there a way to use infoengine group as a table model for the JCA
table?
I have seen the examples of the static methods on the java classes and
one example of using carambola query..

I would really appreciate any help.

Thanks
Vivek
5 REPLIES 5

Hello

No JCA expert here, but I have just started learning the area & was intrigued with your effort.

I figured a search through jsp files that contained GROUP_OUT & getModel would show something.

I think I found 2 in the prog_examples area:

<wt_home>\prog_examples\adapter\windchill\jsps\infoengine\jsp\examples\adapter\windchill\jca\search\index.jsp
<wt_home>\prog_examples\adapter\windchill\jsps\infoengine\jsp\examples\adapter\windchill\jca\CreateGroup.jsp

The route that I used to obtain files that had both GROUP_OUT & getModel is as follows:

ran dos finsdtr for GROUP_OUT on all *.js* & piped to txt file. used /s for all dirs & /m to output onlu files names:

findstr /s /m "GROUP_OUT" *.js*>fnd_GROUP_OUT_namesonly_01.txt

then I ran a bat thatdoes a findstr for getModel on every file in that txt list:

for /f %%x in (FND_GROUP_OUT_NAMESONLY_01.TXT) do findstr /s "getModel" %%x

It only found 2, but they seem to explain how to great group through I*E & display in renderTable.

It saysto use a DataUtilityBean bean to rewrap the data or ???

// create the input group
//
%><ie:webject name="Create-Group" type="GRP">
<ie:param name="GROUP_OUT" data="input"/>
<ie:param name="DELIMITER" data="!"/>
<ie:param name="ELEMENT" data="&lt;a" href="mailto:class=WCTYPE%7Cwt.fc.Persistable!obid=@$(@FORM[]domain">class=WCTYPE|wt.fc.Persistable!obid=@$(@FORM[]domain[])" />
</ie:webject><%
//
// perform the search
//
%><ie:webject name="Dispatch-Tasks" type="MGT">
<ie:param name="GROUP_IN" data="input"/>
<ie:param name="ACTION" data="dca-Search"/">
<ie:param name="USEFORM" data="true"/>
</ie:webject><%
//
// describe the group to display
//
%><jca:describetable var="tableDescriptor" id="ieSearchTable" label="Search" results&quot;=">
<jca:describecolumn id="name" label="Name"/">
<jca:describecolumn id="number" label="Number"/">
<jca:describecolumn id="versionInfo.identifier.versionId" label="Version"/">
<jca:describecolumn id="state.state" label="State"/">
<jca:describecolumn id="thePersistInfo.updateStamp" label="Updated"/">
<jca:describecolumn id="thePersistInfo.createStamp" label="Created"/">
</jca:describetable><%
//
// call getModel w/out data acquisition
// it will return a ComponentModel with a view/action model but no Group of data
//
%><jca:getmodel var="model" descriptor="${tableDescriptor}"/"><%
//
// Post-process the data. DataUtilityBean re-wraps the data within the
// group in structures needed for display by JCA renderers (e.g. NmString).
// The results are placed in a new group.
//
%><jsp:usebean id="dub" class="com.ptc.core.components.beans.DataUtilityBean"/><%
//
// add the table descriptor
//
%><c:set target="${dub}" property="descriptor" value="${tableDescriptor}"/><%
//
// populate the model
//
%><c:set target="${dub}" property="rowData" value="${ie.group.elementList}"/><%
//
// make the group the dataModel
//
%><c:set target="${model}" property="dataModel" value="${dub.model}"/"><%
//
// render the table
//
%><table><tr><td><jca:rendertable model="${model}"/"><%

Let me know if this helps or not. I have not tested, but its ptc program examples, so it has to work....ha..ha

L Jett
cadjett@aol.com,datajett@aol.com

You use the getIeModel, not getModel, this will allow you to pass an 
IE group.

I'll dig up an example later and post an example.

The PTC class Customizing th Windchill UI covered this info. Pretty 
good class as PTC classes go



Also check out the files under

<loadpoint>\Windchill/netmarkets/jsp/carambola





Good Info Steve,<br /><br />I ran across the getIeModel, but didnt recall the IE connection.<br /><br />I found another example searching for GROUP_OUT &amp; renderModel:<br /><br />prog_examples\federation\search_portal\jsps\infoengine\jsp\examples\federation\jca_portal\index.jsp<br /><br /> // describe the table we want to display<br /> //<br /> %&gt;&lt;jca:describetable var="tableDescriptor" id="exampleFederatedSearchTable" configurable="false" label="Federated" search=" results&amp;quot;=" componenttype="SIMPLE"&gt;<br /> &lt;jca:describecolumn id="name" label="The" name&amp;quot;=" sortable="false"/"&gt;<br /> &lt;jca:describecolumn id="number" label="The" number&amp;quot;=" sortable="false"/"&gt; <br /> &lt;jca:describecolumn id="lastModified" label="Last" modified&amp;quot;=" sortable="false"/"&gt;<br /> &lt;jca:describecolumn id="repository" label="Repository" sortable="false"/"&gt;<br /> &lt;jca:describecolumn id="downlink" label="Download" sortable="false"/"&gt;<br /> &lt;/jca:describetable&gt;&lt;%<br /> //<br /> // construct the input<br /> //<br /> String elm = "class=ext.example.Part:obid=@" + MY_DOMAIN;<br /> %&gt;&lt;ie:webject name="Create-Group" type="GRP"&gt;<br /> &lt;ie:param name="GROUP_OUT" data="input"/&gt;<br /> &lt;ie:param name="ELEMENT" data="&amp;lt;%=elm%"&gt;" /&gt;<br /> &lt;/ie:webject&gt;&lt;%<br /> //<br /> // perform the search<br /> // since most of the work will be done in the server VM anyways run the task there<br /> // to cut down on the # of outgoing connections and minimize the amount of IPC required<br /> // to run the search.<br /> //<br /> long start = System.currentTimeMillis();<br /> %&gt;&lt;jca:getiemodel var="tableModel" descriptor="${tableDescriptor}" action="FederatedSearch"&gt;<br /> &lt;ie:param name="CLIMBER" data="com.infoengine.util.LDAPTypeHierarchy"/&gt;<br /> &lt;ie:param name="GROUP_IN" data="input"/&gt;<br /> &lt;/jca:getiemodel&gt;&lt;%<br /> //<br /> // add some info to the output to render in the table<br /> //<br /> postProcess ( ie.getGroup ( "output" ), (java.util.Map)ie.getGroup ( "examplePartRepositories" ).getGroup().getMetaValue ( "map" ) );<br /> //<br /> // display the results<br /> //<br />//ie.getGroup ( "output" ).toXML ( new java.io.PrintWriter ( System.err ), false, true );<br />%&gt; <br /> <br /> (&lt;%="+ie.getGroup().getElementCount()%&gt; parts found in &lt;%=(System.currentTimeMillis()-start)%&gt; ms.) <br />&lt;jca:rendertable model="${tableModel}" showpaginglinks="false"/"&gt; <br /><br />I then did a search for js* withgetIeModel &amp; came across a few more:<br /><br />codebase\netmarkets\jsp\carambola\customization\examples\tree\advancedTree4.jsp<br />codebase\netmarkets\jsp\carambola\ie\jcaSearch.jsp<br />codebase\netmarkets\jsp\esiTransaction\relatedTransactionsStep.jsp<br />codebase\netmarkets\jsp\search\searchResults.jsp<br />codebase\netmarkets\jsp\tgt\distTargetsTable.jsp<br />codebase\netmarkets\jsp\tgt\targetAdminStep.jsp<br />codebase\netmarkets\jsp\tgt\updateTargetAssocationsStep.jsp<br />prog_examples\federation\search_portal\jsps\infoengine\jsp\examples\federation\jca_portal\index.jsp<br /><br />the last index.jsp creates its ie group through domains.jsp:<br /><br />prog_examples\federation\search_portal\jsps\infoengine\jsp\examples\federation\jca_portal\domains.jsp<br /><br />I think it obtains its group through tag lib, instead of direct webject: if ( ie.getGroup ( "examplePartRepositories" ) == null )<br />{<br /> Url u = new Url ( NamingService.getDirectoryProvider() );<br /> u.setDn ( NamingService.getSearchBase() );<br /> DelegateDirectory dir = new DelegateDirectory ( u.toString() );<br /> Repository [] repositories = dir.listRepositories();<br /> Group domains = new Group ( "examplePartRepositories" );<br /> ie.addGroup ( domains );<br /> //<br /> // for easy lookup later add a Map of domain -&gt; description as Meta<br /> //<br /> java.util.Map map = new java.util.HashMap();<br /> domains.getGroup().setMetaValue ( "map", map );<br /> for ( int i = 0; repositories != null &amp;&amp; i &lt; repositories.length; i++ ) {<br /> String type = repositories[i].getRepositoryType();<br /> if ( "com.ptc.windchill".equals ( type ) || type.startsWith ( "ext.example." ) )<br /> {<br /> Element e = new Element();<br /> String d = repositories[i].getDisplayName();<br /> String desc = repositories[i].getDescription ();<br /> if ( d == null || desc == null ) continue;<br /> map.put ( d, desc );<br /> e.addAtt ( new Att ( "domain", d ) );<br /> e.addAtt ( new Att ( "description", repositories[i].getDescription() ) );<br /> e.addAtt ( new Att ( "taskP", repositories[i].getTaskProcessor() ) );<br /> e.addAtt ( new Att ( "webjectP", repositories[i].getSupportingAdapter() ) );<br /> domains.addElement ( e );<br /> }<br /> }<br />}<br />List checked = (List)pageContext.findAttribute ( "selected_domains" );<br />boolean all = checked.isEmpty() || checked.size()==ie.getGroup("examplePartRepositories").getElementCount();<br />%&gt;<br />&lt;input type="checkbox" name="all" onclick="allOrNone(this.form);"&amp;lt;%=all?" checked&amp;quot;:&amp;quot;&amp;quot;%="&gt;&gt; All<br /><br />&lt;ie:foreach groupin="examplePartRepositories" groupout="oneRepository"&gt;&lt;%<br /> String domain = (String)ie.getGroup ( "oneRepository" ).getAttributeValue ( 0, "domain" );<br />%&gt;&lt;input type="checkbox" name="domains" value="&amp;lt;%=domain%"&gt;"&lt;%=(all||checked.contains(domain))?" checked":"%&gt;&gt;<a href="&quot;javascript:displayRepoInfo('','&lt;ie:getvalue name="description"/&gt;','&lt;ie:getvalue name="taskP"/&gt;','&lt;ie:getvalue name="webjectP"/&gt;')"&gt;&lt;ie:getvalue name="description"/&gt;<br /><br />&lt;/ie:foreach&gt; But im not great with that area, so now I have the weekend to get better with it.<br /><br />L Jett<br />cadjett@aol.com,datajett@aol.com<br />

For JCA and Info*Engine..



In a nutshell you need to create a table and use getIEModel vs. getModel.
The trick here is you MUST define what is called by getIEModel using the
Info*Engine package manager (explained in the admin guides)



It works quite nice. Documentation could be a little better. I can help
you further on this. It's not hard at all.





David DeMay



_____
Top Tags