private String loadPropertyValuesForRelation(String resourceRelationTableName, String resourceRelationFKName) { String propertyValues = loadPropertyValueQuery(); String relationPropertyValues = loadRelationPropertyValueQuery(resourceRelationTableName, resourceRelationFKName); return "(" + propertyValues + ") UNION ALL (" + relationPropertyValues + ")"; }
/** * Returns a list containing all existing GLOBAL PropertyTagEntities * @param sortDesc * @return */ public List<PropertyTagEntity> loadAllGlobalPropertyTagEntities(boolean sortDesc) { return loadAllPropertyTagEntities(sortDesc, PropertyTagType.GLOBAL); }
private String loadPropertyTypeValuesForRelation() { String propertyValues = loadPropertyTypeValueQuery(); String relationPropertyValues = loadRelationPropertyTypeValueQuery(); return "(" + propertyValues + ") UNION ALL (" + relationPropertyValues + ")"; }
private PropertyDescriptorEntity savePropertyDescriptorResourceType(ForeignableOwner editingOwner, Integer resourceTypeId, PropertyDescriptorEntity descriptor, String propertyTagsString) throws AMWException { ResourceTypeEntity attachedResourceType = entityManager.find(ResourceTypeEntity.class, resourceTypeId); ResourceTypeContextEntity resourceTypeContextEntity = attachedResourceType.getOrCreateContext(contextService.getGlobalResourceContextEntity()); return propertyDescriptorService.savePropertyDescriptorForOwner(editingOwner, resourceTypeContextEntity, descriptor, propertyTagEditingService.convertToTags(propertyTagsString), attachedResourceType); }
public void savePropertyDescriptorWithTags(PropertyDescriptorEntity propDesc, List<String> tags, ResourceEntity resourceEntity, ForeignableOwner owner) throws AMWException { ResourceContextEntity resourceContext = resourceEntity.getOrCreateContext(globalContext); List<PropertyTagEntity> propertyTags = createPropertyTags(tags); descriptorService.savePropertyDescriptorForOwner(owner, resourceContext, propDesc, propertyTags, resourceEntity); }
public PropertyDescriptorEntity getPropertyDescriptor(Integer propertyDescriptorId) { return propertyDescriptorService.getPropertyDescriptorWithTags(propertyDescriptorId); }
private String loadRelationPropertyDescriptorQuery(String resourceRelationTableName, String resourceRelationFKName) { String template = loadSQLFile("loadPropertyDescriptorsForResource.sql"); template = String.format(template, resourceRelationTableName, resourceRelationFKName, loadPropertyValuesForRelation(resourceRelationTableName, resourceRelationFKName)); return template; }
private List<DifferingProperty> getPropertyDefinedOnResource(ResourceEditRelation relation, ResourceEditProperty property, List<Integer> relevantContextIds, Origin origin) { Query query = queries.getPropertyOverviewForResourceQuery(property.getTechnicalKey(), relation.getSlaveId(), relevantContextIds); return getDifferingProperties(property, query, origin); }
private String loadRelationPropertyTypeValueQuery() { return loadSQLFile("loadPropertyValuesForResourceTypeRelation.sql"); }
/** * We don't expect an exception since encryption is allowed */ public void testManageChangeOfEncryptedPropertyDescriptorEncryptNotAuthorized() throws Exception { testManageChangeOfEncryptedPropertyDescriptor(Boolean.TRUE, false); }
/** * @return all available property types with validation logic */ public List<PropertyTypeEntity> getPropertyTypes() { return propertyTypeService.getPropertyTypes(); }
public List<PropertyEditingService.DifferingProperty> getPropertyOverviewForRelation(ResourceEditRelation relation, ResourceEditProperty property, List<ContextEntity> relevantContexts) { return propertyEditingService.getPropertyOverviewForRelation(relation, property, relevantContexts); } }
public List<PropertyTagEntity> getAllGlobalPropertyTags() { return propertyTagService.loadAllGlobalPropertyTagEntities(false); }
public List<PropertyEditingService.DifferingProperty> getPropertyOverviewForResource(ResourceEntity resourceEntity, ResourceEditProperty property, List<ContextEntity> relevantContexts) { return propertyEditingService.getPropertyOverviewForResource(resourceEntity, property, relevantContexts); }
public List<PropertyEditingService.DifferingProperty> getPropertyOverviewForResourceType(ResourceTypeEntity resourceTypeEntity, ResourceEditProperty property, List<ContextEntity> relevantContexts) { return propertyEditingService.getPropertyOverviewForResourceType(resourceTypeEntity, property, relevantContexts); }
private String loadPropertyValueQuery() { return loadSQLFile("loadPropertyValuesForResource.sql"); }
/** * We expect a @link{NotAuthorizedException} since the user tries to decrypt the property although permission is not given */ @Test(expected = NotAuthorizedException.class) public void testManageChangeOfEncryptedPropertyDescriptorDecryptNotAuthorized() throws Exception { testManageChangeOfEncryptedPropertyDescriptor(Boolean.FALSE, false); }
/** * Returns a list containing all existing LOCAL PropertyTagEntities * @param sortDesc * @return */ public List<PropertyTagEntity> loadAllLocalPropertyTagEntities(boolean sortDesc) { return loadAllPropertyTagEntities(sortDesc, PropertyTagType.LOCAL); }
private String loadPropertyTypeValueQuery() {return loadSQLFile("loadPropertyValuesForResourceType.sql"); }
private String loadRelationPropertyValueQuery(String resourceRelationTableName, String resourceRelationFKName) { String template = loadSQLFile("loadPropertyValuesForResourceRelation.sql"); template = String.format(template, resourceRelationTableName, resourceRelationFKName); return template; }