Programmatically add File System Receivers to Web Projects?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2011 04:41 PM
Hi,
For the longest time, I've had just 2 web projects in my Alfresco installation and as our business has grown, so too have the number of servers we need to deploy to. Each time we need to add server capacity, our sys admins would go be able to use puppet to quickly push out a new server with an installed File System Receiver, but then they'd manually go in to Alfresco and add a new File System Receiver in our web projects' "Actions -> Edit Web Projects -> Configure Deployment Receivers" page. Over time, we've accumulated about 20 different deployment receivers, duplicated in both web projects.
We're about to add 4 or more new web projects and the thought of manually adding each FSR to each web project is really unappealing. Is there a programmatic way to do this? Any config file or DB table I can hack?
For the longest time, I've had just 2 web projects in my Alfresco installation and as our business has grown, so too have the number of servers we need to deploy to. Each time we need to add server capacity, our sys admins would go be able to use puppet to quickly push out a new server with an installed File System Receiver, but then they'd manually go in to Alfresco and add a new File System Receiver in our web projects' "Actions -> Edit Web Projects -> Configure Deployment Receivers" page. Over time, we've accumulated about 20 different deployment receivers, duplicated in both web projects.
We're about to add 4 or more new web projects and the thought of manually adding each FSR to each web project is really unappealing. Is there a programmatic way to do this? Any config file or DB table I can hack?
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 04:17 AM
There's nothing out of the box. However the deployment config is just a child node of the web project node with a particular content model and assoc. You could write a web script to create one.
The code that will do it for you see CreateWebsiteWizard.java and EditWebsiteWizard.java (And yes it needs a re-factor :cry: )
The code that will do it for you see CreateWebsiteWizard.java and EditWebsiteWizard.java (And yes it needs a re-factor :cry: )
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2011 05:18 AM
Below is how you can achieve this programatically.
1. Write a Java backed webscript
2. The backend java class for webscript will read the webproject dns name passed as a webscript argument.
3. It will fetch the webproject noderef using webproject service.
4. Create an XML file to configure deployment receivers to be read programatically.
5. Create DeploymentServerConfig objects and set the required deployment receiver properties accrodingly after reading from the XML file.
6. Add the Deployment receiver to the webproject as below
this.serviceRegistry.getNodeService().createNode(WebProjectNodeRef, WCMAppModel.ASSOC_DEPLOYMENTSERVER, WCMAppModel.ASSOC_DEPLOYMENTSERVER, WCMAppModel.TYPE_DEPLOYMENTSERVER, DeploymentServerConfig.getRepoProps());
You may get a clear idea if you refer to saveDeploymentServerConfig() in CreateWebSiteWizard.java.
Hope it helps.
Thanks
1. Write a Java backed webscript
2. The backend java class for webscript will read the webproject dns name passed as a webscript argument.
3. It will fetch the webproject noderef using webproject service.
4. Create an XML file to configure deployment receivers to be read programatically.
5. Create DeploymentServerConfig objects and set the required deployment receiver properties accrodingly after reading from the XML file.
6. Add the Deployment receiver to the webproject as below
this.serviceRegistry.getNodeService().createNode(WebProjectNodeRef, WCMAppModel.ASSOC_DEPLOYMENTSERVER, WCMAppModel.ASSOC_DEPLOYMENTSERVER, WCMAppModel.TYPE_DEPLOYMENTSERVER, DeploymentServerConfig.getRepoProps());
You may get a clear idea if you refer to saveDeploymentServerConfig() in CreateWebSiteWizard.java.
Hope it helps.
Thanks
