summaryrefslogtreecommitdiff
path: root/DNPMPlugins/src/main/resources
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2023-03-10 09:24:12 +0100
committerPaul-Christian Volkmer2023-03-10 09:28:52 +0100
commit4b121482f1a8323ea23858e8118934be5d9aa54c (patch)
treeaee5e630082ae7a1f81fccdc0ebdaeefc950689c /DNPMPlugins/src/main/resources
parent9d66c42460dda63a6380ba0f30004fcd92a4f5c4 (diff)
Issue #5: Vorschlag für den Aufbau des Projekts
* Maven-Projekt direkt im Hauptverzeichnis * Anpassung der Maven-POM-Datei - nicht benötigte Abhängigkeiten entfernt * Gitignore-Datei angelegt
Diffstat (limited to 'DNPMPlugins/src/main/resources')
-rw-r--r--DNPMPlugins/src/main/resources/app/lib/umr/FormUtils.js201
-rw-r--r--DNPMPlugins/src/main/resources/de/itc/onkostar/library/moduleContext.xml20
-rw-r--r--DNPMPlugins/src/main/resources/onkostar-config.properties1
3 files changed, 0 insertions, 222 deletions
diff --git a/DNPMPlugins/src/main/resources/app/lib/umr/FormUtils.js b/DNPMPlugins/src/main/resources/app/lib/umr/FormUtils.js
deleted file mode 100644
index 7a8cbdd..0000000
--- a/DNPMPlugins/src/main/resources/app/lib/umr/FormUtils.js
+++ /dev/null
@@ -1,201 +0,0 @@
-class FormUtils {
-
- constructor(context) {
- this.context = context;
-
- if (!this.context.genericEditForm) {
- console.error('Context does not contain "genericEditForm". Please use "new FormUtils(this)" or methods will return undefined values!');
- }
- }
-
- /**
- * Returns field with given name from main form if it exists
- * @param fieldName
- * @returns {undefined|*}
- */
- getMainformField(fieldName) {
- if (this.context.genericEditForm) {
- const query = '[originalName=' + fieldName + ']';
- const fields = this.context.genericEditForm
- .query(query)
- .filter(e => e.ownerCt.xtype === 'form' || e.ownerCt.xtype === 'panel' && e.ownerCt.title.length !== 0);
-
- if (fields.length > 0) {
- return this.context.genericEditForm.down('#' + fields[0].id);
- }
- console.error('Field with name "' + fieldName + '" not found in main form!');
- }
- return undefined;
- }
-
- /**
- * Returns field with given field name found at given index within whole form.
- * @param fieldName
- * @param index
- * @returns {undefined|*}
- */
- getFieldAtIndex(fieldName, index) {
- if (this.context.genericEditForm) {
- const query = '[originalName=' + fieldName + ']';
- const fields = this.context.genericEditForm.query(query);
- if (fields.length > index) {
- return this.context.genericEditForm.down('#' + fields[index].id);
- }
- console.error('Field with name "' + fieldName + '" and index "' + index + '" not found!');
- }
- return undefined;
- }
-
- /**
- * Returns field with given field name found in section with given name.
- * @param fieldName
- * @param sectionName
- * @returns {undefined|*}
- */
- getFieldInSection(fieldName, sectionName) {
- if (this.genericEditForm) {
- const query = '[originalName=' + fieldName + ']';
- const fields = this.context.genericEditForm
- .query(query)
- .filter(e => e.ownerCt.xtype === 'panel' && e.ownerCt.ownerCt.originalName === sectionName);
- if (fields.length > 0) {
- return this.context.genericEditForm.down('#' + fields[0].id);
- }
- console.error('Field with name "' + fieldName + '" not found in section with name "' + sectionName + '"!');
- }
- return undefined;
- }
-
- /**
- * Returns value of field with given name from main form if it exists.
- * @param fieldName
- * @returns {undefined|*}
- */
- getMainformFieldValue(fieldName) {
- let mainformField = this.getMainformField(fieldName);
- if (mainformField) {
- return mainformField.getValue();
- }
- return undefined;
- }
-
- /**
- * Updates field with given name to given new value.
- * The field must reside in main form.
- * @param fieldName
- * @param newValue
- * @returns {undefined|*}
- */
- setMainformFieldValue(fieldName, newValue) {
- let mainformField = this.getMainformField(fieldName);
- if (mainformField) {
- return mainformField.setValue(newValue);
- }
- }
-
- /**
- * Returns value of field with given name in section with given name if it exists.
- * @param fieldName
- * @param sectionName
- * @returns {undefined|*}
- */
- getFieldValueInSection(fieldName, sectionName) {
- let sectionField = this.getFieldInSection(fieldName, sectionName);
- if (sectionField) {
- return sectionField.getValue();
- }
- return undefined;
- }
-
- /**
- * Updates field with given name in section with given name new value.
- * The field must reside in main form.
- * @param fieldName
- * @param sectionName
- * @param newValue
- * @returns {undefined|*}
- */
- setFieldValueInSection(fieldName, sectionName, newValue) {
- let sectionField = this.getFieldInSection(fieldName, sectionName);
- if (sectionField) {
- return sectionField.setValue(newValue);
- }
- }
-
- /**
- * Returns value of field with given field name found at given index within whole form.
- * @param fieldName
- * @param index
- * @returns {undefined|*}
- */
- getFieldValueAtIndex(fieldName, index) {
- let field = this.getFieldAtIndex(fieldName, index);
- if (field) {
- return field.getValue();
- }
- return undefined;
- }
-
- /**
- * Updates value of field with given field name found at given index within whole form.
- * @param fieldName
- * @param index
- * @param newValue
- * @returns {undefined|*}
- */
- setFieldValueAtIndex(fieldName, index, newValue) {
- let field = this.getFieldAtIndex(fieldName, index);
- if (field) {
- field.setValue(newValue);
- }
- }
-
- /**
- * Returns all values for all fields with given name.
- * @param fieldName
- * @returns {*|*[]}
- */
- getFieldValues(fieldName) {
- if (this.context.genericEditForm) {
- const query = '[originalName=' + fieldName + ']';
- const fields = this.context.genericEditForm.query(query);
- return fields.map(f => this.context.genericEditForm.down('#' + f.id).getValue());
- }
- return undefined;
- }
-
- /**
- * Counts blocks within given subform field name.
- * @param subformFieldName
- * @returns {undefined|*|number}
- */
- subformBlockCount(subformFieldName) {
- if (this.context.genericEditForm) {
- const query = '[originalName=' + subformFieldName + ']';
- const elements = this.context.genericEditForm.query(query);
-
- if (elements.length === 0) return 0;
-
- return elements
- .map(e => e.numberOfBlocks)
- .reduce((sum, num) => sum + num);
- }
- return undefined;
- }
-
- /**
- * Returns subform field names for given subform name.
- * @param subformName
- * @returns {undefined|*}
- */
- getSubformFieldNames(subformName) {
- if (this.context.genericEditForm) {
- const query = '[formName=' + subformName + ']';
-
- return Ext.ComponentQuery
- .query(query)
- .map(e => e.originalName);
- }
- return undefined;
- }
-} \ No newline at end of file
diff --git a/DNPMPlugins/src/main/resources/de/itc/onkostar/library/moduleContext.xml b/DNPMPlugins/src/main/resources/de/itc/onkostar/library/moduleContext.xml
deleted file mode 100644
index efcde36..0000000
--- a/DNPMPlugins/src/main/resources/de/itc/onkostar/library/moduleContext.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
-
- <bean id="DNPMHelper" class="DNPM.DNPMHelper" />
- <bean id="Merkmalskatalog" class="DNPM.Merkmalskatalog" />
- <bean id="ConsentManager" class="DNPM.ConsentManager" />
-
- <context:component-scan base-package="ATCCodes"/>
-
- <mvc:resources mapping="/app/lib/umr/**" location="classpath:/app/lib/umr/" />
-</beans> \ No newline at end of file
diff --git a/DNPMPlugins/src/main/resources/onkostar-config.properties b/DNPMPlugins/src/main/resources/onkostar-config.properties
deleted file mode 100644
index b546687..0000000
--- a/DNPMPlugins/src/main/resources/onkostar-config.properties
+++ /dev/null
@@ -1 +0,0 @@
-onkostar-api=2.11.1.1 \ No newline at end of file