diff --git a/entity/LogHistory_entity/LogHistory_entity.aod b/entity/LogHistory_entity/LogHistory_entity.aod index 6499fc00e002942363effcb7f67696ae5849e409..b7abfc4219a2b8478201416b55233d42b5207737 100644 --- a/entity/LogHistory_entity/LogHistory_entity.aod +++ b/entity/LogHistory_entity/LogHistory_entity.aod @@ -39,6 +39,12 @@ <entityProvider> <name>LogHistoryProvider</name> <documentation>%aditoprj%/entity/LogHistory_entity/entityfields/loghistoryprovider/documentation.adoc</documentation> + <children> + <entityParameter> + <name>tablenames_param</name> + <documentation>%aditoprj%/entity/LogHistory_entity/entityfields/loghistoryprovider/children/tablenames_param/documentation.adoc</documentation> + </entityParameter> + </children> <dependencies> <entityDependency> <name>23dbfa51-5340-48e3-bd60-e0dcb7d44ad3</name> diff --git a/entity/LogHistory_entity/documentation.adoc b/entity/LogHistory_entity/documentation.adoc index 20fa16faa475bdb8b0cd35d7ddb11fe847f73e0e..b38670d44b72f1f2236c7f594c3f1935458061a3 100644 --- a/entity/LogHistory_entity/documentation.adoc +++ b/entity/LogHistory_entity/documentation.adoc @@ -2,5 +2,92 @@ Entity for the log entries in the individual modules. -This entity is based on the `AB_LOGHISTORY`-table. Note that this database table has no primary key associated to it. -This is because it is only a pit of log-record and not necessary. \ No newline at end of file +This entity is based on the `AB_LOGHISTORY`-table. + +== configure Loghistory + +:DATA_ALIAS: Data_alias +:EDITOR_ALIAS_DEFINITION: AliasDefinition-Editor + +=== the concept +//TODO: extend the concept description +Stoarge: Database-table: `AB_LOGHISTORY` + +Collecting Data: +---- +Audit -> process_audit -> Loghistory_lib: LogHistoryExecutor +---- + +Data is collected and pre-translated. Therefor only one Language can be applied for logging. +Because the loghistory is written via the auditing, only changes that are done with the proper Jdito-Methods will be logged. + +=== prerequisites + +Auditing has to be activated for all tables you want to log. + +.prerequisites of enabling Audit in general +* Auditing has to be enabled in your Server +* Auditing has to be enabled for your alias (default: +{DATA_ALIAS}+) +* Tables that shall be logged need some configs in the _{EDITOR_ALIAS_DEFINITION}_ +** property `idColumn` has to be set (a primary key is needed therefore) +** `auditMode` has to be set -Standard, -CLOB, or -BLOB (chosse the one you really need) + + +=== activate writing into loghistory + +Assuming that the + +* required database-tables exist +* JDito-processes already exist +* audit has been activated in general + +you are ready to configure _which_ column shall be logged and _how_. + +==== configure columns for logging + +There are several properties (custom and pre-exisiting) that can be set for configuring the logging: + +.configuration options per column +[options="header"] +|======= +|property |purpose |property-type +|+title+ |text that is used to display which column has been modified|pre-exisiting +|+log+ |defines whether a column needs to be logged or not; not exisisting equals `false` |custom: Booelan +|+tableRef+ |references table for automatically grouping data. This is usefull for ForeignKeys, e.g. a +OFFERITEM.OFFER_ID+ column could have a +tableRef+ "OFFER"|custom: String +|+primaryKey+ |this is not only used to enable auditing generally, but it's used to resolve +tableRef+ values correctly|pre-exisiting +|+keyword+ |defines a keyword contianer that should be used to transform a +KEYID+ into a display value|custom: String +|+autoMapTrueFalse4Log+ |if `true` the loghistory-executor tries to automatically translate a value into a "yes"/"no"-display value|custom: Booelan +|+translate4Log+ |defines a process to transform a technical value into a display value |custom: JDito +|======= + ++translate4Log+ is a mighty possibility to translate a ID-value into a displayvalue. However, you should keep several important things in mind: + +* translate text if necessary via the locale-parameter +* the process is called each time a change to that column is applied - keep it fast and simple + +.translate4Log example (skip imports for better readability) +[source,javascript] +---- +var params = Translate4LogParams.load();// <1> +var countryName = CountryUtils.getLatinNameByIso2(params.value, params.locale); // <2> +result.string(countryName);// <3> +---- +<1> load the parameters in a easy and fail-proof way +<2> locale is passed to the resolving function and in that function a translation is applied +<3> always return a string + +==== configure a consumer for retrieving the loghistory + +.Example for the +tablenames_param+ process +---- +import("system.vars"); +import("system.result"); +import("Context_lib"); + +var res = []; +res.push({id: vars.get("$field.CONTACTID"), tableNames: ["CONTACT", "COMMUNICATION", "ADDRESS", "AB_ATTRIBUTERELATION"]}); +res.push({id: vars.get("$field.PERSONID"), tableNames: ["PERSON"]}); + +res = JSON.stringify(res); +result.object(res); +---- \ No newline at end of file diff --git a/entity/LogHistory_entity/entityfields/loghistoryprovider/children/tablenames_param/documentation.adoc b/entity/LogHistory_entity/entityfields/loghistoryprovider/children/tablenames_param/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..3051d2df3f9362543da5347d37f36446eb4a924f --- /dev/null +++ b/entity/LogHistory_entity/entityfields/loghistoryprovider/children/tablenames_param/documentation.adoc @@ -0,0 +1,15 @@ += tablenames_param + +.Example +---- +import("system.vars"); +import("system.result"); +import("Context_lib"); + +var res = []; +res.push({id: vars.get("$field.CONTACTID"), tableNames: ["CONTACT", "COMMUNICATION", "ADDRESS", "AB_ATTRIBUTERELATION"]}); +res.push({id: vars.get("$field.PERSONID"), tableNames: ["PERSON"]}); + +res = JSON.stringify(res); +result.object(res); +---- \ No newline at end of file diff --git a/entity/LogHistory_entity/entityfields/loghistoryprovider/documentation.adoc b/entity/LogHistory_entity/entityfields/loghistoryprovider/documentation.adoc index 2712d5d5c6d4ad5349fc4f6539190503d2efa92d..4088dd1c6fa530aa4a30a142f1eb47d5ce7a7c1e 100644 --- a/entity/LogHistory_entity/entityfields/loghistoryprovider/documentation.adoc +++ b/entity/LogHistory_entity/entityfields/loghistoryprovider/documentation.adoc @@ -1,3 +1,5 @@ += LogHistoryProvider + Generic provider for log history entries. A filter for given _tablenames_ is applied, see the documentation of the parameters for an example. \ No newline at end of file diff --git a/neonContext/Offer/Offer.aod b/neonContext/Offer/Offer.aod index e8a6d8d34e56933b89b40bd124432ff6e1a89d0c..271bdfa9b499295cc511d6c1a464eb8afb50a3fd 100644 --- a/neonContext/Offer/Offer.aod +++ b/neonContext/Offer/Offer.aod @@ -44,5 +44,8 @@ <name>136dceaa-0eca-452a-9757-132fd54e8c55</name> <view>OfferPreviewMultiple_view</view> </neonViewReference> + <webserviceReference> + <name>277d4493-9a49-4e68-b00c-29d3d0e0b9d2</name> + </webserviceReference> </references> </neonContext> diff --git a/others/genJsdoc.bat b/others/genJsdoc.bat deleted file mode 100644 index db0775bbbb307e47f3b77efabb48da3851945d61..0000000000000000000000000000000000000000 --- a/others/genJsdoc.bat +++ /dev/null @@ -1,3 +0,0 @@ -SET mypath=%~dp0 - -jsdoc -r %mypath:~0,-1%\..\process -d %mypath:~0,-1%\jsdocOut \ No newline at end of file diff --git a/others/guide/CodingGuidelines.adoc b/others/guide/CodingGuidelines.adoc deleted file mode 100644 index 7fbd1bf92c5ecca6d93d8ffe076b933618cb861b..0000000000000000000000000000000000000000 --- a/others/guide/CodingGuidelines.adoc +++ /dev/null @@ -1,8 +0,0 @@ -= Sample Document -Doc Writer <doc.writer@asciidoc.org>; John Smith <john.smith@asciidoc.org> -v1.0, 2013-05-20: First draft -:title: Sample Document -:tags: [document, example] - - -Preamble... diff --git a/others/guide/CreateJsDoc.adoc b/others/guide/CreateJsDoc.adoc deleted file mode 100644 index d428b85c65aabfc70a1247a8a3a2e443811d571d..0000000000000000000000000000000000000000 --- a/others/guide/CreateJsDoc.adoc +++ /dev/null @@ -1,40 +0,0 @@ -How to build js-doc out of the lib-comments -=========================================== -:toc2: left -:numbered: - -== installation == -1. Nodejs: -https://nodejs.org/en/ -LTS-version (aktuell 10.15.0) - -download and install - -2. install jsdoc - -open CMD -[source] ----- -npm install -g jsdoc ----- - -== generate jsdoc == - -=== manually === -1. open CMD -2. navigate into the project-folder. e.g. -[source] ----- -C: -cd C:\Users\M.Mustermann\Documents\AditoProjects\xRM-Basic5.1 ----- -3. run command -[source] ----- -jsdoc -r process -d others\jsdocOut ----- -4. Open others\jsdocOut\index.html with a webbrowser - -=== with script in designer (Windows) === -1. In the Designer right click on others\genJsdoc.bat -> "Open in System" -2. Right click on others\jsdocOut\index.html -> "View" \ No newline at end of file diff --git a/others/guide/Loghistory.adoc b/others/guide/Loghistory.adoc deleted file mode 100644 index 6a2f284bf89acfae821ba92a33e572343952c9f3..0000000000000000000000000000000000000000 --- a/others/guide/Loghistory.adoc +++ /dev/null @@ -1,87 +0,0 @@ -configure Loghistory -==================== -:DATA_ALIAS: Data_alias -:EDITOR_ALIAS_DEFINITION: AliasDefinition-Editor - -== the concept == -//TODO: extend the concept description -Stoarge: Database-table: `AB_LOGHISTORY` - -Collecting Data: ----- -Audit -> process_audit -> Loghistory_lib: LogHistoryExecutor ----- - -Data is collected and pre-translated. Therefor only one Language can be applied for logging. -Because the loghistory is written via the auditing, only changes that are done with the proper Jdito-Methods will be logged. - -== prerequisites == - -Auditing has to be activated for all tables you want to log. - -.prerequisites of enabling Audit in general -* Auditing has to be enabled in your Server -* Auditing has to be enabled for your alias (default: +{DATA_ALIAS}+) -* Tables that shall be logged need some configs in the _{EDITOR_ALIAS_DEFINITION}_ -** property `idColumn` has to be set (a primary key is needed therefore) -** `auditMode` has to be set -Standard, -CLOB, or -BLOB (chosse the one you really need) - - -== activate writing into loghistory == - -Assuming that the - -* required database-tables exist -* JDito-processes already exist -* audit has been activated in general - -you are ready to configure _which_ column shall be logged and _how_. - -=== configure columns for logging === - -There are several properties (custom and pre-exisiting) that can be set for configuring the logging: - -.configuration options per column -[options="header"] -|======= -|property |purpose |property-type -|+title+ |text that is used to display which column has been modified|pre-exisiting -|+log+ |defines whether a column needs to be logged or not; not exisisting equals `false` |custom: Booelan -|+tableRef+ |references table for automatically grouping data. This is usefull for ForeignKeys, e.g. a +OFFERITEM.OFFER_ID+ column could have a +tableRef+ "OFFER"|custom: String -|+primaryKey+ |this is not only used to enable auditing generally, but it's used to resolve +tableRef+ values correctly|pre-exisiting -|+keyword+ |defines a keyword contianer that should be used to transform a +KEYID+ into a display value|custom: String -|+autoMapTrueFalse4Log+ |if `true` the loghistory-executor tries to automatically translate a value into a "yes"/"no"-display value|custom: Booelan -|+translate4Log+ |defines a process to transform a technical value into a display value |custom: JDito -|======= - -+translate4Log+ is a mighty possibility to translate a ID-value into a displayvalue. However, you should keep several important things in mind: - -* translate text if necessary via the locale-parameter -* the process is called each time a change to that column is applied - keep it fast and simple - -.translate4Log example (skip imports for better readability) -[source,javascript] ----- -var params = Translate4LogParams.load();// <1> -var countryName = CountryUtils.getLatinNameByIso2(params.value, params.locale); // <2> -result.string(countryName);// <3> ----- -<1> load the parameters in a easy and fail-proof way -<2> locale is passed to the resolving function and in that function a translation is applied -<3> always return a string - -=== configure a consumer for retrieving the loghistory === - -.Exampel for the +tablenames_param+ process ----- -import("system.vars"); -import("system.result"); -import("Context_lib"); - -var res = []; -res.push({id: vars.get("$field.CONTACTID"), tableNames: ["CONTACT", "COMMUNICATION", "ADDRESS", "AB_ATTRIBUTERELATION"]}); -res.push({id: vars.get("$field.PERSONID"), tableNames: ["PERSON"]}); - -res = JSON.stringify(res);//currently only strings can be passed as param -result.object(res); ----- \ No newline at end of file diff --git a/others/guide/PersonOrganisationContact.adoc b/others/guide/PersonOrganisationContact.adoc deleted file mode 100644 index 7d7a1b33f971b107ef28b8f4a6a5885a9e10a3f5..0000000000000000000000000000000000000000 --- a/others/guide/PersonOrganisationContact.adoc +++ /dev/null @@ -1,39 +0,0 @@ -Person, Organisation, Contact -============================= -:toc2: left -:numbered: - -== Differences to old Adito == - -The old Adito basic had: - -- Pers -- Org -- Relation - -They are not gone, just renamed: - -- Pers = Person -- Org = Organisation -- Relation = Contact - -TODO: doku erweitern -erson, Organisation, Contact -=========================================== -:toc2: left -:numbered: - -== Differences to old Adito == - -The old Adito basic had: - -- Pers -- Org -- Relation - -They are not gone, just renamed: - -- Pers = Person -- Org = Organisation -- Relation = Contact - diff --git a/others/guide/ProviderConsumerParameter.adoc b/others/guide/ProviderConsumerParameter.adoc deleted file mode 100644 index ee9ff59bc7d051dc069cd0ba1a409887036f8f8c..0000000000000000000000000000000000000000 --- a/others/guide/ProviderConsumerParameter.adoc +++ /dev/null @@ -1,92 +0,0 @@ -Provider - Consumer -=================== -:toc2: left -:numbered: - -=== Provider === -Is the old dfi. - -==== Purpose ==== -The provider provides access to an entity. -You can get data of another entity by connecting a consumer to a provider. - -==== Naming ==== -The names should provide information about *what the provider provides*. - -For example: -Communication_entity has 3 providers: - -- *AllCommunications* -- *EmailCommunications* -- *PhoneCommunications* - -If you connect to *AllCommunications* you get *all* communication types of a contact. -If you connect to *EmailCommunications* you get *only the Email* communication type of a contact. -If you connect to *PhoneCommunications* you get *only the Phone* communication type of a contact. - -*Important:* -*Do not always create a new provider when connecting a new entity. Maybe you can use an already existing provider.* -*Try to reuse providers if you need similar data for two dependencies* - -=== Consumer === -Is the old dfo. - -=== Purpose === -The Consumer *consumes* the data a provider provides. -It can be connected to a provider and fill the parameters of the provider. - -=== Naming === -Most of the time you get a list of "something" so you should call it the plural of what you get. - -Example: -Persons -Organisations - -If you have two Consumer to the same Entity, you should use speaking names. - -Example: -Documents (e.g. for all documents of a person) -MainDocuments (e.g. for only the main documents of a person) - -If you know you get only one row, you can use the singular. - -Example: -Person - -=== Parameter === -Parameters provide a way to tell a provider *what exactly you need*. - -==== Properties ==== -The most important properties are -code, exposed, triggerRecalculation and mandatory - -Parameters work with a fallback mechanism. -This means that if you set the code on the parameter directly then this is executed *only if you did not* provide the code on the parameter at the *provider* and/or *consumer*. -Likewise if you set the code on a parameter at the provider it will only be executed if a *consumer* which connects to this provider *has no code set* at the parameter. - -Here some examples for the *code* property: - -[options="header"] -|======================================================================================================================================================================================================================================================== -| Parameter | Provider | Consumer | Result | Notes -| default | default | default | Nothing executed | -| default | default | code set | Code from consumer executed | This is the mostly used scenario. -| default | code set | default | Code from provider executed | This is used if you need a default value for a parameter which is different on each provider. e.g. used by the Document_entity to determine if it should show main documents or not. -| code set | default | default | Code from parameter executed | -|======================================================================================================================================================================================================================================================== - -The checkbox-parameters can have *three* states: default, checked, unchecked. Default means the property is *gray* and the value from the previous instance is used. Checked and unchecked overwrite always the previous instance. - -The exposed property is a way to decide if a parameter should be visible by the next instance -Here some examples for the *exposed* property: - -[options="header"] -|======================================================================================================================================================== -| Parameter | Provider | Result | Notes -| default | default | NOT Exposed | because the default for exposed is: NOT exposed. -> the parameter won't be visible on the provider and consumer! -| set | set | Exposed | This means that the parameter can be set by the consumer. -| set | UNset | NOT Exposed | This will disable the parameter for one specific provider. -| set | default | Exposed | -|======================================================================================================================================================== - -*Note that there are currently (13.02.2019) some bugs and the handling of parameters with the default #PROVIDER may change.* \ No newline at end of file diff --git a/others/guide/TargetContext.adoc b/others/guide/TargetContext.adoc deleted file mode 100644 index 1d466a0da9c53953491cf301711f745d6d8478e4..0000000000000000000000000000000000000000 --- a/others/guide/TargetContext.adoc +++ /dev/null @@ -1,19 +0,0 @@ -Target Context -============== - -toc2: left -:numbered: - -== What? == -The target context is for forwarding the preview and the klick-action to another context. - -== Why? == -For example the ObjectRelation entity uses this feature to open the linked object directly. - -== Where? == -It is configured by two properties of the providers. - -* targetContextField -* targetIdField - -You can provide an entity-field for each of them which contains the contextId (currently the contextName 13.02.2019) and the rowId (UID) which should be used to open the preview or main view. \ No newline at end of file diff --git a/others/guide/how to write JDito code.adoc b/others/guide/how to write JDito code.adoc deleted file mode 100644 index 9dbbdb19d290d4cffad377c7a19ea1354a52d536..0000000000000000000000000000000000000000 --- a/others/guide/how to write JDito code.adoc +++ /dev/null @@ -1,261 +0,0 @@ -How to wirte JDito code -======================= -:toc2: left -:numbered: - -== basics == -* Keep everything english. Every title, caption, messages, comments, etc. should be english. Add german translation to the languages if necessary. -* in JavaScript-Strings use `"` instead of `'` - even if its only 1 character. `'` is for SQL (within JS-Strings) -* Parameters should start with p. - -== code structure == -=== vars and others (var, let) === -* avoid `let` as much as possible because you cannot debug these variables - -=== brackets === -* `{` are placed on a new line - -Example: -[source,javascript] ----- -for (i = 0, i < dataLen; i++) -{ - //code here -} - -myArray.forEach(function(pItem) -{ - // Do something -}); ----- - -=== loops === -nested loops should be defined with replicated indexer variables. -Therefore it's easy to see in which level of the counter you are. -Even better would be a good and describing name. - -Example: -[source,javascript] ----- -for (i = 0, i < dataLen; i++) -{ - for (ii = 0, ii < dataLen[i].length; ii++) - { - //code... - } -} - -for (row = 0, row < dataLen; row++) -{ - for (col = 0, col < dataLen[row].length; col++) - { - //code... - } -} ----- - - -== Functions - overview of different "types" == -This sections covers how to define different "types" of functions in libraries. - -=== by using static methods === -This will be mostly utility functions where there is no need to instantiate an object. You'll need this probably the most time. - --> Static object with static functions. - - -Definition: -[source,javascript] ----- -/** - * provides static methods for validation of communication data - * do not create an instance of this - * @static - * @class - */ -function CommValidationUtil(){}<1> - -/** - * returns a blueprint for validation extensions; these extensions are needed for validating comm data and can be passed to other functions - * @return {object} a object with properties that have a specific default value; normally you want to overwrite that value - */ -CommValidationUtil.getExtensionsBlueprint = function() <2> -{ - return { - countryCode: null - }; -} ----- -<1> the function-object that keeps everything together - this function should never be actually called (no direct call, no indirect call) -<2> an actual function that can be called - -And how to use it: -[source,javascript] ----- -import("Comm_lib"); - -var additionals = CommValidationUtil.getExtensionsBlueprint(); ----- - -=== by creating an object with functions === - -You may want to hold data and create objects where methods share that data. - -Here is an example for an object that can be created: -[source,javascript] ----- -/** - * object that provides featrues for a single keyword attribute; initalizes itself on creation with a specific keyword-attribute - * - * @param {String} pContainerName specifies the type of the keyword and therefore the list elements; - * e.g. "COUNTRY"; use an entry of the $KeywordRegistry here - * @param {String} pAttributeName the name of the keyword attribute that shall be initalized - * @param {String} [pDefault=undefined] the default value -> Does not throw an error, if default value exists. - * - * @class - */ -function KeywordAttribute(pContainerName, pAttributeName, pDefault) -{ - this.container = pContainerName; - this.attribute = pAttributeName; - this.defaultValue = pDefault; - - var keywordAttrData = newSelect("AB_KEYWORD_ATTRIBUTE.AB_KEYWORD_ATTRIBUTEID, AB_KEYWORD_ATTRIBUTE.KIND") - .from("AB_KEYWORD_ATTRIBUTE") - .where("AB_KEYWORD_ATTRIBUTE.CONTAINER", pContainerName) - .and("AB_KEYWORD_ATTRIBUTE.NAME", pAttributeName) - .arrayRow(); - - if (keywordAttrData.length > 0) - { - this.id = keywordAttrData[0]; - this.type = keywordAttrData[1]; - this.dbField = this.type.trim(); - } - else if(pDefault == undefined) - { - throw new Error(translate.withArguments("no keyword attribute \"%0\" found in keyword container \"%1\"", [this.attribute, this.container])); - } -} - -/** - * get the value for a specific keyId. - * Error if the keyword container does not have the attribute at all (you can check this with .exists()) - * Error if the attribute does not exist at the provided keyId and you have not specified a default - * - * @param {String} pKeyId the keyId - * - * @return {String} the loaded value (or the default) - */ -KeywordAttribute.prototype.getValue = function(pKeyId) -{ - if (this.exists()) - { - var attrValue = newSelect(this.dbField) - .from("AB_KEYWORD_ENTRY") - .join("AB_KEYWORD_ATTRIBUTERELATION", "AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID = AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID") - .where("AB_KEYWORD_ENTRY.CONTAINER", this.container) - .and("AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ATTRIBUTE_ID", this.id) - .and("AB_KEYWORD_ENTRY.KEYID", pKeyId) - .cell(); - - if (attrValue) - return attrValue; - - if (this.defaultValue) - return this.defaultValue; - - throw new Error(translate.withArguments("no keyword attribute \"%0\" found in keyword \"%1\" from container \"%2\"", [this.attribute, pKeyId, this.container])); - } - else if (this.defaultValue == undefined) - throw new Error(translate.withArguments("no keyword attribute \"%0\" found in keyword container \"%1\"", [this.attribute, this.container])); - else - return this.defaultValue; -} - -/** - * get a SqlBuilder object for this keyword attribute. You can easily add additional conditions to it. - * - * @return {SqlBuilder} a SqlBuilder which contains a select for the entry-id's, joins to entry and attribute - * and conditions for the container and the attribute-name. - */ -KeywordAttribute.prototype.getSqlBuilderSelect = function() -{ - return newSelect("AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID") - .from("AB_KEYWORD_ATTRIBUTERELATION") - .join("AB_KEYWORD_ENTRY", "AB_KEYWORD_ENTRYID = AB_KEYWORD_ENTRY_ID", "attrEntry") - .join("AB_KEYWORD_ATTRIBUTE", "AB_KEYWORD_ATTRIBUTEID = AB_KEYWORD_ATTRIBUTE_ID") - .where(["AB_KEYWORD_ENTRY", "CONTAINER", "attrEntry"], this.container) - .and("AB_KEYWORD_ATTRIBUTE.NAME", this.attribute) -} - -/** - * check if the Container can have the attribute. - * @return {Boolean} true if it exists, false if not - */ -KeywordAttribute.prototype.exists = function() -{ - return this.id != undefined && this.type != undefined && this.dbField != undefined; -} - ----- - -=== private functions === - - -Private functions would be possible but make everything much more complicate. -So just start your functions / methods name with a _ if you need private methods. - ---> do not use functions which start with a _ outside of the class! - -Add @ignore to the comment of those functions to prevent showing them in the generated jsdoc. - -== JS-Doc == - -<1> JS-Doc comment: http://usejsdoc.org/ -<2> jsdoc-blocks have to start with /** otherwise JSDoc cannot generate a documentation -<3> use the correct form for optional/required parameters: http://usejsdoc.org/tags-param.html -Optional parameter: [alias=the current alias] -Required parameter: alias -Classes: @class -[source,javascript] ----- -/** - * Description... - * ... - * - * @param {String} [pAlias=the current alias] the database alias where the condition shall be executed later (important for column types of preparedStatements) - * @example Here is an example - * @class - */ -function SqlCondition(pAlias) -{ -... -} ----- -<4> examples are useful on more complex functions -<5> constructor function; init properties (do not set functions ("methods") here!) -<6> add functions ("methods") to the prototype, they are available through the prototype chain - -And how to use it (normally you'd want to use preparedStatements but for the sake of an easy example it's a bit shorter here) -See also HowToSqlConditionLib.adoc for a full documentation. -[source,javascript] ----- -import("system.vars"); -import("system.result"); -import("Sql_lib"); -import("Comm_lib"); - -var cond = new SqlCondition(); - -var mediumIds = CommExtensions.getContextualMediumIds(); -if (mediumIds.length > 0) - cond.and("COMM.MEDIUM_ID in (" + mediumIds.join(", ") + ")"); - -var idVal = vars.get("$local.idvalue"); -if (uids.length > 0) - cond.and("COMM.COMMID = '" + idVal + "' "); - -result.string(cond.toString("COMM.OPTIONAL = 't'")); ----- - diff --git a/others/guide/instanceableLibExample.adoc b/others/guide/instanceableLibExample.adoc deleted file mode 100644 index 66dfc0a312e467be87afcf97921691c4e8f61090..0000000000000000000000000000000000000000 --- a/others/guide/instanceableLibExample.adoc +++ /dev/null @@ -1,62 +0,0 @@ -= Example for a instanceable Lib = -:toc2: left -:numbered: - -Remember to always change the comments to fit your class! + -Use speaking names for ALL variables, classes and functions! - -[source,javascript] ----- -import("..."); - -/** - * instanceable example Utility class; - * - * @param {String} pParam1 is for ... - * - * @example var myUtil = new UtilClass("-"); - * @class - */ -function UtilClass(pParam1) -{ - // here is the constructor. - // create class variables like this: - this.myVariable = pParam1; -} - -/** - * a public function - * - * @param {String} pParam1 is for ... - * @param {String} pParam2 is for ... - * - * @example var myResult = myUtil.myFunction("p1", "p2"); - * - * @return {String} a result - */ -UtilClass.prototype.myFunction = function(pParam1, pParam2) -{ - return this._privateStaticFunction1(pParam1, pParam2, this.myVariable); -} - -/** - * a private function - * - * @param {String} pParam1 is for ... - * @param {String} pParam2 is for ... - * @param {String} pParam3 is for ... - * - * @return {String} a result - * @ignore - */ -UtilClass.prototype._myPrivateFunction = function(pParam1, pParam2, pParam3) -{ - if(pParam1 && pParam2 && pParam3) - { - ... - return pParam1 + pParam3 + pParam2; - } - - return ""; -} ----- \ No newline at end of file diff --git a/others/guide/staticLibExample.adoc b/others/guide/staticLibExample.adoc deleted file mode 100644 index d48e2eba91fc0a15fd515826424dbf631ede54e4..0000000000000000000000000000000000000000 --- a/others/guide/staticLibExample.adoc +++ /dev/null @@ -1,57 +0,0 @@ -= Example for a static Lib = -:toc2: left -:numbered: - -Remember to always change the comments to fit your class! + -Use speaking names for ALL variables, classes and functions! - -[source,javascript] ----- -import("..."); - -/** - * a static Example Utility class - * - * Do not create an instance of this! - * @class - */ -function ExampleUtils() {} // leave this function empty! A constructor is not needed for static functions. - -/** - * a public static function - * - * @param {String} pParam1 is for ... - * @param {String} pParam2 is for ... - * - * @example var myResult = ExampleUtils.staticFunction1("p1", "p2"); - * - * @return {String} a result - */ -ExampleUtils.staticFunction1 = function(pParam1, pParam2) -{ - return this._privateStaticFunction1(pParam1, pParam2, "-") -} - -/** - * a private static function - * - * Do not use outside of ExampleUtils! - * - * @param {String} pParam1 is for ... - * @param {String} pParam2 is for ... - * @param {String} pParam3 is for ... - * - * @return {String} a result - * @ignore - */ -ExampleUtils._privateStaticFunction1 = function(pParam1, pParam2, pParam3) -{ - if(pParam1 && pParam2 && pParam3) - { - ... - return pParam1 + pParam3 + pParam2; - } - - return ""; -} ----- \ No newline at end of file diff --git a/others/guide/whichDatatype.adoc b/others/guide/whichDatatype.adoc deleted file mode 100644 index 092ae1bf6ae5c02d56ced4bf133b5e956a8f23e2..0000000000000000000000000000000000000000 --- a/others/guide/whichDatatype.adoc +++ /dev/null @@ -1,105 +0,0 @@ -Overview over datatypes -======================= -:toc2: left -:numbered: - -This is a simple overview about when to to use which datatype. - -== Boolean == -=== Datatype === ----- -TINYINT ----- -=== Usage === -0 => false -1 => true - -Add nullable="false" constraint, because for boolean null makes no sense and complicates searches and validations. - -== Text == -Text should be saved as Unicode. For this prefix the datatype with a 'N' (there are some exceptions like the UUID) - -=== Big text === -For informations, descriptions, ... ----- -NCLOB ----- - -=== Small / Normal text === -For Names, ... - -You have to define the maximum length. ----- -NVARCHAR(50) ----- - -=== Fixed size text === -If you are sure that the length is always fixed and will not change. - -You have to define the length. ----- -NCHAR(5) ----- - -=== UUID's, standardized codes === -For them unicode is mostly not needed. Only use unicode here if you are sure, it is needed. - -For UUID's, standardized codes (language codes), ... - -You have to define the length. ----- -CHAR(5) ----- - -UUID needs length 36: ----- -CHAR(36) ----- - -=== Decimal numbers === -If precision and fixed decimals (Nachkommastellen) are needed, use DECIMAL. -For prices, ... ----- -NUMERIC(10, 2) ----- - -Else you can use double. ----- -DOUBLE ----- - -=== Integer numbers === -In normal cases just use INTEGER - -If you know that very big integers or only very small Integers are needed, you can also use - -Byte count may not be the same on all databases. - -8 Byte - ----- -BIGINT ----- - -4 Byte - ----- -INTEGER ----- - -2 Byte - ----- -SMALLINT ----- - -1 Byte - ----- -TINYINT ----- - -=== Binary data === ----- -BLOB ----- \ No newline at end of file diff --git a/process/Neon_lib/Neon_lib.aod b/process/Neon_lib/Neon_lib.aod index ace4a1e8ec19c194c1d9e00326013f3656cd35b4..6c99555616cb23f3c63162b338d9d03a4fb86a04 100644 --- a/process/Neon_lib/Neon_lib.aod +++ b/process/Neon_lib/Neon_lib.aod @@ -2,6 +2,7 @@ <process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Neon_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/process/Neon_lib/documentation.adoc</documentation> <process>%aditoprj%/process/Neon_lib/process.js</process> <variants> <element>LIBRARY</element> diff --git a/others/guide/how to copy objects with subitems.adoc b/process/Neon_lib/documentation.adoc similarity index 100% rename from others/guide/how to copy objects with subitems.adoc rename to process/Neon_lib/documentation.adoc