AnsweredAssumed Answered

when will AVMBrowseBean be initialized?

Question asked by rockycres on Jul 6, 2009

I am currently working on Alfresco WCM  where I have created the custom  action called custom_deploy_file ,to that action I want to set few param vaues like (store,updateTestServer).For setting these param values , I have created a custom class called UserStoreFinder ,in which I will use the AvmBrowseBean's getWebsite method to get storeref…etc..After I login & straightaway access this action ,this method is returning  NULL since in avmbrowseBean some of the values are not set.But after I browse the webproject & clicked the same action again ,then it's working fine.So does AVMbrowseBean will be properly set only when we browse the webproject ?Kindly help in this issue.


<action id="custom_deploy_file">
                                <permission allow="true">Write,CreateChildren</permission>
                             <label>Test Deployment</label>
                                <param name="id">#{}</param>
                                <param name="previewURL">#{actionContext.previewUrl}</param>
                                <param name="deployMode">#{DeployWebsiteDialogTest.deployMode}</param>
                                <param name="webproject">#{DeployWebsiteDialogTest.webProjectRef}</param>
                                <param name="snapshotVersion">#{DeployWebsiteDialogTest.snapshotVersion}</param>
                                <param name="store">#{}</param>
                                <param name="updateTestServer">#{UserStoreFinder.updateTestServer}</param>

public class UserStoreFinder
   private static final long serialVersionUID = 59524560340308134L;
   protected String updateTestServer;
   protected String store;
   protected String webapp;
   protected NodeRef webProjectRef;
   protected AVMBrowseBean avmBrowseBean;
   public String getUserStore(){
      Node avm = this.avmBrowseBean.getWebsite();
      String userStore = null;
      if(avm != null)
         Map<String, Object> serverProps = avm.getProperties();
         String creator = (String)serverProps.get(ContentModel.PROP_CREATOR);
         WebProject webProject = avmBrowseBean.getWebProject();      
         userStore = AVMUtil.buildUserMainStoreName(webProject.getStoreId(), creator);
      return userStore;

   public String getStore() {      
      return getUserStore();

   public void setStore(String store) { = store;

   public void setUpdateTestServer(boolean updateTestServer) {
      this.updateTestServer = updateTestServer;

   public boolean getUpdateTestServer() {   
        // if a test server has already been allocated inform the dialog
       // that an update is needed
       NodeRef testServer = DeploymentUtil.findAllocatedTestServer(getUserStore());
       if (testServer != null)
          return  true;
       return false;
   public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean) {
      this.avmBrowseBean = avmBrowseBean;


        The bean that backs up the view of the Versioned Properties