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());
}