use of com.runwaysdk.dataaccess.EntityDAOIF in project geoprism-registry by terraframe.
the class Organization method getGeoObjectTypes.
/**
* Return a map of {@link GeoObjectType} codes and labels for this
* {@link Organization}.
*
* @return a map of {@link GeoObjectType} codes and labels for this
* {@link Organization}.
*/
public Map<String, ServerGeoObjectType> getGeoObjectTypes() {
// For performance, get all of the universals defined
List<? extends EntityDAOIF> universalList = ObjectCache.getCachedEntityDAOs(Universal.CLASS);
Map<String, ServerGeoObjectType> typeCodeMap = new HashMap<String, ServerGeoObjectType>();
for (EntityDAOIF entityDAOIF : universalList) {
Universal universal = (Universal) BusinessFacade.get(entityDAOIF);
// Check to see if the universal is owned by the organization role.
String ownerId = universal.getOwnerOid();
Roles organizationRole = this.getRole();
if (ownerId.equals(organizationRole.getOid())) {
ServerGeoObjectType type = ServerGeoObjectType.get(universal);
typeCodeMap.put(type.getCode(), type);
}
}
return typeCodeMap;
}
use of com.runwaysdk.dataaccess.EntityDAOIF in project geoprism-registry by terraframe.
the class Organization method getOrganizationsFromCache.
/**
* Returns all of the organizations as {@link Organization} objects from the
* cache unsorted instead of fetching from the database.
*
* @return
*/
public static List<Organization> getOrganizationsFromCache() {
// For performance, get all of the universals defined
List<? extends EntityDAOIF> organizationDAOs = ObjectCache.getCachedEntityDAOs(Organization.CLASS);
List<Organization> organizationList = new LinkedList<Organization>();
for (EntityDAOIF entityDAOIF : organizationDAOs) {
Organization organization = (Organization) BusinessFacade.get(entityDAOIF);
organizationList.add(organization);
}
return organizationList;
}
Aggregations