-
1. Re: How to create dynamically new portals?
julien1 Aug 14, 2005 6:19 PM (in response to tomcmok)Hello Tom,
what you describe is scheduled for 2.2 release. -
2. Re: How to create dynamically new portals?
tomcmok Aug 16, 2005 8:42 AM (in response to tomcmok)Hi Julien,
OK - so I have couple more questions:
1) When do you plat to release final 2.2 (have read something about Nov?)
2) How safe (in terms of compatibility, etc.) is to start development on 2.0 i.e. implementation of other functionality, wait till 2.2 and then upgrade and use new features of 2.2 to implement that part of functionality I descibed above?
Tomasz -
3. Re: How to create dynamically new portals?
marec Aug 18, 2005 1:12 AM (in response to tomcmok)It's also possible in JBP 2.0.
Take a look at org.jboss.portal.core.deployment.jboss.PortalDeployment class. Especially the create() method that is derived from super class.
Everything what you need to is to override the create() method in your new class derived form PortalDeployment.
To obtain the serverManager use this peace of code:MBeanServer server = MBeanServerLocator.locateJBoss(); ObjectName objName = new ObjectName("portal:service=ServerManager");
and instead ofgetServerManager().deploy(portalMD);
callserver.invoke(objName, "deploy", new Object[] {portalMD}, new String[] {"org.jboss.portal.server.metadata.ServerObjectMetaData"});
-
4. Re: How to create dynamically new portals?
tomcmok Aug 18, 2005 4:12 AM (in response to tomcmok)marec,
Thanks for a hint. I assume the code you provided will rescan the deploy directories and deploy this what is new in there - right?
So - whenever I create new portal dynamically (i.e. some basic set of config files in new *.war directory), I just call create() in my derived class and this should do the trick?
Thanks,
Tomasz -
5. Re: How to create dynamically new portals?
tomcmok Aug 18, 2005 4:16 AM (in response to tomcmok)...and what do I need 'server' MBean for - it doesn't seem to be referenced in your suggested code?
Tomasz -
6. Re: How to create dynamically new portals?
marec Aug 23, 2005 2:18 AM (in response to tomcmok)"tomcmok" wrote:
I assume the code you provided will rescan the deploy directories and deploy this what is new in there - right?
No. It is not rescaning. You don't need to have WAR file or any file. Everything what you need is portal description XML String in a variable. Your overriden create method will create org.w3c.Document from this String instead of loading it from file."tomcmok" wrote:
So - whenever I create new portal dynamically (i.e. some basic set of config files in new *.war directory), I just call create() in my derived class and this should do the trick?
yes, what you need to do is to create instance of you class and call create()."tomcmok" wrote:
...and what do I need 'server' MBean for - it doesn't seem to be referenced in your suggested code?
Not referenced? and what is this than?server.invoke(objName, "deploy", new Object[] {portalMD}, new String[] {"org.jboss.portal.server.metadata.ServerObjectMetaData"});
You have to call it instead of "getServerManager()" method than is called in the class you derived from. -
7. Re: How to create dynamically new portals?
tomcmok Aug 24, 2005 3:55 AM (in response to tomcmok)Not referenced? and what is this than?
...yeah, I was too much fosused on the parameters ;)
Ok - thanks - I'll give it a try and eventually come back to bother you with more questions ;)
Cheers,
Tomasz