diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index e016d3d0870069ccef713ba523c35f38bea1d17e..8752963e7b2b0f7efeed05322086e6b251b27230 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -370,6 +370,19 @@ <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/objectrowid_param/valueProcess.js</valueProcess> <expose v="true" /> </entityParameter> + <entityField> + <name>USAGE_FILTER</name> + <title>Usage</title> + <consumer>Contexts</consumer> + </entityField> + <entityConsumer> + <name>Contexts</name> + <dependency> + <name>dependency</name> + <entityName>Context_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> @@ -422,6 +435,10 @@ <jDitoRecordFieldMapping> <name>FULL_ATTRIBUTE_NAME.value</name> </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>USAGE_FILTER.value</name> + <isFilterable v="true" /> + </jDitoRecordFieldMapping> </recordFieldMappings> </jDitoRecordContainer> </recordContainers> diff --git a/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js b/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js index e4fd9e63f9acbce13f072c6c5e3be46ed3285263..80d83fad229b4861db91aace94c85aeddfab0983 100644 --- a/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js @@ -86,7 +86,26 @@ if (vars.exists("$local.filter") && vars.get("$local.filter")) { var filter = vars.get("$local.filter"); if (filter.filter) - condition.andSqlCondition(JditoFilterUtils.getSqlCondition(filter.filter, "AB_ATTRIBUTE")); + condition.andSqlCondition(JditoFilterUtils.getSqlCondition(filter.filter, "AB_ATTRIBUTE", undefined, { + // special filter for usage + USAGE_FILTER : function (pValue, pOperator) + { + var cond = new SqlCondition(); + + switch (pOperator) + { + case "EQUAL": + return cond.andPrepare(["AB_ATTRIBUTEUSAGE", "OBJECT_TYPE", "attrUse"], pValue, "exists (select 1 from AB_ATTRIBUTEUSAGE attrUse where attrUse.AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID and # = ?)"); + case "NOT_EQUAL": + return cond.andPrepare(["AB_ATTRIBUTEUSAGE", "OBJECT_TYPE", "attrUse"], pValue, "not exists (select 1 from AB_ATTRIBUTEUSAGE attrUse where attrUse.AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID and # = ?)"); + case "ISNULL": + return cond.and("not exists (select 1 from AB_ATTRIBUTEUSAGE attrUse where attrUse.AB_ATTRIBUTE_ID = AB_ATTRIBUTEID)"); + case "ISNOTNULL": + return cond.and("exists (select 1 from AB_ATTRIBUTEUSAGE attrUse where attrUse.AB_ATTRIBUTE_ID = AB_ATTRIBUTEID)"); + } + return cond; + } + })); } var usages; @@ -163,6 +182,7 @@ function _buildAttributeTable (pAttributes, pUsages) } rowData[10] = _getFullName(rowData[1]); //parent full name rowData[11] = _getFullName(rowData[0], displaySimpleName); + rowData[12] = "dummy" sortedArray[rows[i].index] = rowData; } diff --git a/entity/Context_entity/Context_entity.aod b/entity/Context_entity/Context_entity.aod index 95285692f1ee0c680ec64642e56e851d99d2d4fc..efc6a9df140ce133be11b7ef49f3a71590897e32 100644 --- a/entity/Context_entity/Context_entity.aod +++ b/entity/Context_entity/Context_entity.aod @@ -22,6 +22,12 @@ <fieldName>Context</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>68f79479-52e5-42b1-81f5-bb725e032382</name> + <entityName>Attribute_entity</entityName> + <fieldName>Contexts</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityField> @@ -77,6 +83,10 @@ <name>ExclusiveContexts_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>UseExclusives_param</name> + <expose v="false" /> + </entityParameter> </children> </entityProvider> <entityParameter> @@ -134,6 +144,27 @@ <name>Whitelist</name> <expose v="true" /> </entityParameter> + <entityProvider> + <name>Exclusive</name> + <children> + <entityParameter> + <name>ExclusiveContexts_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>GetAllContexts_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>UseExclusives_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>Whitelist</name> + <expose v="false" /> + </entityParameter> + </children> + </entityProvider> </entityFields> <recordContainers> <jDitoRecordContainer>