基本自訂 > User Interface Customization > Information Pages > Updating Legacy information Pages
Updating Legacy information Pages
If you have an info page jsp using describeInfoPage and infoPage.jspf here are the steps to convert to the new design:
1. Create an InfoBuilder.
a. Many of the attributes on the describeInfoPage tag should have a corresponding setter on the InfoConfig.
a. id, helpContext, actionListName, navBarName,
b. The propertyPanel, moreAttributesActionName, moreAttributesActionType attributes (and the addPropertyPanel tag) are obsolete. See step 4 for how to create your attribute layouts.
c. The describeStatusGlyph tags will become properties on the InfoConfig. (see section Adding a Status Glyph in Customization Points topic).
2. Configure Visualization if necessary (see section Configuring the Visualization Component in Customization Points topic)
3. Create an attribute layout for your object type using one of these 3 options:
a. Through the Type and Attribute Management utility. (see Type and Attribute Management)
b. With a load file.
c. With a custom attribute panel builder. See the Packaged Samples.
4. Delete the xconf entry for your info page jsp
a. If there is an xconf entry for your object type, that will be used instead of the InfoPageBuilder.
5. Delete the describeInfoPage tag and infoPage.jspf include from your info.jsp
6. If there is something left in your jsp that you want displayed on the info page (some tables or property panels), move those tables/property panels into the third level nav bar (which becomes the Table of Contents). This way the tables/panels shown can be configured by admins and the end user.
a. Create a separate action for each table/panel. See the Actions Framework documentation for more info on actions/action models.
a. Preferred – create a builder for each table/panel. See the MVC table documentation. The resulting actions.xml entry will be something like:
<action name="myTable">
<component name="myTable" typeBased="true" windowType="page"/>
</action>
b. Legacy way – create a separate jsp for each table/panel. The resulting actions.xml entry will be something like:
<action name="myTable">
<command windowType="page"/>
</action>
b. Add those actions to your navBarName action model. Make sure you have set that navBarName in the InfoBuilder. (see the. section Configure the Table of Contents for more details. )
c. Configure which tables/panels are shown out of the box on the Details tab. See section Tab Customizations in Customization Points topic for more information.
Debugging
Add jcaDebug=true to the URL to see some debug info displayed on the info page. http://<hostName>/<webApp>/app/#ptc1/tcomp/infoPage?typeIdForTypeLookup=com.ptc.carambola.customization.examples.infoPage.Carambola&jcaDebug=true In particular, at the top of the page jcaDebugdisplays whether a ComponentConfigBuilder or a jsp produced the page.
Also available are which action models were used for the Actions menu, the top tab set and the Customize option that lets you add tables to the tabs. See the jcaDebug documentation for more details about what is displayed and where to find it.
Log4J
The following log4J loggers are available to provide you more information when debugging your Information Page implementation:
Logger
Description
com.ptc.core.components.validators.VisualizationAndAttributesFilter
Logs information related to the hiding and showing of the primaryAttributes or visualizationAndAttributes components. See Attributes v.s. Visualization and Attributes
com.ptc.jca.mvc.components.AbstractInfoComponentBuilder
Logs information related to finding the context object for the information page.
com.ptc.mvc.components.AbstractInfoConfigBuilder
Logs information related to the view chosen for the information page. This may be useful if you are trying to set a custom view.
com.ptc.jca.mvc.controllers.TypeBasedIncludeController
Logs information related to determining whether the requested information page is being rendered with a legacy jsp or an MVC builder.
Log4javascript
Log4javascript is also available for debugging within the browser. You can turn this on by adding a parameter to the end of the url. “&jsLog=PTC”. This will turn on all the JavaScript logging. You will then see the logging information in the FF/Chrome console or in a separate console which opens when you add the parameter in IE browsers. The following loggers can also be turned on individually by setting jsLog=<loggername>.
Logger
Description
PTC.infoPage
Logs information about errors encountered when rendering an info page as well as, information related to refreshing the top area of the page.
PTC.infoPage.ActiveTab
Logs information related to selecting the active tab based on defaults, stickiness and potential overrides.
PTC.jca.state.ClientStateStore
Logs information related to the stickiness information being stored and retrieved for client side stickiness.
PTC.infoPageTableMgr
Logs information about the adding and removing of tables from the tabs on an information page.
PTC.jca.manager
Logs information about the adding and removing of tables from the tabs on an information page and about the adding and removing of tabs.
這是否有幫助?