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

Split Classification into two entities. One for admin one for usage

parent 83095e54
No related branches found
No related tags found
No related merge requests found
Showing
with 316 additions and 59 deletions
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.6">
<name>ClassificationAdmin_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<icon>VAADIN:LIST_OL</icon>
<title>Classification</title>
<grantView v="true" />
<grantCreate v="false" />
<grantUpdate v="false" />
<grantDelete v="false" />
<contentTitleProcess>%aditoprj%/entity/ClassificationAdmin_entity/contentTitleProcess.js</contentTitleProcess>
<usePermissions v="true" />
<titlePlural>Classifications</titlePlural>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
<title>Usage</title>
<consumer>KeywordClassificationTypes</consumer>
<displayValueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/uid/displayValueProcess.js</displayValueProcess>
</entityField>
<entityConsumer>
<name>ClassificationsAdmin</name>
<dependency>
<name>dependency</name>
<entityName>Classification_entity</entityName>
<fieldName>ClassificationsAdministration</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>KeywordClassificationTypes</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/ClassificationAdmin_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<recordFields>
<element>UID.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.6">
<name>ClassificationAdmin_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<icon>VAADIN:LIST_OL</icon>
<title>Classification</title>
<grantDeleteProcess>%aditoprj%/entity/ClassificationAdmin_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/ClassificationAdmin_entity/contentTitleProcess.js</contentTitleProcess>
<titlePlural>Classifications</titlePlural>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
<title>Usage</title>
<consumer>KeywordClassificationTypes</consumer>
<displayValueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/uid/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>CLASSIFICATIONID</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CLASSIFICATIONSCORE_ID</name>
<title>Selection</title>
<consumer>ClassificationScores</consumer>
<searchable v="false" />
<titleProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationscore_id/titleProcess.js</titleProcess>
<displayValueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationscore_id/displayValueProcess.js</displayValueProcess>
</entityField>
<entityParameter>
<name>ClassificationType_param</name>
<expose v="true" />
<mandatory v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>ObjectType_param</name>
<expose v="true" />
<mandatory v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>ObjectRowid_param</name>
<expose v="true" />
<mandatory v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>CLASSIFICATIONTYPEID</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationtypeid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CLASSIFICATIONGROUP</name>
<contentType>TEXT</contentType>
<groupable v="true" />
<mandatoryProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroup/mandatoryProcess.js</mandatoryProcess>
<dropDownProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroup/dropDownProcess.js</dropDownProcess>
<textInputAllowed v="true" />
<searchable v="false" />
<titleProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroup/titleProcess.js</titleProcess>
<displayValueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroup/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroup/onValidation.js</onValidation>
</entityField>
<entityField>
<name>CLASSIFICATIONTYPE_ID</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationtype_id/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OBJECT_ROWID</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/object_rowid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OBJECT_TYPE</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/object_type/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
<name>KeywordClassificationTypes</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>ClassificationScores</name>
<state>EDITABLE</state>
<dependency>
<name>dependency</name>
<entityName>ClassificationScore_entity</entityName>
<fieldName>ClassificationScores</fieldName>
</dependency>
<children>
<entityParameter>
<name>ClassificationGroup_param</name>
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationscores/children/classificationgroup_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>ClassificationTypeId_param</name>
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationscores/children/classificationtypeid_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>ClassificationType_param</name>
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationscores/children/classificationtype_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>CLASSIFICATIONTYPE</name>
<title>Usage</title>
<consumer>KeywordClassificationTypes</consumer>
<groupable v="true" />
<mandatory v="true" />
<searchable v="true" />
<stateProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationtype/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationtype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationtype/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>SCORETYPE</name>
<title>Scoretype</title>
<mandatory v="true" />
<displayValueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/scoretype/displayValueProcess.js</displayValueProcess>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<isFilterable v="true" />
<isRequireContainerFiltering v="true" />
<contentProcess>%aditoprj%/entity/ClassificationAdmin_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<onInsert>%aditoprj%/entity/ClassificationAdmin_entity/recordcontainers/jdito/onInsert.js</onInsert>
<onUpdate>%aditoprj%/entity/ClassificationAdmin_entity/recordcontainers/jdito/onUpdate.js</onUpdate>
<onDelete>%aditoprj%/entity/ClassificationAdmin_entity/recordcontainers/jdito/onDelete.js</onDelete>
<recordFields>
<element>UID.value</element>
<element>CLASSIFICATIONID.value</element>
<element>CLASSIFICATIONGROUP.value</element>
<element>CLASSIFICATIONSCORE_ID.value</element>
<element>CLASSIFICATIONTYPEID.value</element>
<element>CLASSIFICATIONTYPE_ID.value</element>
<element>OBJECT_TYPE.value</element>
<element>OBJECT_ROWID.value</element>
<element>SCORETYPE.value</element>
<element>CLASSIFICATIONTYPE.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.translate");
import("system.result");
result.string(translate.text(vars.get("$this.value")));
\ No newline at end of file
......@@ -3,10 +3,10 @@ import("system.neon");
import("system.vars");
import("system.db");
import("system.result");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.IsAdminMode_param") && vars.get("$param.IsAdminMode_param") == "1")
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
// use param if available or current selectionRows
var classificationType = vars.get("$field.CLASSIFICATIONTYPE")
var classificationType = vars.get("$field.CLASSIFICATIONTYPE")
if (classificationType)
result.object(ClassificationUtils.getAllGroups(classificationType, true));
}
\ No newline at end of file
import("system.neon");
import("system.result");
import("system.vars");
result.object(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT);
\ No newline at end of file
......@@ -5,7 +5,7 @@ import("system.vars");
import("Classification_lib");
import("Entity_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && vars.exists("$param.IsAdminMode_param") && vars.get("$param.IsAdminMode_param") == "1")
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
{
var newGroup = ProcessHandlingUtils.getOnValidationValue();
......
import("system.neon");
import("system.translate");
import("system.vars");
import("system.result");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
result.string(translate.text("Group"));
}
else
{
result.string(translate.text("Group name"));
}
\ No newline at end of file
import("system.translate");
import("Sql_lib");
import("system.db");
import("system.result");
// TODO: loadEntity / #Title
result.string(translate.text(db.cell(SqlCondition.begin()
.andPrepareVars("CLASSIFICATIONSCORE.CLASSIFICATIONSCOREID", "$field.CLASSIFICATIONSCORE_ID")
.buildSql("select TITLE from CLASSIFICATIONSCORE", "1=2"))));
\ No newline at end of file
import("system.neon");
import("system.result");
import("system.vars");
import("system.translate");
if (vars.get("$sys.recordstate") && vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW)
{
result.string(translate.text(vars.get("$field.SCORETYPE")));
}
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.CLASSIFICATIONGROUP"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(1);
\ No newline at end of file
result.string(vars.get("$field.CLASSIFICATIONTYPE"))
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.CLASSIFICATIONTYPEID"));
\ No newline at end of file
import("system.result");
import("system.vars");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.string(KeywordUtils.getViewValue($KeywordRegistry.classificationType(), vars.get("$this.value")));
\ No newline at end of file
import("system.neon");
import("system.result");
import("system.neon");
import("system.vars");
if (vars.exists("$param.IsAdminMode_param") && vars.getString("$param.IsAdminMode_param") == "1")
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
else
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
result.string(neon.COMPONENTSTATE_READONLY);
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
result.string(vars.get("$param.ClassificationType_param"));
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if ((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) && !vars.get("$this.value"))
{
result.string(vars.get("$field.CLASSIFICATIONTYPEID"));
}
\ No newline at end of file
import("system.util");
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
var newId = util.getNewUUID();
result.string(newId);
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && !vars.get("$this.value"))
{
result.string(vars.get("$param.ObjectRowid_param"));
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && !vars.get("$this.value"))
{
result.string(vars.get("$param.ObjectType_param"));
}
\ No newline at end of file
import("system.vars");
import("system.translate");
import("system.result");
result.string(translate.text(vars.get("$this.value")));
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.db");
import("system.vars");
import("Sql_lib");
logging.log(db.cell(SqlCondition.begin()
.andPrepare("CLASSIFICATION.CLASSIFICATIONTYPE_ID", vars.get("$field.CLASSIFICATIONTYPEID"))
.buildSql("select count(*) from CLASSIFICATION", "1=2")))
result.object(parseInt(db.cell(SqlCondition.begin()
.andPrepare("CLASSIFICATION.CLASSIFICATIONTYPE_ID", vars.get("$field.CLASSIFICATIONTYPEID"))
.buildSql("select count(*) from CLASSIFICATION", "1=2"))) <= 0);
//{
/*db.deleteData("CLASSIFICATION", "CLASSIFICATION.CLASSIFICATIONTYPE_ID in (" + db.translateStatement(
SqlCondition.begin()
.andPrepare("CLASSIFICATIONTYPE.SCORETYPE", type)
.buildSql("select CLASSIFICATIONTYPE.CLASSIFICATIONTYPEID from CLASSIFICATIONTYPE", "1=2")) + ")");
db.deleteData("CLASSIFICATIONTYPE", SqlCondition.equals("CLASSIFICATIONTYPE.SCORETYPE", type, "1=2"));
db.deleteData("CLASSIFICATIONSCORE", SqlCondition.equals("CLASSIFICATIONSCORE.SCORETYPE", type, "1=2"));*/
//}
//neon.refreshAll();
\ No newline at end of file
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