[jboss-user] [JBoss Portal] - Re: How to create a new Portlet Instance using API

2009-01-22 Thread aspdeepak
Window w = 
currentPage.createWindow(portalWindowName,ContentType.PORTLET,instanceId);
log.info(" window["+w+"] is assigned with portlet ["+instanceId+"] 
successfully");


w.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,region);

w.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + 
Integer.MAX_VALUE);

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204215#4204215

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204215
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: How to create a new Portlet Instance using API

2009-01-22 Thread aspdeepak
hi
 you should create a Window and assign this newly created portlet instance into 
that.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204212#4204212

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204212
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: How to create a new Portlet Instance using API

2009-01-20 Thread yanivc24
Thanks for the answer

I did as you suggested and created the following code in order to create a new 
instance: 


  | PersistentInstanceDefinition instanceToCopy=(PersistentInstanceDefinition)  
 instanceContainerContext.getInstanceDefinition(intanceName);
  | 
  | Date current = new Date();
  | String newInstanceId = instanceToCopy.getId() + "_"  + current.getTime();
  | 
  | PortletContext portletContext =  
PortletContext.createPortletContext("PortletName");
  | 
  | Portlet portletDefinition = portletInvoker.getPortlet(portletContext);
  | PersistentInstanceDefinition newInstance=(PersistentInstanceDefinition) 
  | 
instanceContainer.createDefinition(newInstanceId,portletDefinition.getContext().getId());
  | 
  | Set constraints = Collections.singleton(new RoleSecurityBinding("view", 
SecurityConstants.UNCHECKED_ROLE_NAME));
  | securityService.setSecurityBindings(newInstanceId,constraints);
  | 
  | PropertyChange[] properties = 
duplicateInstanceProperties(instanceToCopy.getProperties());
  | newInstance.setProperties(properties);
  | 
  | 



As you can see from the code, I'm actually trying to create a new instance that 
will be identical to an existing instance(based on the same portlet and have 
the same property values). Unfortunately this code works without giving an 
exception or returning any null values. but the instance created is never shown 
in the instance list of the portal administrative panel and therefore cannot be 
used. 

Basically I followed the code in the CreateInstanceAction class file.

Any suggestions?


Many Thanks,


Yaniv













View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203134#4203134

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203134
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: How to create a new Portlet Instance using API

2009-01-19 Thread prabhat....@jboss.com
The best place would be look into jboss portal source code. Check out the code 
from SVN and look into core-admin.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203039#4203039

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203039
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user