docroot/WEB-INF/src/it/infn/ct/g_hmmer_portlet.java
void storePreferences(ActionRequest request)
    throws PortletException, IOException{
        _log.info("Calling storePreferences ...");
        // Stored preference content
        String storedPrefs="Stored preferences:"
                       +LS+"-------------------"
                       +LS;
        // The code below stores all the portlet preference values
        PortletPreferences prefs = request.getPreferences();
        if(prefs!=null) {            
            String logLevel              =appPreferences.getLogLevel              ();
            String gridOperationId       =appPreferences.getGridOperationId       ();
            int    numInfrastructures    =appPreferences.getNumInfrastructures    ();
            int    currPaneInfrastructure=appPreferences.getCurrPaneInfrastructure();   
            String gridOperationDesc     =appPreferences.getGridOperationDesc     ();
            prefs.setValue("pref_logLevel"          , ""+logLevel              );            
            prefs.setValue("pref_gridOperationId"   , ""+gridOperationId       );
            prefs.setValue("pref_gridOperationDesc" , ""+gridOperationDesc     );
            prefs.setValue("pref_numInfrastructures", ""+numInfrastructures    ); 
            prefs.setValue("pref_currInfrastructure", ""+currPaneInfrastructure);                        
            storedPrefs+="pref_logLevel           : '"+logLevel              +"'"
                     +LS+"pref_gridOperationId    : '"+gridOperationId       +"'"
                     +LS+"pref_gridOperationDesc  : '"+gridOperationDesc     +"'"
                     +LS+"pref_numInfrastructures : '"+numInfrastructures    +"'"
                     +LS+"pref_currInfrastructure : '"+currPaneInfrastructure+"'"
                     +LS;            
            // For each preference infrastructure
            for(int i=0; i<numInfrastructures; i++) {                
                int j=i+1;                      
                storedPrefs=LS+"Infrastructure #"+j
                           +LS+"--------------------"
                           +LS;                                
                String enableInfrastructure =appPreferences.getEnableInfrastructure (i);
                String nameInfrastructure   =appPreferences.getNameInfrastructure   (i);
                String acronymInfrastructure=appPreferences.getAcronymInfrastructure(i);
                String bdiiHost             =appPreferences.getBdiiHost             (i);
                String wmsHost              =appPreferences.getWmsHosts             (i);
                String pxServerHost         =appPreferences.getPxServerHost         (i);
                String pxServerPort         =appPreferences.getPxServerPort         (i);
                String pxServerSecure       =appPreferences.getPxServerSecure       (i);
                String pxRobotId            =appPreferences.getPxRobotId            (i);
                String pxRobotVO            =appPreferences.getPxRobotVO            (i);
                String pxRobotRole          =appPreferences.getPxRobotRole          (i);
                String pxRobotRenewalFlag   =appPreferences.getPxRobotRenewalFlag   (i);
                String pxUserProxy          =appPreferences.getPxUserProxy          (i);
                String softwareTags         =appPreferences.getSoftwareTags         (i);
                // Set preference values
                prefs.setValue("pref_"+j+"_enableInfrastructure" ,enableInfrastructure );
                prefs.setValue("pref_"+j+"_nameInfrastructure"   ,nameInfrastructure   );
                prefs.setValue("pref_"+j+"_acronymInfrastructure",acronymInfrastructure);
                prefs.setValue("pref_"+j+"_bdiiHost"             ,bdiiHost             );
                prefs.setValue("pref_"+j+"_wmsHosts"             ,wmsHost              );
                prefs.setValue("pref_"+j+"_pxServerHost"         ,pxServerHost         );
                prefs.setValue("pref_"+j+"_pxServerPort"         ,pxServerPort         );
                prefs.setValue("pref_"+j+"_pxServerSecure"       ,pxServerSecure       );                
                prefs.setValue("pref_"+j+"_pxRobotId"            ,pxRobotId            );
                prefs.setValue("pref_"+j+"_pxRobotVO"            ,pxRobotVO            );
                prefs.setValue("pref_"+j+"_pxRobotRole"          ,pxRobotRole          );
                prefs.setValue("pref_"+j+"_pxRobotRenewalFlag"   ,pxRobotRenewalFlag   );
                prefs.setValue("pref_"+j+"_pxUserProxy"          ,pxUserProxy          );
                prefs.setValue("pref_"+j+"_softwareTags"         ,softwareTags         );
                // Dumps the infrastructure preferences
                storedPrefs+=  "  pref_"+j+"_enableInfrastructure : '"+enableInfrastructure +"'"
                           +LS+"  pref_"+j+"_nameInfrastructure   : '"+nameInfrastructure   +"'"
                           +LS+"  pref_"+j+"_acronymInfrastructure: '"+acronymInfrastructure+"'"
                           +LS+"  pref_"+j+"_bdiiHost             : '"+bdiiHost             +"'"
                           +LS+"  pref_"+j+"_wmsHosts             : '"+wmsHost              +"'"              
                           +LS+"  pref_"+j+"_pxServerHost         : '"+pxServerHost         +"'"   
                           +LS+"  pref_"+j+"_pxServerPort         : '"+pxServerPort         +"'"   
                           +LS+"  pref_"+j+"_pxServerSecure       : '"+pxServerSecure       +"'"   
                           +LS+"  pref_"+j+"_pxRobotId            : '"+pxRobotId            +"'"  
                           +LS+"  pref_"+j+"_pxRobotVO            : '"+pxRobotVO            +"'"   
                           +LS+"  pref_"+j+"_pxRobotRole          : '"+pxRobotRole          +"'"  
                           +LS+"  pref_"+j+"_pxRobotRenewalFlag   : '"+pxRobotRenewalFlag   +"'"  
                           +LS+"  pref_"+j+"_pxUserProxy          : '"+pxUserProxy          +"'"    
                           +LS+"  pref_"+j+"_softwareTags         : '"+softwareTags         +"'"
                           +LS;                       
            } // for each preference infrastructure                   
            String jobRequirements=appInitPreferences.getJobRequirements();
            String pilotScript    =appInitPreferences.getPilotScript    ();            
            prefs.setValue("pref_jobRequirements", jobRequirements);
            prefs.setValue("pref_pilotScript"    , pilotScript    );
            storedPrefs+=  "pref_jobRequirements: '"+jobRequirements+"'"
                       +LS+"pref_pilotScript    : '"+pilotScript    +"'"
                       +LS;            
            // Store preferences
            prefs.store();
        } // pref !=null
        
        // Show saved preferences
        _log.info("Stored preferences"
              +LS+"------------------"
              +storedPrefs
              +LS);
              
    }
/**
     * This method Uses the AppPreference object settings to store Application preferences
     * 
     * @param request ActinRequest instance (called by the processAction)
     * 
     * @throws PortletException
     * @throws IOException 
     */
This method Uses the AppPreference object settings to store Application preferences

@param request ActinRequest instance (called by the processAction)


This method Uses the AppPreference object settings to store Application preferences @param request ActinRequest instance ( called by the processAction )
void storePreferences(ActionRequest request)
    throws PortletException, IOException{
        _log.info("Calling storePreferences ...");
        String storedPrefs="Stored preferences:"
                       +LS+"-------------------"
                       +LS;
        PortletPreferences prefs = request.getPreferences();
        if(prefs!=null) {            
            String logLevel              =appPreferences.getLogLevel              ();
            String gridOperationId       =appPreferences.getGridOperationId       ();
            int    numInfrastructures    =appPreferences.getNumInfrastructures    ();
            int    currPaneInfrastructure=appPreferences.getCurrPaneInfrastructure();   
            String gridOperationDesc     =appPreferences.getGridOperationDesc     ();
            prefs.setValue("pref_logLevel"          , ""+logLevel              );            
            prefs.setValue("pref_gridOperationId"   , ""+gridOperationId       );
            prefs.setValue("pref_gridOperationDesc" , ""+gridOperationDesc     );
            prefs.setValue("pref_numInfrastructures", ""+numInfrastructures    ); 
            prefs.setValue("pref_currInfrastructure", ""+currPaneInfrastructure);                        
            storedPrefs+="pref_logLevel           : '"+logLevel              +"'"
                     +LS+"pref_gridOperationId    : '"+gridOperationId       +"'"
                     +LS+"pref_gridOperationDesc  : '"+gridOperationDesc     +"'"
                     +LS+"pref_numInfrastructures : '"+numInfrastructures    +"'"
                     +LS+"pref_currInfrastructure : '"+currPaneInfrastructure+"'"
                     +LS;            
            for(int i=0; i<numInfrastructures; i++) {                
                int j=i+1;                      
                storedPrefs=LS+"Infrastructure #"+j
                           +LS+"--------------------"
                           +LS;                                
                String enableInfrastructure =appPreferences.getEnableInfrastructure (i);
                String nameInfrastructure   =appPreferences.getNameInfrastructure   (i);
                String acronymInfrastructure=appPreferences.getAcronymInfrastructure(i);
                String bdiiHost             =appPreferences.getBdiiHost             (i);
                String wmsHost              =appPreferences.getWmsHosts             (i);
                String pxServerHost         =appPreferences.getPxServerHost         (i);
                String pxServerPort         =appPreferences.getPxServerPort         (i);
                String pxServerSecure       =appPreferences.getPxServerSecure       (i);
                String pxRobotId            =appPreferences.getPxRobotId            (i);
                String pxRobotVO            =appPreferences.getPxRobotVO            (i);
                String pxRobotRole          =appPreferences.getPxRobotRole          (i);
                String pxRobotRenewalFlag   =appPreferences.getPxRobotRenewalFlag   (i);
                String pxUserProxy          =appPreferences.getPxUserProxy          (i);
                String softwareTags         =appPreferences.getSoftwareTags         (i);
                prefs.setValue("pref_"+j+"_enableInfrastructure" ,enableInfrastructure );
                prefs.setValue("pref_"+j+"_nameInfrastructure"   ,nameInfrastructure   );
                prefs.setValue("pref_"+j+"_acronymInfrastructure",acronymInfrastructure);
                prefs.setValue("pref_"+j+"_bdiiHost"             ,bdiiHost             );
                prefs.setValue("pref_"+j+"_wmsHosts"             ,wmsHost              );
                prefs.setValue("pref_"+j+"_pxServerHost"         ,pxServerHost         );
                prefs.setValue("pref_"+j+"_pxServerPort"         ,pxServerPort         );
                prefs.setValue("pref_"+j+"_pxServerSecure"       ,pxServerSecure       );                
                prefs.setValue("pref_"+j+"_pxRobotId"            ,pxRobotId            );
                prefs.setValue("pref_"+j+"_pxRobotVO"            ,pxRobotVO            );
                prefs.setValue("pref_"+j+"_pxRobotRole"          ,pxRobotRole          );
                prefs.setValue("pref_"+j+"_pxRobotRenewalFlag"   ,pxRobotRenewalFlag   );
                prefs.setValue("pref_"+j+"_pxUserProxy"          ,pxUserProxy          );
                prefs.setValue("pref_"+j+"_softwareTags"         ,softwareTags         );
                storedPrefs+=  "  pref_"+j+"_enableInfrastructure : '"+enableInfrastructure +"'"
                           +LS+"  pref_"+j+"_nameInfrastructure   : '"+nameInfrastructure   +"'"
                           +LS+"  pref_"+j+"_acronymInfrastructure: '"+acronymInfrastructure+"'"
                           +LS+"  pref_"+j+"_bdiiHost             : '"+bdiiHost             +"'"
                           +LS+"  pref_"+j+"_wmsHosts             : '"+wmsHost              +"'"              
                           +LS+"  pref_"+j+"_pxServerHost         : '"+pxServerHost         +"'"   
                           +LS+"  pref_"+j+"_pxServerPort         : '"+pxServerPort         +"'"   
                           +LS+"  pref_"+j+"_pxServerSecure       : '"+pxServerSecure       +"'"   
                           +LS+"  pref_"+j+"_pxRobotId            : '"+pxRobotId            +"'"  
                           +LS+"  pref_"+j+"_pxRobotVO            : '"+pxRobotVO            +"'"   
                           +LS+"  pref_"+j+"_pxRobotRole          : '"+pxRobotRole          +"'"  
                           +LS+"  pref_"+j+"_pxRobotRenewalFlag   : '"+pxRobotRenewalFlag   +"'"  
                           +LS+"  pref_"+j+"_pxUserProxy          : '"+pxUserProxy          +"'"    
                           +LS+"  pref_"+j+"_softwareTags         : '"+softwareTags         +"'"
                           +LS;                       
            } 
            String jobRequirements=appInitPreferences.getJobRequirements();
            String pilotScript    =appInitPreferences.getPilotScript    ();            
            prefs.setValue("pref_jobRequirements", jobRequirements);
            prefs.setValue("pref_pilotScript"    , pilotScript    );
            storedPrefs+=  "pref_jobRequirements: '"+jobRequirements+"'"
                       +LS+"pref_pilotScript    : '"+pilotScript    +"'"
                       +LS;            
            prefs.store();
        } 
        _log.info("Stored preferences"
              +LS+"------------------"
              +storedPrefs
              +LS);
    }
void storePreferences ( ActionRequest request ) throws PortletException , IOException { _log . info ( "Calling storePreferences ..." ) ; String storedPrefs = "Stored preferences:" + LS + "-------------------" + LS ; PortletPreferences prefs = request . getPreferences ( ) ; if ( prefs != null ) { String logLevel = appPreferences . getLogLevel ( ) ; String gridOperationId = appPreferences . getGridOperationId ( ) ; int numInfrastructures = appPreferences . getNumInfrastructures ( ) ; int currPaneInfrastructure = appPreferences . getCurrPaneInfrastructure ( ) ; String gridOperationDesc = appPreferences . getGridOperationDesc ( ) ; prefs . setValue ( "pref_logLevel" , "" + logLevel ) ; prefs . setValue ( "pref_gridOperationId" , "" + gridOperationId ) ; prefs . setValue ( "pref_gridOperationDesc" , "" + gridOperationDesc ) ; prefs . setValue ( "pref_numInfrastructures" , "" + numInfrastructures ) ; prefs . setValue ( "pref_currInfrastructure" , "" + currPaneInfrastructure ) ; storedPrefs += "pref_logLevel           : '" + logLevel + "'" + LS + "pref_gridOperationId    : '" + gridOperationId + "'" + LS + "pref_gridOperationDesc  : '" + gridOperationDesc + "'" + LS + "pref_numInfrastructures : '" + numInfrastructures + "'" + LS + "pref_currInfrastructure : '" + currPaneInfrastructure + "'" + LS ; for ( int i = 0 ; i < numInfrastructures ; i ++ ) { int j = i + 1 ; storedPrefs = LS + "Infrastructure #" + j + LS + "--------------------" + LS ; String enableInfrastructure = appPreferences . getEnableInfrastructure ( i ) ; String nameInfrastructure = appPreferences . getNameInfrastructure ( i ) ; String acronymInfrastructure = appPreferences . getAcronymInfrastructure ( i ) ; String bdiiHost = appPreferences . getBdiiHost ( i ) ; String wmsHost = appPreferences . getWmsHosts ( i ) ; String pxServerHost = appPreferences . getPxServerHost ( i ) ; String pxServerPort = appPreferences . getPxServerPort ( i ) ; String pxServerSecure = appPreferences . getPxServerSecure ( i ) ; String pxRobotId = appPreferences . getPxRobotId ( i ) ; String pxRobotVO = appPreferences . getPxRobotVO ( i ) ; String pxRobotRole = appPreferences . getPxRobotRole ( i ) ; String pxRobotRenewalFlag = appPreferences . getPxRobotRenewalFlag ( i ) ; String pxUserProxy = appPreferences . getPxUserProxy ( i ) ; String softwareTags = appPreferences . getSoftwareTags ( i ) ; prefs . setValue ( "pref_" + j + "_enableInfrastructure" , enableInfrastructure ) ; prefs . setValue ( "pref_" + j + "_nameInfrastructure" , nameInfrastructure ) ; prefs . setValue ( "pref_" + j + "_acronymInfrastructure" , acronymInfrastructure ) ; prefs . setValue ( "pref_" + j + "_bdiiHost" , bdiiHost ) ; prefs . setValue ( "pref_" + j + "_wmsHosts" , wmsHost ) ; prefs . setValue ( "pref_" + j + "_pxServerHost" , pxServerHost ) ; prefs . setValue ( "pref_" + j + "_pxServerPort" , pxServerPort ) ; prefs . setValue ( "pref_" + j + "_pxServerSecure" , pxServerSecure ) ; prefs . setValue ( "pref_" + j + "_pxRobotId" , pxRobotId ) ; prefs . setValue ( "pref_" + j + "_pxRobotVO" , pxRobotVO ) ; prefs . setValue ( "pref_" + j + "_pxRobotRole" , pxRobotRole ) ; prefs . setValue ( "pref_" + j + "_pxRobotRenewalFlag" , pxRobotRenewalFlag ) ; prefs . setValue ( "pref_" + j + "_pxUserProxy" , pxUserProxy ) ; prefs . setValue ( "pref_" + j + "_softwareTags" , softwareTags ) ; storedPrefs += "  pref_" + j + "_enableInfrastructure : '" + enableInfrastructure + "'" + LS + "  pref_" + j + "_nameInfrastructure   : '" + nameInfrastructure + "'" + LS + "  pref_" + j + "_acronymInfrastructure: '" + acronymInfrastructure + "'" + LS + "  pref_" + j + "_bdiiHost             : '" + bdiiHost + "'" + LS + "  pref_" + j + "_wmsHosts             : '" + wmsHost + "'" + LS + "  pref_" + j + "_pxServerHost         : '" + pxServerHost + "'" + LS + "  pref_" + j + "_pxServerPort         : '" + pxServerPort + "'" + LS + "  pref_" + j + "_pxServerSecure       : '" + pxServerSecure + "'" + LS + "  pref_" + j + "_pxRobotId            : '" + pxRobotId + "'" + LS + "  pref_" + j + "_pxRobotVO            : '" + pxRobotVO + "'" + LS + "  pref_" + j + "_pxRobotRole          : '" + pxRobotRole + "'" + LS + "  pref_" + j + "_pxRobotRenewalFlag   : '" + pxRobotRenewalFlag + "'" + LS + "  pref_" + j + "_pxUserProxy          : '" + pxUserProxy + "'" + LS + "  pref_" + j + "_softwareTags         : '" + softwareTags + "'" + LS ; } String jobRequirements = appInitPreferences . getJobRequirements ( ) ; String pilotScript = appInitPreferences . getPilotScript ( ) ; prefs . setValue ( "pref_jobRequirements" , jobRequirements ) ; prefs . setValue ( "pref_pilotScript" , pilotScript ) ; storedPrefs += "pref_jobRequirements: '" + jobRequirements + "'" + LS + "pref_pilotScript    : '" + pilotScript + "'" + LS ; prefs . store ( ) ; } _log . info ( "Stored preferences" + LS + "------------------" + storedPrefs + LS ) ; }
This method Uses the AppPreference object settings to store Application preferences
This method Uses the AppPreference object settings to store Application preferences
// Stored preference content // The code below stores all the portlet preference values // For each preference infrastructure // Set preference values // Dumps the infrastructure preferences // for each preference infrastructure                    // Store preferences // pref !=null // Show saved preferences