1 16 package com.blandware.atleap.webapp.action.core.globalProperty; 17 18 import com.blandware.atleap.common.Constants; 19 import com.blandware.atleap.model.core.GlobalProperty; 20 import com.blandware.atleap.service.core.GlobalPropertyManager; 21 import com.blandware.atleap.webapp.action.core.BaseAction; 22 import com.blandware.atleap.webapp.form.core.GlobalPropertyForm; 23 import org.apache.struts.action.ActionForm; 24 import org.apache.struts.action.ActionForward; 25 import org.apache.struts.action.ActionMapping; 26 27 import javax.servlet.http.HttpServletRequest ; 28 import javax.servlet.http.HttpServletResponse ; 29 import java.util.Iterator ; 30 import java.util.List ; 31 32 47 public final class ListGlobalPropertiesAction extends BaseAction { 48 57 public ActionForward execute(ActionMapping mapping, ActionForm form, 58 HttpServletRequest request, HttpServletResponse response) throws Exception { 59 60 GlobalPropertyManager globalPropertyManager = (GlobalPropertyManager) getBean(Constants.GLOBAL_PROPERTY_MANAGER_BEAN); 61 62 GlobalPropertyForm globalPropertyForm = (GlobalPropertyForm) form; 63 64 List dynamicProperties = globalPropertyManager.listDynamicProperties(); 65 for ( Iterator i = dynamicProperties.iterator(); i.hasNext(); ) { 66 GlobalProperty globalProperty = (GlobalProperty) i.next(); 67 String key = globalProperty.getName(); 68 globalPropertyForm.setProperty(key, globalProperty.getValue()); 69 globalPropertyForm.setVersion(key, globalProperty.getVersion()); 70 } 71 72 saveToken(request); 74 return mapping.findForward("listGlobalProperties"); 75 } 76 } | Popular Tags |