first.guiml
<?xml version="1.0" encoding="iso-8859-9"?> <guiml> <page> <layout type="XYLayout"/> <bean layoutConstraint="185,110,110,25" name="cmbLanguage" type="ComboBox"> <properties> <property name="selectionKey"> <data en="NAME"/> </property> </properties> </bean> <bean layoutConstraint="185,145,110,25" name="txtLanguage" type="TextField"/> <bean layoutConstraint="185,180,110,25" name="button86375" type="Button"> <listeners> <listener name="ActionListener"> <listener-method action="CheckLanguageInfo" name="actionPerformed"/> </listener> </listeners> </bean> </page> <actions> <action name="INITIALIZE"> <call id="GM_ADM_MODULE_LIST" type="service"/> </action> <action name="CheckLanguageInfo"> <call type="ifThenElse"> <call id="Compare" method="equals" type="method"> <call id="Page.cmbLanguage" method="getSelection" type="method"/> <call id="Administration" type="staticText"/> </call> <call id="MessageBox" method="info" type="method"> <call id="True" type="staticText"/> </call> <call id="MessageBox" method="warn" type="method"> <call id="False" type="staticText"/> </call> </call> </action> </actions> <services> <service alias="GM_ADM_MODULE_LIST" name="GM_ADM_MODULE_LIST" target="Remote"> <inputs/> <outputs> <output name="LIST"> <call id="Page.cmbLanguage" method="setModelData" type="method"/> </output> </outputs> </service> </services> <variables/> </guiml>
GM_ADM_MODULE_LIST GraymoundService
@GraymoundService("GM_ADM_MODULE_LIST") public static HashMap<String, Object> moduleList(HashMap<String, Object> iMap){ try { ArrayList<HashMap<String, Object>> list = new ArrayList<HashMap<String,Object>>(); Session session = DAOSession.getSession(DAO_SESSION_FACTORY_NAME); Iterator<?> iterator = session.createCriteria(GMModule.class).list().iterator(); while (iterator.hasNext()) { GMModule module = (GMModule) iterator.next(); if (module.getVersion().intValue() <1000){ HashMap<String, Object> map = module.getMap(); map.put("NAME", module.getName((String)GMContext.getCurrentContext().getSession().get("language"))); list.add(map); } } HashMap<String, Object> oMap = new HashMap<String, Object>(); oMap.put("LIST", list); return oMap; } catch (Exception e) { throw new RuntimeException(e); } }
