Java Code Examples for ims.core.vo.OrgVo

The following are top voted examples for showing how to use ims.core.vo.OrgVo. 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: TaxonomyLoaderHelper.java   Source Code and License 6 votes vote down vote up
private OrgVo savePracticeVo(OrgVo vo) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException 
{
	//WDEV-17409
	String[] err = vo.validate();
	if (err != null && err.length > 0) 
	{
		String concat = "";
		for (int i = 0; i < err.length; i++) 
		{
			concat = concat + " " + err[i] + " ";
		}
		throw new DomainRuntimeException(concat);
	} else 
	{
			return domainTaxonomy.savePracticeRecord(vo);
	}
}
 
Example 2
Project: openMAXIMS   File: TaxonomyLoaderHelper.java   Source Code and License 6 votes vote down vote up
private OrgVo savePracticeVo(OrgVo vo) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException 
{
	//WDEV-17409
	String[] err = vo.validate();
	if (err != null && err.length > 0) 
	{
		String concat = "";
		for (int i = 0; i < err.length; i++) 
		{
			concat = concat + " " + err[i] + " ";
		}
		throw new DomainRuntimeException(concat);
	} else 
	{
			return domainTaxonomy.savePracticeRecord(vo);
	}
}
 
Example 3
Project: openMAXIMS   File: TaxonomyLoaderHelper.java   Source Code and License 6 votes vote down vote up
private OrgVo savePracticeVo(OrgVo vo) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException 
{
	//WDEV-17409
	String[] err = vo.validate();
	if (err != null && err.length > 0) 
	{
		String concat = "";
		for (int i = 0; i < err.length; i++) 
		{
			concat = concat + " " + err[i] + " ";
		}
		throw new DomainRuntimeException(concat);
	} else 
	{
			return domainTaxonomy.savePracticeRecord(vo);
	}
}
 
Example 4
Project: openmaxims-linux   File: TaxonomyLoaderHelper.java   Source Code and License 6 votes vote down vote up
private OrgVo savePracticeVo(OrgVo vo) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException 
{
	//WDEV-17409
	String[] err = vo.validate();
	if (err != null && err.length > 0) 
	{
		String concat = "";
		for (int i = 0; i < err.length; i++) 
		{
			concat = concat + " " + err[i] + " ";
		}
		throw new DomainRuntimeException(concat);
	} else 
	{
			return domainTaxonomy.savePracticeRecord(vo);
	}
}
 
Example 5
Project: AvoinApotti   File: TaxonomySearchCmpImpl.java   Source Code and License 4 votes vote down vote up
private TaxonomyMapCollection searchPracticeCodes(TaxonomyMap filter) throws ims.domain.exceptions.DomainInterfaceException
{
	// TODO Auto-generated method stub
	try{

		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and upper(mappings.taxonomyCode) like :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add("%"+filter.getDescription().toUpperCase()+"%");
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		TaxonomyMapCollection coll_ret = new TaxonomyMapCollection();
		
		if (coll != null && coll.size()>0)
		{							
			for (int i = 0; i < coll.size(); i++)
			{
				OrgVo vo= coll.get(i);
				
				/*TaxonomyMap tmCAB = new TaxonomyMap();
				tmCAB.setTaxonomyName(TaxonomyType.ICAB);
				tmCAB.setDescription(vo.getName());
				tmCAB.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.ICAB));		*/
				
				TaxonomyMap tmNAT = new TaxonomyMap();
				tmNAT.setTaxonomyName(TaxonomyType.NAT_LOC_CODE);
				tmNAT.setDescription(vo.getName());
				tmNAT.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.NAT_LOC_CODE));
				
				//coll_ret.add(tmCAB);
				coll_ret.add(tmNAT);
			}				 
		}	
		return coll_ret;
	}
	catch (DomainRuntimeException e)
	{
		throw new ims.domain.exceptions.DomainInterfaceException("Please contact your system administrator.\n\nError:\n" + e.getMessage());
	}			
}
 
Example 6
Project: AvoinApotti   File: TaxonomyCodeAdminImpl.java   Source Code and License 4 votes vote down vote up
public OrgVo savePracticeRecord(OrgVo vo) throws DomainInterfaceException,
		StaleObjectException, UniqueKeyViolationException {
	
	if (!vo.isValidated())
	{
		throw new DomainRuntimeException("OrgVo Vo has not been validated.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	//Opcs4 opcs4Bo = Opcs4VoAssembler.extractOpcs4(factory, vo);
	
	Organisation orgBo = OrgVoAssembler.extractOrganisation(factory, vo);

	factory.save(orgBo);

	return OrgVoAssembler.create(orgBo);
			
}
 
Example 7
Project: openMAXIMS   File: TaxonomySearchCmpImpl.java   Source Code and License 4 votes vote down vote up
private TaxonomyMapCollection searchPracticeCodes(TaxonomyMap filter) throws ims.domain.exceptions.DomainInterfaceException
{
	// TODO Auto-generated method stub
	try{

		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and upper(mappings.taxonomyCode) like :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add("%"+filter.getDescription().toUpperCase()+"%");
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		TaxonomyMapCollection coll_ret = new TaxonomyMapCollection();
		
		if (coll != null && coll.size()>0)
		{							
			for (int i = 0; i < coll.size(); i++)
			{
				OrgVo vo= coll.get(i);
				
				/*TaxonomyMap tmCAB = new TaxonomyMap();
				tmCAB.setTaxonomyName(TaxonomyType.ICAB);
				tmCAB.setDescription(vo.getName());
				tmCAB.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.ICAB));		*/
				
				TaxonomyMap tmNAT = new TaxonomyMap();
				tmNAT.setTaxonomyName(TaxonomyType.NAT_LOC_CODE);
				tmNAT.setDescription(vo.getName());
				tmNAT.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.NAT_LOC_CODE));
				
				//coll_ret.add(tmCAB);
				coll_ret.add(tmNAT);
			}				 
		}	
		return coll_ret;
	}
	catch (DomainRuntimeException e)
	{
		throw new ims.domain.exceptions.DomainInterfaceException("Please contact your system administrator.\n\nError:\n" + e.getMessage());
	}			
}
 
Example 8
Project: openMAXIMS   File: TaxonomyCodeAdminImpl.java   Source Code and License 4 votes vote down vote up
public OrgVo savePracticeRecord(OrgVo vo) throws DomainInterfaceException,
		StaleObjectException, UniqueKeyViolationException {
	
	if (!vo.isValidated())
	{
		throw new DomainRuntimeException("OrgVo Vo has not been validated.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	//Opcs4 opcs4Bo = Opcs4VoAssembler.extractOpcs4(factory, vo);
	
	Organisation orgBo = OrgVoAssembler.extractOrganisation(factory, vo);

	factory.save(orgBo);

	return OrgVoAssembler.create(orgBo);
			
}
 
Example 9
Project: openMAXIMS   File: TaxonomySearchCmpImpl.java   Source Code and License 4 votes vote down vote up
private TaxonomyMapCollection searchPracticeCodes(TaxonomyMap filter) throws ims.domain.exceptions.DomainInterfaceException
{
	// TODO Auto-generated method stub
	try{

		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and upper(mappings.taxonomyCode) like :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add("%"+filter.getDescription().toUpperCase()+"%");
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		TaxonomyMapCollection coll_ret = new TaxonomyMapCollection();
		
		if (coll != null && coll.size()>0)
		{							
			for (int i = 0; i < coll.size(); i++)
			{
				OrgVo vo= coll.get(i);
				
				/*TaxonomyMap tmCAB = new TaxonomyMap();
				tmCAB.setTaxonomyName(TaxonomyType.ICAB);
				tmCAB.setDescription(vo.getName());
				tmCAB.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.ICAB));		*/
				
				TaxonomyMap tmNAT = new TaxonomyMap();
				tmNAT.setTaxonomyName(TaxonomyType.NAT_LOC_CODE);
				tmNAT.setDescription(vo.getName());
				tmNAT.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.NAT_LOC_CODE));
				
				//coll_ret.add(tmCAB);
				coll_ret.add(tmNAT);
			}				 
		}	
		return coll_ret;
	}
	catch (DomainRuntimeException e)
	{
		throw new ims.domain.exceptions.DomainInterfaceException("Please contact your system administrator.\n\nError:\n" + e.getMessage());
	}			
}
 
Example 10
Project: openMAXIMS   File: TaxonomyCodeAdminImpl.java   Source Code and License 4 votes vote down vote up
public OrgVo savePracticeRecord(OrgVo vo) throws DomainInterfaceException,
		StaleObjectException, UniqueKeyViolationException {
	
	if (!vo.isValidated())
	{
		throw new DomainRuntimeException("OrgVo Vo has not been validated.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	//Opcs4 opcs4Bo = Opcs4VoAssembler.extractOpcs4(factory, vo);
	
	Organisation orgBo = OrgVoAssembler.extractOrganisation(factory, vo);

	factory.save(orgBo);

	return OrgVoAssembler.create(orgBo);
			
}
 
Example 11
Project: openmaxims-linux   File: TaxonomySearchCmpImpl.java   Source Code and License 4 votes vote down vote up
private TaxonomyMapCollection searchPracticeCodes(TaxonomyMap filter) throws ims.domain.exceptions.DomainInterfaceException
{
	// TODO Auto-generated method stub
	try{

		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and upper(mappings.taxonomyCode) like :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add("%"+filter.getDescription().toUpperCase()+"%");
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		TaxonomyMapCollection coll_ret = new TaxonomyMapCollection();
		
		if (coll != null && coll.size()>0)
		{							
			for (int i = 0; i < coll.size(); i++)
			{
				OrgVo vo= coll.get(i);
				
				/*TaxonomyMap tmCAB = new TaxonomyMap();
				tmCAB.setTaxonomyName(TaxonomyType.ICAB);
				tmCAB.setDescription(vo.getName());
				tmCAB.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.ICAB));		*/
				
				TaxonomyMap tmNAT = new TaxonomyMap();
				tmNAT.setTaxonomyName(TaxonomyType.NAT_LOC_CODE);
				tmNAT.setDescription(vo.getName());
				tmNAT.setTaxonomyCode(vo.getCodeMappings().getMappingValue(TaxonomyType.NAT_LOC_CODE));
				
				//coll_ret.add(tmCAB);
				coll_ret.add(tmNAT);
			}				 
		}	
		return coll_ret;
	}
	catch (DomainRuntimeException e)
	{
		throw new ims.domain.exceptions.DomainInterfaceException("Please contact your system administrator.\n\nError:\n" + e.getMessage());
	}			
}
 
Example 12
Project: openmaxims-linux   File: TaxonomyCodeAdminImpl.java   Source Code and License 4 votes vote down vote up
public OrgVo savePracticeRecord(OrgVo vo) throws DomainInterfaceException,
		StaleObjectException, UniqueKeyViolationException {
	
	if (!vo.isValidated())
	{
		throw new DomainRuntimeException("OrgVo Vo has not been validated.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	//Opcs4 opcs4Bo = Opcs4VoAssembler.extractOpcs4(factory, vo);
	
	Organisation orgBo = OrgVoAssembler.extractOrganisation(factory, vo);

	factory.save(orgBo);

	return OrgVoAssembler.create(orgBo);
			
}
 
Example 13
Project: AvoinApotti   File: TaxonomyCodeAdminImpl.java   Source Code and License 3 votes vote down vote up
public OrgVo getPracticeCode(String code) throws DomainInterfaceException {
		
		if(code == null || code.trim().length() == 0)
			return null;
		
		//OrgVoCollection coll= OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find("from Organisation as o1_1 left join o1_1.codeMappings as t1_1 left join t1_1.taxonomyName as l1_1 where  l1_1.id = -828 and t1_1.taxonomyCode = ") 
//" ));
			
		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and mappings.taxonomyCode = :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add(code);
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		if (coll != null && coll.size()>0)
			return coll.get(0);
		
		return null;
		
	}
 
Example 14
Project: openMAXIMS   File: TaxonomyCodeAdminImpl.java   Source Code and License 3 votes vote down vote up
public OrgVo getPracticeCode(String code) throws DomainInterfaceException {
		
		if(code == null || code.trim().length() == 0)
			return null;
		
		//OrgVoCollection coll= OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find("from Organisation as o1_1 left join o1_1.codeMappings as t1_1 left join t1_1.taxonomyName as l1_1 where  l1_1.id = -828 and t1_1.taxonomyCode = ") 
//" ));
			
		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and mappings.taxonomyCode = :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add(code);
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		if (coll != null && coll.size()>0)
			return coll.get(0);
		
		return null;
		
	}
 
Example 15
Project: openMAXIMS   File: TaxonomyCodeAdminImpl.java   Source Code and License 3 votes vote down vote up
public OrgVo getPracticeCode(String code) throws DomainInterfaceException {
		
		if(code == null || code.trim().length() == 0)
			return null;
		
		//OrgVoCollection coll= OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find("from Organisation as o1_1 left join o1_1.codeMappings as t1_1 left join t1_1.taxonomyName as l1_1 where  l1_1.id = -828 and t1_1.taxonomyCode = ") 
//" ));
			
		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and mappings.taxonomyCode = :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add(code);
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		if (coll != null && coll.size()>0)
			return coll.get(0);
		
		return null;
		
	}
 
Example 16
Project: openmaxims-linux   File: TaxonomyCodeAdminImpl.java   Source Code and License 3 votes vote down vote up
public OrgVo getPracticeCode(String code) throws DomainInterfaceException {
		
		if(code == null || code.trim().length() == 0)
			return null;
		
		//OrgVoCollection coll= OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find("from Organisation as o1_1 left join o1_1.codeMappings as t1_1 left join t1_1.taxonomyName as l1_1 where  l1_1.id = -828 and t1_1.taxonomyCode = ") 
//" ));
			
		ArrayList names = new ArrayList();
		ArrayList values = new ArrayList();
			
		StringBuffer taxonomyHql = new StringBuffer(" select distinct org from Organisation org join org.codeMappings as mappings" +
						" where mappings.taxonomyName = :taxonomyType and mappings.taxonomyCode = :taxonomyCode and org.type = :gpPractice");
			
		names.add("taxonomyType");
		names.add("taxonomyCode");
		names.add("gpPractice");
		
		values.add(getDomLookup(TaxonomyType.NAT_LOC_CODE));
		values.add(code);
		values.add(getDomLookup(OrganisationType.GPP));
		
		OrgVoCollection  coll = OrgVoAssembler.createOrgVoCollectionFromOrganisation(getDomainFactory().find(taxonomyHql.toString(), names, values));
		
		if (coll != null && coll.size()>0)
			return coll.get(0);
		
		return null;
		
	}