Java Code Examples for ims.core.vo.LocSiteVoCollection

The following are top voted examples for showing how to use ims.core.vo.LocSiteVoCollection. 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: OrgTreeHelper.java   View source code 6 votes vote down vote up
private void populateLocSites(LocSiteVoCollection locationSites, TreeNode orgNode)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;		
		
		//WDEV-6444 - if node is inactive disable drag dropping for that node
		if(voLoc.getIsActive().booleanValue() == false)
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName());
		else
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
		
		locNode.setCollapsedImage(img);
		locNode.setExpandedImage(img);
		locNode.setCheckBoxVisible(showCheckBoxes);
		populateLocations(voLoc.getLocations().sort(), locNode);
	}		
}
 
Example 2
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
private void checkChildsForDuplicateTaxonoy(LocSiteVoCollection childs,Map<?, ?> doMap,DomainFactory factory) throws UniqueKeyViolationException
{
		if (childs == null || doMap==null)
			return;
		
		for (int i = 0 ; i < childs.size(); i++)
		{
			LocSiteVo locMostVo = childs.get(i);
			Object doObj = doMap.get(locMostVo);
			//If doObj is null it means that nothing has changed in that record and hibernate didn't instantiated that record
			if (doObj instanceof Location)
			{
				//I'm using new Location(((Location) doObj).getId(),((Location) doObj).getVersion()) because LocSite extends Location 
				//and it's possible to have a Location with same mappings and not a LocSite.
				Location loc =(Location) doObj;
				String dupMessage = Keywords.checkDuplicateTaxonomy(factory,new Location(loc.getId(),loc.getVersion()), "codeMappings", locMostVo.getCodeMappings(), "getName");
				if (dupMessage!=null)
					throw new UniqueKeyViolationException(dupMessage);
			}
		}
}
 
Example 3
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
private void checkChildsForDuplicateTaxonoy(LocSiteVoCollection childs,Map<?, ?> doMap,DomainFactory factory) throws UniqueKeyViolationException
{
		if (childs == null || doMap==null)
			return;
		
		for (int i = 0 ; i < childs.size(); i++)
		{
			LocSiteVo locMostVo = childs.get(i);
			Object doObj = doMap.get(locMostVo);
			//If doObj is null it means that nothing has changed in that record and hibernate didn't instantiated that record
			if (doObj instanceof Location)
			{
				//I'm using new Location(((Location) doObj).getId(),((Location) doObj).getVersion()) because LocSite extends Location 
				//and it's possible to have a Location with same mappings and not a LocSite.
				Location loc =(Location) doObj;
				String dupMessage = Keywords.checkDuplicateTaxonomy(factory,new Location(loc.getId(),loc.getVersion()), "codeMappings", locMostVo.getCodeMappings(), "getName");
				if (dupMessage!=null)
					throw new UniqueKeyViolationException(dupMessage);
			}
		}
}
 
Example 4
Project: openMAXIMS   File: OrgTreeHelper.java   View source code 6 votes vote down vote up
private void populateLocSites(LocSiteVoCollection locationSites, TreeNode orgNode)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;		
		
		//WDEV-6444 - if node is inactive disable drag dropping for that node
		if(voLoc.getIsActive().booleanValue() == false)
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName());
		else
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
		
		locNode.setCollapsedImage(img);
		locNode.setExpandedImage(img);
		locNode.setCheckBoxVisible(showCheckBoxes);
		populateLocations(voLoc.getLocations().sort(), locNode);
	}		
}
 
Example 5
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
private void checkChildsForDuplicateTaxonoy(LocSiteVoCollection childs,Map<?, ?> doMap,DomainFactory factory) throws UniqueKeyViolationException
{
		if (childs == null || doMap==null)
			return;
		
		for (int i = 0 ; i < childs.size(); i++)
		{
			LocSiteVo locMostVo = childs.get(i);
			Object doObj = doMap.get(locMostVo);
			//If doObj is null it means that nothing has changed in that record and hibernate didn't instantiated that record
			if (doObj instanceof Location)
			{
				//I'm using new Location(((Location) doObj).getId(),((Location) doObj).getVersion()) because LocSite extends Location 
				//and it's possible to have a Location with same mappings and not a LocSite.
				Location loc =(Location) doObj;
				String dupMessage = Keywords.checkDuplicateTaxonomy(factory,new Location(loc.getId(),loc.getVersion()), "codeMappings", locMostVo.getCodeMappings(), "getName");
				if (dupMessage!=null)
					throw new UniqueKeyViolationException(dupMessage);
			}
		}
}
 
Example 6
Project: openmaxims-linux   File: OrgTreeHelper.java   View source code 6 votes vote down vote up
private void populateLocSites(LocSiteVoCollection locationSites, TreeNode orgNode)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;		
		
		//WDEV-6444 - if node is inactive disable drag dropping for that node
		if(voLoc.getIsActive().booleanValue() == false)
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName());
		else
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
		
		locNode.setCollapsedImage(img);
		locNode.setExpandedImage(img);
		locNode.setCheckBoxVisible(showCheckBoxes);
		populateLocations(voLoc.getLocations().sort(), locNode);
	}		
}
 
Example 7
Project: openmaxims-linux   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
private void checkChildsForDuplicateTaxonoy(LocSiteVoCollection childs,Map<?, ?> doMap,DomainFactory factory) throws UniqueKeyViolationException
{
		if (childs == null || doMap==null)
			return;
		
		for (int i = 0 ; i < childs.size(); i++)
		{
			LocSiteVo locMostVo = childs.get(i);
			Object doObj = doMap.get(locMostVo);
			//If doObj is null it means that nothing has changed in that record and hibernate didn't instantiated that record
			if (doObj instanceof Location)
			{
				//I'm using new Location(((Location) doObj).getId(),((Location) doObj).getVersion()) because LocSite extends Location 
				//and it's possible to have a Location with same mappings and not a LocSite.
				Location loc =(Location) doObj;
				String dupMessage = Keywords.checkDuplicateTaxonomy(factory,new Location(loc.getId(),loc.getVersion()), "codeMappings", locMostVo.getCodeMappings(), "getName");
				if (dupMessage!=null)
					throw new UniqueKeyViolationException(dupMessage);
			}
		}
}
 
Example 8
Project: AvoinApotti   File: M02VoMapper.java   View source code 5 votes vote down vote up
private void checkModifiedSurgery(LocSiteVoCollection locationSites, LocSiteVo siteVo)
{
	for (int i = 0; i < locationSites.size(); i++)
	{
		LocSiteVo vo =locationSites.get(i); 
		if (vo.equals(siteVo))
		{				
			if (vo.getAddress() == null) vo.setAddress(new PersonAddress());
			
			if (!siteVo.getAddressIsNotNull() || //msg surgery will be null if all fields cleared with HL7Null ("")
			!adrLinesEqual(vo.getAddress().getLine1(),siteVo.getAddress().getLine1()) ||						
			!adrLinesEqual(vo.getAddress().getLine2(),siteVo.getAddress().getLine2()) ||
			!adrLinesEqual(vo.getAddress().getLine3(),siteVo.getAddress().getLine3()) || 
			!adrLinesEqual(vo.getAddress().getLine4(),siteVo.getAddress().getLine4()) || 
			!adrLinesEqual(vo.getAddress().getLine5(),siteVo.getAddress().getLine5()) ||
			!adrLinesEqual(vo.getAddress().getPostCode(),siteVo.getAddress().getPostCode()	)
			||
			vo.getAddress().getCountyIsNotNull() && !vo.getAddress().getCounty().equals(siteVo.getAddress().getCounty())
			)
			{
				vo.setAddress(siteVo.getAddress());
				vo.setName(siteVo.getName());
			}
			setCommsChannels(vo.getCommChannels(),siteVo.getCommChannels());				
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * creates a LocSiteCollection with one LocSiteVo. point is to create a 1 to 1 mapping 
 * of practice - surgery for sites who are not visibly using surgeries. 
 * 
 * @param practice
 * @return practice with 1 surgery, populated from the screen (matches practice values)
 */
private OrganisationVo createOneMatchingChildSurgery(OrganisationVo practice) 
{
	LocSiteVoCollection surgeryCollection = new LocSiteVoCollection();
	LocSiteVo surgery = new LocSiteVo();
	surgery = populateSurgeryData(surgery);
	surgery.setName(surgery.getName() + " surgery");
	surgery.setCodeMappings(null);  // do not want to be creating duplicate location mappings. 
	surgery.setIsVirtual(false);  //wdev-4093 
	surgeryCollection.add(surgery);
	surgeryCollection.get(0).setParentOrganisation(practice);
	practice.setLocationSites(surgeryCollection);
		
	return practice;
}
 
Example 10
Project: openMAXIMS   File: M02VoMapper.java   View source code 5 votes vote down vote up
private void checkModifiedSurgery(LocSiteVoCollection locationSites, LocSiteVo siteVo)
{
	for (int i = 0; i < locationSites.size(); i++)
	{
		LocSiteVo vo =locationSites.get(i); 
		if (vo.equals(siteVo))
		{				
			if (vo.getAddress() == null) vo.setAddress(new PersonAddress());
			
			if (!siteVo.getAddressIsNotNull() || //msg surgery will be null if all fields cleared with HL7Null ("")
			!adrLinesEqual(vo.getAddress().getLine1(),siteVo.getAddress().getLine1()) ||						
			!adrLinesEqual(vo.getAddress().getLine2(),siteVo.getAddress().getLine2()) ||
			!adrLinesEqual(vo.getAddress().getLine3(),siteVo.getAddress().getLine3()) || 
			!adrLinesEqual(vo.getAddress().getLine4(),siteVo.getAddress().getLine4()) || 
			!adrLinesEqual(vo.getAddress().getLine5(),siteVo.getAddress().getLine5()) ||
			!adrLinesEqual(vo.getAddress().getPostCode(),siteVo.getAddress().getPostCode()	)
			||
			vo.getAddress().getCountyIsNotNull() && !vo.getAddress().getCounty().equals(siteVo.getAddress().getCounty())
			)
			{
				vo.setAddress(siteVo.getAddress());
				vo.setName(siteVo.getName());
			}
			setCommsChannels(vo.getCommChannels(),siteVo.getCommChannels());				
		}
	}
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
/**
 * creates a LocSiteCollection with one LocSiteVo. point is to create a 1 to 1 mapping 
 * of practice - surgery for sites who are not visibly using surgeries. 
 * 
 * @param practice
 * @return practice with 1 surgery, populated from the screen (matches practice values)
 */
private OrganisationVo createOneMatchingChildSurgery(OrganisationVo practice) 
{
	LocSiteVoCollection surgeryCollection = new LocSiteVoCollection();
	LocSiteVo surgery = new LocSiteVo();
	surgery = populateSurgeryData(surgery);
	surgery.setName(surgery.getName() + " surgery");
	surgery.setCodeMappings(null);  // do not want to be creating duplicate location mappings. 
	surgery.setIsVirtual(false);  //wdev-4093 
	surgeryCollection.add(surgery);
	surgeryCollection.get(0).setParentOrganisation(practice);
	practice.setLocationSites(surgeryCollection);
		
	return practice;
}
 
Example 12
Project: openMAXIMS   File: OrgTreeHelper.java   View source code 5 votes vote down vote up
private void populateLocSites(LocSiteVoCollection locationSites, TreeNode orgNode)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		
		if ((voLoc.getIsActive().booleanValue() == false && !showInactive) || (voLoc.getIsVirtual().booleanValue() && !showVirtual) || ((LocationType.CASE_NOTE_FOLDER_LOCATION.equals(voLoc.getType()) || LocationType.MEDICAL_RECORDS.equals(voLoc.getType()))  && !showCaseNoteLocations && !showLocationsMarkedAsCaseNoteFolderOnly) || (showLocationsMarkedAsCaseNoteFolderOnly && !isCaseFolderLocationOrHasCaseNoteLocChild(voLoc))) //WDEV-19532 //WDEV-19545
			continue;
		
		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;		
		
		//WDEV-6444 - if node is inactive disable drag dropping for that node
		if(voLoc.getIsActive().booleanValue() == false)
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName());
		else
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
		
		locNode.setCollapsedImage(img);
		locNode.setExpandedImage(img);
		locNode.setCheckBoxVisible(showCheckBoxes);
		locNode.setEnabled(showLocationsMarkedAsCaseNoteFolderOnly ? Boolean.TRUE.equals(voLoc.getCaseNoteFolderLocation()) : true); //WDEV-19518
		populateLocations(voLoc.getLocations().sort(), locNode);
	}		
}
 
Example 13
Project: openMAXIMS   File: M02VoMapper.java   View source code 5 votes vote down vote up
private void checkModifiedSurgery(LocSiteVoCollection locationSites, LocSiteVo siteVo)
{
	for (int i = 0; i < locationSites.size(); i++)
	{
		LocSiteVo vo =locationSites.get(i); 
		if (vo.equals(siteVo))
		{				
			if (vo.getAddress() == null) vo.setAddress(new PersonAddress());
			
			if (!siteVo.getAddressIsNotNull() || //msg surgery will be null if all fields cleared with HL7Null ("")
			!adrLinesEqual(vo.getAddress().getLine1(),siteVo.getAddress().getLine1()) ||						
			!adrLinesEqual(vo.getAddress().getLine2(),siteVo.getAddress().getLine2()) ||
			!adrLinesEqual(vo.getAddress().getLine3(),siteVo.getAddress().getLine3()) || 
			!adrLinesEqual(vo.getAddress().getLine4(),siteVo.getAddress().getLine4()) || 
			!adrLinesEqual(vo.getAddress().getLine5(),siteVo.getAddress().getLine5()) ||
			!adrLinesEqual(vo.getAddress().getPostCode(),siteVo.getAddress().getPostCode()	)
			||
			vo.getAddress().getCountyIsNotNull() && !vo.getAddress().getCounty().equals(siteVo.getAddress().getCounty())
			)
			{
				vo.setAddress(siteVo.getAddress());
				vo.setName(siteVo.getName());
			}
			setCommsChannels(vo.getCommChannels(),siteVo.getCommChannels());				
		}
	}
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
/**
 * creates a LocSiteCollection with one LocSiteVo. point is to create a 1 to 1 mapping 
 * of practice - surgery for sites who are not visibly using surgeries. 
 * 
 * @param practice
 * @return practice with 1 surgery, populated from the screen (matches practice values)
 */
private OrganisationVo createOneMatchingChildSurgery(OrganisationVo practice) 
{
	LocSiteVoCollection surgeryCollection = new LocSiteVoCollection();
	LocSiteVo surgery = new LocSiteVo();
	surgery = populateSurgeryData(surgery);
	surgery.setName(surgery.getName() + " surgery");
	surgery.setCodeMappings(null);  // do not want to be creating duplicate location mappings. 
	surgery.setIsVirtual(false);  //wdev-4093 
	surgeryCollection.add(surgery);
	surgeryCollection.get(0).setParentOrganisation(practice);
	practice.setLocationSites(surgeryCollection);
		
	return practice;
}
 
Example 15
Project: openmaxims-linux   File: M02VoMapper.java   View source code 5 votes vote down vote up
private void checkModifiedSurgery(LocSiteVoCollection locationSites, LocSiteVo siteVo)
{
	for (int i = 0; i < locationSites.size(); i++)
	{
		LocSiteVo vo =locationSites.get(i); 
		if (vo.equals(siteVo))
		{				
			if (vo.getAddress() == null) vo.setAddress(new PersonAddress());
			
			if (!siteVo.getAddressIsNotNull() || //msg surgery will be null if all fields cleared with HL7Null ("")
			!adrLinesEqual(vo.getAddress().getLine1(),siteVo.getAddress().getLine1()) ||						
			!adrLinesEqual(vo.getAddress().getLine2(),siteVo.getAddress().getLine2()) ||
			!adrLinesEqual(vo.getAddress().getLine3(),siteVo.getAddress().getLine3()) || 
			!adrLinesEqual(vo.getAddress().getLine4(),siteVo.getAddress().getLine4()) || 
			!adrLinesEqual(vo.getAddress().getLine5(),siteVo.getAddress().getLine5()) ||
			!adrLinesEqual(vo.getAddress().getPostCode(),siteVo.getAddress().getPostCode()	)
			||
			vo.getAddress().getCountyIsNotNull() && !vo.getAddress().getCounty().equals(siteVo.getAddress().getCounty())
			)
			{
				vo.setAddress(siteVo.getAddress());
				vo.setName(siteVo.getName());
			}
			setCommsChannels(vo.getCommChannels(),siteVo.getCommChannels());				
		}
	}
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
/**
 * creates a LocSiteCollection with one LocSiteVo. point is to create a 1 to 1 mapping 
 * of practice - surgery for sites who are not visibly using surgeries. 
 * 
 * @param practice
 * @return practice with 1 surgery, populated from the screen (matches practice values)
 */
private OrganisationVo createOneMatchingChildSurgery(OrganisationVo practice) 
{
	LocSiteVoCollection surgeryCollection = new LocSiteVoCollection();
	LocSiteVo surgery = new LocSiteVo();
	surgery = populateSurgeryData(surgery);
	surgery.setName(surgery.getName() + " surgery");
	surgery.setCodeMappings(null);  // do not want to be creating duplicate location mappings. 
	surgery.setIsVirtual(false);  //wdev-4093 
	surgeryCollection.add(surgery);
	surgeryCollection.get(0).setParentOrganisation(practice);
	practice.setLocationSites(surgeryCollection);
		
	return practice;
}
 
Example 17
Project: AvoinApotti   File: OrganisationLocationHelper.java   View source code 4 votes vote down vote up
private void populateLocationSites(LocSiteVoCollection locationSites, Object objectTreeOrGrid)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		if (voLoc.getIsVirtualIsNotNull() && voLoc.getIsVirtual().booleanValue())
			continue;

		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;			

		if (this.tree != null)
		{
			TreeNode parentNode = (TreeNode) objectTreeOrGrid;

			locNode = parentNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
			locNode.setCollapsedImage(img);
			locNode.setExpandedImage(img);
			locNode.setCheckBoxVisible(showCheckBoxes);

			populateLocations(voLoc.getLocations().sort(), locNode);
		}
		else
		{
			DynamicGridRow rowParent = (DynamicGridRow)objectTreeOrGrid;
			DynamicGridRow row = null;
			row = rowParent.getRows().newRow();

			DynamicGridCell cell1 = row.getCells().newCell(getColByIdentifier(COL_DESC), DynamicCellType.LABEL);
			cell1.setValue(voLoc.getNameIsNotNull() ? voLoc.getName() : "");
			cell1.setIdentifier(voLoc.getName());

			row.setValue(voLoc);
			row.setCheckBoxVisible(showCheckBoxes);
			
			row.setCollapsedImage(img);
			row.setExpandedImage(img);

			populateLocations(voLoc.getLocations().sort(), row);
		}
	}		
}
 
Example 18
Project: openMAXIMS   File: OrganisationLocationHelper.java   View source code 4 votes vote down vote up
private void populateLocationSites(LocSiteVoCollection locationSites, Object objectTreeOrGrid)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		if (voLoc.getIsVirtualIsNotNull() && voLoc.getIsVirtual().booleanValue())
			continue;

		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;			

		if (this.tree != null)
		{
			TreeNode parentNode = (TreeNode) objectTreeOrGrid;

			locNode = parentNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
			locNode.setCollapsedImage(img);
			locNode.setExpandedImage(img);
			locNode.setCheckBoxVisible(showCheckBoxes);

			populateLocations(voLoc.getLocations().sort(), locNode);
		}
		else
		{
			DynamicGridRow rowParent = (DynamicGridRow)objectTreeOrGrid;
			DynamicGridRow row = null;
			row = rowParent.getRows().newRow();

			DynamicGridCell cell1 = row.getCells().newCell(getColByIdentifier(COL_DESC), DynamicCellType.LABEL);
			cell1.setValue(voLoc.getNameIsNotNull() ? voLoc.getName() : "");
			cell1.setIdentifier(voLoc.getName());

			row.setValue(voLoc);
			row.setCheckBoxVisible(showCheckBoxes);
			
			row.setCollapsedImage(img);
			row.setExpandedImage(img);

			populateLocations(voLoc.getLocations().sort(), row);
		}
	}		
}
 
Example 19
Project: openMAXIMS   File: OrganisationLocationHelper.java   View source code 4 votes vote down vote up
private void populateLocationSites(LocSiteVoCollection locationSites, Object objectTreeOrGrid)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		if (voLoc.getIsVirtualIsNotNull() && voLoc.getIsVirtual().booleanValue())
			continue;

		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;			

		if (this.tree != null)
		{
			TreeNode parentNode = (TreeNode) objectTreeOrGrid;

			locNode = parentNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
			locNode.setCollapsedImage(img);
			locNode.setExpandedImage(img);
			locNode.setCheckBoxVisible(showCheckBoxes);

			populateLocations(voLoc.getLocations().sort(), locNode);
		}
		else
		{
			DynamicGridRow rowParent = (DynamicGridRow)objectTreeOrGrid;
			DynamicGridRow row = null;
			row = rowParent.getRows().newRow();

			DynamicGridCell cell1 = row.getCells().newCell(getColByIdentifier(COL_DESC), DynamicCellType.LABEL);
			cell1.setValue(voLoc.getNameIsNotNull() ? voLoc.getName() : "");
			cell1.setIdentifier(voLoc.getName());

			row.setValue(voLoc);
			row.setCheckBoxVisible(showCheckBoxes);
			
			row.setCollapsedImage(img);
			row.setExpandedImage(img);

			populateLocations(voLoc.getLocations().sort(), row);
		}
	}		
}
 
Example 20
Project: openmaxims-linux   File: OrganisationLocationHelper.java   View source code 4 votes vote down vote up
private void populateLocationSites(LocSiteVoCollection locationSites, Object objectTreeOrGrid)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		if (voLoc.getIsVirtualIsNotNull() && voLoc.getIsVirtual().booleanValue())
			continue;

		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;			

		if (this.tree != null)
		{
			TreeNode parentNode = (TreeNode) objectTreeOrGrid;

			locNode = parentNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
			locNode.setCollapsedImage(img);
			locNode.setExpandedImage(img);
			locNode.setCheckBoxVisible(showCheckBoxes);

			populateLocations(voLoc.getLocations().sort(), locNode);
		}
		else
		{
			DynamicGridRow rowParent = (DynamicGridRow)objectTreeOrGrid;
			DynamicGridRow row = null;
			row = rowParent.getRows().newRow();

			DynamicGridCell cell1 = row.getCells().newCell(getColByIdentifier(COL_DESC), DynamicCellType.LABEL);
			cell1.setValue(voLoc.getNameIsNotNull() ? voLoc.getName() : "");
			cell1.setIdentifier(voLoc.getName());

			row.setValue(voLoc);
			row.setCheckBoxVisible(showCheckBoxes);
			
			row.setCollapsedImage(img);
			row.setExpandedImage(img);

			populateLocations(voLoc.getLocations().sort(), row);
		}
	}		
}