[JBoss Portal] - Re: Setting Portlet Preferences in Jboss Portal
by piergiorgiolucidi
To manage preferences in your portlet you need to add preferences in your portlet.xml in this way:
| <portlet>
| <portlet-name>YourPortlet</portlet-name>
| <portlet-class>org.yourcompany.portlet.content.YourPortlet</portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>Your Portlet Title</title>
| </portlet-info>
| <portlet-preferences>
| <preference>
| <name>numberContactPerPage</name>
| <value>10</value>
| </preference>
| </portlet-preferences>
| </portlet>
|
Then in your portlet you can use this snippet:
| public void processAction (ActionRequest request, ActionResponse
| actionResponse)
| throws PortletException, java.io.IOException {
| PortletPreferences pref = request.getPreferences();
| pref.setValue("15",request.getParameter("numberContactPerPage"));
| pref.store();
| actionResponse.setPortletMode(PortletMode.VIEW);
| actionResponse.setRenderParameters(request.getParameterMap());
| }
|
Hope this helps.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214599#4214599
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214599
17 years, 1 month
[JBoss Portal] - WSRP resources URLs
by cpage
I have some questions about URLs of resources with remote portlet.
I use JBoss 4.2.3 + JBossPortal 2.6.6.
In the WSRP primer we can read :
anonymous wrote : Producers may not offer a web interface (i.e., offer http/https ports) for content
So I suppose the consumer should rewrite all URLs to refer to him but it seems not the case with JBossPortal.
For example, this is the differences between local et remote portlet HTML code rendering :
| local :
| <img src="/myportlet/transparent.gif" style="background:url('/myportlet/creer.png')!important;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='/myportlet/creer.png');" />
|
| remote :
| <img src="http://localhost:8180/myportlet/transparent.gif" style="background:url('/myportlet/creer.png')!important;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='http://localhost:8180/myportlet/creer.png');" />
In this example, for the remote portlet, some URLs refers to the producer (localhost:8180) and others (in CSS) refers to relative URLs (that do not exist in the consumer).
What is the good practice with resources in remote portlet ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214595#4214595
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214595
17 years, 1 month
[JBoss Portal] - Re: unable to see java portlet instence
by piergiorgiolucidi
I think it could be depend on settings on your portlet-instances.xml file.
If you have declared "if-exists" tag for this portlet in your portlet-instances.xml in this way:
| <if-exists>overwrite</if-exists>
| <instance>
| <instance-id>YourPortletInstance</instance-id>
| <portlet-ref>yourApp.yourPortlet</portlet-ref>
| </instance>
|
You are telling the container to destroy any existing object and create a new one.
If would you like the container retains any existing copy and creates a new instance, then you must set "keep" as value of this tag, in this way:
| <if-exists>keep</if-exists>
| <instance>
| <instance-id>YourPortletInstance</instance-id>
| <portlet-ref>yourApp.yourPortlet</portlet-ref>
| </instance>
|
Try this ;)
Hope this helps
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214585#4214585
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214585
17 years, 1 month