use of org.commongeoregistry.adapter.metadata.MetadataCache in project geoprism-registry by terraframe.
the class RemoveChildAction method getMessage.
@Override
protected String getMessage() {
RegistryAdapter adapter = ServiceFactory.getAdapter();
MetadataCache cache = adapter.getMetadataCache();
ServerGeoObjectType parentType = ServerGeoObjectType.get(this.getParentTypeCode());
ServerGeoObjectType childType = ServerGeoObjectType.get(this.getChildTypeCode());
HierarchyType hierarchyType = cache.getHierachyType(this.getHierarchyTypeCode()).get();
String message = LocalizationFacade.getFromBundles("change.request.email.remove.child");
message = message.replaceAll("\\{0\\}", this.getChildId());
message = message.replaceAll("\\{1\\}", childType.getLabel().getValue(Session.getCurrentLocale()));
message = message.replaceAll("\\{2\\}", this.getParentId());
message = message.replaceAll("\\{3\\}", parentType.getLabel().getValue(Session.getCurrentLocale()));
message = message.replaceAll("\\{4\\}", hierarchyType.getLabel().getValue(Session.getCurrentLocale()));
return message;
}
use of org.commongeoregistry.adapter.metadata.MetadataCache in project geoprism-registry by terraframe.
the class AddChildAction method getMessage.
@Override
protected String getMessage() {
RegistryAdapter adapter = ServiceFactory.getAdapter();
MetadataCache cache = adapter.getMetadataCache();
ServerGeoObjectType parentType = ServerGeoObjectType.get(this.getParentTypeCode());
ServerGeoObjectType childType = ServerGeoObjectType.get(this.getChildTypeCode());
HierarchyType hierarchyType = cache.getHierachyType(this.getHierarchyTypeCode()).get();
String message = LocalizationFacade.getFromBundles("change.request.email.add.child");
message = message.replaceAll("\\{0\\}", this.getChildId());
message = message.replaceAll("\\{1\\}", childType.getLabel().getValue(Session.getCurrentLocale()));
message = message.replaceAll("\\{2\\}", this.getParentId());
message = message.replaceAll("\\{3\\}", parentType.getLabel().getValue(Session.getCurrentLocale()));
message = message.replaceAll("\\{4\\}", hierarchyType.getLabel().getValue(Session.getCurrentLocale()));
return message;
}
Aggregations