use of net.geoprism.registry.Organization in project geoprism-registry by terraframe.
the class ListCurationJob method startInTrans.
@Transaction
private JobHistoryRecord startInTrans(ListTypeVersion version) {
final ListType listType = version.getListType();
final ServerGeoObjectType type = listType.getGeoObjectType();
final Organization org = listType.getOrganization();
RolePermissionService perms = ServiceFactory.getRolePermissionService();
if (perms.isRA()) {
perms.enforceRA(org.getCode());
} else if (perms.isRM()) {
perms.enforceRM(org.getCode(), type);
} else {
perms.enforceRM();
}
ListCurationHistory history = (ListCurationHistory) this.createNewHistory();
history.appLock();
history.setVersion(version);
history.apply();
JobHistoryRecord record = new JobHistoryRecord(this, history);
record.apply();
return record;
}
use of net.geoprism.registry.Organization in project geoprism-registry by terraframe.
the class PatchOrgIntoImportHistory method doIt.
@Transaction
private void doIt() {
ImportHistoryQuery ihq = new ImportHistoryQuery(new QueryFactory());
OIterator<? extends ImportHistory> it = ihq.getIterator();
try {
for (ImportHistory hist : it) {
try {
ImportConfiguration config = hist.getConfig();
if (config instanceof GeoObjectImportConfiguration) {
GeoObjectImportConfiguration goConfig = (GeoObjectImportConfiguration) config;
Organization org = goConfig.getType().getOrganization();
hist.appLock();
hist.setOrganization(org);
hist.apply();
}
} catch (net.geoprism.registry.DataNotFoundException e) {
logger.error("ImportHistory references object which does not exist", e);
}
}
} finally {
it.close();
}
}
use of net.geoprism.registry.Organization in project geoprism-registry by terraframe.
the class LocalizedValueConverter method populateOrganizationDisplayLabel.
/**
* Populates the {@link Organization} display label on the given
* {@link RegistryRole} object.
*
* @param registryRole
*/
public static void populateOrganizationDisplayLabel(RegistryRole registryRole) {
String organizationCode = registryRole.getOrganizationCode();
if (organizationCode != null && !organizationCode.trim().equals("")) {
Organization organization = Organization.getByCode(organizationCode);
registryRole.setOrganizationLabel(LocalizedValueConverter.convert(organization.getDisplayLabel()));
}
}
use of net.geoprism.registry.Organization in project geoprism-registry by terraframe.
the class OrganizationConverter method fromDTO.
public Organization fromDTO(OrganizationDTO organizationDTO) {
Organization organization = new Organization();
organization.setCode(organizationDTO.getCode());
populate(organization.getDisplayLabel(), organizationDTO.getLabel());
populate(organization.getContactInfo(), organizationDTO.getContactInfo());
return organization;
}
use of net.geoprism.registry.Organization in project geoprism-registry by terraframe.
the class ServerGeoObjectTypeConverter method assignAll_RA_Permissions.
/**
* Assigns all permissions to the Organization's RA
*
* @param mdGeoVertexDAO
* @param mdBusiness
* @param organizationCode
*/
private void assignAll_RA_Permissions(MdGeoVertexDAO mdGeoVertexDAO, MdBusiness mdBusiness, String organizationCode) {
if (organizationCode != null && !organizationCode.trim().equals("")) {
Organization organization = Organization.getByKey(organizationCode);
Roles raRole = organization.getRegistryAdminiRole();
this.assignAllPermissions(mdBusiness, raRole);
this.assignAllPermissions(mdGeoVertexDAO, raRole);
}
}
Aggregations