cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 2.2 API changes

jameskinley
Champ in-the-making
Champ in-the-making
Hi, I have upgraded to Alfresco 2.2 from 2.1.5.

It appears that the following API calls have been deprecated:

AVMUtil.getRemoteDeploymentUsername();
AVMUtil.getRemoteDeploymentPassword();
AVMUtil.getRemoteReceiverRMIPort();

Does anyone know what these calls have been replaced by in 2.2?
Also, is there a list of API changes available anywhere?

Thanks.
6 REPLIES 6

zaizi
Champ in-the-making
Champ in-the-making
Alfresco 2.2 added a new Deployment Configuration Wizard in the Create Web Project Wizard. You can find more information on this at http://wiki.alfresco.com/wiki/Deployment. Remote server details are configured via the wizard and no set in web-client-config-wcm.xml. Hence why the methods are deprecated.

The AVMDeployWebsiteAction does not require the remote user details or port details any more as it looks it up for each remote server (prior to 2.2 all remote servers used the same username and password). As long as you've updated your website project using the new wizard with all the server details and your deployment code is using AVMDeployWebsiteAction (and not AVMDeploySnapshotAction) you should be fine.

And no, we are not aware of a list of all the API changes.

Hope that helps.

jameskinley
Champ in-the-making
Champ in-the-making
Thanks,

The trouble is our publishing code has been implemented by creating our own publishing server wrapper objects. We have been selecting the "deployto" QNAME from the web project properties but this no longer exists (because of the new wizard).

Instead of re-writing all of our publishing code (which would be nice but we do not have the time) we need to get the configured server properties from Alfresco and create our wrapper objects to pass through to the deployer code. Is there an API that can do this?

Thanks.

zaizi
Champ in-the-making
Champ in-the-making
Take a look at org.alfresco.repo.avm.actions.AVMDeployWebsiteAction.


      // get the NodeRef representing the server to deploy to
      NodeRef serverRef = (NodeRef)action.getParameterValue(PARAM_SERVER);

and then get the properties;


      // get the other data from the deploymentserver object
      Map<QName, Serializable> serverProps = nodeService.getProperties(serverRef);
      String serverUri = calculateServerUri(serverProps);
      String host = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERHOST);
      Integer port = (Integer)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERPORT);
      String remoteUsername = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERUSERNAME);
      String remotePassword = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERPASSWORD);

jameskinley
Champ in-the-making
Champ in-the-making
Thats great thanks,

One question - is there a way to get the server noderefs from the repository?

zaizi
Champ in-the-making
Champ in-the-making
The configured servers for a Web Project are child associations to the web project node. The following code will return the servers where nodeRef is the nodeRef of your web project.


List<ChildAssociationRef> serverRefs = getNodeService().getChildAssocs(
               nodeRef, WCMAppModel.ASSOC_DEPLOYMENTSERVER, RegexQNamePattern.MATCH_ALL);

jameskinley
Champ in-the-making
Champ in-the-making
Thanks very much for your help. The publishing is now working in 2.2.