private void populateNavigation() { AppFormVoCollection coll = domain.listFormsWithHelpUrl(); form.grdDetails().getRows().clear(); GenForm.grdDetailsRow row; for (int i = 0; coll != null && i < coll.size(); i++) { AppFormVo vo = coll.get(i); row = form.grdDetails().getRows().newRow(); row.setValue(vo); row.setForm(vo.isAlias() ? vo.getAliasName() : vo.getName()); row.seturl(vo.getHelpLink()); } if (form.getLocalContext().getCurrentFormIsNotNull()) { form.grdDetails().setValue(form.getLocalContext().getCurrentForm()); } populateDetailsPanel(); onFormModeChanged(); }
protected void onQmbNavStartFormTextSubmited(String value) throws PresentationLogicException { form.qmbNavStartForm().clear(); if (value != null) { AppFormVoCollection formColl = form.getLocalContext().getAllForms(); for (int i = 0; i < formColl.size(); i++) { AppFormVo appform = formColl.get(i); if(appform.getName().indexOf(value) != -1) { if (appform.isAlias()) { form.qmbNavStartForm().newRow(appform,appform.getName() + " (" + appform.getAliasName() +")",Color.Gray); } else { form.qmbNavStartForm().newRow(appform,appform.getName()); } } form.qmbNavStartForm().showOpened(); } } }
protected void onBtnFormFilterClick() throws PresentationLogicException { if (form.lyr1().Forms().txtFormFilter().getValue() == null || form.lyr1().Forms().txtFormFilter().getValue().length() < 3) { engine.showMessage("To search, enter at least three characters."); return; } form.lyr1().Forms().grdForms().getRows().clear(); form.lyr1().Forms().grdFormLookups().getRows().clear(); form.lyr1().Forms().cmbDefInst().clear(); form.getLocalContext().setChosenForm(null); AppFormVoCollection coll = domain.listForms(form.lyr1().Forms().txtFormFilter().getValue()); for (int i = 0; i < coll.size(); i++) { AppFormVo formVo = coll.get(i); grdFormsRow row = form.lyr1().Forms().grdForms().getRows().newRow(); row.setValue(formVo); row.setFormName(formVo.getName()); } form.lyr1().Forms().txtFormFilter().setFocus(); }
@SuppressWarnings("unchecked") public AppFormVoCollection listFormsByName(String formName) { // Similar to FormHelpImpl method, though this includes dialogs if (formName == null) throw new CodingRuntimeException("Cannot search on null Form Name!"); DomainFactory factory = getDomainFactory(); /* String hql = " from AppForm app where app.isAlias != true and app.isComponent != true and app.namespace is not null " + " and app.name like :formName";*/ String hql = " from AppForm app where app.isComponent != true and app.namespace is not null " + " and upper(app.name) like upper(:formName)"; if (formName.indexOf("%") == -1) formName += "%"; List lst = factory.find(hql, new String[]{"formName"}, new Object[]{formName}); return AppFormVoAssembler.createAppFormVoCollectionFromAppForm(lst); }
@Override protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException { if (form.txtName().getValue() == null) { engine.showMessage("Please enter a search criteria", "Message", MessageButtons.OK); return; } form.grdForms().getRows().clear(); AppFormVoCollection forms = null; if (form.txtName() != null) { forms = domain.listForms(form.txtName().getValue(), form.chkIncludeAliases().getValue(), form.chkIncludeDialogs().getValue()); } if (forms != null) { for (AppFormVo item : forms) { grdFormsRow aRow = form.grdForms().getRows().newRow(); aRow.setValue(item); aRow.setcolName(item.getName()); aRow.setcolAlias(item.getAliasName()); aRow.setcolSelect(false); } } else { engine.showMessage("No results found", "Message", MessageButtons.OK); } }
public ims.admin.vo.AppFormVoCollection listForms(String form, Boolean includeAliases, Boolean includeDialogs) { DomainFactory factory = getDomainFactory(); IMSCriteria imsc = new IMSCriteria(AppForm.class,factory); imsc.like(AppForm.FieldNames.Name, "%" + form + "%"); // Include aliases if (!Boolean.TRUE.equals(includeAliases)) { imsc.equal(AppForm.FieldNames.IsAlias, false); } // Include dialogs if (!Boolean.TRUE.equals(includeDialogs)) { imsc.equal(AppForm.FieldNames.IsDialog, false); } List<AppForm> forms = imsc.find(); if (forms != null && forms.size() > 0) return AppFormVoAssembler.createAppFormVoCollectionFromAppForm(forms); return null; }
protected void onQmbFormTextSubmited(String value) throws PresentationLogicException { if (value == null || value.length() < 3) { engine.showMessage("Please enter at least 3 characters for search criteria"); return; } AppFormVoCollection coll = domain.listFormByName(value); form.qmbForm().setValue(null); form.qmbForm().clear(); if (coll != null) { for (int i = 0; i < coll.size(); i++) { AppFormVo vo = coll.get(i); //-------------------------wdev-8572 if(!compareFormsName(vo)) //--------------------------- if (vo.isAlias()) form.qmbForm().newRow(vo, vo.getAliasName()); else form.qmbForm().newRow(vo, vo.getName()); } } if (coll.size() == 1) { form.qmbForm().setValue(coll.get(0)); } else if (coll.size() > 1) { form.qmbForm().showOpened(); } }
private void open() { AppNavShortVoCollection coll = domain.listNavigations(); form.getLocalContext().setAllNavs(coll); AppFormVoCollection formColl = domain.listNavigableForms(); form.getLocalContext().setAllForms(formColl); populateNavGrid(coll); // populate the assessment grid based on flag value if( ! ConfigFlag.GEN.ENABLE_ASSESSMENTS_IN_NAV_CFG.getValue()) { form.lblAssessmentLabel().setVisible(false); form.grdAssessments().setVisible(false); } else { // It is possible that the ENABLE_ASSESSMENTS_IN_NAV_CFG config flag may be set wrong. // This will cause a crash in the domain.listAssessments() function if UserAssessment // is not mapped. Catch the exception and ask the user to correct the flag value. try { populateAssessmentGrid(); } catch ( DomainRuntimeException e ) { engine.showMessage("Please ask an administrator to check the value of the ENABLE_ASSESSMENTS_IN_NAV_CFG flag. It should be false. "); setFormMode(FormMode.VIEW); } } }
private void populateFormGrid(AppFormVoCollection formColl) { form.grdForms().getRows().clear(); formColl = sortFormGrid(formColl); for (int i = 0; i < formColl.size(); i++) { AppFormVo appform = formColl.get(i); grdFormsRow row = form.grdForms().getRows().newRow(); row.setValue(appform); String namespaceName = ""; if(appform.getNamespace() != null && appform.getNamespace().getName() != null) namespaceName = appform.getNamespace().getName() + "."; row.setFormName(namespaceName + appform.getName()); if (appform.isAlias()) { row.setTextColor(Color.Gray); row.setFormName(namespaceName + appform.getName() + " (" + appform.getAliasName() +")"); } row.setTooltip(appform.getTooltip()); if(form.treNav().getSelectedNode()!= null) { form.grdForms().setEnabled(true); } else form.grdForms().setEnabled(false); } }
private AppFormVoCollection sortFormGrid(AppFormVoCollection formColl) { boolean shouldStop = false; while(!shouldStop) { shouldStop = true; for(int i=0; i<formColl.size()-1; i++) { AppFormVo appformI = formColl.get(i); String namespaceNameI = ""; String nameI = appformI.getName(); if(appformI.getNamespace() != null && appformI.getNamespace().getName() != null) namespaceNameI = appformI.getNamespace().getName(); AppFormVo appformS = formColl.get(i + 1); String namespaceNameS = ""; String nameS = appformS.getName(); if(appformS.getNamespace() != null && appformS.getNamespace().getName() != null) namespaceNameS = appformS.getNamespace().getName(); if(namespaceNameI.compareTo(namespaceNameS) > 0) { formColl.set(i, appformS); formColl.set(i + 1,appformI); shouldStop = false; } else if(namespaceNameI.compareTo(namespaceNameS) == 0) { if(nameI.compareTo(nameS) > 0) { formColl.set(i, appformS); formColl.set(i + 1,appformI); shouldStop = false; } } } } return formColl; }
protected void onQmbNavSearchFormTextSubmited(String value) throws PresentationLogicException { form.qmbNavSearchForm().clear(); if (value != null) { AppFormVoCollection formColl = form.getLocalContext().getAllForms(); for (int i = 0; i < formColl.size(); i++) { AppFormVo appform = formColl.get(i); if(appform.getName().indexOf(value) != -1) { if (appform.isAlias()) { form.qmbNavSearchForm().newRow(appform,appform.getName() + " (" + appform.getAliasName() +")",Color.Gray); } else { form.qmbNavSearchForm().newRow(appform,appform.getName()); } } } form.qmbNavSearchForm().showOpened(); } }
@Override protected void onQmbFormNameTextSubmited(String value) throws PresentationLogicException { AppFormVoCollection coll = domain.listFormsByName(value); form.qmbFormName().clear(); form.grdReportList().getRows().clear(); for (int i = 0; coll != null && i < coll.size(); i++) { AppFormVo vo = coll.get(i); if(vo.isAlias() == false) form.qmbFormName().newRow(vo, vo.getName()); else { form.qmbFormName().newRow(vo, vo.getName() + " (" + vo.getAliasName() + ")"); } } if(coll.size() == 1) { form.qmbFormName().setValue(coll.get(0)); onQmbFormNameValueChanged(); } else form.qmbFormName().showOpened(); }
public AppFormVoCollection listForms(String nameFilter) { DomainFactory factory = getDomainFactory(); String hql = " from AppForm af where upper(af.name) like :name and af.isComponent = :isComp and af.isAlias = :isAlias"; String filter = "%" + nameFilter.trim().toUpperCase() + "%"; return AppFormVoAssembler.createAppFormVoCollectionFromAppForm(factory.find(hql, new String[]{"name", "isComp", "isAlias"}, new Object[]{filter, Boolean.FALSE, Boolean.FALSE})).sort(); }
public AppFormVoCollection listFormByName(String formName) { if (formName == null) throw new CodingRuntimeException("Cannot search on null Form Name!"); DomainFactory factory = getDomainFactory(); String hql = " from AppForm app where app.isComponent != true " + " and upper(app.name) like :formName"; if (formName.indexOf("%") == -1) formName += "%"; List lst = factory.find(hql, new String[]{"formName"}, new Object[]{formName.toUpperCase()}); return AppFormVoAssembler.createAppFormVoCollectionFromAppForm(lst); }
public AppFormVoCollection listFormsWithHelpUrl() { DomainFactory factory = getDomainFactory(); String hql = " from AppForm app where app.isComponent != true " + " and app.helpLink != null"; List lst = factory.find(hql); return AppFormVoAssembler.createAppFormVoCollectionFromAppForm(lst); }