OK, now that I have been directed to instantiating the "foreign" portlet
programatically, I've tried.
I'm doing things from a servlet's init method. Now please do not tell me to use
an MBean. It doesn't fit in my environment, and it should be possible to do it
from a servlet's init method, right? I execute a JavaScript and I have
successfully created my instance and added the "Unchecked"/"view" permission
(you didn't mention this, but without it I get an access denied error when
trying to display the portlet instance). Seemed easy enough:
| function createPortletInstance (containerService, instanceId, portletId,
prefs) {
| if (containerService.getInstance (instanceId) != null) {
| containerService.destroyInstance (instanceId);
| }
| var portletInstance = containerService.createInstance (instanceId,
portletId);
| if (prefs != null) {
| portletInstance.setPreferences (prefs);
| }
| var authDomain = containerService.getAuthorizationDomain();
| var configurator = authDomain.getConfigurator();
| var bindings = new Packages.java.util.HashSet ();
| var binding = new Packages.org.jboss.portal.security.RoleSecurityBinding
| ("view",
Packages.org.jboss.portal.security.SecurityConstants.UNCHECKED_ROLE_NAME);
| bindings.add (binding);
| configurator.setBindings (instanceId, bindings);
| }
|
Now, when executing this I get the following messages:
| 23:44:23,105 WARN [ReadWriteCache] An item was expired by the cache while
it was locked (increase your cache timeout):
org.jboss.portal.core.impl.portlet.state.PersistentState.children#38
| 23:44:23,105 WARN [ReadWriteCache] An item was expired by the cache while
it was locked (increase your cache timeout):
org.jboss.portal.core.impl.portlet.state.PersistentState#38
| 23:44:23,105 WARN [ReadWriteCache] An item was expired by the cache while
it was locked (increase your cache timeout):
org.jboss.portal.core.impl.portlet.state.PersistentState.children#40
|
The warnings are somehow disturbing. Are they a problem? Can I avoid them?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014698#4014698
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014698
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user