Java Code Examples for ims.admin.vo.AppFormVo

The following are top voted examples for showing how to use ims.admin.vo.AppFormVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addMenuAction(AppFormVo appForm, MenuActionVo vo) 
{
	TreeNode treeNode = findOrCreateMenuActionFormNode(appForm);
	
	boolean exists = false;
	
	for(int x = 0; x < treeNode.getNodes().size(); x++)
	{
		if(vo.equals(treeNode.getNodes().get(x).getValue()))
		{
			exists = true;
			break;
		}
	}
	
	if(!exists)
	{
		TreeNode actionNode = treeNode.getNodes().add(vo, vo.getMenuActionDescription());
		actionNode.setCollapsedImage(form.getImages().Core.AnswerBox_NotAvailable);
		actionNode.setExpandedImage(form.getImages().Core.AnswerBox_NotAvailable);
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdDetailsSelectionChanged() throws PresentationLogicException
{
	if(form.getMode().equals(FormMode.VIEW)){
		AppFormVo vo = form.grdDetails().getValue();
		if (vo != null)
		{
			form.getLocalContext().setCurrentForm(vo);
			form.txtURL().setValue(vo.getHelpLink());
			form.qmbForm().setValue(vo);
			form.qmbForm().setEditedText(vo.isAlias() ? vo.getAliasName() : vo.getName());
			form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
		}
		else
		{
			form.qmbForm().setValue(null);
			form.txtURL().setValue("");
			form.getLocalContext().setCurrentForm(null);
		}
		onFormModeChanged();
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean compareFormsName(AppFormVo vo)
{
	for(int i = 0;i < form.grdDetails().getRows().size();i++)
	{
		String temp = form.grdDetails().getRows().get(i).getForm();
		if(!vo.isAlias()) {
			if(vo.getName().equals(temp)) {
				return true;
			}
		}
		else {
			if(vo.getAliasName().equals(temp)) {
				return true;
			}
		}
	}
	
	return false;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onTreNavTreeViewSelectionChanged(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException
{
	setFormMode(form.getMode());
	Object val = node.getValue();
	if (val instanceof AppNavFormVo)
	{
		form.grdForms().setEnabled(false);
		AppNavFormVo navForm = (AppNavFormVo)val;
		AppFormVo formVo = navForm.getForm();
		if (formVo.equals(this.getAssessmentForm()) && form.getMode().equals(FormMode.EDIT))
		{
			form.grdAssessments().setEnabled(true);
		}
	}
	else
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.grdForms().setEnabled(true);			
		}
	}
	form.getLocalContext().setSelectedTreeValue(node.getValue());
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
		}		

	}
	
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormInTree(AppFormVo form, TreeNodeCollection tree, BooleanWraper result)
{
	if (result.isValue() && tree == null)
		return;
	for (int i = 0; i < tree.size(); i++)
	{
		if (tree.get(i).getValue() instanceof AppNavFormVo)
		{
			if (((AppNavFormVo) tree.get(i).getValue()).getForm().getFormId() == form.getFormId())
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormInTree(form, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForReport(ReportTemplateLiteVo rep, AppFormVo reportForm)
{

	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(reportForm);
	newForm.setLinkedClasses(null);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(rep.getBoId());
	genVo.setClassName(rep.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);
	newForm.setNodeText(rep.getName());

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	return newForm;
}
 
Example 11
Project: AvoinApotti   File: FormHelpImpl.java   Source Code and License 6 votes vote down vote up
public void deleteForm(AppFormVo appForm) throws ForeignKeyViolationException, StaleObjectException 
{
	String errors[] = appForm.validate();
	if (errors != null)
	{
		throw new DomainRuntimeException(errors.toString());
	
	}
		
	DomainFactory factory = getDomainFactory();
	AppForm domForm = (AppForm)factory.getDomainObject(appForm);
	domForm.setHelpLink(null);
	factory.save(domForm);


}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addMenuAction(AppFormVo appForm, MenuActionVo vo) 
{
	TreeNode treeNode = findOrCreateMenuActionFormNode(appForm);
	
	boolean exists = false;
	
	for(int x = 0; x < treeNode.getNodes().size(); x++)
	{
		if(vo.equals(treeNode.getNodes().get(x).getValue()))
		{
			exists = true;
			break;
		}
	}
	
	if(!exists)
	{
		TreeNode actionNode = treeNode.getNodes().add(vo, vo.getMenuActionDescription());
		actionNode.setCollapsedImage(form.getImages().Core.AnswerBox_NotAvailable);
		actionNode.setExpandedImage(form.getImages().Core.AnswerBox_NotAvailable);
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdDetailsSelectionChanged() throws PresentationLogicException
{
	if(form.getMode().equals(FormMode.VIEW)){
		AppFormVo vo = form.grdDetails().getValue();
		if (vo != null)
		{
			form.getLocalContext().setCurrentForm(vo);
			form.txtURL().setValue(vo.getHelpLink());
			form.qmbForm().setValue(vo);
			form.qmbForm().setEditedText(vo.isAlias() ? vo.getAliasName() : vo.getName());
			form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
		}
		else
		{
			form.qmbForm().setValue(null);
			form.txtURL().setValue("");
			form.getLocalContext().setCurrentForm(null);
		}
		onFormModeChanged();
	}
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean compareFormsName(AppFormVo vo)
{
	for(int i = 0;i < form.grdDetails().getRows().size();i++)
	{
		String temp = form.grdDetails().getRows().get(i).getForm();
		if(!vo.isAlias()) {
			if(vo.getName().equals(temp)) {
				return true;
			}
		}
		else {
			if(vo.getAliasName().equals(temp)) {
				return true;
			}
		}
	}
	
	return false;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onTreNavTreeViewSelectionChanged(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException
{
	setFormMode(form.getMode());
	Object val = node.getValue();
	if (val instanceof AppNavFormVo)
	{
		form.grdForms().setEnabled(false);
		AppNavFormVo navForm = (AppNavFormVo)val;
		AppFormVo formVo = navForm.getForm();
		if (formVo.equals(this.getAssessmentForm()) && form.getMode().equals(FormMode.EDIT))
		{
			form.grdAssessments().setEnabled(true);
		}
	}
	else
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.grdForms().setEnabled(true);			
		}
	}
	form.getLocalContext().setSelectedTreeValue(node.getValue());
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormInTree(AppFormVo form, TreeNodeCollection tree, BooleanWraper result)
{
	if (result.isValue() && tree == null)
		return;
	for (int i = 0; i < tree.size(); i++)
	{
		if (tree.get(i).getValue() instanceof AppNavFormVo)
		{
			if (((AppNavFormVo) tree.get(i).getValue()).getForm().getFormId() == form.getFormId())
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormInTree(form, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 20
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormInTree(AppFormVo form, TreeNodeCollection tree, BooleanWraper result)
{
	if (result.isValue() && tree == null)
		return;
	for (int i = 0; i < tree.size(); i++)
	{
		if (tree.get(i).getValue() instanceof AppNavFormVo)
		{
			if (((AppNavFormVo) tree.get(i).getValue()).getForm().getFormId() == form.getFormId())
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormInTree(form, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForReport(ReportTemplateLiteVo rep, AppFormVo reportForm)
{

	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(reportForm);
	newForm.setLinkedClasses(null);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(rep.getBoId());
	genVo.setClassName(rep.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);
	newForm.setNodeText(rep.getName());

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	return newForm;
}
 
Example 23
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForReport(ReportTemplateLiteVo rep, AppFormVo reportForm)
{

	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(reportForm);
	newForm.setLinkedClasses(null);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(rep.getBoId());
	genVo.setClassName(rep.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);
	newForm.setNodeText(rep.getName());

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	return newForm;
}
 
Example 24
Project: openMAXIMS   File: FormHelpImpl.java   Source Code and License 6 votes vote down vote up
public void deleteForm(AppFormVo appForm) throws ForeignKeyViolationException, StaleObjectException 
{
	String errors[] = appForm.validate();
	if (errors != null)
	{
		throw new DomainRuntimeException(errors.toString());
	
	}
		
	DomainFactory factory = getDomainFactory();
	AppForm domForm = (AppForm)factory.getDomainObject(appForm);
	domForm.setHelpLink(null);
	factory.save(domForm);


}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addMenuAction(AppFormVo appForm, MenuActionVo vo) 
{
	TreeNode treeNode = findOrCreateMenuActionFormNode(appForm);
	
	boolean exists = false;
	
	for(int x = 0; x < treeNode.getNodes().size(); x++)
	{
		if(vo.equals(treeNode.getNodes().get(x).getValue()))
		{
			exists = true;
			break;
		}
	}
	
	if(!exists)
	{
		TreeNode actionNode = treeNode.getNodes().add(vo, vo.getMenuActionDescription());
		actionNode.setCollapsedImage(form.getImages().Core.AnswerBox_NotAvailable);
		actionNode.setExpandedImage(form.getImages().Core.AnswerBox_NotAvailable);
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean compareFormsName(AppFormVo vo)
{
	for(int i = 0;i < form.grdDetails().getRows().size();i++)
	{
		String temp = form.grdDetails().getRows().get(i).getForm();
		if(!vo.isAlias()) {
			if(vo.getName().equals(temp)) {
				return true;
			}
		}
		else {
			if(vo.getAliasName().equals(temp)) {
				return true;
			}
		}
	}
	
	return false;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onTreNavTreeViewSelectionChanged(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException
{
	setFormMode(form.getMode());
	Object val = node.getValue();
	if (val instanceof AppNavFormVo)
	{
		form.grdForms().setEnabled(false);
		AppNavFormVo navForm = (AppNavFormVo)val;
		AppFormVo formVo = navForm.getForm();
		if (formVo.equals(this.getAssessmentForm()) && form.getMode().equals(FormMode.EDIT))
		{
			form.grdAssessments().setEnabled(true);
		}
	}
	else
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.grdForms().setEnabled(true);			
		}
	}
	form.getLocalContext().setSelectedTreeValue(node.getValue());
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
		}		

	}
	
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormInTree(AppFormVo form, TreeNodeCollection tree, BooleanWraper result)
{
	if (result.isValue() && tree == null)
		return;
	for (int i = 0; i < tree.size(); i++)
	{
		if (tree.get(i).getValue() instanceof AppNavFormVo)
		{
			if (((AppNavFormVo) tree.get(i).getValue()).getForm().getFormId() == form.getFormId())
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormInTree(form, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForReport(ReportTemplateLiteVo rep, AppFormVo reportForm)
{

	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(reportForm);
	newForm.setLinkedClasses(null);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(rep.getBoId());
	genVo.setClassName(rep.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);
	newForm.setNodeText(rep.getName());

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	return newForm;
}
 
Example 34
Project: openMAXIMS   File: FormHelpImpl.java   Source Code and License 6 votes vote down vote up
public void deleteForm(AppFormVo appForm) throws ForeignKeyViolationException, StaleObjectException 
{
	String errors[] = appForm.validate();
	if (errors != null)
	{
		throw new DomainRuntimeException(errors.toString());
	
	}
		
	DomainFactory factory = getDomainFactory();
	AppForm domForm = (AppForm)factory.getDomainObject(appForm);
	domForm.setHelpLink(null);
	factory.save(domForm);


}
 
Example 35
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addMenuAction(AppFormVo appForm, MenuActionVo vo) 
{
	TreeNode treeNode = findOrCreateMenuActionFormNode(appForm);
	
	boolean exists = false;
	
	for(int x = 0; x < treeNode.getNodes().size(); x++)
	{
		if(vo.equals(treeNode.getNodes().get(x).getValue()))
		{
			exists = true;
			break;
		}
	}
	
	if(!exists)
	{
		TreeNode actionNode = treeNode.getNodes().add(vo, vo.getMenuActionDescription());
		actionNode.setCollapsedImage(form.getImages().Core.AnswerBox_NotAvailable);
		actionNode.setExpandedImage(form.getImages().Core.AnswerBox_NotAvailable);
	}
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdDetailsSelectionChanged() throws PresentationLogicException
{
	if(form.getMode().equals(FormMode.VIEW)){
		AppFormVo vo = form.grdDetails().getValue();
		if (vo != null)
		{
			form.getLocalContext().setCurrentForm(vo);
			form.txtURL().setValue(vo.getHelpLink());
			form.qmbForm().setValue(vo);
			form.qmbForm().setEditedText(vo.isAlias() ? vo.getAliasName() : vo.getName());
			form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
		}
		else
		{
			form.qmbForm().setValue(null);
			form.txtURL().setValue("");
			form.getLocalContext().setCurrentForm(null);
		}
		onFormModeChanged();
	}
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean compareFormsName(AppFormVo vo)
{
	for(int i = 0;i < form.grdDetails().getRows().size();i++)
	{
		String temp = form.grdDetails().getRows().get(i).getForm();
		if(!vo.isAlias()) {
			if(vo.getName().equals(temp)) {
				return true;
			}
		}
		else {
			if(vo.getAliasName().equals(temp)) {
				return true;
			}
		}
	}
	
	return false;
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 40
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onTreNavTreeViewSelectionChanged(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException
{
	setFormMode(form.getMode());
	Object val = node.getValue();
	if (val instanceof AppNavFormVo)
	{
		form.grdForms().setEnabled(false);
		AppNavFormVo navForm = (AppNavFormVo)val;
		AppFormVo formVo = navForm.getForm();
		if (formVo.equals(this.getAssessmentForm()) && form.getMode().equals(FormMode.EDIT))
		{
			form.grdAssessments().setEnabled(true);
		}
	}
	else
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.grdForms().setEnabled(true);			
		}
	}
	form.getLocalContext().setSelectedTreeValue(node.getValue());
}
 
Example 41
Project: openmaxims-linux   File: FormHelpImpl.java   Source Code and License 6 votes vote down vote up
public void deleteForm(AppFormVo appForm) throws ForeignKeyViolationException, StaleObjectException 
{
	String errors[] = appForm.validate();
	if (errors != null)
	{
		throw new DomainRuntimeException(errors.toString());
	
	}
		
	DomainFactory factory = getDomainFactory();
	AppForm domForm = (AppForm)factory.getDomainObject(appForm);
	domForm.setHelpLink(null);
	factory.save(domForm);


}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@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);
	}
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private TreeNode findOrCreateMenuActionFormNode(AppFormVo appForm)
{
	TreeNode formNode = null;
	
	for(int x = 0; x < form.lyrRights().tabActionsDenied().treActions().getNodes().size(); x++)
	{
		if(appForm.equals(form.lyrRights().tabActionsDenied().treActions().getNodes().get(x).getValue()))
		{
			formNode = form.lyrRights().tabActionsDenied().treActions().getNodes().get(x);
			break;
		}
	}
	
	if(formNode == null)
	{
		String formName = appForm.getName();
		if(appForm.isAlias())
			formName += " (" + appForm.getAliasName() + ")";
		if(appForm.isDialog())
			formName += " - dialog";
		
		formNode = form.lyrRights().tabActionsDenied().treActions().getNodes().add(appForm, formName);
		formNode.setCollapsedImage(form.getImages().Core.Form);
		formNode.setExpandedImage(form.getImages().Core.Form);
	}
	
	return formNode;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppFormVo getAppForm(int formID) 
{		
	for(int x = 0; x < form.lyrRights().tabActionsDenied().treActions().getNodes().size(); x++)
	{
		if(form.lyrRights().tabActionsDenied().treActions().getNodes().get(x).getValue() instanceof AppFormVo)
		{
			AppFormVo formValue = (AppFormVo)form.lyrRights().tabActionsDenied().treActions().getNodes().get(x).getValue();
			if(formValue.getFormId() == formID)
				return formValue;
		}
	}
	
	return domain.getForm(new AppFormRefVo(formID, 0));
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private FormMenuActionsDeniedVoCollection getActionsDenied()
{
	FormMenuActionsDeniedVoCollection result = new FormMenuActionsDeniedVoCollection();
	
	for(int x = 0; x < form.lyrRights().tabActionsDenied().treActions().getNodes().size(); x++)
	{
		TreeNode formNode = form.lyrRights().tabActionsDenied().treActions().getNodes().get(x);			
		AppFormVo formValue = (AppFormVo)formNode.getValue();
		MenuActionVoCollection actions = new MenuActionVoCollection();
		
		for(int y = 0; y < formNode.getNodes().size(); y++)
		{
			TreeNode itemNode = formNode.getNodes().get(y);
			if(itemNode.getValue() != null)
			{
				actions.add((MenuActionVo)itemNode.getValue());
			}
		}
		
		if(actions.size() > 0)
		{
			FormMenuActionsDeniedVo item = new FormMenuActionsDeniedVo();
			item.setForm(formValue);
			item.setMenuActions(actions);
			
			result.add(item);
		}
	}
	
	return result;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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();
	}
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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);
	
	}	
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdFormsSelectionChanged() 
{
	Object val = form.treNav().getValue();	
	AppFormVo formVo = form.grdForms().getValue();
	addAppNavFormVo(formVo, val);
	populateNavigation(form.getLocalContext().getSelectedNav(), false);
	if (form.getLocalContext().getSelectedTreeValue() != null)
	{
		form.treNav().setValue(form.getLocalContext().getSelectedTreeValue());	
		
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppFormVo getAssessmentForm()
{
	if (form.getLocalContext().getAssessmentForm() == null)
	{
		AppFormVo formVo = domain.getAppForm(InitConfig.getAssessmentContainerFormId());
		form.getLocalContext().setAssessmentForm(formVo);
	}
	return form.getLocalContext().getAssessmentForm();
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppFormVo getReportViewerForm()
{
	if (form.getLocalContext().getReportViewerForm() == null)
	{
		AppFormVo formVo = domain.getAppForm(InitConfig.getReportViewerFormId());
		form.getLocalContext().setReportViewerForm(formVo);
	}
	return form.getLocalContext().getReportViewerForm();
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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();
			

	}
	
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onQmbNavSearchFormValueChanged() throws PresentationLogicException
{
	AppFormVo appform = form.qmbNavSearchForm().getValue();
	AppNavigationVo nav = form.getLocalContext().getSelectedNav();
	if (nav == null)
		return;
	nav.setPatientSearchForm(appform);
	populateNavigation(nav);		

	
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onQmbNavStartFormValueChanged() throws PresentationLogicException
{
	AppFormVo appform = form.qmbNavStartForm().getValue();
	AppNavigationVo nav = form.getLocalContext().getSelectedNav();
	if (nav == null)
		return;
	nav.setStartForm(appform);
	populateNavigation(nav);		

	
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdFormsSelectionChanged() throws PresentationLogicException
{
	AppFormVo appForm = form.lyr1().Forms().grdForms().getValue();
	form.getLocalContext().setChosenForm(appForm);
	FormLookupVoCollection coll = domain.getFormLookups(appForm);
	populateFormLookupsGrid(coll);
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbNavSearchFormTextSubmited(String value) throws PresentationLogicException
{
	form.qmbNavSearchForm().clear();
	form.qmbNavSearchForm().getValues().clear();
	if (value == null || value.length() < 2)
		return;
	AppNavFormVoCollection availableForms = getAllFormsWithName(value);
	if (availableForms == null || availableForms.size() == 0)
	{
		String message = null;
		if (value.replace("%", "").trim().length() == 0)
		{
			message = "Navigation doesn't contain\nany valid forms.\nPlease add some";
		}
		else
		{
			message = "No form in the navigation\nmeets your criteria";
		}

		form.qmbNavSearchForm().newRow(null, message);

	}
	else
	{
		for (int i = 0; i < availableForms.size(); i++)
		{
			AppFormVo newForm = availableForms.get(i).getForm();
			form.qmbNavSearchForm().newRow(newForm, newForm.isAlias() ? newForm.getAliasName() : newForm.getName());
		}
	}
	form.qmbNavSearchForm().showOpened();
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbNavStartFormTextSubmited(String value) throws PresentationLogicException
{

	form.qmbNavStartForm().clear();
	form.qmbNavStartForm().getValues().clear();
	if (value == null || value.length() < 2)
		return;
	AppNavFormVoCollection availableForms = getAllFormsWithName(value);
	if (availableForms == null || availableForms.size() == 0)
	{
		String message = null;
		if (value.replace("%", "").trim().length() == 0)
		{
			message = "Navigation doesn't contain\nany valid forms.\nPlease add some";
		}
		else
		{
			message = "No form in the navigation\nmeets your criteria";
		}

		form.qmbNavStartForm().newRow(null, message);

	}
	else
	{
		for (int i = 0; i < availableForms.size(); i++)
		{
			AppFormVo newForm = availableForms.get(i).getForm();
			form.qmbNavStartForm().newRow(newForm, newForm.isAlias() ? newForm.getAliasName() : newForm.getName());
		}
	}
	form.qmbNavStartForm().showOpened();

}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void verifyQmbStart()
{
	AppFormVo start = form.qmbNavStartForm().getValue();
	if (start == null)
		return;
	if (formIsInTree(start, form.treNav().getNodes()))
		return;
	form.getLocalContext().getSelectedNav().setStartForm(null);
	form.qmbNavStartForm().getValues().clear();
	form.qmbNavStartForm().clear();

}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void verifyQmbSearch()
{
	AppFormVo search = form.qmbNavSearchForm().getValue();
	if (search == null)
		return;
	if (formIsInTree(search, form.treNav().getNodes()))
		return;
	form.getLocalContext().getSelectedNav().setPatientSearchForm(null);
	form.qmbNavSearchForm().getValues().clear();
	form.qmbNavSearchForm().clear();

}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean formIsInTree(AppFormVo form, TreeNodeCollection tree)
{
	BooleanWraper result = new BooleanWraper(false);
	verifyFormInTree(form, tree, result);
	if (result.isValue())
	{
		return true;
	}
	return false;
}