Java Code Examples for ims.core.vo.LocationServiceVo

The following are top voted examples for showing how to use ims.core.vo.LocationServiceVo. 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 cmbLocationValueChanged()
{
	LocShortVo voLoc = form.ctnServiceDetail().cmbLocation().getValue();
	form.ctnServiceDetail().txtAddressService().setValue(null);
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.ctnServiceDetail().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.ctnServiceDetail().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if(voLocService.getContact().getNameIsNotNull())
				form.ctnServiceDetail().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.ctnServiceDetail().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocShortVo voLoc = form.lyrProServices().tabServices().cmbLocation().getValue();
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.lyrProServices().tabServices().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.lyrProServices().tabServices().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if (voLocService.getContact().getNameIsNotNull())
				form.lyrProServices().tabServices().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.lyrProServices().tabServices().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
	else
		form.lyrProServices().tabServices().txtAddressService().setValue(null);

}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocationServiceVo voLoc = form.lyrSupportServices().tabPageServices().cmbLocationServices().getValue();
	if (voLoc != null
		&& voLoc.getLocationIsNotNull())
	{
		if (voLoc.getLocation().getAddressIsNotNull())
			form.lyrSupportServices().tabPageServices().txtAddressService().setValue(voLoc.getLocation().getAddress().toDisplayStringForMultiLineTextBox());

		if (voLoc.getContact() != null)
		{
			if (voLoc.getContact().getNameIsNotNull())
				form.lyrSupportServices().tabPageServices().txtContactPerson().setValue(voLoc.getContact().getName().toString());
			form.lyrSupportServices().tabPageServices().txtPhoneNoService().setValue(voLoc.getContact().getContactNumber());
		}
	}
	else
		form.lyrSupportServices().tabPageServices().txtAddressService().setValue(null);

}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private StringBuilder getFormattedNodeDetails(TreeNode node, StringBuilder out)
{
	if (node.getValue() instanceof LocShortVo)
	{
		LocShortVo vo = (LocShortVo) node.getValue();
		out = formatLocationDetails(out, vo);
		if (node.isExpanded())
		{
			TreeNodeCollection treeNodeColl = node.getNodes();
			for (int i = 0; i < treeNodeColl.size(); i++)
			{
				out = getFormattedNodeDetails(treeNodeColl.get(i), out);
			}
		}
	}
	else if (node.getValue() instanceof LocationServiceVo)
	{
		out = formatServiceDetails(out, (LocationServiceVo) node.getValue());
	}
	return out;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromDataContact(LocationServiceVo voLocService)
{
	if (voLocService.getContactIsNotNull())
	{
		if (voLocService.getContact().getNameIsNotNull())
		{
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtForename().setValue(voLocService.getContact().getName().getForenameIsNotNull() ? voLocService.getContact().getName().getForename() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtSurname().setValue(voLocService.getContact().getName().getSurnameIsNotNull() ? voLocService.getContact().getName().getSurname() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtMiddleName().setValue(voLocService.getContact().getName().getMiddleNameIsNotNull() ? voLocService.getContact().getName().getMiddleName() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().cmbTitle().setValue(voLocService.getContact().getName().getTitleIsNotNull() ? voLocService.getContact().getName().getTitle() : null);
		}
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtContactNumber().setValue(voLocService.getContact().getContactNumberIsNotNull() ? voLocService.getContact().getContactNumber() : null);
	}
	// WDEV-2895
	if (voLocService.getDefaultPrinter() != null)
	{
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().newRow(voLocService.getDefaultPrinter(), voLocService.getDefaultPrinter());
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().setValue(voLocService.getDefaultPrinter());
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (save() == false)
		return;
	TreeNode node = form.treHeader().getSelectedNode();
	if (node != null)
	{
		Object value = node.getValue();

		// this came from an Add Provider User action
		if (value instanceof LocationServiceVo)
			addProviderSystem(node);

		treeViewSelectionChanged(node);
	}

	form.setMode(FormMode.VIEW);
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * @param node
 */
private void addProviderSystem(TreeNode node)
{
	Object value = node.getValue();
	if (value instanceof LocationServiceVo)
	{

		LocSvcProviderSysVoCollection voLocSvcProviderSys = null;
		if (node.getNodes().size() > 0)
		{
			node.getNodes().clear();
			// get list of locserviceproviders for this locationservice
			voLocSvcProviderSys = domain.listLocationServiceProvider(((LocationServiceVo) value).getID_LocationService());
			if (voLocSvcProviderSys != null)
			{
				for (int i = 0; i < voLocSvcProviderSys.size(); i++)
				{
					TreeNode providerNode = node.getNodes().add(voLocSvcProviderSys, getProviderSystemName(voLocSvcProviderSys.get(i)));
					providerNode.setExpandedImage(form.getImages().OCRR.Provider);
					providerNode.setCollapsedImage(form.getImages().OCRR.Provider);
				}
			}
		}
	}
}
 
Example 8
Project: AvoinApotti   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public ims.core.vo.LocationServiceVo saveLocationService(ims.core.vo.LocationServiceVo locationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException, ims.domain.exceptions.UniqueKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, locationService);

	try
	{
		factory.save(doLocService);
		locationService = LocationServiceVoAssembler.create(doLocService);
	}
	catch (UnqViolationUncheckedException e)
	{
		throw new UniqueKeyViolationException(locationService.getService().getServiceName().toString() + " already exists. Duplicates not allowed.", e);
	}

	return locationService;
}
 
Example 9
Project: AvoinApotti   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public void removeLocationService(ims.core.vo.LocationServiceVo voLocationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, voLocationService);
	try
	{
		try
		{
			factory.delete(doLocService);
		}
		catch (ForeignKeyViolationException e)
		{
			throw new ForeignKeyViolationException(e.getMessage());
		}
	}
	catch (DomainRuntimeException re) // SN: catching
										// DomainRuntimeException here as
										// this is what Hib is returning
										// with e.getCause() =
										// ConstrainViolationException
	{
		throw new ForeignKeyViolationException(re.getMessage());
	}
	return;
}
 
Example 10
Project: AvoinApotti   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 11
Project: openmaxims-linux   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public ims.core.vo.LocationServiceVo saveLocationService(ims.core.vo.LocationServiceVo locationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException, ims.domain.exceptions.UniqueKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, locationService);

	try
	{
		factory.save(doLocService);
		locationService = LocationServiceVoAssembler.create(doLocService);
	}
	catch (UnqViolationUncheckedException e)
	{
		throw new UniqueKeyViolationException(locationService.getService().getServiceName().toString() + " already exists. Duplicates not allowed.", e);
	}

	return locationService;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocShortVo voLoc = form.lyrProServices().tabServices().cmbLocation().getValue();
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.lyrProServices().tabServices().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.lyrProServices().tabServices().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if (voLocService.getContact().getNameIsNotNull())
				form.lyrProServices().tabServices().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.lyrProServices().tabServices().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
	else
		form.lyrProServices().tabServices().txtAddressService().setValue(null);

}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocationServiceVo voLoc = form.lyrSupportServices().tabPageServices().cmbLocationServices().getValue();
	if (voLoc != null
		&& voLoc.getLocationIsNotNull())
	{
		if (voLoc.getLocation().getAddressIsNotNull())
			form.lyrSupportServices().tabPageServices().txtAddressService().setValue(voLoc.getLocation().getAddress().toDisplayStringForMultiLineTextBox());

		if (voLoc.getContact() != null)
		{
			if (voLoc.getContact().getNameIsNotNull())
				form.lyrSupportServices().tabPageServices().txtContactPerson().setValue(voLoc.getContact().getName().toString());
			form.lyrSupportServices().tabPageServices().txtPhoneNoService().setValue(voLoc.getContact().getContactNumber());
		}
	}
	else
		form.lyrSupportServices().tabPageServices().txtAddressService().setValue(null);

}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromDataContact(LocationServiceVo voLocService)
{
	if (voLocService.getContactIsNotNull())
	{
		if (voLocService.getContact().getNameIsNotNull())
		{
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtForename().setValue(voLocService.getContact().getName().getForenameIsNotNull() ? voLocService.getContact().getName().getForename() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtSurname().setValue(voLocService.getContact().getName().getSurnameIsNotNull() ? voLocService.getContact().getName().getSurname() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtMiddleName().setValue(voLocService.getContact().getName().getMiddleNameIsNotNull() ? voLocService.getContact().getName().getMiddleName() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().cmbTitle().setValue(voLocService.getContact().getName().getTitleIsNotNull() ? voLocService.getContact().getName().getTitle() : null);
		}
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtContactNumber().setValue(voLocService.getContact().getContactNumberIsNotNull() ? voLocService.getContact().getContactNumber() : null);
	}
	// WDEV-2895
	if (voLocService.getDefaultPrinter() != null)
	{
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().newRow(voLocService.getDefaultPrinter(), voLocService.getDefaultPrinter());
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().setValue(voLocService.getDefaultPrinter());
	}
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (save() == false)
		return;
	TreeNode node = form.treHeader().getSelectedNode();
	if (node != null)
	{
		Object value = node.getValue();

		// this came from an Add Provider User action
		if (value instanceof LocationServiceVo)
			addProviderSystem(node);

		treeViewSelectionChanged(node);
	}

	form.setMode(FormMode.VIEW);
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * @param node
 */
private void addProviderSystem(TreeNode node)
{
	Object value = node.getValue();
	if (value instanceof LocationServiceVo)
	{

		LocSvcProviderSysVoCollection voLocSvcProviderSys = null;
		if (node.getNodes().size() > 0)
		{
			node.getNodes().clear();
			// get list of locserviceproviders for this locationservice
			voLocSvcProviderSys = domain.listLocationServiceProvider(((LocationServiceVo) value).getID_LocationService());
			if (voLocSvcProviderSys != null)
			{
				for (int i = 0; i < voLocSvcProviderSys.size(); i++)
				{
					TreeNode providerNode = node.getNodes().add(voLocSvcProviderSys, getProviderSystemName(voLocSvcProviderSys.get(i)));
					providerNode.setExpandedImage(form.getImages().OCRR.Provider);
					providerNode.setCollapsedImage(form.getImages().OCRR.Provider);
				}
			}
		}
	}
}
 
Example 17
Project: openmaxims-linux   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 18
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public ims.core.vo.LocationServiceVo saveLocationService(ims.core.vo.LocationServiceVo locationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException, ims.domain.exceptions.UniqueKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, locationService);

	try
	{
		factory.save(doLocService);
		locationService = LocationServiceVoAssembler.create(doLocService);
	}
	catch (UnqViolationUncheckedException e)
	{
		throw new UniqueKeyViolationException(locationService.getService().getServiceName().toString() + " already exists. Duplicates not allowed.", e);
	}

	return locationService;
}
 
Example 19
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public void removeLocationService(ims.core.vo.LocationServiceVo voLocationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, voLocationService);
	try
	{
		try
		{
			factory.delete(doLocService);
		}
		catch (ForeignKeyViolationException e)
		{
			throw new ForeignKeyViolationException(e.getMessage());
		}
	}
	catch (DomainRuntimeException re) // SN: catching
										// DomainRuntimeException here as
										// this is what Hib is returning
										// with e.getCause() =
										// ConstrainViolationException
	{
		throw new ForeignKeyViolationException(re.getMessage());
	}
	return;
}
 
Example 20
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocShortVo voLoc = form.ctnServiceDetail().cmbLocation().getValue();
	form.ctnServiceDetail().txtAddressService().setValue(null);
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.ctnServiceDetail().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.ctnServiceDetail().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if(voLocService.getContact().getNameIsNotNull())
				form.ctnServiceDetail().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.ctnServiceDetail().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocShortVo voLoc = form.lyrProServices().tabServices().cmbLocation().getValue();
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.lyrProServices().tabServices().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.lyrProServices().tabServices().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if (voLocService.getContact().getNameIsNotNull())
				form.lyrProServices().tabServices().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.lyrProServices().tabServices().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
	else
		form.lyrProServices().tabServices().txtAddressService().setValue(null);

}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocationServiceVo voLoc = form.lyrSupportServices().tabPageServices().cmbLocationServices().getValue();
	if (voLoc != null
		&& voLoc.getLocationIsNotNull())
	{
		if (voLoc.getLocation().getAddressIsNotNull())
			form.lyrSupportServices().tabPageServices().txtAddressService().setValue(voLoc.getLocation().getAddress().toDisplayStringForMultiLineTextBox());

		if (voLoc.getContact() != null)
		{
			if (voLoc.getContact().getNameIsNotNull())
				form.lyrSupportServices().tabPageServices().txtContactPerson().setValue(voLoc.getContact().getName().toString());
			form.lyrSupportServices().tabPageServices().txtPhoneNoService().setValue(voLoc.getContact().getContactNumber());
		}
	}
	else
		form.lyrSupportServices().tabPageServices().txtAddressService().setValue(null);

}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private StringBuilder getFormattedNodeDetails(TreeNode node, StringBuilder out)
{
	if (node.getValue() instanceof LocShortVo)
	{
		LocShortVo vo = (LocShortVo) node.getValue();
		out = formatLocationDetails(out, vo);
		if (node.isExpanded())
		{
			TreeNodeCollection treeNodeColl = node.getNodes();
			for (int i = 0; i < treeNodeColl.size(); i++)
			{
				out = getFormattedNodeDetails(treeNodeColl.get(i), out);
			}
		}
	}
	else if (node.getValue() instanceof LocationServiceVo)
	{
		out = formatServiceDetails(out, (LocationServiceVo) node.getValue());
	}
	return out;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromDataContact(LocationServiceVo voLocService)
{
	if (voLocService.getContactIsNotNull())
	{
		if (voLocService.getContact().getNameIsNotNull())
		{
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtForename().setValue(voLocService.getContact().getName().getForenameIsNotNull() ? voLocService.getContact().getName().getForename() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtSurname().setValue(voLocService.getContact().getName().getSurnameIsNotNull() ? voLocService.getContact().getName().getSurname() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtMiddleName().setValue(voLocService.getContact().getName().getMiddleNameIsNotNull() ? voLocService.getContact().getName().getMiddleName() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().cmbTitle().setValue(voLocService.getContact().getName().getTitleIsNotNull() ? voLocService.getContact().getName().getTitle() : null);
		}
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtContactNumber().setValue(voLocService.getContact().getContactNumberIsNotNull() ? voLocService.getContact().getContactNumber() : null);
	}
	// WDEV-2895
	if (voLocService.getDefaultPrinter() != null)
	{
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().newRow(voLocService.getDefaultPrinter(), voLocService.getDefaultPrinter());
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().setValue(voLocService.getDefaultPrinter());
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * @param node
 */
private void addProviderSystem(TreeNode node)
{
	Object value = node.getValue();
	if (value instanceof LocationServiceVo)
	{

		LocSvcProviderSysVoCollection voLocSvcProviderSys = null;
		if (node.getNodes().size() > 0)
		{
			node.getNodes().clear();
			// get list of locserviceproviders for this locationservice
			voLocSvcProviderSys = domain.listLocationServiceProvider(((LocationServiceVo) value).getID_LocationService());
			if (voLocSvcProviderSys != null)
			{
				for (int i = 0; i < voLocSvcProviderSys.size(); i++)
				{
					TreeNode providerNode = node.getNodes().add(voLocSvcProviderSys, getProviderSystemName(voLocSvcProviderSys.get(i)));
					providerNode.setExpandedImage(form.getImages().OCRR.Provider);
					providerNode.setCollapsedImage(form.getImages().OCRR.Provider);
				}
			}
		}
	}
}
 
Example 27
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public ims.core.vo.LocationServiceVo saveLocationService(ims.core.vo.LocationServiceVo locationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException, ims.domain.exceptions.UniqueKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, locationService);

	try
	{
		factory.save(doLocService);
		locationService = LocationServiceVoAssembler.create(doLocService);
	}
	catch (UnqViolationUncheckedException e)
	{
		throw new UniqueKeyViolationException(locationService.getService().getServiceName().toString() + " already exists. Duplicates not allowed.", e);
	}

	return locationService;
}
 
Example 28
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
public void removeLocationService(ims.core.vo.LocationServiceVo voLocationService) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();
	LocationService doLocService = LocationServiceVoAssembler.extractLocationService(factory, voLocationService);
	try
	{
		try
		{
			factory.delete(doLocService);
		}
		catch (ForeignKeyViolationException e)
		{
			throw new ForeignKeyViolationException(e.getMessage());
		}
	}
	catch (DomainRuntimeException re) // SN: catching
										// DomainRuntimeException here as
										// this is what Hib is returning
										// with e.getCause() =
										// ConstrainViolationException
	{
		throw new ForeignKeyViolationException(re.getMessage());
	}
	return;
}
 
Example 29
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocShortVo voLoc = form.ctnServiceDetail().cmbLocation().getValue();
	form.ctnServiceDetail().txtAddressService().setValue(null);
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.ctnServiceDetail().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.ctnServiceDetail().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if(voLocService.getContact().getNameIsNotNull())
				form.ctnServiceDetail().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.ctnServiceDetail().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbLocationValueChanged()
{
	LocShortVo voLoc = form.lyrProServices().tabServices().cmbLocation().getValue();
	if (voLoc != null)
	{
		if (voLoc.getAddressIsNotNull())
			form.lyrProServices().tabServices().txtAddressService().setValue(voLoc.getAddress().toDisplayStringForMultiLineTextBox());

		LocationServiceVo voLocService = domain.getLocationService(voLoc, form.lyrProServices().tabServices().cmbService().getValue());

		if (voLocService == null)
			return;

		form.getLocalContext().setlocationService(voLocService);
		if (voLocService.getContact() != null)
		{
			if (voLocService.getContact().getNameIsNotNull())
				form.lyrProServices().tabServices().txtContactPerson().setValue(voLocService.getContact().getName().toString());
			form.lyrProServices().tabServices().txtPhoneNoService().setValue(voLocService.getContact().getContactNumber());
		}
	}
	else
		form.lyrProServices().tabServices().txtAddressService().setValue(null);

}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private StringBuilder getFormattedNodeDetails(TreeNode node, StringBuilder out)
{
	if (node.getValue() instanceof LocShortVo)
	{
		LocShortVo vo = (LocShortVo) node.getValue();
		out = formatLocationDetails(out, vo);
		if (node.isExpanded())
		{
			TreeNodeCollection treeNodeColl = node.getNodes();
			for (int i = 0; i < treeNodeColl.size(); i++)
			{
				out = getFormattedNodeDetails(treeNodeColl.get(i), out);
			}
		}
	}
	else if (node.getValue() instanceof LocationServiceVo)
	{
		out = formatServiceDetails(out, (LocationServiceVo) node.getValue());
	}
	return out;
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromDataContact(LocationServiceVo voLocService)
{
	if (voLocService.getContactIsNotNull())
	{
		if (voLocService.getContact().getNameIsNotNull())
		{
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtForename().setValue(voLocService.getContact().getName().getForenameIsNotNull() ? voLocService.getContact().getName().getForename() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtSurname().setValue(voLocService.getContact().getName().getSurnameIsNotNull() ? voLocService.getContact().getName().getSurname() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtMiddleName().setValue(voLocService.getContact().getName().getMiddleNameIsNotNull() ? voLocService.getContact().getName().getMiddleName() : null);
			form.lyr1().Edit().lyrLocationDetail().tabPageContact().cmbTitle().setValue(voLocService.getContact().getName().getTitleIsNotNull() ? voLocService.getContact().getName().getTitle() : null);
		}
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().txtContactNumber().setValue(voLocService.getContact().getContactNumberIsNotNull() ? voLocService.getContact().getContactNumber() : null);
	}
	// WDEV-2895
	if (voLocService.getDefaultPrinter() != null)
	{
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().newRow(voLocService.getDefaultPrinter(), voLocService.getDefaultPrinter());
		form.lyr1().Edit().lyrLocationDetail().tabPageContact().qmbPrinter().setValue(voLocService.getDefaultPrinter());
	}
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * @param node
 */
private void addProviderSystem(TreeNode node)
{
	Object value = node.getValue();
	if (value instanceof LocationServiceVo)
	{

		LocSvcProviderSysVoCollection voLocSvcProviderSys = null;
		if (node.getNodes().size() > 0)
		{
			node.getNodes().clear();
			// get list of locserviceproviders for this locationservice
			voLocSvcProviderSys = domain.listLocationServiceProvider(((LocationServiceVo) value).getID_LocationService());
			if (voLocSvcProviderSys != null)
			{
				for (int i = 0; i < voLocSvcProviderSys.size(); i++)
				{
					TreeNode providerNode = node.getNodes().add(voLocSvcProviderSys, getProviderSystemName(voLocSvcProviderSys.get(i)));
					providerNode.setExpandedImage(form.getImages().OCRR.Provider);
					providerNode.setCollapsedImage(form.getImages().OCRR.Provider);
				}
			}
		}
	}
}
 
Example 35
Project: AvoinApotti   File: SupportNetworkProfessionalServicesImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceVo getLocationService(LocShortVo locShort, ServiceRefVo service)
{
	if (locShort == null || service == null)
		throw new DomainRuntimeException("Failed to get LocationService record, location and/or service not supplied");

	DomainFactory factory = getDomainFactory();

	List lstLocService = factory.find("from LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{locShort.getID_Location(), service.getID_Service()});
	LocationServiceVoCollection voCollLocServices = LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(lstLocService);

	if (voCollLocServices != null && voCollLocServices.size() > 0)
		return voCollLocServices.get(0);

	return null;
}
 
Example 36
Project: AvoinApotti   File: SupportServicesImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceVo getLocationService(LocShortVo locShort, ServiceRefVo service) 
{
	if (locShort == null || service == null)
		throw new DomainRuntimeException("Failed to get LocationService record, location and/or service not supplied");

	DomainFactory factory = getDomainFactory();

	List lstLocService = factory.find("from LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{locShort.getID_Location(), service.getID_Service()});
	LocationServiceVoCollection voCollLocServices = LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(lstLocService);

	if (voCollLocServices != null && voCollLocServices.size() > 0)
		return voCollLocServices.get(0);

	return null;
}
 
Example 37
Project: AvoinApotti   File: ProfilesImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceVo getLocationService(LocationRefVo location, ServiceRefVo service)
{
	if(location == null || service == null) 
		throw new CodingRuntimeException("location and service are madatory in method getLocationService");

	DomainFactory factory = getDomainFactory();
	List locServics = factory.find("from LocationService locSer where locSer.location.id = :idLocation and locSer.service.id = :idService", new String[] {"idLocation", "idService"}, new Object[] { location.getID_Location(), service.getID_Service()});
	if(locServics != null && locServics.size() > 0)
		return LocationServiceVoAssembler.create((ims.core.resource.place.domain.objects.LocationService) locServics.get(0));
	
	return null;
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkServiceExists(ServiceShortVo voServiceShort, LocationServiceVo voLocationService)
{
	ServiceVo voService = new ServiceVo();
	voService.setID_Service(voServiceShort.getID_Service());
	voLocationService.setService(voService);
	return (domain.listLocationService(voLocationService).size() > 0);
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeService()
{
	if (form.getLocalContext().getSelectedRecordLocationServiceIsNotNull())
	{
		if ((form.treHeader().getSelectedNode().getValue() != null) && (form.treHeader().getSelectedNode().getValue() instanceof LocationServiceVo))
		{
			LocationServiceVo voLocSer = (LocationServiceVo) form.treHeader().getSelectedNode().getValue();
			try
			{
				try
				{
					domain.removeLocationService(voLocSer);
					if (form.treHeader().getSelectedNode().getParent() != null)
					{
						try
						{
							onTreHeaderTreeViewSelectionChanged(form.treHeader().getSelectedNode().getParent());
						}
						catch (PresentationLogicException pe)
						{
							engine.showMessage(pe.getMessage());
						}
					}
				}
				catch (ForeignKeyViolationException fe)
				{
					if (form.getLocalContext().getSelectedRecordLocationService().getServiceIsNotNull())
						engine.showMessage("Cannot remove " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue() + " : " + (form.getLocalContext().getSelectedRecordLocationService().getService().getServiceNameIsNotNull() ? form.getLocalContext().getSelectedRecordLocationService().getService().getServiceName() : "") + ". It is already referenced.");
					else
						engine.showMessage("Cannot remove this" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue() + " as it is already referenced.");
				}
			}
			catch (StaleObjectException se)
			{
				engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
				populateLocationServices(form.treHeader().getSelectedNode().getParent(), (LocShortVo) form.treHeader().getSelectedNode().getParent().getValue());
			}
		}
	}
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String[] validateRules(LocationServiceVo voLocService) {
	
	if (voLocService == null || !voLocService.getServiceIsNotNull())
		return null;
	if (!voLocService.getService().getIsActiveIsNotNull() || !voLocService.getService().getIsActive().booleanValue())
		return new String[]{"Service "+voLocService.getService().getServiceName()+" is not active"};
	return null;
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void updateControlsState()
{
	boolean viewMode = form.getMode().equals(FormMode.VIEW);
	boolean isLocationServiceVo = (form.treHeader().getSelectedNode() != null && form.treHeader().getSelectedNode().getValue()	instanceof LocationServiceVo);
	boolean service = false;
	
	if (isLocationServiceVo)
	{
		service = form.treHeader().getSelectedNode().getNodes().size() < 1;
	}
	
	form.getContextMenus().getGenericGridAddItem().setVisible(viewMode && isAddAllowed() && service);
	form.getContextMenus().getGenericGridUpdateItem().setVisible(viewMode && isPoviderSelected());
	form.getContextMenus().getGenericGridReplaceItem().setVisible(viewMode && isPoviderSelected());
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * @param node
 */
private void treeViewSelectionChanged(ims.framework.controls.TreeNode node)
{
	clearInstanceControls();
	if (node == null)
		return;

	Object value = node.getValue();
	if (value instanceof LocSvcProviderSysVo)
	{
		LocSvcProviderSysVo voLocSvcProviderSys = (LocSvcProviderSysVo) value;
		populateScreenFromData(voLocSvcProviderSys.getProviderSystem());
		populateServiceProviders(node.getParent(), (LocationServiceVo) node.getParent().getValue());
		form.getLocalContext().setSelectedRecord((LocSvcProviderSysVo) value);
	}

	if (value instanceof LocShortVo)
	{
		populateLocationServices(node, (LocShortVo) node.getValue());
		if (value instanceof LocSiteVo)
		{
			LocSiteVo voLocSite = (LocSiteVo) node.getValue();
			populateLocations(voLocSite.getLocations(), node);
			node.setExpanded(true);
		}
	}

	if (value instanceof LocationServiceVo)
	{
		populateServiceProviders(node, (LocationServiceVo) node.getValue());
		form.getLocalContext().setSelectedRecord(null);
	}

	updateControlsState();
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private LocationServiceVo getSelectedLocation()
{
	TreeNode node = form.treHeader().getSelectedNode();
	if (node != null)
	{
		Object value = node.getValue();
		if (value instanceof LocationServiceVo)
			return (LocationServiceVo) value;
	}

	return null;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateServiceProviders(TreeNode node, LocationServiceVo voLocService)
{
	String out = "";
	TreeNode childNode = null;

	if ((node != null) && (voLocService != null) && (voLocService.getID_LocationServiceIsNotNull()))
	{
		node.getNodes().clear();
		LocSvcProviderSysVoCollection voLocSvcProviderSys = null;
		// get list of locserviceproviders for this location
		voLocSvcProviderSys = domain.listLocationServiceProvider(voLocService.getID_LocationService());
		form.getGlobalContext().OCRR.setProviderSystemColl(returnProviderSystem(voLocSvcProviderSys));
		out += formatServiceHeaderVo(voLocService);
		if ((voLocSvcProviderSys != null) && (voLocSvcProviderSys.size() > 0))
		{
			for (int i = 0; i < voLocSvcProviderSys.size(); i++)
			{
				// html output
				out += formatProviderVo(voLocSvcProviderSys.get(i).getProviderSystem());
				out += makeNewLine(new Integer(1));

				// add node
				childNode = node.getNodes().add(voLocSvcProviderSys.get(i), voLocSvcProviderSys.get(i).getProviderSystemIsNotNull() ? voLocSvcProviderSys.get(i).getProviderSystem().getSystemNameIsNotNull() ? voLocSvcProviderSys.get(i).getProviderSystem().getSystemName() : "" : "");
				childNode.setCollapsedImage(form.getImages().OCRR.Provider);
				childNode.setExpandedImage(form.getImages().OCRR.Provider);
			}
			node.setExpanded(true);
		}
		else
			out += makeTextile("<CENTER>*No provider system*</CENTER>", "SlateBlue", "tahoma", "14");
	}

	form.htmProviderView().setHTML(new TextileString(out).toString());
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String formatServiceVo(LocationServiceVo voLocService)
{
	String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "12");
	out += makeTextile(voLocService.getService().getServiceName(), "black", "tahoma", "12");
	if (voLocService.getService().getServiceDescriptionIsNotNull())
	{
		out += makeNewLine(new Integer(2));
		out += makeTextile("*Description: *", "SlateBlue", "tahoma", "12");
		out += makeTextile(voLocService.getService().getServiceDescription(), "black", "tahoma", "12");
	}
	else
		out += makeNewLine(new Integer(1));

	if (voLocService.getContactIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Contact Details: *", "SlateBlue", "tahoma", "12");
		out += makeTextile((voLocService.getContact().getNameIsNotNull()?voLocService.getContact().getName().toString():""), "black", "tahoma", "12");
		if (voLocService.getContact().getContactNumberIsNotNull())
		{
			out += makeNewLine(new Integer(1));
			out += makeTextile("*Contact Number: *", "SlateBlue", "tahoma", "12");
			out += makeTextile(voLocService.getContact().getContactNumber().toString(), "black", "tahoma", "12");
			out += makeNewLine(new Integer(1));
		}
		else
			out += makeNewLine(new Integer(1));
	}

	out += makeNewLine(new Integer(1));

	return new TextileString(out).toString();
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String formatServiceHeaderVo(LocationServiceVo voLocService)
{
	if (voLocService != null && voLocService.getServiceIsNotNull() && voLocService.getLocationIsNotNull())
	{
		String out = makeTextile("<CENTER>*" + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + ": *", "DarkRed", "tahoma", "14");
		out += makeTextile((voLocService.getLocation().getNameIsNotNull() ? voLocService.getLocation().getName() : "") + "</CENTER>", "black", "tahoma", "14");
		out += makeTextile("<CENTER>*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
		out += makeTextile((voLocService.getService().getServiceNameIsNotNull() ? voLocService.getService().getServiceName() : "") + "</CENTER>", "black", "tahoma", "14");
		if (voLocService.getService().getServiceDescriptionIsNotNull())
		{
			out += makeNewLine(new Integer(2));
			out += makeTextile("*Description: *", "SlateBlue", "tahoma", "12");
			out += makeTextile(voLocService.getService().getServiceDescription(), "black", "tahoma", "12");
		}
		else
			out += makeNewLine(new Integer(1));

		if (voLocService.getContactIsNotNull())
		{
			out += makeNewLine(new Integer(1));
			out += makeTextile("*Contact Details: *", "SlateBlue", "tahoma", "12");
			out += makeTextile(voLocService.getContact().getNameIsNotNull()?voLocService.getContact().getName().toString():"", "black", "tahoma", "12");
			if (voLocService.getContact().getContactNumberIsNotNull())
			{
				out += makeNewLine(new Integer(1));
				out += makeTextile("*Contact Number: *", "SlateBlue", "tahoma", "12");
				out += makeTextile(voLocService.getContact().getContactNumber().toString(), "black", "tahoma", "12");
				out += makeNewLine(new Integer(1));
			}
			else
				out += makeNewLine(new Integer(1));
		}

		out += makeNewLine(new Integer(1));

		return new TextileString(out).toString();
	}

	return "";
}
 
Example 47
Project: AvoinApotti   File: NTPFExchequerCodingChecks.java   Source Code and License 5 votes vote down vote up
public static String ValidHospitalSpecialty(LocationServiceVo voLocService)
{
	if (voLocService.getIsActiveIsNotNull() 
		&& ! voLocService.getIsActive().booleanValue())
		return "\r\nThe Hospital / Specialty link is not active. No editing is allowed";
	
	//Check Specialty is Active and has an Exchequer code
	if (voLocService.getServiceIsNotNull())
	{
		if (voLocService.getService().getIsActiveIsNotNull() 
			&& ! voLocService.getService().getIsActive().booleanValue())
			return "\r\nThe Specialty is not active. No editing is allowed";

		if (voLocService.getService().getTaxonomyMapIsNotNull())
		{
			boolean bFound = false;
			for(int i=0;i < voLocService.getService().getTaxonomyMap().size() ; i++)
			{
				//Has it an Exchequer code
				if (voLocService.getService().getTaxonomyMap().get(i).getTaxonomyNameIsNotNull()
					&& voLocService.getService().getTaxonomyMap().get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					bFound = true;
					//Is it a valid Exchequer code
					if ( ! checkCodeIsA6NNN(voLocService.getService().getTaxonomyMap().get(i).getTaxonomyCode()) )
						return "\r\nThe Specialty Exchequer code is not of the format 6NNN. No editing is allowed";
				}
			}
			if ( ! bFound)
				return "\r\nThe Specialty has no Exchequer code. No editing is allowed";

		}
	}
	return "";
}
 
Example 48
Project: AvoinApotti   File: LocationServiceImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceActivityVoCollection listLocationServiceActivity(LocationServiceVo filterLocationService)
{
	DomainFactory factory = getDomainFactory();

	String hql = " from LocationServiceActivity locServiceActivity ";
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();

	if (filterLocationService != null && filterLocationService.getID_LocationServiceIsNotNull())
	{
		condStr.append(andStr + " locServiceActivity.locationService.id = :locService");
		markers.add("locService");
		values.add(filterLocationService.getID_LocationService());
		andStr = " and ";
	}

	if (andStr.equals(" and "))
		hql += " where ";
	else
		return new LocationServiceActivityVoCollection();

	hql += condStr.toString();
	return LocationServiceActivityVoAssembler.createLocationServiceActivityVoCollectionFromLocationServiceActivity(factory.find(hql, markers, values)).sort();
}
 
Example 49
Project: AvoinApotti   File: ServiceImpl.java   Source Code and License 5 votes vote down vote up
public String checkLSALinks(ServiceActivityVo voServiceActivity) throws DomainInterfaceException
{
	if (voServiceActivity != null)
	{
		// check if an active Location Service Activity records
		LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
		LocationServiceActivityVo voLocSerAct = new LocationServiceActivityVo();
		voLocSerAct.setServiceActivity(voServiceActivity);
		voLocSerAct.setIsActive(new Boolean(true));
		LocationServiceVo voLocSer = new LocationServiceVo();
		ServiceVo voSer = new ServiceVo();
		voSer.setID_Service(voServiceActivity.getService().getID_Service());
		voSer.setIsActive(voServiceActivity.getService().getIsActive());
		voLocSer.setService(voSer);
		voLocSerAct.setLocationService(voLocSer);
		LocationServiceActivityVoCollection voColl = impl.listLocationServiceActivity(voLocSerAct.getLocationService(), voLocSerAct.getServiceActivity().getActivity());
		if (voColl != null && voColl.size() > 0)
		{
			String activeMessage = "The following " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " links are still active.\r\n";
			for (int j = 0; j < voColl.size(); j++)
			{
				activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + " : " + (voColl.get(j).getLocationService().getLocation().getNameIsNotNull() ? voColl.get(j).getLocationService().getLocation().getName() : "");
				activeMessage += "  " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + (voColl.get(j).getLocationService().getService().getServiceNameIsNotNull() ? voColl.get(j).getLocationService().getService().getServiceName() : "");
				for (int k = 0; k < voColl.get(j).getLocationService().getActivities().size(); k++)
				{
					if (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivityIsNotNull())
					{
						activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " : " + (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getNameIsNotNull() ? voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getName() : "");
					}
				}
			}
			return activeMessage;
		}
	}

	return null;
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean compareDiscipline(LocationServiceVo discipline, OrderInvestigationVo voOrderInv)
{
	if (discipline == null)
		throw new CodingRuntimeException("discipline parameter not supplied for method compareDiscipline");

	if (voOrderInv == null)
		throw new CodingRuntimeException("voOrderInv parameter not supplied for method compareDiscipline");

	if (voOrderInv.getInvestigationIsNotNull() && voOrderInv.getInvestigation().getProviderServiceIsNotNull() && voOrderInv.getInvestigation().getProviderService().getLocationServiceIsNotNull())
		return discipline.equals(voOrderInv.getInvestigation().getProviderService().getLocationService());

	return false;
}
 
Example 51
Project: AvoinApotti   File: DemoreferralDetailsImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceVo getLocationService(LocShortVo locShort, ServiceRefVo service) {
	if (locShort == null || service == null)
		throw new DomainRuntimeException("Failed to get LocationService record, location and/or service not supplied");

	DomainFactory factory = getDomainFactory();

	List lstLocService = factory.find("from LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{locShort.getID_Location(), service.getID_Service()});
	LocationServiceVoCollection voCollLocServices = LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(lstLocService);

	if (voCollLocServices != null && voCollLocServices.size() > 0)
		return voCollLocServices.get(0);

	return null;
}
 
Example 52
Project: openMAXIMS   File: SupportNetworkProfessionalServicesImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceVo getLocationService(LocShortVo locShort, ServiceRefVo service)
{
	if (locShort == null || service == null)
		throw new DomainRuntimeException("Failed to get LocationService record, location and/or service not supplied");

	DomainFactory factory = getDomainFactory();

	List lstLocService = factory.find("from LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{locShort.getID_Location(), service.getID_Service()});
	LocationServiceVoCollection voCollLocServices = LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(lstLocService);

	if (voCollLocServices != null && voCollLocServices.size() > 0)
		return voCollLocServices.get(0);

	return null;
}
 
Example 53
Project: openMAXIMS   File: SupportServicesImpl.java   Source Code and License 5 votes vote down vote up
public LocationServiceVo getLocationService(LocShortVo locShort, ServiceRefVo service) 
{
	if (locShort == null || service == null)
		throw new DomainRuntimeException("Failed to get LocationService record, location and/or service not supplied");

	DomainFactory factory = getDomainFactory();

	List lstLocService = factory.find("from LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{locShort.getID_Location(), service.getID_Service()});
	LocationServiceVoCollection voCollLocServices = LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(lstLocService);

	if (voCollLocServices != null && voCollLocServices.size() > 0)
		return voCollLocServices.get(0);

	return null;
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkServiceExists(ServiceShortVo voServiceShort, LocationServiceVo voLocationService)
{
	ServiceVo voService = new ServiceVo();
	voService.setID_Service(voServiceShort.getID_Service());
	voLocationService.setService(voService);
	return (domain.listLocationService(voLocationService).size() > 0);
}
 
Example 55
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean compareDiscipline(LocationServiceVo discipline, OrderInvestigationVo voOrderInv)
{
	if (discipline == null)
		throw new CodingRuntimeException("discipline parameter not supplied for method compareDiscipline");

	if (voOrderInv == null)
		throw new CodingRuntimeException("voOrderInv parameter not supplied for method compareDiscipline");

	if (voOrderInv.getInvestigationIsNotNull() && voOrderInv.getInvestigation().getProviderServiceIsNotNull() && voOrderInv.getInvestigation().getProviderService().getLocationServiceIsNotNull())
		return discipline.equals(voOrderInv.getInvestigation().getProviderService().getLocationService());

	return false;
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeService()
{
	if (form.getLocalContext().getSelectedRecordLocationServiceIsNotNull())
	{
		if ((form.treHeader().getSelectedNode().getValue() != null) && (form.treHeader().getSelectedNode().getValue() instanceof LocationServiceVo))
		{
			LocationServiceVo voLocSer = (LocationServiceVo) form.treHeader().getSelectedNode().getValue();
			try
			{
				try
				{
					domain.removeLocationService(voLocSer);
					if (form.treHeader().getSelectedNode().getParent() != null)
					{
						try
						{
							onTreHeaderTreeViewSelectionChanged(form.treHeader().getSelectedNode().getParent());
						}
						catch (PresentationLogicException pe)
						{
							engine.showMessage(pe.getMessage());
						}
					}
				}
				catch (ForeignKeyViolationException fe)
				{
					if (form.getLocalContext().getSelectedRecordLocationService().getServiceIsNotNull())
						engine.showMessage("Cannot remove " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue() + " : " + (form.getLocalContext().getSelectedRecordLocationService().getService().getServiceNameIsNotNull() ? form.getLocalContext().getSelectedRecordLocationService().getService().getServiceName() : "") + ". It is already referenced.");
					else
						engine.showMessage("Cannot remove this" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue() + " as it is already referenced.");
				}
			}
			catch (StaleObjectException se)
			{
				engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
				populateLocationServices(form.treHeader().getSelectedNode().getParent(), (LocShortVo) form.treHeader().getSelectedNode().getParent().getValue());
			}
		}
	}
}
 
Example 57
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String[] validateRules(LocationServiceVo voLocService) {
	
	if (voLocService == null || !voLocService.getServiceIsNotNull())
		return null;
	if (!voLocService.getService().getIsActiveIsNotNull() || !voLocService.getService().getIsActive().booleanValue())
		return new String[]{"Service "+voLocService.getService().getServiceName()+" is not active"};
	return null;
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public void updateControlsState()
{
	boolean viewMode = form.getMode().equals(FormMode.VIEW);
	boolean isLocationServiceVo = (form.treHeader().getSelectedNode() != null && form.treHeader().getSelectedNode().getValue()	instanceof LocationServiceVo);
	boolean service = false;
	
	if (isLocationServiceVo)
	{
		service = form.treHeader().getSelectedNode().getNodes().size() < 1;
	}
	
	form.getContextMenus().getGenericGridAddItem().setVisible(viewMode && isAddAllowed() && service);
	form.getContextMenus().getGenericGridUpdateItem().setVisible(viewMode && isPoviderSelected());
	form.getContextMenus().getGenericGridReplaceItem().setVisible(viewMode && isPoviderSelected());
}
 
Example 59
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * @param node
 */
private void treeViewSelectionChanged(ims.framework.controls.TreeNode node)
{
	clearInstanceControls();
	if (node == null)
		return;

	Object value = node.getValue();
	if (value instanceof LocSvcProviderSysVo)
	{
		LocSvcProviderSysVo voLocSvcProviderSys = (LocSvcProviderSysVo) value;
		populateScreenFromData(voLocSvcProviderSys.getProviderSystem());
		populateServiceProviders(node.getParent(), (LocationServiceVo) node.getParent().getValue());
		form.getLocalContext().setSelectedRecord((LocSvcProviderSysVo) value);
	}

	if (value instanceof LocShortVo)
	{
		populateLocationServices(node, (LocShortVo) node.getValue());
		if (value instanceof LocSiteVo)
		{
			LocSiteVo voLocSite = (LocSiteVo) node.getValue();
			populateLocations(voLocSite.getLocations(), node);
			node.setExpanded(true);
		}
	}

	if (value instanceof LocationServiceVo)
	{
		populateServiceProviders(node, (LocationServiceVo) node.getValue());
		form.getLocalContext().setSelectedRecord(null);
	}

	updateControlsState();
}
 
Example 60
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private LocationServiceVo getSelectedLocation()
{
	TreeNode node = form.treHeader().getSelectedNode();
	if (node != null)
	{
		Object value = node.getValue();
		if (value instanceof LocationServiceVo)
			return (LocationServiceVo) value;
	}

	return null;
}