Skip to content
Snippets Groups Projects
Commit b0a37e2d authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

filter attributes for usage

parent 269366bc
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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;
}
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment