Search in sources :

Example 1 with MetadataCache

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;
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) HierarchyType(org.commongeoregistry.adapter.metadata.HierarchyType) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) MetadataCache(org.commongeoregistry.adapter.metadata.MetadataCache) RegistryAdapter(org.commongeoregistry.adapter.RegistryAdapter)

Example 2 with MetadataCache

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;
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) HierarchyType(org.commongeoregistry.adapter.metadata.HierarchyType) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) MetadataCache(org.commongeoregistry.adapter.metadata.MetadataCache) RegistryAdapter(org.commongeoregistry.adapter.RegistryAdapter)

Aggregations

ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)2 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)2 RegistryAdapter (org.commongeoregistry.adapter.RegistryAdapter)2 HierarchyType (org.commongeoregistry.adapter.metadata.HierarchyType)2 MetadataCache (org.commongeoregistry.adapter.metadata.MetadataCache)2