You can create the new property by using the Portal Server Admin Console. Create the new property for the container at the organization level (e.g. DeveloperSample) so that it is available for all of the roles and users in that organization.
The properties can be retrieved using the getStringProperty() API call. There is also a tab library call that can be accessed from within the JSP.
There are lots of samples that demonstrate how to get/set string properties using the JSP and Java API. Take a look at some of the JSPs that are part of the portal samples an you will see how it is done.
HTH,
Jim
I saw that. What I've made :
create a new property on the tab from JSPTabContainer /TabProperties
Then the Display Profile looks like :
?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
<DisplayProfile version="1.0" priority="10">
<Properties>
</Properties>
<Channels>
<Container name="JSPTabContainer" provider="JSPTabContainerProvider" merge="replace">
<Properties>
<Collection name="TabProperties">
<Collection name="JSPTabCustomTableContainer">
<Boolean name="removable" value="true"/>
<Boolean name="renamable" value="true"/>
<Boolean name="predefined" value="false"/>
</Collection>
<Collection name="JSPTabContainer/Actualite">
<Boolean name="removable" value="false"/>
<Boolean name="predefined" value="true"/>
<Boolean name="renamable" value="false"/>
<Integer name="NEWPROPERTY" value="1"/>
</Collection>
</Collection>
I want to get the NEWPROPERTY from JSPTabContainer/tab.jsp
I could get the property TabProperties but what to do with that ?
It looks like your new property was created as part of the TabProperties collection. This collection is really meant to be reserved for some pre-defined properties that control the display of a particular tab.
If you you just want a custom property that is added to the tab container, then just add the property directly under the <Properties> element.
- Jim
You re right, I could not find any method to create a new "basic" property on my tab (a JSPTableContainerProvider). I've only found the "new property" button on the tab properties of the JSPTabContainer from PSconsole. At the moment I didn't try to create the property uploading a display profile with the new property. My aim is to do that using the PSconsole.
The new property action seems to be available only for collections...
Hmmm .... You're right. It looks like there is no way to create a new property using the psconsole. I will check in to this and see why that's the case.
Apparently you must directly edit the display profile document in order to create the new property that you need. You can still do this with the psconsole by downloading - editing - uploading the document.
- Jim
I've created the new property by adding a dispaly profile at the org level.
The xml content is :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
<Provider name="JSPTableContainerProvider" class="com.sun.portal.providers.containers.jsp.table.JSPTableContainerProvider" version="3">
<Properties>
<Integer name="NumTab" value="0" advanced="true"/>
</Properties>
</Provider>
I add it using the psadmin add-dp command and now the property NumTab is available for all the tabs with the default value set to 0.
But now how can I get the new property value from jsp's JSPTabContainer ?
:)
Message was edited by:
pascal25
I 've got it. From JSPTabContainer we can use the "obtainChannelFromContainer" tag and then the getIntegerProperty according the property's type :
<dtcpc:obtainChannelFromContainer channel="complete_path_for_tab" >
<dtpc:getIntegerProperty id="NumTab" key="NumTab"/>
complete_path_for_tab is the entire path for the tab channel (JSPTabContainer/MyTab for exemple).