diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 7b3c237ecf4f029d4ecac06e14dcfefba15d2269..75c71b883609f89ed79cc092c9690cd17ec8e896 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -88,6 +88,7 @@ </entry> <entry> <key>Claim task</key> + <value>Aufgabe annehmen</value> </entry> <entry> <key>Finished tasks</key> @@ -8041,6 +8042,12 @@ Bitte Datumseingabe prüfen</value> <entry> <key>PermissionCalendar_entity.PermissionCalendarJDito.onUpdate: AB_PERMISSIONCALENDARID or UID and OBJECT_TYPE and PERMISSIONDEALER_ID is not set.</key> </entry> + <entry> + <key>Workflow signal</key> + </entry> + <entry> + <key>Signals</key> + </entry> <entry> <key>PermissionCalendar_entity.PermissionCalendarJDito.onUpdate: PERMISSION is not set.</key> </entry> @@ -8063,6 +8070,9 @@ Bitte Datumseingabe prüfen</value> <key>ReadWritePermission</key> <value>Lese- und Schreibberechtigung</value> </entry> + <entry> + <key>Context</key> + </entry> <entry> <key>Permission Dealer</key> <value>Rechtegeber</value> @@ -8074,6 +8084,9 @@ Bitte Datumseingabe prüfen</value> <key>LimitedReadPermission</key> <value>eingeschränkte Leseberechtigung</value> </entry> + <entry> + <key>Signal</key> + </entry> <entry> <key>Permission Dealer User</key> <value>Rechtegeber Benutzer</value> @@ -8081,6 +8094,9 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Berechtigungen</key> </entry> + <entry> + <key>Claim task</key> + </entry> <entry> <key>permission dealer type</key> <value>Rechtegeber Typ</value> @@ -8089,6 +8105,9 @@ Bitte Datumseingabe prüfen</value> <key>ReadPermission</key> <value>volle Leseberechtigung</value> </entry> + <entry> + <key>Scope</key> + </entry> <entry> <key>permission procurer type</key> <value>Rechteempfänger Typ</value> @@ -8100,6 +8119,9 @@ Bitte Datumseingabe prüfen</value> <entry> <key>PermissionCalendar_entity.PermissionCalendarJDito.onDelete: This operation isn't allowed.</key> </entry> + <entry> + <key>Claim date</key> + </entry> <entry> <key>Auf eigenen Benutzer kann keine Berechtigung gesetzt werden!</key> </entry> diff --git a/process/ActivityTask_lib/process.js b/process/ActivityTask_lib/process.js index d0536720851457d268c4621d4c2962e8ade47c45..8b47036ae72278c5eee854102ea827dbebe8fc0f 100644 --- a/process/ActivityTask_lib/process.js +++ b/process/ActivityTask_lib/process.js @@ -1,4 +1,3 @@ -import("Binary_lib"); import("system.vars"); import("system.util"); import("system.datetime"); @@ -7,6 +6,7 @@ import("system.neon"); import("system.db"); import("system.translate"); import("system.eMath"); +import("Binary_lib"); import("Util_lib"); import("Sql_lib"); import("Keyword_lib"); @@ -16,8 +16,9 @@ import("Report_lib"); import("Context_lib"); /** - * Methods used by for activities (former history). - * Do not create an instance of this! + * Methods used by for activities (former history).<br> + * <p> + * <b><u>Do not create an instance of this!</u></b> * * @class */ @@ -25,37 +26,47 @@ function ActivityUtils() {} /** * Create a new activity within the database-scope. - * This funciton will insert a complete new activity into the Database - * - * @param {Object} [pDataPreset={}] an object that contains the data for the activity, you do not need to specify any preset data at all, - * but you CAN define the following properties: - * <ul> - * <li>activityId</li> - * <li>responsibleContactId</li> - * <li>categoryKeywordId</li> - * <li>directionKeywordId</li> - * <li>subject</li> - * <li>content</li> - * <li>userNew</li> - * <li>entrydate</li> - * </ul> - * @param {Array} [pActivityLinks] 2D array where each element is an array of Contextname and objectid, for example: - * <pre>[["Organisation", "2d1e505c-a75a-4fa6-826b-7224a97d5b51"]]</pre> - * @param {Array} [pDocuments] 2D array where each element is an array of: - * <ul> - * <li>document-name</li> - * <li>document-content(base64-string)</li> - * <li>true/false if it's mainDocument or not</li> - * </ul> - * for example: - * <pre>[["number.txt", "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> - * @param {String} [pDbAlias=current db alias] database alias where the activity shall be inserted - * @param {Date} [pDateNew] The Date which one is in the DB the DATE_NEW + * This funciton will insert a complete new activity into the database. * - * @return {Object} js object where the following are filled: - * <ul> - * <li>activityId</li> - * </ul> + * @param {Object} pDataPreset={} (optional) <p> + * An object that contains the data for the activity, you <br> + * do not need to specify any preset data at all, but you <br> + * 'CAN' define the following properties: + * <ul> + * <li>activityId</li> + * <li>responsibleContactId</li> + * <li>categoryKeywordId</li> + * <li>directionKeywordId</li> + * <li>subject</li> + * <li>content</li> + * <li>userNew</li> + * <li>entrydate</li> + * </ul> + * @param {Array} pActivityLinks (optional) <p> + * 2D array where each element is an array of<br> + * context name and objectid, for example: + * <br><pre>[["Organisation", + * "2d1e505c-a75a-4fa6-826b-7224a97d5b51"]]</pre> + * @param {Array} pDocuments (optional) <p> + * 2D array where each element is an array of: + * <ul> + * <li>document-name</li> + * <li>document-content(base64-string)</li> + * <li>true/false (If it's mainDocument or not)</li> + * </ul> + * <i><u>For example:</u></i> + * <pre>[["number.txt", + * "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> + * @param {String} pDbAlias (optional) <p> + * Database alias where the activity shall be inserted.<br> + * If no one is explicit given, it takes the current one. + * @param {Date} pDateNew (optional) <p> + * The date which one is in the db the 'DATE_NEW'. + * @return {Object} <p> + * Object where the following are filled: + * <ul> + * <li>activityId</li> + * </ul> */ ActivityUtils.insertNewActivity = function(pDataPreset, pActivityLinks, pDocuments, pDbAlias, pDateNew) { @@ -112,17 +123,20 @@ ActivityUtils.insertNewActivity = function(pDataPreset, pActivityLinks, pDocumen }; /** - * inserts documents for an activity + * Inserts documents for an activity. * - * @param {String} pActivityId activity id - * @param {Array} pDocuments 2D array where each element is an array of: - * <ul> - * <li>document-name</li> - * <li>document-content(base64-string)</li> - * <li>true/false if it's mainDocument or not</li> - * </ul> - * for example: - * <pre>[["number.txt", "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> + * @param {String} pActivityId <p> + * The activity id which shall be inserted. + * @param {Array} pDocuments <p> + * 2D array where each element is an array of: + * <ul> + * <li>document-name</li> + * <li>document-content(base64-string)</li> + * <li>true/false if it's mainDocument or not</li> + * </ul> + * <i><u>For example:</u></i> + * <pre>[["number.txt", + * "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> */ ActivityUtils.insertDocuments = function (pActivityId, pDocuments) { @@ -138,45 +152,75 @@ ActivityUtils.insertDocuments = function (pActivityId, pDocuments) /** - * Creates a new Activity, this will _not_ insert a new Activity into the database but will open the Activity context in "new" mode and - * presets several fields instead + * Creates a new activity, this will <b><u>not</u></b> insert a + * new activity into the database but will open the activity + * context in "new" mode and presets several fields instead * - * @param {String} [pRowId] rowid of an record that is linked automatically, as object the current context is used, so this needs to be an ID of - * the current context. Useful whenever you create an Activity from another Object (e.g. an Organisation) and that - * other object shall be linked automatically. There will be no check performed if your given context and id are possible - * values in the ActivityLinks. Specifing nothing (e.g. null) will result in not automatically linking your current - * context - * @param {Array} [pAdditionalLinks] Links that shall be added but are not from an "your curren context view"(see pRowId-param). pAdditionalLinks is a - * two dimensional array where each elemt in the array is in the form of [objectType, objectRowId] - * @param {String} [pParentContext] name of a context that shall be specified as a parent record. The relation between child an parent is: - * 1 parent : n childs; only a fre Contexts are possible parents, e.g.: - * a Task may have other Tasks or Activities as children. - * The pParentContext and pParentId both need to bet set, otherwise no parent will be set - * @param {String} [pParentId] id of record (that is of the given type in pParentContext) which shall be specified as a parent record; see - * pParentContext param - * @param {String} [pSubject] subject text which is set as preset in the Activity - * @param {String} [pInfo] description text which is set as preset in the Activity - * @param {String} [pDirection] direction key (keyword keyid) of the direction which is set as preset in the Activity; consider using $KeywordRegistry - * @param {Object} [pDocuments] 2D array where each element is an array of: - * <ul> - * <li>document-name</li> - * <li>document-content(base64-string)</li> - * <li>true/false if it's mainDocument or not</li> - * </ul> - * for example: - * <pre>[["number.txt", "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> + * @param {String} pRowId (optional) <p> + * Row id of an record that is linked automatically, as <br> + * object the current context is used, so this needs to be <br> + * an id of the current context. Useful whenever you create <br> + * an activity from another object (e.g. an organisation)<br> + * and that other object shall be linked automatically. <br> + * There will be no check performed if your given context <br> + * and id are possible values in the activity-links.<br> + * Specifing nothing (e.g. null) will result in not <br> + * automatically linking your current context<br> + * @param {Array} pAdditionalLinks (optional) <p> + * Links that shall be added but are not from an "your curren<br> + * context view" (see pRowId-param). pAdditionalLinks is a two<br> + * dimensional array where each elemt in the array is in the<br> + * form of [objectType, objectRowId]<br> + * @param {String} pParentContext (optional) <p> + * The relation between child an parent is:<br> + * - 1 parent : n childs (only a fre Contexts are possible parents)<br> + * <p> + * <u><i>For example:</i></u><br> + * A task may have other tasks or activities as children.<br> + * The pParentContext and pParentId both need to bet set,<br> + * otherwise no parent will be set.<br> + * @param {String} pParentId (optional) <p> + * Id of record (that is of the given type in pParentContext)<br> + * which shall be specified as a parent record; see<br> + * pParentContext param.<br> + * @param {String} pSubject (optional) <p> + * Subject text which is set as preset in the activity.<br> + * @param {String} pInfo (optional) <p> + * Description text which is set as preset in the activity.<br> + * @param {String} pDirection (optional) <p> + * Direction key (keyword keyid) of the direction<br> + * which is set as preset in the Activity;<br> + * consider using <u><i>$KeywordRegistry</u></i>.<br> + * @param {Object} pDocuments (optional) <p> + * 2D array where each element is an array of: + * <ul> + * <li>document-name</li> + * <li>document-content(base64-string)</li> + * <li>true/false if it's mainDocument or not</li> + * </ul> + * For example: + * <pre>[["number.txt", + * "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> * @static * @example - * var content; //will be filled with letter-file as base64 encoded string + * var content; + * //will be filled with letter-file + * //as base64 encoded string * ..... * var links = []; * if (contactId) * { - * var context = ContactUtils.getContextByContactId(contactId); - * links.push([context, contactId]); + * var context = ContactUtils. + * getContextByContactId(contactId); + * links.push([context, contactId]); * } - * ActivityUtils.createNewActivity(vars.get("$sys.uid"), links, null, null, translate.text("Letter"), translate.text("Outgoing letter was sent."), - * $KeywordRegistry.activityDirection$outgoing(), [["Letter.docx", content, false]]); + * ActivityUtils.createNewActivity( + * vars.get("$sys.uid"), + * links, null, null, + * translate.text("Letter"), + * translate.text("Outgoing letter was sent."), + * $KeywordRegistry.activityDirection$outgoing(), + * [["Letter.docx", content, false]]); */ ActivityUtils.createNewActivity = function(pRowId, pAdditionalLinks, pParentContext, pParentId, pSubject, pInfo, pDirection, pDocuments) { @@ -194,11 +238,12 @@ ActivityUtils.createNewActivity = function(pRowId, pAdditionalLinks, pParentCont }; /* - * Gets the date of the last activity + * Gets the date of the last activity. * - * @param {String} pRowId the rowid of the dataset - * - * @return {number|null} the date of the last actvity as long + * @param {String} pRowId <p> + * The rowid of the dataset.<br> + * @return {Number|null} <p> + * The date of the last actvity as long. */ ActivityUtils.getLastActivityDate = function(pRowId) { @@ -218,17 +263,35 @@ ActivityUtils.getLastActivityDate = function(pRowId) } /** - * add the links to the link-table in new mode + * Add the links to the link-table in new mode. * - * @return {String} pObjectIdField jdito Field for the objectId - * @return {String} pRowIdField jdito Field for the rowId - * @return {String} pAdditionalLinksField jdito Field for additional links + * @param {String} pObjectIdField <p> + * JDito field for the object id.<br> + * @param {String} pRowIdField <p> + * JDito field for the row id.<br> + * @param {String} pAdditionalLinksField <p> + * JDito field for the additional link.<br> + * @param {String} pParentContextField <p> + * JDito field for the parent context.<br> + * @param {String} pParentIdField <p> + * JDito field for the parent id.<br> */ -ActivityUtils.addLinkRecords= function(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField) +ActivityUtils.addLinkRecords = function(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField) { _ActivityTaskUtils._addLinkRecords(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField, "Links"); } +/** + * Checks whether the given object has activities. + * + * @param {String} pRowId <p> + * JDito field for the object id.<br> + * @param {String} pObjectType <p> + * JDito field for the row id.<br> + * @return {Boolean} <p> + * Returns <i><b>false</b></i> if there are no linked tasks<br> + * for this object and <i><b>true</b></i> if there are linked tasks.<br> + */ ActivityUtils.hasActivities = function (pRowId, pObjectType) { if (pRowId && pObjectType) @@ -246,7 +309,15 @@ ActivityUtils.hasActivities = function (pRowId, pObjectType) } /** - * creates links for an activity + * Creates links for an activity.<br> + * In the database table 'ACTIVITYLINK'. + * + * @param {String} pActivityId <p> + * The id of the activity.<br> + * @param {String} pObjectType <p> + * The type of the object.<br> + * @param {String} pRowId <p> + * The id of the row.<br> */ ActivityUtils.insertLink = function (pActivityId, pObjectType, pRowId) { @@ -258,6 +329,7 @@ ActivityUtils.insertLink = function (pActivityId, pObjectType, pRowId) "USER_NEW", "DATE_NEW" ]; + var linkVals = [ util.getNewUUID(), pActivityId, @@ -266,45 +338,71 @@ ActivityUtils.insertLink = function (pActivityId, pObjectType, pRowId) vars.get("$sys.user"), vars.get("$sys.date") ]; + db.insertData("ACTIVITYLINK", linkCols, null, linkVals); } /** - * Methods used by for tasks. - * Do not create an instance of this! + * Methods used by for tasks.<br> + * <b><u>Do not create an instance of this!</u></b> * * @class */ function TaskUtils () {} /** - * Creates a new Task, this will _not_ insert a new Task into the database but will open the Task context in "new" mode and - * preset several fields instead + * Creates a new task, this will <u><i>not</i></u> insert + * a new task into the database but will open the task + * context in "new" mode and preset several fields instead. * - * @param {String} [pRowId] rowid of an record that is linked automatically, as object the current context is used, so this needs to be an ID of - * the current context. Useful whenever you create an Task from another Object (e.g. an Organisation) and that - * other object shall be linked automatically. There will be no check performed if your given context and id are possible - * values in the TaskLinks. Specifing nothing (e.g. null) will result in not automatically linking your current - * context - * @param {Array} [pAdditionalLinks] Links that shall be added but are not from an "your curren context view"(see pRowId-param). pAdditionalLinks is a - * two dimensional array where each elemt in the array is in the form of [objectType, objectRowId] - * @param {String} [pParentContext] name of a context that shall be specified as a parent record. The relation between child an parent is: - * 1 parent : n childs; only a fre Contexts are possible parents, e.g.: - * a Task may have other Tasks or Activities as children. - * The pParentContext and pParentId both need to bet set, otherwise no parent will be set - * @param {String} [pParentId] id of record (that is of the given type in pParentContext) which shall be specified as a parent record; see - * pParentContext param - * @param {Object} [pParams] additional params that are bypassed to the Task-context as key-value pairs. If you set a param that is - * populated within another function parameter (e.g. the parent-parameters) the value of pParams will be discarded and the - * value of the "other function parameter" (e.g. the parent-parameter) will be used - * @param {Object} [pDocuments] 2D array where each element is an array of: - * <ul> - * <li>document-name</li> - * <li>document-content(base64-string)</li> - * <li>true/false if it's mainDocument or not</li> - * </ul> - * for example: - * <pre>[["number.txt", "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> + * @param {String} pRowId (optional) <p> + * Row id of an record that is linked automatically,<br> + * as object the current context is used, so this needs<br> + * to be an id of the current context. Useful whenever<br> + * you create an Task from another Object (e.g. an organisation)<br> + * and that other object shall be linked automatically.<br> + * There will be no check performed if your given context and<br> + * id are possible values in the TaskLinks. Specifing nothing<br> + * (e.g. null) will result in not automatically linking your current<br> + * context.<br> + * @param {Array} pAdditionalLinks (optional) <p> + * Links that shall be added but are not from an "your<br> + * curren context view" (see pRowId-param).<br> + * pAdditionalLinks is a two dimensional array<br> + * where each elemt in the array is in the form<br> + * of [objectType, objectRowId].<br> + * @param {String} pParentContext (optional) <p> + * Name of a context that shall be specified as a<br> + * parent record. The relation between child an parent is:<br> + * <p> + * <i>- 1 parent : n childs (only a fre contexts are possible parents)</i><br> + * <p> + * <u><i>For example:</i></u><br> + * A task may have other tasks or activities as children.<br> + * The pParentContext and pParentId both need to bet set,<br> + * otherwise no parent will be set.<br> + * @param {String} pParentId (optional) <p> + * Id of record (that is of the given type in pParentContext)<br> + * which shall be specified as a parent record; see pParentContext<br> + * param. + * @param {Object} pParams (optional) <p> + * Additional params that are bypassed to the task<br> + * context as key-value pairs. If you set a param that is<br> + * populated within another function parameter<br> + * (e.g. the parent-parameters) the value of<br> + * pParams will be discarded and the value of the<br> + * "other function parameter" (e.g. the<br> + * parent-parameter) will be used.<br> + * @param {Object} pDocuments (optional) <p> + * 2D array where each element is an array of: + * <ul> + * <li>document-name</li> + * <li>document-content(base64-string)</li> + * <li>true/false if it's mainDocument or not</li> + * </ul> + * <p><u><i>For example:</i></u> + * <pre>[["number.txt", + * "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> * @static * @example * ..... @@ -327,7 +425,15 @@ TaskUtils.createNewTask = function(pRowId, pAdditionalLinks, pParentContext, pPa } /** - * Create a new task + * Checks whether a record <i><u>(e.g.: person or company)</u></i> <br>with the given parameters has linked tasks or not. + * + * @param {String} pRowId <p> + * The id of the row. (e.g. contact id) + * @param {String} pObjectType <p> + * The type of the object (e.g.: Organisation). + * @return {Boolean} <p> + * Returns <i><b>false</b></i> if there are no linked tasks<br> + * for this object and <i><b>true</b></i> if there are linked tasks.<br> */ TaskUtils.hasTasks = function(pRowId, pObjectType) { @@ -347,24 +453,52 @@ TaskUtils.hasTasks = function(pRowId, pObjectType) else return true; } - +/** + * Returns the name of the icon, to the given status. + * Which can used in a icon process. + * + * @param {String} pStatus <p> + * The status, from which you want the icon back.<br> + * @return {String} <p> + * The name of the icon. (e.g.: "VAADIN:PEOPLE") + */ TaskUtils.getStatusIcon = function(pStatus) { return KeywordUtils.getAttributeRelation(pStatus, $KeywordRegistry.taskStatus(), "icon", "NEON:STATUS_NOT_STARTED"); } /** - * add the links to the link-table in new mode + * Add the links to the link-table in new mode. * - * @return {String} pObjectIdField jdito Field for the objectId - * @return {String} pRowIdField jdito Field for the rowId - * @return {String} pAdditionalLinksField jdito Field for additional links + * @param {String} pObjectIdField <p> + * JDito field for the object id.<br> + * @param {String} pRowIdField <p> + * JDito field for the row id.<br> + * @param {String} pAdditionalLinksField <p> + * Description<br> + * @param {String} pParentContextField <p> + * Description<br> + * @param {String} pParentIdField <p> + * Description<br> + * @return {String} <p> + * JDito field for additional links.<br> */ -TaskUtils.addLinkRecords= function(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField) +TaskUtils.addLinkRecords = function(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField) { _ActivityTaskUtils._addLinkRecords(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField, "Links"); } +/** + * Returns the number of tasks, to the given object, which are open. + * + * @param {String} pRowId <p> + * The row id of the object (e.g. contact id). + * @param {String} pObjectType <p> + * The object type (e.g. "Organisation") + * @return {Integer} <p> + * Returns an Integer which represents the number<br> + * of, open tasks to the before given object. + */ TaskUtils.getOpenTaskCount = function(pRowId, pObjectType) { var taskCount = newSelect("count(*)") @@ -379,7 +513,9 @@ TaskUtils.getOpenTaskCount = function(pRowId, pObjectType) } /** - * @return all status keyIds which indicate a ended task + * Returns all status key ids which indicate a ended task. + * + * @return {Array} */ TaskUtils.getEndedStatuses = function() { @@ -388,7 +524,7 @@ TaskUtils.getEndedStatuses = function() /** * Methods used by for tasks. - * Do not create an instance of this! + * <b><u>Do not create an instance of this!</u></b> * * @ignore * @private @@ -397,27 +533,55 @@ TaskUtils.getEndedStatuses = function() function _ActivityTaskUtils() {} /** - * Helper function which creates a new activity/task-like objects like Activity, Task or SupportTicket. - * This will _not_ insert a new record into the database but will open the corresponding context in "new" mode and presets several fields instead + * Helper function which creates a new activity/task-like objects like Activity, Task or SupportTicket.<br> + * This will <b><i>not</i></b> insert a new record into the database but will open the corresponding context in<br> + * "new" mode and presets several fields instead. * - * @param {String} pContext Name of the Context that shall be opened ("Task", "Activity", etc.) - * @param {String} [pRowId] rowid of an record that is linked automatically, as object the current context is used, so this needs to be an ID of - * the current context. Useful whenever you create an Activity/Task from another Object (e.g. an Organisation) and that - * other object shall be linked automatically. There will be no check performed if your given context and id are possible - * values in ActivityLinks/TaskLinks. Specifing nothing (e.g. null) will result in not automatically linking your current - * context - * @param {Array} [pAdditionalLinks] Links that shall be added but are not from an "your curren context view"(see pRowId-param). pAdditionalLinks is a - * two dimensional array where each elemt in the array is in the form of [objectType, objectRowId] - * @param {String} [pParentContext] name of a context that shall be specified as a parent record. The relation between child an parent is: - * 1 parent : n childs; only a fre Contexts are possible parents, e.g.: - * a Task may have other Tasks or Activities as children. - * The pParentContext and pParentId both need to bet set, otherwise no parent will be set - * Links of parent will be added automatically used as preset - * @param {String} [pParentId] id of record (that is of the given type in pParentContext) which shall be specified as a parent record; see - * pParentContext param - * @param {Object} [pParams] additional params that are bypassed to the context that is opened as key-value pairs. If you set a param that is - * populated within another function parameter (e.g. the parent-parameters) the value of pParams will be discarded and the - * value of the "other function parameter" (e.g. the parent-parameter) will be used + * @param {String} pContext <p> + * Name of the Context that shall be opened ("Task", "Activity", etc.) + * @param {String} pRowId (optional) <p> + * Row id of an record that is linked automatically,<br> + * as object the current context is used,<br> + * so this needs to be an id of.<br> + * the current context. Useful whenever<br> + * you create an Activity/Task from <br> + * another Object (e.g. an Organisation) + * and that other object shall be linked <br> + * automatically. There will be no check <br> + * performed if your given context <br> + * and id are possible values in <br> + * ActivityLinks/TaskLinks. Specifing nothing <br> + * (e.g. null) will result in not <br> + * automatically linking your current context. + * @param {Array} pAdditionalLinks (optional) <p> + * Links that shall be added but are not from <br> + * an "your curren context view"(see pRowId-param).<br> + * pAdditionalLinks is a two dimensional array where <br> + * each element in the array is in the form of<br> + * [objectType, objectRowId]. + * @param {String} pParentContext (optional) <p> + * Name of a context that shall be specified as <br> + * a parent record. The relation between child an <br> + * parent is:<br> + * <p> + * <i>1 parent : n childs (only a free contexts are possible parents)</i> + * <i><u>For example:</i></u> + * A task may have other tasks or activities as children. + * The pParentContext and pParentId both need to bet set,<br> + * otherwise no parent will be set links of parent will <br> + * be added automatically used as preset.<br> + * @param {String} pParentId (optional) <p> + * Id of record (that is of the given type in pParentContext)<br> + * which shall be specified as a parent record<br> + * (see pParentContext param).<br> + * @param {Object} pParams (optional) <p> + * Additional params that are bypassed to the context <br> + * that is opened as key-value pairs. If you set a <br> + * param that is populated within another function <br> + * parameter (e.g. the parent-parameters) the value <br> + * of pParams will be discarded and the value of the <br> + * "other function parameter" (e.g. the parent-parameter)<br> + * will be used. * * @ignore * @private @@ -450,13 +614,22 @@ _ActivityTaskUtils._createNew = function(pContext, pRowId, pAdditionalLinks, pPa }; /** - * add the links to the link-table in new mode + * Add the links to the link-table in new mode. * - * @return {String} pObjectIdField jdito Field for the objectId - * @return {String} pRowIdField jdito Field for the rowId - * @return {String} pAdditionalLinksField jdito Field for additional links - * - * @ignore + * @param {String} pObjectIdField <p> + * JDito field for the object id.<br> + * @param {String} pRowIdField <p> + * JDito field for the row id.<br> + * @param {String} pAdditionalLinksField <p> + * JDito field for the additional link.<br> + * @param {String} pParentContextField <p> + * JDito field for the parent context.<br> + * @param {String} pParentIdField <p> + * JDito field for the parent id.<br> + * @param {String} pConsumerName <p> + * Name of the consumer.<br> + * + * @ignore */ _ActivityTaskUtils._addLinkRecords = function(pObjectIdField, pRowIdField, pAdditionalLinksField, pParentContextField, pParentIdField, pConsumerName) { diff --git a/process/AddressEntity_lib/process.js b/process/AddressEntity_lib/process.js index ffb472671a854f7a114a3a8480380bcbaa2c4aea..8255690161ec155b4c0ae679e6cf2dd7d06d5007 100644 --- a/process/AddressEntity_lib/process.js +++ b/process/AddressEntity_lib/process.js @@ -13,11 +13,14 @@ import("system.vars"); function AddressEntityValidation(){} /** - * check if the field, this function is called in is a mandatory field of the country + * Check if the field, this function is called in is a mandatory field of the country. * - * @param {String} pCountryCode iso code of the country of the field whoes standard values should be checked - * @param {String} [pField=undefined] if provided use this field else use $this.name - * @return {Boolean} + * @param {String} pCountryCode <p> + * ISO code of the country of the field which<br> + * standard values should be checked.<br> + * @param {String} pField=undefined (optional) <p> + * If provided use this field else use $this.name<br> + * @return {Boolean} <p> */ AddressEntityValidation.isMandatoryField = function(pCountryCode, pField) { @@ -37,9 +40,10 @@ AddressEntityValidation.isMandatoryField = function(pCountryCode, pField) }; /** - * return the shorthand for an field name + * Return the shorthand for an field name. * - * @return {String} ADDRESS: A, CITY: C, STATE: S, ZIP: Z + * @return {String} <p> + * ADDRESS: A, CITY: C, STATE: S, ZIP: Z */ AddressEntityValidation.mapFieldToShorthand = function(fieldName) { diff --git a/process/Address_lib/process.js b/process/Address_lib/process.js index ab96ff44aba00e918364a3285ef68eff07439b95..53efa4e9f4899e4078c3be0362aaf56256d9d13a 100644 --- a/process/Address_lib/process.js +++ b/process/Address_lib/process.js @@ -1,10 +1,10 @@ -import("Employee_lib"); import("system.swing"); import("system.text"); import("system.db"); import("system.logging"); import("system.vars"); import("system.translate"); +import("Employee_lib"); import("Attribute_lib"); import("Sql_lib"); import("Util_lib"); @@ -12,28 +12,32 @@ import("DocumentTemplate_lib"); // TODO: muss überarbeitet werden / evtl neu gemacht werden + /* -* Creates a Address Object +* Creates a address object. * -* @param {String} pContactId req relationid for which address should be retrieved -* @param {String} pAddressId opt addressid for which address should be retrieved -* @param {boolean} pPerson whether the address is from a person, not an organisation -* -* @return {String} the formatted address +* @param {String} pContactId <p> +* Relation id for which address should be retrieved.<br> +* @param {Boolean} pPerson <p> +* Whether the address is from a person, not an organisation.<br> +* @param {String} pAddressId (optional) <p> +* Address id for which address should be retrieved.<br> +* @return {String} <p>The formatted address. */ - function AddrObject(pContactId, pPerson, pAddressId) { this.Data = fetchAddressData([pContactId], [new Placeholder("", Placeholder.types.ADDRESSFORMAT, "")], pAddressId, pPerson); this.fmt = this.Data[0][0][26]; /* - * creates a formatted address - * - * @param {boolean} pCountry whether the country should be displayed - * @param {String} pFormat a fixed format for the address + * Creates a formatted address. * - * @return {String} formatted address + * @param {Boolean} pCountry <p> + * Whether the country should be displayed or not.<br> + * @param {String} pFormat <p> + * A fixed format for the address.<br> + * <p> + * @return {String} Formatted address.<br> */ this.getFormattedAddress = function( pCountry, pFormat ) { @@ -43,16 +47,20 @@ function AddrObject(pContactId, pPerson, pAddressId) } /* -* creates address data +* Returns address data. * -* @param {String} pCondition req SQL-Where-Condition -* @param {Object []} pConfig req ( name, functionality, details ) -* @param {String} pSenderID opt UserRelationID -* @param {String} pAddressID opt addressid -* -* @return {[]} Daten +* @param {String} pCondition <p> +* SQL-where-condition.<br> +* @param {Object[]} pConfig <p> +* Name, functionality, details.<br> +* @param {String} pSenderID (optional) <p> +* User relation id.<br> +* @param {String} pAddressID (optional) <p> +* Address id.<br> +* @return {Array} <p> +* The address data. */ -function getAddressesData( pCondition, pConfig, pSenderID, pAddressID) +function getAddressesData(pCondition, pConfig, pSenderID, pAddressID) { var returndata = []; var senderconfig = []; @@ -99,30 +107,37 @@ function getAddressesData( pCondition, pConfig, pSenderID, pAddressID) } /* -* creates -* -* @param {String} pCondition req SQL-Where-Condition -* @param {Placeholder[]} pConfig req array of placeholders -* @param {String} AddressID opt addressid -* @param {boolean} pPerson opt if person -* @param {boolean} pOrganisation opt if organisation +* Returns address data. * -* @return {[]} Daten +* @param {String} pCondition <p> +* SQL-where-condition.<br> +* @param {Placeholder[]} pConfig <p> +* Array of placeholders.<br> +* @param {String} AddressID (optional) <p> +* Address id.<br> +* @param {Boolean} pPerson (optional) <p> +* If its person.<br> +* @return {Array} <p> +* The address data. */ -function getAddressData( pCondition, pConfig, AddressID, pPerson) +function getAddressData(pCondition, pConfig, AddressID, pPerson) { - return setAddressData( fetchAddressData( pCondition, pConfig, AddressID, pPerson) ); + return setAddressData( fetchAddressData(pCondition, pConfig, AddressID, pPerson) ); } /* -* reads data from the database +* Reads data from the database. * -* @param {String} pCondition req SQL-Where-Condition -* @param {Placeholder[]} pConfig req array of placeholders -* @param {String} AddressID opt addressid -* @param {boolean} pPerson opt if person -* -* @return {Array} 2d-Array, structure: [[ data, output, header, addrfields ]] +* @param {String} pCondition <p> +* SQL-where-condition.<br> +* @param {Placeholder[]} pConfig <p> +* Array of placeholders.<br> +* @param {String} AddressID (optional) <p> +* Address id.<br> +* @param {Boolean} pPerson (optional) <p> +* If person.<br> +* @return {Array} <p> +* 2d-Array, structure: [[ data, output, header, addrfields ]]. */ function fetchAddressData( pCondition, pConfig, AddressID, pPerson) { @@ -249,13 +264,14 @@ function fetchAddressData( pCondition, pConfig, AddressID, pPerson) } /* -* reads data from the database -* -* @param {String [[]]} pData req array of data +* Reads data from the database. * -* @return {String [[]]} data +* @param {String [[]]} pData <p> +* Array of data.<br> +* @return {String [[]]} <p> +* Data.<br> */ -function setAddressData( pData ) +function setAddressData(pData) { var sqlresult = pData[0]; var data = []; @@ -291,13 +307,14 @@ function setAddressData( pData ) } return data; } -/* -* -* returns formatted address data -* -* @param {String [[]]} pData req data + +/** +* Returns formatted address data. * -* @return {String [[]]} formatted data +* @param {String [[]]} pData <p> +* Address data which shall be formatted.<br> +* @return {String [[]]} <p> +* Formatted data.<br> */ function _getAddrData( pData ) { @@ -335,11 +352,12 @@ function _getAddrData( pData ) } /* -* returns a formatted salutation +* Returns a formatted salutation. * -* @param {String} pSalutCode req salutation code -* -* @return {String} translated salutation +* @param {String} pSalutCode <p> +* Salutation code.<br> +* <p> +* @return {String} Translated salutation.<br> */ function _getSalutation( pSalutCode ) { @@ -362,11 +380,12 @@ function _getSalutation( pSalutCode ) } /* -* returns country names -* -* @param {String} pCountryCode req countrycode +* Returns country names. * -* @return {String} translated countryname +* @param {String} pCountryCode <p> +* Country code. +* <p> +* @return {String} Translated country name. */ function _getCountryName(pCountryCode) { @@ -382,13 +401,16 @@ function _getCountryName(pCountryCode) } /* -* returns a formatted address +* Returns a formatted address. * -* @param {String [[]]} pAddrData req Address data -* @param {String} pFormat opt given format -* @param {boolean} pCountry if the country should be displayed -* -* @return {String} formatted address +* @param {String [[]]} pAddrData <p> +* Address data.<br> +* @param {String} pFormat (optional) <p> +* Given format.<br> +* @param {Boolean} pCountry <p> +* If the country should be displayed.<br> +* <p> +* @return {String} Formatted address.<br> */ function _formatAddrData( pAddrData, pFormat, pCountry ) { @@ -435,13 +457,16 @@ function _formatAddrData( pAddrData, pFormat, pCountry ) } /* -* returns the new format -* -* @param {String [[]]} pAddrData req Daten -* @param {String} pFormat req the format string -* @param {boolean} pCountry if the country should be displayed +* Returns the new format. * -* @return {String} new formate +* @param {String [[]]} pAddrData <p> +* Address data which shall formatted.<br> +* @param {String} pFormat <p> +* The format string.<br> +* @param {Boolean} pCountry <p> +* If the country should be displayed.<br> +* <p> +* @return {String} New format.<br> * N – Name - salutation O – Organisation - orgname diff --git a/process/Appointment_lib/process.js b/process/Appointment_lib/process.js index 7f7dadbbc2485fc8e5f11dcbaf45f79e44a8db89..66eabd04b1983a22cb7c2b1b477f3b7ae9bb8218 100644 --- a/process/Appointment_lib/process.js +++ b/process/Appointment_lib/process.js @@ -6,20 +6,26 @@ import("system.neon"); import("system.text"); /** - * provides static methods for appointments - * do not create an instance of this + * Provides static methods for appointments.<br> + * Do <u><b>not</b></u> create an instance of this. * * @class */ function AppointmentUtils() {} /** - * Sets the participant stats of the current users as given param state - * @param {String} currentUserUri - * @param {String} attendees encoded as multistring - * @param {String} newState partstat + * Sets the participant status of the current users as <br> + * given param state. <u>(Sets the user status for an <br> + * appointment to accepted or declined.)</u><br> * - * @return {String} updated attendees encoded as multistring + * @param {String} currentUserUri <p> + * Current user identifier.<br> + * @param {String} attendees <p> + * Attendees encoded as a multistring.<br> + * @param {String} newState <p> + * The new status.<br> + * @return {String} <p> + * Updated attendees encoded as multistring.<br> */ AppointmentUtils.setPartStat = function (currentUserUri, attendees, newState) { attendeesDecodedArray = text.decodeMS(attendees); @@ -71,9 +77,15 @@ AppointmentUtils.setPartStat = function (currentUserUri, attendees, newState) { } /** - * send an exchange action - * @param {String} event to send - * @param {String} newState state to send: "ACCEPT", "DECLINE", "" + * Sets the a new status for an users appointment.<br> + * (Use case: when a exchange is running at the backend)<br> + * + * @param {String} event <p> + * Event which will be sent to the exchange.<br> + * (= the parsed appointment)<br> + * @param {String} newState <p> + * The new state which will be set.<br> + * (e.g.: "ACCEPT", "DECLINE", "")<br> */ AppointmentUtils.sendExchangedAction = function(event, newState) { @@ -99,6 +111,32 @@ AppointmentUtils.sendExchangedAction = function(event, newState) calendars.updateEntry(jsonEvent); } +/** + * Creates links in appointments.<br> + * (e.g.: type: privat person and object: Christine Müller) + * + * @param {String} pSysRecordstate <p> + * The system record state<br> + * (e.g.: neon.OPERATINGSTATE_NEW)<br> + * @param {String} pAppointmentState <p> + * In case this is filled with<br> + * <b><i>neon.OPERATINGSTATE_NEW</i></b> it entails that<br> + * the current user is fetched and if he is<br> + * the organizer of the appointment<br> + * the appointment will be editable for<br> + * him otherwise he is only a attendee<br> + * and not able to edit the appointment.<br> + * @param {String} pAppointmentIdParam <p> + * Is used as parameter for calling the<br> + * <b><i>calendars.getEntry()</i></b> function in case<br> + * pSysRecordstate is neon.OPERATINGSTATE_NEW.<br> + * @param {String} pAppointmentIdFieldValue <p> + * Is used as parameter for calling the<br> + * <b><i>calendars.getEntry()</i></b> function in case<br> + * pSysRecordstate is neon.OPERATINGSTATE_EDIT.<br> + * <p> + * @return {String} Returns the matching component state. + */ AppointmentUtils.setAppointmentLinkComponentState = function(pSysRecordstate, pAppointmentState, pAppointmentIdParam, pAppointmentIdFieldValue) { var entry; diff --git a/process/AttributeRegistry_basic/process.js b/process/AttributeRegistry_basic/process.js index 132797695565e73846abb8747ff49b5dd089658a..141c192f3f3cccfc5f424b8e2b3f1fb94fa9679d 100644 --- a/process/AttributeRegistry_basic/process.js +++ b/process/AttributeRegistry_basic/process.js @@ -1,5 +1,5 @@ /** - * provides static functionality for a registry of attribute ids + * Provides static functionality for a registry of attribute ids. * The reason for this is a convenient usage within jdito-code (autocomplete) * and better readability * diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index c38845e81d7c4b72931a90084071a9e5dda027a5..2bd5cfbb0b9d4d0c229e4e4e7361ab4e1b9c00ee 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -14,16 +14,18 @@ import("Sql_lib"); import("Keyword_lib"); /** - * Provides functions for the work with attributes, like - * listing the available attributes for a context. - * Don't instanciate this! + * Provides functions for the work with attributes,<br> + * like listing the available attributes for a context.<br> + * <b><u>Don't instanciate this!</u></b> * * @class */ function AttributeUtil () {} /** - * @return all Contexts (Object types) which can be the usage of attributes + * Returns all possible usageable contexts for attributes. + * <p> + * @return {Array} Array with the useable contexts. */ AttributeUtil.getPossibleUsageContexts = function() { @@ -46,15 +48,20 @@ AttributeUtil.getPossibleUsageContexts = function() } /** - * Gives an array of all available attributes for a context. This is used in the possibleItems - * process for the attribute id in AttributeRelation + * Gives an array of all available attributes for a context.<br> + * This is used in the possibleItems process for the <br> + * attribute id in AttributeRelation.<br> * - * @param {String} pObjectType the object type (= context) - * @param {boolean} [pIncludeGroups=false] - * @param {String[]} [pFilteredAttributeIds=[]] Whitleist of attribute ids - * @param {Object} [pAttributeCount=null] Object with attribute ids and their count - * - * @return {String[]} array of attributeIds + * @param {String} pObjectType <p> + * The object type (context).<br> + * @param {Boolean} pIncludeGroups=false (optional) <p> + * Description.<br> + * @param {String[]} pFilteredAttributeIds=[] (optional) <p> + * Whitleist of attribute ids.<br> + * @param {Object} pAttributeCount=null (optional) <p> + * Object with attribute ids and their count.<br> + * @return {String[]} <p> + * Array of attribute ids. */ AttributeUtil.getPossibleAttributes = function (pObjectType, pIncludeGroups, pFilteredAttributeIds, pAttributeCount) { @@ -114,16 +121,28 @@ AttributeUtil.getPossibleAttributes = function (pObjectType, pIncludeGroups, pFi } /** - * searches for possiblevalues for a atttribute and returns these. The values depend on the attributeType - * - * @param {String} pAttributeId the id of the attribute - * @param {Boolean} pAttributeType type of the attribute that is specified with pAttributeId; - * The type needs to be passed to the function for better performance - * (loading the type via attribute several times would be too slow) - * @param {Boolean} [pIncludeInactives=false] specifies if only active attributevalues or actives + inactives shall be returned, - * this is important when you want to search for attributevalues + * Searches for possible values for a atttribute<br> + * and returns these. The values depend on<br> + * the attributeType.<br> * - * @return {Array} 2D-array with [ID, value] als elements if the given attributeType has possible items. if not null is returned + * @param {String} pAttributeId <p> + * The id of the attribute.<br> + * @param {Boolean} pAttributeType <p> + * Type of the attribute that is <br> + * specified with pAttributeId. The type <br> + * needs to be passed to the function <br> + * for better performance. (loading the<br> + * type via attribute several times would<br> + * be too slow)<br> + * @param {Boolean} pIncludeInactives=false (optional) <p> + * Specifies if only active attributevalues <br> + * or actives and inactives shall be returned,<br> + * this is important when you want <br> + * to search for attribute values.<br> + * @return {Array} <p> + * 2D-array with [id, value] as elements if<br> + * the given attributeType has possible items,<br> + * if not null is returned.<br> */ AttributeUtil.getPossibleListValues = function (pAttributeId, pAttributeType, pIncludeInactives) { @@ -200,16 +219,26 @@ AttributeUtil.getPossibleListValues = function (pAttributeId, pAttributeType, pI } /** - * returns the name of an attribute with all parent attribute names - * - * @param {String} pAttributeId the id of the attribute - * @param {Boolean} [pSimpleName=false] Use only the name of the attribute and not the names of the parents. - * @param {Boolean} [pTranslate=true] translate the name - * @param {Number} [pStartLayer=0] Group names to omit. Example: The attribute is "Departments / Distribution / Field staff". - * If you set this value to 1, "Departments / " will be removed, if set to 2, "Departments / Distribution / " will be removed and so on. - * The last name will never be removed to avoid an empty result if something is wrong. + * Returns the name of an attribute <br> + * with all parent attribute names.<br> * - * @return {String} the name of the attribute + * @param {String} pAttributeId <p> + * The id of the attribute.<br> + * @param {Boolean} pSimpleName=false (optional) <p> + * Use only the name of the attribute <br> + * and not the names of the parents.<br> + * @param {Boolean} pTranslate=true (optional) <p> + * If the name should be translated.<br> + * @param {Number} pStartLayer=0 (optional) <p> + * Group names to omit. Example: The attribute <br> + * is "Departments / Distribution / Field staff".<br> + * If you set this value to 1, "Departments / " will <br> + * be removed, if set to 2, "Departments / Distribution /"<br> + * will be removed and so on. The last name will never <br> + * be removed to avoid an empty result <br> + * if something is wrong.<br> + * @return {String} <p> + * The name of the attribute.<br> */ AttributeUtil.getFullAttributeName = function (pAttributeId, pSimpleName, pTranslate, pStartLayer) { @@ -259,12 +288,14 @@ AttributeUtil.getFullAttributeName = function (pAttributeId, pSimpleName, pTrans } /** - * returns the name of an attribute + * Returns the name of an attribute. * - * @param {String} pAttributeId the id of the attribute - * @param {boolean} [pTranslate] if the name should be translated - * - * @return {String} the name of the attribute + * @param {String} pAttributeId <p> + * The id of the attribute.<br> + * @param {boolean} pTranslate <p> + * If the name should be translated.<br> + * @return {String} <p> + * The name of the attribute.<br> */ AttributeUtil.getSimpleAttributeName = function (pAttributeId, pTranslate) { @@ -278,11 +309,12 @@ AttributeUtil.getSimpleAttributeName = function (pAttributeId, pTranslate) } /** - * returns the ids of all subordinated attributes of an attribute - * - * @param {String|Array} pAttributeIds the id(s) of the attribute(s) + * Returns the ids of all subordinated attributes of an attribute. * - * @result {String[]} array with the ids of every subordinated attribute + * @param {String|Array} pAttributeIds <p> + * The id(s) of the attribute(s).<br> + * @return {String[]} <p> + * Array with the ids of every subordinated attribute.<br> */ AttributeUtil.getAllChildren = function (pAttributeIds) { @@ -304,11 +336,12 @@ AttributeUtil.getAllChildren = function (pAttributeIds) } /** - * checks if an attribute has attribute relations - * - * @param {String} pAttributeId the id of the attribute + * Checks if an attribute has attribute relations. * - * @result {boolean} true if it has relations + * @param {String} pAttributeId <p> + * The id of the attribute.<br> + * @return {Boolean} <p> + * True, if it has relations.<br> */ AttributeUtil.hasRelations = function (pAttributeId) { @@ -320,11 +353,12 @@ AttributeUtil.hasRelations = function (pAttributeId) } /** - * returns the type of an attribute + * Returns the type of an attribute. * - * @param {String} pAttributeId the id of the attribute - * - * @result {String} attribute type + * @param {String} pAttributeId <p> + * The id of the attribute.<br> + * @return {String} <p> + * Attribute type.<br> */ AttributeUtil.getAttributeType = function (pAttributeId) { @@ -338,6 +372,18 @@ AttributeUtil.getAttributeType = function (pAttributeId) .trim(); } +/** + * Checks whether the given object type <br> + * has attribute in usage.<br> + * + * @param {String} pObjectType <p> + * The object type.<br> + * @return {String} <p> + * Returns false whether the given object<br> + * type is not filled correctly and true<br> + * if the given object type has attributes<br> + * in usage.<b> + */ AttributeUtil.hasAttributes = function (pObjectType) { if (!pObjectType) @@ -355,8 +401,9 @@ AttributeUtil.hasAttributes = function (pObjectType) /*********************************************************************************************************************/ /** - * Provides functions for the work with attributeRelations, getting the value of an attributeRelation for an object. - * Don't instanciate this! + * Provides functions for the work with attributeRelations,<br> + * getting the value of an attributeRelation for an object.<br> + * <b>Don't instanciate this!</b> * * @class */ @@ -367,13 +414,20 @@ function AttributeRelationUtils () {} * * gets the value of an attributeRelation for one dataset (e. g. a person) * - * @param {String} pAttributeId attribute-id - * @param {String} pObjectRowId row-id of the dataset - * @param {String} [pObjectType=null] object-type - * @param {String} [pGetViewValue=false] if true the values are resolved and formatted - * @param {String} [pGetAttrname=false] if true the attributename is also returned - * - * @return {String|String[]|null} the value of the attribute or an array of attrname and value [attrname, value] (if pGetAttrname is true) + * @param {String} pAttributeId <p> + * Attribute id.<br> + * @param {String} pObjectRowId <p> + * Row id of the dataset.<br> + * @param {String} pObjectType=null <p> + * Object type.<br> + * @param {String} pGetViewValue=false <p> + * If true, the values are resolved and formatted.<br> + * @param {String} pGetAttrname=false <p> + * If true, the attributename is also returned.<br> + * @return {String|String[]|null} <p> + * The value of the attribute or an array<br> + * of attrname and value [attrname, value]<br> + * (if pGetAttrname is true)<br> */ AttributeRelationUtils.getAttribute = function (pAttributeId, pObjectRowId, pObjectType, pGetViewValue, pGetAttrname) { @@ -391,12 +445,17 @@ AttributeRelationUtils.getAttribute = function (pAttributeId, pObjectRowId, pObj } /** - * Get a SqlBuilder already containing the full select for attributes. - * @param {String[]} pFields array of all fields which should be selected - * @param {String} pObjectRowId object rowid - * @param {String} [pObjectType=null] object-type + * Get a SqlBuilder already containing <br> + * the full select for attributes.<br> * - * @return {SqlBuilder} a already filled SqlBuilder + * @param {String[]} pFields <p> + * Array of all fields which should be selected.<br> + * @param {String} pObjectRowId <p> + * Object row id.<br> + * @param {String} [pObjectType=null] <p> + * Object type.<br> + * @return {SqlBuilder} <p> + * A already filled SqlBuilder.<br> */ AttributeRelationUtils.getAttributeSqlBuilder = function (pFields, pObjectRowId, pObjectType) { @@ -410,16 +469,23 @@ AttributeRelationUtils.getAttributeSqlBuilder = function (pFields, pObjectRowId, /** * @deprecated use AttributeRelationQuery - * gets all attributes for a dataset - * - * @param {String} pObjectRowId object rowid - * @param {String} [pObjectType=null] object-type - * @param {String} [pUseAttributeIds=0] if 0 the full attribute names are returned - * if 1 the ids are used instead of the full attribute names - * if 2 the ids AND the full attribute name is returned - * @param {String} [pUseIdValues=false] if true the values are not resolved or formatted [attributeId, attributeName, value] + * Gets all attributes for a dataset. * - * @return {String[][]} two-dimensional array a row is [attributeId|attributeName, value] (or [attributeId, attributeName, value]) + * @param {String} pObjectRowId <p> + * Object row id.<br> + * @param {String} pObjectType=null <p> + * Object type.<br> + * @param {String} pUseAttributeIds=0 <p> + * <ul> + * <li>0: The full attribute names are returned.<br></li> + * <li>1: The ids are used instead of the full attribute names.<br></li> + * <li>2: The ids and the full attribute name is returned.<br></li> + * </ul> + * @param {String} pUseIdValues=false If true the values are not resolved or formatted<br> + * [attributeId, attributeName, value].<br> + * @return {String[][]} <p> + * Two-dimensional array a row is [attributeId|attributeName, value]<br> + * (or [attributeId, attributeName, value]).<br> */ AttributeRelationUtils.getAllAttributes = function (pObjectRowId, pObjectType, pUseAttributeIds, pUseIdValues) { @@ -447,13 +513,19 @@ AttributeRelationUtils.getAllAttributes = function (pObjectRowId, pObjectType, p } /** - * gets the correct attribute value from a map with values depending on the attribute id + * Gets the correct attribute value from <br> + * a map with values depending on the attribute id.<br> * - * @param {String} pAttributeId the attribute id - * @param {Object} pValueMap a map with the attribute values and the db fields as keys - * @param {Boolean} [pGetViewValue=false] if true, get the view value - * - * @return {String|null} the value of the attribute or null if the attribute doesn't exist + * @param {String} pAttributeId <p> + * The attribute id. + * @param {Object} pValueMap <p> + * A map with the attribute values <br> + * and the db fields as keys.<br> + * @param {Boolean} pGetViewValue=false <p> + * If true, get the view value.<br> + * @return {String|null} <p> + * The value of the attribute or null <br> + * if the attribute doesn't exist.<br> */ AttributeRelationUtils.selectAttributeValue = function (pAttributeId, pValueMap, pGetViewValue) { @@ -509,11 +581,15 @@ AttributeRelationUtils.insertAttribute = function (pRowId, pObjectType, pAttribu } /** - * adds rows for attributes with min_count > 0 + * Adds rows for attributes with min_count > 0. * - * @param {String} pObjectType the object type - * @param {String} pConsumer the name of the attribute relation consumer - * @param {String[]} pFiltered array of attributeId's which act as a whitelist. (groups are resolves to the childid's) + * @param {String} pObjectType <p> + * The object type.<br> + * @param {String} pConsumer <p> + * The name of the attribute relation consumer.<br> + * @param {String[]} pFiltered <p> + * Array of attributeId's which act as a whitelist.<br> + * (groups are resolves to the childid's)<br> */ AttributeRelationUtils.presetMandatoryAttributes = function (pObjectType, pConsumer, pFiltered) { @@ -547,9 +623,10 @@ AttributeRelationUtils.presetMandatoryAttributes = function (pObjectType, pConsu } /** - * clears rows of attribute + * Clears rows of attribute. * - * @param {String} pConsumer the name of the attribute relation consumer + * @param {String} pConsumer <p> + * The name of the attribute relation consumer.<br> */ AttributeRelationUtils.clearAttributes = function (pConsumer) { @@ -564,15 +641,22 @@ AttributeRelationUtils.clearAttributes = function (pConsumer) } /** - * Checks if the count of the used attributes is valid and returns a message if it's not. - * - * @param {String} pRowId the row id of the entity - * @param {String} [pObjectType=null] the object type - * @param {String} pConsumerField the name of the attribute relation consumer - * @param {String} [pFilteredAttributeIds] filters the attributes that are validated, this should - * be the same as the FilteredAttributeIds_param + * Checks if the count of the used attributes <br> + * is valid and returns a message if it's not.<br> * - * @return {String} the validation message or an empty string if everything is ok + * @param {String} pRowId <p> + * The row id of the entity.<br> + * @param {String} pObjectType=null <p> + * The object type.<br> + * @param {String} pConsumerField <p> + * The name of the attribute relation consumer.<br> + * @param {String} pFilteredAttributeIds <p> + * Filters the attributes that are, validated<br> + * this should be the same as the<br> + * FilteredAttributeIds_param.<br> + * @return {String} <p> + * The validation message or an empty<br> + * string if everything is ok.<br> */ AttributeRelationUtils.validateAttributeCount = function (pRowId, pObjectType, pConsumerField, pFilteredAttributeIds) { @@ -647,14 +731,19 @@ AttributeRelationUtils.validateAttributeCount = function (pRowId, pObjectType, p } /** - * counts attribute relations - * - * @param {String} pRowId the row id of the entity - * @param {String} [pObjectType=null] the object type - * @param {Object} [pAttributeChanges=null] object containing changes and deletions of attributes - * structure = {attributeRelationId : new attributeId or "" when deleted} + * Counts attribute relations. * - * @return {Object} object with attribute ids and the count of the usage (without new rows) + * @param {String} pRowId <p> + * The row id of the entity.<br> + * @param {String} pObjectType=null <p> + * The object type.<br> + * @param {Object} pAttributeChanges=null <p> + * Object containing changes and deletions <br> + * of attributes structure = {attributeRelationId <br> + * : new attributeId or "" when deleted}<br> + * @return {Object} <p> + * Object with attribute ids and the count of <br> + * the usage (without new rows).<br> */ AttributeRelationUtils.countAttributeRelations = function (pRowId, pObjectType, pAttributeChanges) { @@ -892,11 +981,13 @@ $AttributeTypes.THEME = { function AttributeTypeUtil () {} /** - * returns the required contentType for the given attribute type + * Returns the required contentType for the given attribute type. * - * @param {String} pAttributeType the attribute type - * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) - * @return {String} the contentType for the attribute + * @param {String} pAttributeType <p> + * The attribute type (use the values of the AttributeTypes<br> + * object, e. g. AttributeTypes.TEXT)<br> + * @return {String} <p> + * The contentType for the attribute.<br> */ AttributeTypeUtil.getContentType = function (pAttributeType) { @@ -904,11 +995,13 @@ AttributeTypeUtil.getContentType = function (pAttributeType) } /** - * returns if the type is a group type + * Returns if the type is a group type. * - * @param {String} pAttributeType the attribute type - * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) - * @return {Boolean} if the type is a group type + * @param {String} pAttributeType <p> + * The attribute type (use the values of the <br> + * AttributeTypes object, e. g. AttributeTypes.TEXT) + * @return {Boolean} <p> + * If the type is a group type it returns true. */ AttributeTypeUtil.isGroupType = function (pAttributeType) { @@ -916,11 +1009,16 @@ AttributeTypeUtil.isGroupType = function (pAttributeType) } /** - * returns the database field for the given attribute type that holds the value of the attribute + * Returns the database field for the given<br> + * attribute type that holds the value of the<br> + * attribute.<br> * - * @param {String} pAttributeType the attribute type - * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) - * @return {String} the database field for the attribute + * @param {String} pAttributeType <p> + * The attribute type (use the values of<br> + * the AttributeTypes object, e.g.<br> + * AttributeTypes.TEXT)<br> + * @return {String} <p> + * The database field for the attribute.<br> */ AttributeTypeUtil.getDatabaseField = function (pAttributeType) { @@ -928,11 +1026,14 @@ AttributeTypeUtil.getDatabaseField = function (pAttributeType) } /** - * returns the possible children types for the given attribute type + * Returns the possible children types for the given attribute type.<br> * - * @param {String} pAttributeType the attribute type - * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) - * @return {String[]} the possible children types + * @param {String} pAttributeType <p> + * The attribute type (use the values <br> + * of the AttributeTypes object, e. g.<br> + * AttributeTypes.TEXT)<br> + * @return {String[]} <p> + * The possible children types.<br> */ AttributeTypeUtil.getPossibleChildren = function (pAttributeType) { @@ -940,22 +1041,47 @@ AttributeTypeUtil.getPossibleChildren = function (pAttributeType) } /** - * returns the possible children types for the given attribute type + * Checks whether the given attribute type is<br> + * is a single selection attribute type.<br> * - * @param {String} pAttributeType the attribute type - * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) - * @return {String[]} the possible children types + * @param {String} pAttributeType <p> + * The attribute type (use the values<br> + * of the AttributeTypes object, e. g.<br> + * AttributeTypes.TEXT)<br> + * @return {String[]} <p> + * .<br> */ AttributeTypeUtil.isSingleSelection = function (pAttributeType) { return AttributeTypeUtil._getProperty(pAttributeType, "singleSelection", false); } +/** + * Compare the given pAttributeType with the attribute type string + * "OBJECTSELECTION". + * + * @param {String} pAttributeType <p> + * The attribute type which shall be comapred. + * @return {String} <p> + * Returns true, if the given attribute type is equal<br> + * with the attribute string "OBJECTSELECTION" and <br> + * false, if not.<br> + */ AttributeTypeUtil.useLookup = function (pAttributeType) { return pAttributeType.trim() == $AttributeTypes.OBJECTSELECTION.toString(); } +/** + * Compare the given attribute type with every other<br> + * existing attribute type and returns every compared <br> + * type which is a possible parent type.<br> + * + * @param {String} pChildType <p> + * The attribute type which shall be used to compare. + * @return {Array} <p> + * Returns all possible parent attribute types.<br> + */ AttributeTypeUtil.getGroupTypes = function (pChildType) { var groupTypes = []; @@ -968,7 +1094,20 @@ AttributeTypeUtil.getGroupTypes = function (pChildType) } /** - * function to get a property of an attribute type + * Returns the property matching to the property name.<br> + * + * @param {String} pAttributeType <p> + * The corresponding attribute type to the<br> + * property. + * @param {String} pPropertyName <p> + * The property name of the property. + * @param {String} pDefaultValue <p> + * Description. + * @return <p> + * Returns the property or null, when pAttributeType<br> + * isn't filled or the given attribute type isn't in<br> + * $AttributeTypes. Otherwise the pDefaultValue,<br> + * will be returned, case if it isn't undefined or null.<br> */ AttributeTypeUtil._getProperty = function (pAttributeType, pPropertyName, pDefaultValue) { @@ -985,6 +1124,21 @@ AttributeTypeUtil._getProperty = function (pAttributeType, pPropertyName, pDefau return null; } +/** + * If the given attribute type is a <br> + * valid type and it has a getViewValue<br> + * function it will return the matching<br> + * view value to the given pValue.<br> + * + * @param {String} pAttributeType <p> + * The attribute type.<br> + * @param {String} pValue <p> + * The value.<br> + * @param {String} pKeyword <p> + * The keyword.<br> + * @return {String} <p> + * Returns the view value. + */ AttributeTypeUtil.getAttributeViewValue = function (pAttributeType, pValue, pKeyword) { if (pAttributeType in $AttributeTypes && $AttributeTypes[pAttributeType].getViewValue) @@ -992,6 +1146,9 @@ AttributeTypeUtil.getAttributeViewValue = function (pAttributeType, pValue, pKey return pValue; } +/** + * Initializes the type columns. + */ AttributeTypeUtil._initTypeColumnData = function () { var columns = []; @@ -1015,6 +1172,12 @@ AttributeTypeUtil._initTypeColumnData = function () this._typeColumnMap = typeColumnMap; } +/** + * Return the all database fields/columns of the every attribute type. + * + * @return {String} <p> + * All database fields/columns. + */ AttributeTypeUtil.getAllDatabaseFields = function () { if (this._allDBColumns == undefined) @@ -1022,6 +1185,14 @@ AttributeTypeUtil.getAllDatabaseFields = function () return this._allDBColumns; } +/** + * Returns the type column index. + * + * @param {String} pAttributeType <p> + * The attribute type of you want the column<br> + * type index back.<br> + * @return {String} + */ AttributeTypeUtil.getTypeColumnIndex = function (pAttributeType) { if (this._typeColumnMap == undefined) @@ -1032,17 +1203,20 @@ AttributeTypeUtil.getTypeColumnIndex = function (pAttributeType) /*********************************************************************************************************************/ /** - * Functions for AttributeUsages. - * Do not instanciate this! + * Functions for AttributeUsages.<br> + * <b><i>Do not instanciate this!</i></b> */ function AttributeUsageUtil () {} /** - * Creates AttributeUsages for all subordinate attributes of an attribute. - * This is required when an usage is added to a superordinate attribute. + * Creates AttributeUsages for all subordinate attributes <br> + * of an attribute.This is required when an usage is added <br> + * to a superordinate attribute.<br> * - * @param {String} pAttributeId the id of the superordinate attribute - * @param {String} pObjectType the context + * @param {String} pAttributeId <p> + * The id of the superordinate attribute.<br> + * @param {String} pObjectType <p> + * The context.<br> */ AttributeUsageUtil.insertChildrenUsages = function (pAttributeId, pObjectType) { @@ -1084,12 +1258,16 @@ AttributeUsageUtil.insertChildrenUsages = function (pAttributeId, pObjectType) } /** - * Updates AttributeUsages for all subordinate attributes of an attribute. - * This is required when an usage of a superordinate attribute is changed. + * Updates AttributeUsages for all subordinate attributes <br> + * of an attribute. This is required when an usage of a <br> + * superordinate attribute is changed.<br> * - * @param {String} pAttributeId the id of the superordinate attribute - * @param {String} pOldObjectType ye olde context - * @param {String} pNewObjectType the new context + * @param {String} pAttributeId <p> + * The id of the superordinate attribute.<br> + * @param {String} pOldObjectType <p> + * The old context.<br> + * @param {String} pNewObjectType <p> + * The new context.<br> */ AttributeUsageUtil.updateChildrenUsages = function (pAttributeId, pOldObjectType, pNewObjectType) { @@ -1143,8 +1321,10 @@ AttributeUsageUtil.updateChildrenUsages = function (pAttributeId, pOldObjectType * Deletes AttributeUsages for all subordinate attributes of an attribute. * This is required when an usage is removed from a superordinate attribute. * - * @param {String} pAttributeId the id of the superordinate attribute - * @param {String} pObjectType the context + * @param {String} pAttributeId <p> + * The id of the superordinate attribute.<br> + * @param {String} pObjectType <p> + * The context. */ AttributeUsageUtil.deleteChildrenUsages = function (pAttributeId, pObjectType) { @@ -1177,7 +1357,8 @@ AttributeUsageUtil.deleteChildrenUsages = function (pAttributeId, pObjectType) /** * Deletes duplicate attribute usages. * - * @param {String} [pAttributeId=null] attribute id, if omitted, all duplicates will be deleted + * @param {String} [pAttributeId=null] <p> + * Attribute id, if omitted, all duplicates will be deleted.<br> */ AttributeUsageUtil.removeDuplicates = function (pAttributeId) { @@ -1213,15 +1394,23 @@ AttributeUsageUtil.removeDuplicates = function (pAttributeId) /*************************************************************************************************/ /** - * @class - * - * An AttributeRelationQuery can be used for getting the value and other properties - * of an AttributeRelation. You have to instanciate it with "new". * + * An AttributeRelationQuery can be used for getting the + * value and other properties of an AttributeRelation. <br> + * <i><u>You have to instanciate it with "new".</u></i> + * <p> * This is built like this because there are several different scenarios for * loading the values or other properties of one or more attribute relations. Because of this, * the constructor takes in the common parameters for loading attribute relations and you can * use methods of the constructed object to configure the query and get the desired result. + * + * @param {String} pObjectRowId <p> + * The object row id. (e.g.: contact id)<br> + * @param {String} pAttributeId <p> + * The attribute id.<br> + * @param {String} pObjectType <p> + * The object type. (e.g.: "Organisation") + * @class */ function AttributeRelationQuery (pObjectRowId, pAttributeId, pObjectType) { @@ -1236,7 +1425,13 @@ function AttributeRelationQuery (pObjectRowId, pAttributeId, pObjectType) } /** - * sets the object-row-id for the query + * Sets the object row id for the query. + * + * @param {String} pObjectRowId <p> + * The row id of the object. (e.g.: contact id)<br> + * @return {Object} <p> + * Returns AttributeRelationQuery object<br> + * with the object row id set.<br> */ AttributeRelationQuery.prototype.objectRowId = function (pObjectRowId) { @@ -1245,8 +1440,14 @@ AttributeRelationQuery.prototype.objectRowId = function (pObjectRowId) } /** - * sets the object-type for the query - */ + * Sets the object-type for the query.<br> + * + * @param {String} pObjectType <p> + * The object type. (e.g.: "Organisation")<br> + * @return {Object} <p> + * Returns AttributeRelationQuery object<br> + * with the object type set.<br> + */ AttributeRelationQuery.prototype.objectType = function (pObjectType) { this._objectType = pObjectType; @@ -1254,7 +1455,13 @@ AttributeRelationQuery.prototype.objectType = function (pObjectType) } /** - * sets the attribute id for the query + * Sets only one attribute id for the query.<br> + * + * @param {Array} pAttributeId <p> + * The attribute id.<br> + * @return {Object} <p> + * Returns AttributeRelationQuery object<br> + * with the attribute id set.<br> */ AttributeRelationQuery.prototype.attributeId = function (pAttributeId) { @@ -1263,7 +1470,13 @@ AttributeRelationQuery.prototype.attributeId = function (pAttributeId) } /** - * sets the attribute ids for the query + * Sets the attribute ids for the query. + * + * @param {Array} pAttributeIds <p> + * The attribute ids in a array.<br> + * @return {Object} <p> + * Returns AttributeRelationQuery object<br> + * with the attribute ids set.<br> */ AttributeRelationQuery.prototype.attributeIds = function (pAttributeIds) { @@ -1272,7 +1485,13 @@ AttributeRelationQuery.prototype.attributeIds = function (pAttributeIds) } /** - * sets the attribute type for the query + * Sets the attribute type for the query. + * + * @param {Array} pAttributeTypes <p> + * The attribute types.<br> + * @return {Object} <p> + * Returns the AttributeRelationQuery object<br> + * with the attributeTypes set.<br> */ AttributeRelationQuery.prototype.attributeTypes = function (pAttributeTypes) { @@ -1281,7 +1500,11 @@ AttributeRelationQuery.prototype.attributeTypes = function (pAttributeTypes) } /** - * if this method was called, the query result will contain the fullAttributeName + * If this method was called, the query result will contain the fullAttributeName. + * + * @return {Object} <p> + * Return the AttributeRelationQuery object<br> + * with the option includeFullAttributeName enabled.<br> */ AttributeRelationQuery.prototype.includeFullAttributeName = function () { @@ -1290,7 +1513,11 @@ AttributeRelationQuery.prototype.includeFullAttributeName = function () } /** - * if this method was called, the query result will contain the displayValue + * If this method was called, the query result will contain the displayValue. + * + * @return {Object} <p> + * Return the AttributeRelationQuery object<br> + * with the option includeDisplayValue enabled.<br> */ AttributeRelationQuery.prototype.includeDisplayValue = function () { @@ -1301,9 +1528,18 @@ AttributeRelationQuery.prototype.includeDisplayValue = function () /** * Executes the query and returns the result, depending on the properties of the AttributeRelationQuery object. * - * @return {AttributeRelation[]} Array of objects. By default, the objects contain the properties {attributeId, value, attributeRelationId, attributeName, attributeType}. - * If includeDisplayValue is true, the object also contains the property 'displayValue' and if includeFullAttributeName is true, there is also the property - * 'fullAttributeName'. + * @return {Object[]} <p> + * Array of objects. By default, the objects contain the properties: + * <ul> + * <li>attributeId</li> + * <li>value</li> + * <li>attributeRelationId</li> + * <li>attributeName</li> + * <li>attributeType</li> + * </ul> + * If includeDisplayValue is true, the object also contains<br> + * the property 'displayValue' and if includeFullAttributeName <br> + * is true, there is also the property 'fullAttributeName'.<br> */ AttributeRelationQuery.prototype.getAttributes = function () { @@ -1313,9 +1549,7 @@ AttributeRelationQuery.prototype.getAttributes = function () "AB_ATTRIBUTE.ATTRIBUTE_NAME", "COMBOVAL.ATTRIBUTE_NAME", "AB_ATTRIBUTE.AB_ATTRIBUTEID", - "AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID", - "AB_ATTRIBUTERELATION.OBJECT_ROWID", - "AB_ATTRIBUTERELATION.OBJECT_TYPE" + "AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID" ]; var valueFields = AttributeTypeUtil.getAllDatabaseFields(); @@ -1330,7 +1564,13 @@ AttributeRelationQuery.prototype.getAttributes = function () var mappingFn = function (row) { - var attrObj = new AttributeRelation(row[5], row[4], row[AttributeTypeUtil.getTypeColumnIndex(row[0]) + defaultFields.length], row[2], row[0], row[6], row[7]); + var attrObj = { + attributeId : row[4], + value : row[AttributeTypeUtil.getTypeColumnIndex(row[0]) + defaultFields.length], + attributeRelationId : row[5], + attributeName : row[2], + attributeType : row[0] + }; if (this._includeDisplayValue) { @@ -1351,7 +1591,12 @@ AttributeRelationQuery.prototype.getAttributes = function () } /** - * @return {AttributeRelation} + * If this method is executed on your AttributeRelationQuery<br> + * object it will return only one attribute. + * + * @return {Object} <p> + * Returns the AttributeRelationQuery object<br> + * with only a sinlge attribute.<br> */ AttributeRelationQuery.prototype.getSingleAttribute = function () { @@ -1361,9 +1606,11 @@ AttributeRelationQuery.prototype.getSingleAttribute = function () } /** - * Executes the query and returns a single value. For this, there must be a attribute id set. + * Executes the query and returns a single value.<br> + * For this, there must be a attribute id set. * - * @return {String} + * @return {String} <p> + * The single value. */ AttributeRelationQuery.prototype.getSingleAttributeValue = function () { @@ -1374,7 +1621,8 @@ AttributeRelationQuery.prototype.getSingleAttributeValue = function () /** * Executes the query and returns the count of datasets. * - * @return {Number} the number of attribute relations + * @return {Number} <p> + * The number of attribute relations. */ AttributeRelationQuery.prototype.getAttributeCount = function () { @@ -1384,12 +1632,16 @@ AttributeRelationQuery.prototype.getAttributeCount = function () } /** - * inserts a new attribute relation + * Inserts a new attribute relation. * - * @param {String} pValue value of the attribute relation - * @param {boolean} [pOmitValidation=false] if set to true, the current usage of the attribute and max count won't be checked - * - * @return {boolean} true, if the attribute relation was inserted, false if the count validation failed + * @param {String} pValue <p> + * Value of the attribute relation. + * @param {Boolean} [pOmitValidation=false] <p> + * If set to true, the current usage of the attribute and <br> + * max count won't be checked.<br> + * @return {Boolean} <p> + * True, if the attribute relation was inserted, false <br> + * if the count validation failed.<br> */ AttributeRelationQuery.prototype.insertAttribute = function (pValue, pOmitValidation) { @@ -1434,102 +1686,4 @@ AttributeRelationQuery.prototype.insertAttribute = function (pValue, pOmitValida new SqlBuilder().insertFields(attrData, "AB_ATTRIBUTERELATION", "AB_ATTRIBUTERELATIONID"); return true; -} - -/** - * deletes all attribute relations with the given rowId and objectType - * - * @return {Number} count of deleted rows - */ -AttributeRelationQuery.prototype.deleteAllAttributes = function () -{ - if (!this._rowId) - throw new Error("AttributeRelationQuery: Row id is required for delete"); - - return newWhere("AB_ATTRIBUTERELATION.OBJECT_ROWID", this._rowId) - .andIfSet("AB_ATTRIBUTERELATION.OBJECT_TYPE", this._objectType) - .deleteData(); -} - -/** - * Object representing one attribute relation in the database. Don't use this constructor in you own code! - * Instances of this should only be created by functions in this library. - * - * @param {String} pAttributeRelationId attribute relation id - * @param {String} pAttributeId attribute id - * @param {String} pValue value of the attribute - * @param {String} pAttributeName name of the attribute - * @param {String} pAttributeType type of the attribute - * @param {String} pObjectRowId rowId of the linked object - * @param {String} pObjectType context of the linked object - */ -function AttributeRelation (pAttributeRelationId, pAttributeId, pValue, pAttributeName, pAttributeType, pObjectRowId, pObjectType) -{ - if (!pAttributeRelationId) - throw new Error("AttributeRelation: pAttributeRelationId must be provided"); - - this.attributeRelationId = pAttributeRelationId; - this.attributeId = pAttributeId; - this.value = pValue; - this.attributeName = pAttributeName; - this.attributeType = pAttributeType; - this.objectRowId = pObjectRowId; - this.objectType = pObjectType; - this.displayValue = undefined; - this.fullAttributeName = undefined; -} - -/** - * updates the value of the attribute in the database - * - * @param {String} pValue the new value of the attribute relation - * @return {Boolean} currently the function always returns true (if some kind of validation is implemented in the future, - * it will return false if the validation fails) - */ -AttributeRelation.prototype.updateAttribute = function (pValue) -{ - if (pValue == undefined || pValue == "") - throw new Error("AttributeRelation: no value provided for update"); - - var attrData = { - "DATE_EDIT" : vars.get("$sys.date"), - "USER_EDIT" : vars.get("$sys.user") - }; - - var valueField = AttributeTypeUtil.getDatabaseField(this.attributeType); - if (valueField) - attrData[valueField] = pValue; - - newWhere("AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID", this.attributeRelationId) - .updateFields(attrData); - return true; -} - -/** - * deletes the attribute relation from the database - * - * @param {Boolean} [pOmitValidation=false] if set to true, the function won't check if the min count prohibits the deletion - * @retun {Boolean} true if it was deleted and false if the min count doesn't allow the deletion - */ -AttributeRelation.prototype.deleteAttribute = function (pOmitValidation) -{ - if (!pOmitValidation) - { - var minCount = newSelect("MIN_COUNT") - .from("AB_ATTRIBUTEUSAGE") - .where("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID", this.attributeId) - .and("AB_ATTRIBUTEUSAGE.OBJECT_TYPE", this.objectType) - .cell(); - - if (minCount && minCount != 0) - { - let timesUsed = new AttributeRelationQuery(this.objectRowId, this.attributeId, this.objectType).getAttributeCount(); - if (timesUsed <= minCount) - return false; - } - } - - newWhere("AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID", this.attributeRelationId) - .deleteData(); - return true; } \ No newline at end of file diff --git a/process/Binary_lib/process.js b/process/Binary_lib/process.js index d2cfd8490e42242e4b907d3694a30150e29aa8a9..a1a13b0307be55f2056f24961b76f93f1f89f338 100644 --- a/process/Binary_lib/process.js +++ b/process/Binary_lib/process.js @@ -4,24 +4,34 @@ import("system.db"); import("Sql_lib"); /** - * a static Utility class for binarys using db. binary functions - * It provides methods to ensure that only one Binary for a AssignmentTable, AssignmentName and AssignmentRowId exist. - * - * Do not create an instance of this! + * A static utility class for binarys using database binary functions. + * It provides methods to ensure that only one binary for a AssignmentTable, AssignmentName and AssignmentRowId exist.<br> + * <p> + * <b><u>Do not create an instance of this!</u></b> * @class */ function SingleBinaryUtils() {} /** - * Get the binary data - * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] + * Get the binary data. * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} the binary data or false if no data exists + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES).<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS) + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * The binary data or false if no data exists.<br> */ SingleBinaryUtils.get = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pAlias) { @@ -38,16 +48,29 @@ SingleBinaryUtils.get = function(pAssignmentTable, pAssignmentName, pAssignmentR } /** - * Get the binary metadata - * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {Boolean} [pIncludePreview=false] - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] + * Get the binary metadata. * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} the binary metadata (object properties: id, parentid, filename, edit, keyword, description, size, mimetype) or false if no data exists + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES).<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {Boolean} pIncludePreview=false (optional) <p> + * Case if its true, a preview will also be retrieved.<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * The binary metadata (object properties: id, parentid, <br> + * filename, edit, keyword, description, size, mimetype) <br> + * or false if no data exists.<br> */ SingleBinaryUtils.getMetadata = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pIncludePreview, pAlias) { @@ -65,15 +88,24 @@ SingleBinaryUtils.getMetadata = function(pAssignmentTable, pAssignmentName, pAss /** * Checks if the given binary exists only one time.<br> * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] - * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return result of the check - * If yes, it returns true.<br> - * If it doesn't exist, it returns false.<br> + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES) + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists. <br> + * This shouldn't happen, if this lib is used.<br> + * @return <p> + * Result of the check. If yes, it returns true.<br> + * If it doesn't exist, it returns false.<br> */ SingleBinaryUtils.checkExistsOneTime = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pAlias) { @@ -95,19 +127,34 @@ SingleBinaryUtils.checkExistsOneTime = function(pAssignmentTable, pAssignmentNam } /** - * Inserts the given binary<br> - * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} pBase64 - * @param {String} pFileName - * @param {String} pDescription - * @param {String} pKeyword - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] + * Inserts the given binary.<br> * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} the ID of the inserted binary or false if data already existed. + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {String} pBase64 <p> + * The base64-encoded data.<br> + * @param {String} pFileName <p> + * The name of the file.<br> + * @param {String} pDescription <p> + * The file description.<br> + * @param {String} pKeyword <p> + * The keyword.<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * The ID of the inserted binary or false if <br> + * data already existed.<br> */ SingleBinaryUtils.insert = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pBase64, pFileName, pDescription, pKeyword, pAlias) { @@ -124,18 +171,32 @@ SingleBinaryUtils.insert = function(pAssignmentTable, pAssignmentName, pAssignme /** - * Inserts the given binary as mainDocument<br> + * Inserts the given binary as mainDocument.<br> * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} pBase64 - * @param {String} pFileName - * @param {String} pDescription - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] - * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} the ID of the inserted binary or false if data already existed. + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {String} pBase64 <p> + * The base64 encoded data.<br> + * @param {String} pFileName <p> + * The name of the file.<br> + * @param {String} pDescription <p> + * The file description.<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * The ID of the inserted binary or false if data<br> + * already existed.<br> */ SingleBinaryUtils.insertMainDocument = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pBase64, pFileName, pDescription, pAlias) { @@ -143,18 +204,32 @@ SingleBinaryUtils.insertMainDocument = function(pAssignmentTable, pAssignmentNam }; /** - * Updates the given binary<br> - * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} pBase64 - * @param {String} pFileName - * @param {String} pDescription - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] + * Updates the given binary.<br> * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} true if inserted, false if the binary was not found + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of record)<br> + * @param {String} pBase64 <p> + * The base64 encoded data.<br> + * @param {String} pFileName <p> + * The name of the file.<br> + * @param {String} pDescription <p> + * The file description.<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * True if inserted, false if the binary <br> + * was not found.<br> */ SingleBinaryUtils.update = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pBase64, pFileName, pDescription, pAlias) { @@ -173,15 +248,26 @@ SingleBinaryUtils.update = function(pAssignmentTable, pAssignmentName, pAssignme } /** - * Removes the given binary<br> - * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} [pAlias = SqlUtils.getBinariesAlias()] + * Removes the given binary.<br> * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} true if binary was removed, false if data didn't exist. + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record) + * @param {String} pAlias = SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * True if binary was removed,<br> + * false if data didn't exist.<br> */ SingleBinaryUtils.remove = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pAlias) { @@ -201,16 +287,30 @@ SingleBinaryUtils.remove = function(pAssignmentTable, pAssignmentName, pAssignme /** * Updates the given binary, if it exists, otherwise inserts it.<br> * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} pBase64 - * @param {String} pFileName - * @param {String} pDescription - * @param {String} [pAlias=SqlUtils.getBinariesAlias()] - * - * @throws {Error} if more than one binary exists. This shouldn't happen, if this lib is used. - * @return {String | Boolean} true if the binary was updated, the binary id if it was inserted, false if it failed + * @param {String} pAssignmentTable <p> + * The table from which the binary data will fetched.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENT)<br> + * @param {String} pAssignmentRowId The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {String} pBase64 <p> + * The base64 encoded data.<br> + * @param {String} pFileName <p> + * The name of the file.<br> + * @param {String} pDescription <p> + * The file description.<br> + * @param {String} pAlias=SqlUtils.getBinariesAlias() (optional) <p> + * The database alias.<br> + * (e.g.: _____SYSTEMALIAS)<br> + * @throws {Error} <p> + * If more than one binary exists.<br> + * This shouldn't happen, if this lib is used.<br> + * @return {String | Boolean} <p> + * True if the binary was updated, <br> + * the binary id if it was inserted, <br> + * false if it failed.<br> */ SingleBinaryUtils.set = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pBase64, pFileName, pDescription, pAlias) { @@ -224,21 +324,30 @@ SingleBinaryUtils.set = function(pAssignmentTable, pAssignmentName, pAssignmentR /** - * a static Utility class for the Images. - * - * Do not create an instance of this! + * A static utility class for the images. + * <p> + * <u><b>Do not create an instance of this!</b></u> * @class */ function ImageUtils() {} /** - * returns the image + * Returns the image.<br> * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} pDefaultText the text, to use for default image generation. - * @return {String} base64 coded String of the image. If none existed, the given String is used to create an image. + * @param {String} pAssignmentTable <p> + * The database table where data get retrieved.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENTS)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of record)<br> + * @param {String} pDefaultText <p> + * The text, to use for default image generation.<br> + * @return {String} <p> + * Base64 encoded string of the image. If none existed,<br> + * the given String is used to create an image.<br> */ ImageUtils.get = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pDefaultText) { @@ -257,15 +366,26 @@ ImageUtils.get = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, p } /** - * sets the image: update if it already existed, insert, if it didn't exist. + * Sets the image: update if it already existed,<br> + * insert, if it didn't exist. * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @param {String} pImageDateBase64 base64 coded String of the image. - * @param {String} pFileName - * @param {String} pDescription - * @return {Boolean} if image could be set + * @param {String} pAssignmentTable <p> + * The database table where the data retrieved from.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g: DOCUMENT)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @param {String} pImageDateBase64 <p> + * Base64 encoded string of the image.<br> + * @param {String} pFileName <p> + * The name of the file.<br> + * @param {String} pDescription <p> + * The file description.<br> + * @return {Boolean} <p> + * If image could be set.<br> */ ImageUtils.set = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pImageDateBase64, pFileName, pDescription) { @@ -279,12 +399,19 @@ ImageUtils.set = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, p } /** - * deletes the image + * Deletes the image.<br> * - * @param {String} pAssignmentTable - * @param {String} pAssignmentName - * @param {String} pAssignmentRowId - * @return {Boolean} if image could be removed + * @param {String} pAssignmentTable <p> + * The database table where the data retrieved from.<br> + * (e.g.: ASYS_BINARIES)<br> + * @param {String} pAssignmentName <p> + * The name of the assignment/container name.<br> + * (e.g.: DOCUMENTS)<br> + * @param {String} pAssignmentRowId <p> + * The row id.<br> + * (e.g.: UUID of the record)<br> + * @return {Boolean} <p> + * If image could be removed.<br> */ ImageUtils.remove = function(pAssignmentTable, pAssignmentName, pAssignmentRowId) { diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index ee3eb81dd4ededed66d07c1a7c921444e18add54..3b2fa97df0c4634a148ea70a385874c03f24d145 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -17,17 +17,21 @@ import("system.notification"); import("Document_lib"); /** - * functions for bulk mails + * Functions for bulk mails. */ function BulkMailUtils () {} /** * Executes a process to send bulk mails on the server and creates a notification when finished. * - * @param {String} pBulkMailId id of the bulk mail - * @param {Array} [pTestRecipients] overwrite the recipients (e.g. for testing) - * @param {String} [pUser=currentUser] User that will get the notification, if null (not undefined!), no notification - * will be created. + * @param {String} pBulkMailId <p> + * Id of the bulk mail.<br> + * @param {Array} pTestRecipients (optional) <p> + * Overwrite the recipients (e.g. for testing).<br> + * @param {String} pUser=currentUser (optional) <p> + * User that will get the notification, <br> + * if null (not undefined!), no notification<br> + * will be created.<br> */ BulkMailUtils.sendBulkMailOnServer = function (pBulkMailId, pTestRecipients, pUser) { @@ -47,10 +51,12 @@ BulkMailUtils.sendBulkMailOnServer = function (pBulkMailId, pTestRecipients, pUs * Sends a bulk mail. You should only call this function on the server because it * can take some time to execute, use BulkMailUtils.sendBulkMailOnServer instead. * - * @param {String} pBulkMailId id of the bulk mail - * @param {Array} [pTestRecipients] overwrite the recipients (e.g. for testing) - * - * @return {Object} count of sucessful and failed mails + * @param {String} pBulkMailId <p> + * Id of the bulk mail.<br> + * @param {Array} pTestRecipients (optional) <p> + * Overwrite the recipients (e.g. for testing)<br> + * @return {Object} <p> + * Count of sucessful and failed mails.<br> */ BulkMailUtils.sendBulkMail = function (pBulkMailId, pTestRecipients) { @@ -144,9 +150,10 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pTestRecipients) } /** - * opens a context to select a bulk mail to add recipients to + * Opens a context to select a bulk mail to add recipients to.<br> * - * @param {String[]} pContactIds recipients that should be added + * @param {String[]} pContactIds <p> + * Recipients that should be added.<br> */ BulkMailUtils.openAddRecipientView = function (pContactIds) { @@ -157,9 +164,10 @@ BulkMailUtils.openAddRecipientView = function (pContactIds) } /** - * deletes all bulk mail recipients that have a commrestriction for emails + * Deletes all bulk mail recipients that have a commrestriction for emails.<br> * - * @param {String} pBulkMailId + * @param {String} pBulkMailId <p> + * The mail id.<br> */ BulkMailUtils.removeCommRestrictionRecipients = function (pBulkMailId) { @@ -176,10 +184,12 @@ BulkMailUtils.removeCommRestrictionRecipients = function (pBulkMailId) } /** - * adds recipients to a bulkmail + * Adds recipients to a bulkmail.<br> * - * @param {String} pBulkMailId bulk mail id - * @param {String[]} pContactIds contact ids of the recipients + * @param {String} pBulkMailId <p> + * Bulk mail id.<br> + * @param {String[]} pContactIds <p> + * Contact ids of the recipients.<br> */ BulkMailUtils.addRecipients = function (pBulkMailId, pContactIds) { @@ -209,16 +219,21 @@ BulkMailUtils.addRecipients = function (pBulkMailId, pContactIds) } /** - * Loads the document template of a bulk mail. If the bulk mail itself has a - * template, it is preferred over the documentTemplate-id. - * - * @param {String} pBulkMailId bulkmail id - * @param {String} pDocumentTemplateId documentTemplate id - * @param {Boolean} [pResolveSubtemplates=true] if true subtemplates are resolved (if the type is html) - * @param {Boolean} [pUseTemplateAttachments=false] if true the attachments from the document template is always used - * @param {FileUpload} [pUpload] the upload value if a custom template is used + * Loads the document template of a bulk mail. If the bulk mail + * itself has a template, it is preferred over the documentTemplate-id. * - * @return {DocumentTemplate} the document template, null if no content was found. + * @param {String} pBulkMailId <p> + * The id of the bulk mail.<br> + * @param {String} pDocumentTemplateId <p> + * The id of the document template.<br> + * @param {Boolean} pResolveSubtemplates=true (optional) <p> + * If true subtemplates are resolved (if the type is html) + * @param {Boolean} pUseTemplateAttachments=false <p> + * If true the attachments from the document template is always used + * @param {FileUpload} pUpload (optional) <p> + * The upload value if a custom template is used.<br> + * @return {DocumentTemplate} <p> + * The document template, null if no content was found.<br> */ BulkMailUtils.getBulkMailTemplate = function (pBulkMailId, pDocumentTemplateId, pResolveSubtemplates, pUseTemplateAttachments, pUpload) { @@ -242,12 +257,17 @@ BulkMailUtils.getBulkMailTemplate = function (pBulkMailId, pDocumentTemplateId, } /** - * checks if a contact is a recipient of a bulk mail + * Checks if a contact is a recipient of a bulk mail.<br> * - * @param {String} pBulkMailId bulkmail id - * @param {String} pContactId contact id - * @param {String} pRecipientId bulkmailrecipient id - * @return {boolean} true, if the contact is a recipient + * @param {String} pBulkMailId <p> + * The id of the bulk mail.<br> + * @param {String} pContactId <p> + * The contact id.<br> + * @param {String} pRecipientId <p> + * The contact id of the contact where,<br> + * the bulk mail shall sent to.<br> + * @return {boolean} <p> + * True, if the contact is a recipient.<br> */ BulkMailUtils.isRecipient = function (pBulkMailId, pContactId, pRecipientId) { @@ -260,9 +280,10 @@ BulkMailUtils.isRecipient = function (pBulkMailId, pContactId, pRecipientId) } /** - * opens the BulkMail context in new mode + * Opens the BulkMail context in new mode.<br> * - * @param {String[]} [pRecipients] recipients that should be added after creation + * @param {String[]} pRecipients (optional) <p> + * Recipients that should be added after creation.<br> */ BulkMailUtils.newBulkMail = function (pRecipients) { @@ -297,7 +318,10 @@ BulkMailUtils.filterNewRecipients = function (pBulkMailId, pContactIds) } /** - * opens the given bulk mail + * Opens the given bulk mail. + * + * @param {String} pBulkMailId <p> + * The id of the bulk mail.<br> */ BulkMailUtils.openBulkMail = function (pBulkMailId) { @@ -305,10 +329,12 @@ BulkMailUtils.openBulkMail = function (pBulkMailId) } /** - * checks is the given mime type can be used for a bulk mail + * Checks is the given mime type can be used for a bulk mail.<br> * - * @param {String} pMimeType mime type - * @return {Boolean} wheter the type is usable or not + * @param {String} pMimeType <p> + * The mime type.<br> + * @return {Boolean} <p> + * Whether the type is usable or not.<br> */ BulkMailUtils.isValidMimeType = function (pMimeType) { @@ -317,10 +343,12 @@ BulkMailUtils.isValidMimeType = function (pMimeType) } /** - * checks is the given template type can be used for a bulk mail + * Checks is the given template type can be used for a bulk mail.<br> * - * @param {String} pTemplateType template type - * @return {Boolean} wheter the type is usable or not + * @param {String} pTemplateType <p> + * Template type.<br> + * @return {Boolean} <p> + * Whether the type is usable or not.<br> */ BulkMailUtils.isValidTemplateType = function (pTemplateType) { @@ -336,14 +364,26 @@ BulkMailUtils.isValidTemplateType = function (pTemplateType) } /** - * @param {String} pStatus the keyid of the current status - * @return {Boolean} true if the status is "sent" or "sending" + * Checks whether the given status id matches,<br> + * to the status of a bulk mail which is sent or<br> + * not. + * + * @param {String} pStatus <p> + * The key id of the current status.<br> + * @return {Boolean} <p> + * True if the status is "sent" or "sending".<br> */ BulkMailUtils.isStatusSendingOrSent = function (pStatus) { return pStatus == $KeywordRegistry.bulkMailStatus$sent() || pStatus == $KeywordRegistry.bulkMailStatus$beingSent() } +/** + * Opens BulkMail context in new mode, with the given bulk mail id.<br> + * + * @param {String} pBulkMailId <p> + * The id of the bulk mail.<br> + */ BulkMailUtils.copy = function(pBulkMailId) { var params = { @@ -355,10 +395,12 @@ BulkMailUtils.copy = function(pBulkMailId) function SerialLetterUtils () {} /** - * adds recipients to a serial letter + * Adds recipients to a serial letter.<br> * - * @param {String} pSerialLetterId serial letter id - * @param {String[]} pContactIds contact ids of the recipients + * @param {String} pSerialLetterId <p> + * The id of the serial letter.<br> + * @param {String[]} pContactIds <p> + * Contact ids of the recipients.<br> */ SerialLetterUtils.addRecipients = function (pSerialLetterId, pContactIds) { @@ -376,9 +418,11 @@ SerialLetterUtils.addRecipients = function (pSerialLetterId, pContactIds) } /** - * opens a context to select a serial letter to add recipients to + * Opens a context to select a serial letter<br> + * to add recipients to.<br> * - * @param {String[]} pContactIds recipients that should be added + * @param {String[]} pContactIds <p> + * Recipients that should be added.<br> */ SerialLetterUtils.openAddRecipientView = function (pContactIds) { @@ -389,11 +433,13 @@ SerialLetterUtils.openAddRecipientView = function (pContactIds) } /** - * executes a server process that builds a serial letter + * Executes a server process that builds a serial letter.<br> * - * @param {String} pSerialLetterId serial letter id - * @param {String[]} [pRecipientIds] Letter recipient ids of that should be used. - * If omitted, all recipients of the letter will be used. + * @param {String} pSerialLetterId <p> + * The id of the serial letter.<br> + * @param {String[]} pRecipientIds (optional) <p> + * Letter recipient ids of that should be used.<br> + * If omitted, all recipients of the letter will be used.<br> */ SerialLetterUtils.buildSerialLetterOnServer = function (pSerialLetterId, pRecipientIds) { @@ -407,11 +453,13 @@ SerialLetterUtils.buildSerialLetterOnServer = function (pSerialLetterId, pRecipi } /** - * executes a server process that builds a serial letter + * Executes a server process that builds a serial letter.<br> * - * @param {String} pSerialLetterId serial letter id - * @param {String[]} [pRecipientIds] Letter recipient ids of that should be used. - * If omitted, all recipients of the letter will be used. + * @param {String} pSerialLetterId <p> + * Serial letter id.<br> + * @param {String[]} pRecipientIds <p> + * Letter recipient ids of that should be used.<br> + * If omitted, all recipients of the letter will be used.<br> */ SerialLetterUtils.buildSerialLetter = function (pSerialLetterId, pRecipientIds) { @@ -446,12 +494,17 @@ SerialLetterUtils.buildSerialLetter = function (pSerialLetterId, pRecipientIds) } /** - * checks if a contact is a recipient of a serial letter + * Checks if a contact is a recipient of a serial letter.<br> * - * @param {String} pSerialLetterId serial letter id - * @param {String} pContactId contact id - * @param {String} [pRecipientId] letter recipient id - * @return {boolean} true, if the contact is a recipient + * @param {String} pSerialLetterId <p> + * The id of the serial letter.<br> + * @param {String} pContactId <p> + * The contact id of the contact.<br> + * @param {String} pRecipientId (optional) <p> + * Letter recipient id.<br> + * @return {Boolean} <p> + * True, if the contact is a recipient<br> + * and otherwise false.<br> */ SerialLetterUtils.isRecipient = function (pSerialLetterId, pContactId, pRecipientId) { @@ -463,19 +516,29 @@ SerialLetterUtils.isRecipient = function (pSerialLetterId, pContactId, pRecipien .cell() != "0"; // TODO: is there a way exists could be used? } +/** + * Opens the serial letter context in new mode, with<br> + * the given serial letter id.<br> + * + * @param {String} pSerialLetterId <p> + * The id of the serial letter.<br> + */ SerialLetterUtils.openSerialLetter = function (pSerialLetterId) { neon.openContext("SerialLetter", "SerialLetterMain_view", [pSerialLetterId], neon.OPERATINGSTATE_VIEW, null); } /** - * Loads the document template of a serial letter. If the serial letter itself has a - * template, it is preferred over the documentTemplate-id. - * - * @param {String} pLetterId serial letter id - * @param {String} pDocumentTemplateId documentTemplate id + * Loads the document template of a serial letter. <br> + * If the serial letter itself has a template, it is <br> + * preferred over the documentTemplate-id.<br> * - * @return {DocumentTemplate} the document template + * @param {String} pLetterId <p> + * The id of the serial letter.<br> + * @param {String} pDocumentTemplateId <p> + * The id of the document template.<br> + * @return {DocumentTemplate} <p> + * The document template.<br> */ SerialLetterUtils.getSerialLetterTemplate = function (pLetterId, pDocumentTemplateId) { diff --git a/process/Calendar_lib/process.js b/process/Calendar_lib/process.js index 2241543df91e320e981d5ecfdcb4116252f13b57..7820ef4c7b5061a2dad85569762db68254816007 100644 --- a/process/Calendar_lib/process.js +++ b/process/Calendar_lib/process.js @@ -18,27 +18,43 @@ import("system.util") /** - * @class - **/ + * Functions for the calendar. + * <p> + * <b><u>Do not create an instance of this!</u></b> + * @class + */ function CalendarUtil(){} /* - * Erzeugt und öffnet ein neues Aufgabenobjekt (mit einem Link). + * Creates and opens an new task object (with link). * - * @param {String} pSummary opt die Zusammenfassung - * @param {String} pDescription opt die Beschreibung - * @param {Boolean} pWithLink opt TRUE legt eine Verknüpfung zu $image.frametable - * @param {String[][]} pWithLink opt pWithLink[0]: Name des Frames - * pWithLink[1]: ID des angezeigten Datensatzes - * pWithLink[2]: Verknüpfungstitel - * @param {String} pUser opt der Benutzer ( Login ) - * @param {[]} pAffectedUsers opt die betroffenen Benutzer ( Login ) - * @param {date} pStart opt Beginn der Aufgabe - * @param {date} pDuration opt Dauer - * @param {integer} pCategory opt ( calendars.CATEGORIES , encoded(String) z.B.: text.encodeMS(["Service"]) ) - * @param {String} pStatus opt Status des Termins ( calendars.STATUS_TENTATIVE, calendars.STATUS_CONFIRMED, calendars.STATUS_CANCELLED ) - * @param {Array{[]} pComps4Refresh opt die zu aktualisierenden Komponenten + * @param {String} pSummary (optional) <p> + * The summary.<br> + * @param {String} pDescription (optional) <p> + * The description.<br> + * @param {Boolean} pWithLink (optional) Case if its true, then an a shortcut to $image.frametable will created.<br> + * @param {String[][]} pWithLink (optional) <p> + * The required informations:<br> + * <ul> + * <li>pWithLink[0]: Name of the frame.</li> + * <li>pWithLink[1]: Id of the shown record.</li> + * <li>pWithLink[2]: Linking title.</li> + * @param {String} pUser (optional) <p> + * The user (login).<br> + * @param {[]} pAffectedUsers (optional) <p> + * The affected users. (login)<br> + * @param {date} pStart (optional) <p> + * Start of the task.<br> + * @param {date} pDuration (optional) <p> + * Duration of the task.<br> + * @param {integer} pCategory (optional) <p> + * calendars.CATEGORIES , encoded(String) (e.g.: text.encodeMS(["Service"])) + * @param {String} pStatus (optional) <p> + * Status of the appointment. (calendars.STATUS_TENTATIVE, <br> + * calendars.STATUS_CONFIRMED, calendars.STATUS_CANCELLED)<br> + * @param {Array{[]} pComps4Refresh (optional) <p> + * The component which will be updated.<br> * * @return {void} */ @@ -70,11 +86,17 @@ CalendarUtil.newTodo = function(pSummary, pDescription, pWithLink, pUser, pAffec /** - * Finds the effective calendarId of an user in the same attribute order like the ADITO core, which is exchangeEmail -> calendarID -> email - * DO NOT CHANGE THIS ORDER + * Finds the effective calendarId of an user in the same <br> + * attribute order like the ADITO core, which is:<br> + * <p> + * exchangeEmail -> calendarID -> email<br> + * <p> + * <b><u>DO NOT CHANGE THIS ORDER!</u></b> * - * @param {String} pUser to check - * @return effective calendar id + * @param {String} pUser <p> + * To check. + * @return <p> + * Effective calendar id.<br> */ CalendarUtil.getEffectiveCalendarIdFromUser = function(pUser) { @@ -96,23 +118,40 @@ CalendarUtil.getEffectiveCalendarIdFromUser = function(pUser) } /* - * Erzeugt eine neue Aufgabe (mit einem Link). + * Creates an new task (with link). * - * @param {String} pSummary opt die Zusammenfassung - * @param {String} pDescription opt die Beschreibung - * @param {Boolean} pWithLink opt TRUE legt eine Verknüpfung zu $image.frametable - * @param {String[][]} pWithLink opt pWithLink[0]: Name des Frames - * pWithLink[1]: ID des angezeigten Datensatzes - * pWithLink[2]: Verknüpfungstitel - * @param {String} pUser opt der Benutzer ( Login ) - * @param {[]} pAffectedUsers opt die betroffenen Benutzer ( Login ) - * @param {date} pStart opt Beginn der Aufagebe - * @param {integer} pGroupType opt ( calendars.GROUP_SINGLE , calendars.GROUP_MULTI ) - * @param {date} pDuration opt Dauer - * @param {integer} pCategory opt ( calendars.CATEGORIES , encoded(String) z.B.: text.encodeMS(["Service"]) ) - * @param {String} pStatus opt Status der Aufgabe ( calendars.STATUS_TENTATIVE, calendars.STATUS_CONFIRMED, calendars.STATUS_CANCELLED ) - * @param {String} pPriority opt Priorität der Aufgabe - * @param {String} pReminder opt Erinnerung der Aufgabe + * @param {String} pSummary (optional) <p> + * The summary. + * @param {String} pDescription (optional) <p> + * The description. + * @param {Boolean} pWithLink (optional) <p> + * True sets an linking to $image.frametable.<br> + * @param {String[][]} pWithLink (optional) <p> + * Description:<br> + * <ul> + * <li>pWithLink[0]: Name of the record</li> + * <li>pWithLink[1]: Id of the shown record</li> + * <li>pWithLink[2]: linking title</li> + * </ul> + * @param {String} pUser (optional) <p> + * The user (login). + * @param {[]} pAffectedUsers (optional) <p> + * The afftected users (login). + * @param {date} pStart (optional) <p> + * Start of the appointment.<br> + * @param {integer} pGroupType (optional) <p> + * calendars.GROUP_SINGLE , calendars.GROUP_MULTI + * @param {date} pDuration (optional) <p> + * Duration of the appointment.<br> + * @param {integer} pCategory (optional) <p> + * calendars.CATEGORIES , encoded(String) (e.g.: text.encodeMS(["Service"])).<br> + * @param {String} pStatus (optional) <p> + * Status of the task (calendars.STATUS_TENTATIVE, calendars.STATUS_CONFIRMED, <br> + * calendars.STATUS_CANCELLED).<br> + * @param {String} pPriority (optional) <p> + * Priority of the task.<br> + * @param {String} pReminder (optional) <p> + * Reminder for the task.<br> * * @return {void} */ @@ -126,22 +165,41 @@ CalendarUtil.newSilentTodo = function(pSummary, pDescription, pWithLink, pUser, } /* - * Erzeugt und öffnet ein neues Terminnobjekt mit einem Link. + * Creates and opens an new appointment object (with link). * - * @param {String} pSummary opt die Zusammenfassung - * @param {String} pDescription opt die Beschreibung - * @param {Boolean} pWithLink opt TRUE legt eine Verknüpfung zu $image.frametable - * @param {String[][]} pWithLink opt pWithLink[0]: Name des Frames - * pWithLink[1]: ID des angezeigten Datensatzes - * pWithLink[2]: Verknüpfungstitel - * @param {String} pUser opt der Benutzer ( Login ) - * @param {[]} pAffectedUsers opt die betroffenen Benutzer ( Login ) - * @param {date} pStart opt Beginn der Aufagebe - * @param {date} pDuration opt Dauer - * @param {integer} pCategory opt ( calendars.CATEGORIES , encoded(String) z.B.: text.encodeMS(["Service"]) ) - * @param {String} pStatus opt Status des Termins ( calendars.STATUS_TENTATIVE, calendars.STATUS_CONFIRMED, calendars.STATUS_CANCELLED ) - * @param {Array{[]} pComps4Refresh opt die zu aktualisierenden Komponenten - * @param {Array{[]} pWorklistId opt + * @param {String} pSummary (optional) <p> + * The summary.<br> + * @param {String} pDescription (optional) <p> + * The description.<br> + * @param {Boolean} pWithLink (optional) <p> + * True sets an link to $image.frametable<br> + * @param {String[][]} pWithLink (optional) Description:<br> + * <ul> + * <li>pWithLink[0]: Name of the frame</li> + * <li>pWithLink[1]: Id of the shown record</li> + * <li>pWithLink[2]: linking title</li> + * </ul> + * @param {String} pUser (optional) <p> + * The user (login). + * @param {[]} pAffectedUsers (optional) <p> + * The affected users (login). + * @param {Date} pStart (optional) <p> + * Begin of the task.<br> + * @param {Date} pDuration (optional) <p> + * Duration.<br> + * @param {Number} pCategory (optional) <p> + * calendars.CATEGORIES , encoded(String) (z.B.: text.encodeMS(["Service"])).<br> + * @param {String} pStatus (optional) <p> + * Status of the appointment:<br> + * <ul> + * <li>calendars.STATUS_TENTATIVE</li> + * <li>calendars.STATUS_CONFIRMED</li> + * <li>calendars.STATUS_CANCELLED</li> + * </ul> + * @param {Array{[]} pComps4Refresh (optional) <p> + * The component which will be updated.<br> + * @param {Array{[]} pWorklistId (optional) <p> + * The worklist id.<br> * * @return {void} */ @@ -172,23 +230,47 @@ CalendarUtil.newEvent = function( pSummary, pDescription, pWithLink, pUser, pAff /* - * Erzeugt einen neuen Termineintrag (mit einem Link). - * - * @param {String} pSummary opt die Zusammenfassung - * @param {String} pDescription opt die Beschreibung - * @param {Boolean} pWithLink opt TRUE legt eine Verknüpfung zu $image.frametable - * @param {String[][]} pWithLink opt pWithLink[0]: Name des Frames - * pWithLink[1]: ID des angezeigten Datensatzes - * pWithLink[2]: Verknüpfungstitel - * @param {String} pUser opt der Benutzer ( Login ) - * @param {[]} pAffectedUsers opt die betroffenen Benutzer ( Login ) - * @param {date} pStart opt Beginn des Termins - * @param {date} pDuration opt Dauer - * @param {integer} pGroupType opt ( calendars.GROUP_SINGLE , calendars.GROUP_MULTI ) - * @param {integer} pCategory opt ( calendars.CATEGORIES , encoded(String) z.B.: text.encodeMS(["Service"]) ) - * @param {String} pStatus opt Status des Termins ( calendars.STATUS_TENTATIVE, calendars.STATUS_CONFIRMED, calendars.STATUS_CANCELLED ) - * @param {String} pReminder opt Erinnerung des Termins + * Creates an new appointment entry (with link). * + * @param {String} pSummary (optional) <p> + * The summary.<br> + * @param {String} pDescription (optional) <p> + * The description.<br> + * @param {Boolean} pWithLink (optional) <p> + * True, sets an linking to $image.frametable.<br> + * @param {String[][]} pWithLink (optional) <p> + * Description:<br> + * <ul> + * <li>pWithLink[0]: Name of the frame</li> + * <li>pWithLink[1]: Id of the shown record</li> + * <li>pWithLink[2]: Linking title</li> + * </ul> + * @param {String} pUser (optional) <p> + * The user (login).<br> + * @param {[]} pAffectedUsers (optional) <p> + * The affected users.<br> + * @param {date} pStart (optional) <p> + * Start of the appointment.<br> + * @param {date} pDuration (optional) <p> + * Duration of the appointment.<br> + * @param {integer} pGroupType (optional) <p> + * The group type:<br> + * <ul> + * <li>calendars.GROUP_SINGLE</li> + * <li>calendars.GROUP_MULTI</li> + * </ul> + * @param {integer} pCategory (optional) <p> + * calendars.CATEGORIES , encoded(String) (e.g.: text.encodeMS(["Service"])) + * @param {String} pStatus (optional) <p> + * Status of the appointment:<br> + * <ul> + * <li>calendars.STATUS_TENTATIVE</li> + * <li>calendars.STATUS_CONFIRMED</li> + * <li>calendars.STATUS_CANCELLED</li> + * </ul> + * @param {String} pReminder (optional) <p> + * Reminder for the appointment.<br> + * <p> * @return {void} */ CalendarUtil.newSilentEvent = function( pSummary, pDescription, pWithLink, pUser, pAffectedUsers, pStart, pDuration, pGroupType, pCategory, pStatus, pReminder) @@ -199,25 +281,47 @@ CalendarUtil.newSilentEvent = function( pSummary, pDescription, pWithLink, pUser } /* - * Erzeugt ein neues Aufgaben- / Termin-Objekt (mit einem Link). - * - * @param {String} pUid - * @param {date} pType req Augabe oder Termin ( calendars.VTODO, calendars.VEVENT ) - * @param {String} pSummary opt die Zusammenfassung - * @param {String} pDescription opt die Beschreibung - * @param {Boolean} pWithLink opt TRUE legt eine Verknüpfung zu $image.frametable - * @param {Boolean} pAppLinkContext opt Name des Frames - * @param {Boolean} pAppLinkId opt ID des angezeigten Datensatzes - * @param {String} pUser opt der Benutzer ( Login ) - * @param {[]} pAffectedUsers opt die betroffenen Benutzer ( [ Login ] ) - * @param {date} pStart opt Beginn - * @param {date} pDuration opt Dauer - * @param {integer} pCategory opt ( calendars.CATEGORIES , encoded(String) z.B.: text.encodeMS(["Service"]) ) - * @param {String} pStatus opt Status des Termins ( calendars.STATUS_TENTATIVE, calendars.STATUS_CONFIRMED, calendars.STATUS_CANCELLED ) - * @param {String} pPriority opt Priorität - * @param {String} pReminder opt Erinnerung + * Creates an new task-/appointment object (with link). * -@return {Object} das EntryObjekt + * @param {String} pUid <p> + * The uuid.<br> + * @param {Date} pType <p> + * Tasks or appointments:<br> + * <ul> + * <li>calendars.VTODO</li> + * <li>calendars.VEVENT</li> + * </ul> + * @param {String} pSummary (optional) <p> + * The summary.<br> + * @param {String} pDescription (optional) <p> + * The description.<br> + * @param {Boolean} pWithLink (optional) <p> + * True, sets an linking to $image.frametable.<br> + * @param {Boolean} pAppLinkContext (optional) <p> + * Name of the frame.<br> + * @param {Boolean} pAppLinkId (optional) <p> + * Id of the shown record.<br> + * @param {String} pUser (optional) <p> + * The user (login).<br> + * @param {[]} pAffectedUsers (optional) <p> + * The affected users ([login]).<br> + * @param {Date} pStart (optional) <p> + * Start of the task/appointment.<br> + * @param {Date} pDuration (optional) <p> + * Duration of the task/appointment.<br> + * @param {Number} pCategory (optional) <p> + * calendars.CATEGORIES , encoded(String) (e.g.: text.encodeMS(["Service"]))<br> + * @param {String} pStatus (optional) Status of the appointment:<br> + * <ul> + * <li>calendars.STATUS_TENTATIVE</li> + * <li>calendars.STATUS_CONFIRMED</li> + * <li>calendars.STATUS_CANCELLED</li> + * </ul> + * @param {String} pPriority (optional) <p> + * Priority of the task/appointment.<br> + * @param {String} pReminder (optional) <p> + * Reminder.<br> + * @return {Object} <p> */ CalendarUtil.createEntry = function(pUid, pType, pSummary, pDescription, pWithLink, pAppLinkContext, pAppLinkId, pUser, pAffectedUsers, pStart, pDuration, pCategory, pStatus, pPriority, pReminder ) { @@ -356,12 +460,14 @@ CalendarUtil.createEntry = function(pUid, pType, pSummary, pDescription, pWithLi } /* - * Fügt eine Condition hinzu - * - * @param {[]} pConditions req die Conditions - * @param {Integer} pIndex req Index der Condition - * @param {Object} pValues req + * Add an condition.<br> * + * @param {[]} pConditions <p> + * The condition.<br> + * @param {Integer} pIndex <p> + * Index of the condition.<br> + * @param {Object} pValues <p> + * The values.<br> * @return {void} */ CalendarUtil.addEntryCondition = function(pConditions, pIndex, pValues) @@ -373,11 +479,12 @@ CalendarUtil.addEntryCondition = function(pConditions, pIndex, pValues) } /* - * Liefert das Datum ohne Urzeit zurück - * - * @param {String} datetimeIn req DatumZeit + * Returns the date without the time.<br> * - * @return {date} + * @param {String} datetimeIn <p> + * Datetime.<br> + * @return {Date} <p> + * The desired date.<br> */ CalendarUtil.getDate = function(datetimeIn) { @@ -387,9 +494,9 @@ CalendarUtil.getDate = function(datetimeIn) } /* - * Setzt den Event-Filter zurück + * Resets the event filter.<br> * - * @return {filter} + * @return {Object} */ CalendarUtil.reset_filterEvent = function() { @@ -411,6 +518,7 @@ CalendarUtil.reset_filterEvent = function() /* * Gibt den richtigen Status zum Prüfen je nach Backend zurück + * Returns the matching status, to the corresponding backend. * * * @param {String} pStatus req die konstante für den zu prüfenden status, @@ -441,10 +549,17 @@ CalendarUtil.mapCalendarStatus = function(pStatus, pCalendarType) } /** - * Returns the "real" calendar system/backend type (BackendType & SyncBackendType) + * Returns the "real" calendar system/backend type<br> + * (e.g.: BackendType & SyncBackendType) * - * @param {Number} pScope - The needed scope (e.g. "calendars.VEVENT", "calendars.VTODO") - * @return {Number} - The backend type (calendars.BACKEND_*) + * @param {Number} pScope <p> + * The needed scope:<br> + * <ul> + * <li>calendars.VEVENT</li> + * <li>calendars.VTODO</li> + * </ul> + * @return {Number} <p> + * The backend type (e.g.: calendars.BACKEND_*).<br> */ CalendarUtil.getCalendarSystemType = function(pScope) { diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js index 9d80baee3dfcb1d6279109b72e9ac4c9651223d0..c159f8c6c2187ae0d75b2f02bd5a5d6dd73e6e99 100644 --- a/process/Campaign_lib/process.js +++ b/process/Campaign_lib/process.js @@ -8,18 +8,21 @@ import("KeywordRegistry_basic"); import("Neon_lib"); /** - * Methods for campaignmanagement. - * Do not create an instance of this! + * Methods for campaignmanagement.<br> + * <p> + * <u><b>Do not create an instance of this!</b></u> * * @class */ function CampaignUtils() {} /** - * Add many Contacts (Person or Organistaion) to a Campaign + * Add many contacts (person or organistaion) to a campaign.<br> * - * @param {String} pRowIds ContactIds as JSON array - * @param {String} pSourceTableName req + * @param {String} pRowIds <p> + * The contact ids as JSON array.<br> + * @param {String} pSourceTableName <p> + * The source table.<br> */ CampaignUtils.addParticipantsByRowIds = function(pRowIds, pSourceTableName) { @@ -28,10 +31,12 @@ CampaignUtils.addParticipantsByRowIds = function(pRowIds, pSourceTableName) } /** - * Add many Contacts (Person or Organistaion) to a Campaign + * Add many contacts (person or organistaion) to a campaign.<br> * - * @param {String} pCondition req ContactIds - * @param {String} pSourceTableName req + * @param {String} pCondition <p> + * Contact ids. + * @param {String} pSourceTableName <p> + * The source table.<br> */ CampaignUtils.addParticipantsByCondition = function(pCondition, pSourceTableName) { @@ -40,8 +45,11 @@ CampaignUtils.addParticipantsByCondition = function(pCondition, pSourceTableName } /** - * Gets the campaign name per Id - * @return Name of a campaign, empty string if no campaign could be found for the id + * Gets the campaign name per id.<br> + * + * @return <p> + * Name of a campaign, empty string if no campaign could<br> + * be found for the id.<br> */ CampaignUtils.getCampaignNameById = function(pCampaignId) { @@ -52,8 +60,11 @@ CampaignUtils.getCampaignNameById = function(pCampaignId) } /** - * Gets the campaign step name per Id - * @return Name of a campaignstep, empty string if no step could be found for the id + * Gets the campaign step name per Id.<br> + * + * @return <p> + * Name of a campaignstep, empty string if no step could <br> + * be found for the id.<br> */ CampaignUtils.getCampaignStepNameById = function(pCampaignStepId) { @@ -64,8 +75,10 @@ CampaignUtils.getCampaignStepNameById = function(pCampaignStepId) } /** - * The current count of participants in the given campaignstep - * @return count of participants, 0 if no campaignstep could be found for the id + * The current count of participants in the given campaignstep.<br> + * @return <p> + * Count of participants, 0 if no campaignstep <br> + * could be found for the id.<br> */ CampaignUtils.getParticipantCountForStep = function(pCampaignStepId, pCampaignId) { @@ -77,8 +90,11 @@ CampaignUtils.getParticipantCountForStep = function(pCampaignStepId, pCampaignId } /** - * The current count of participants in the given campaign - * @return count of participants, 0 if no campaign could be found for the id + * The current count of participants in the given campaign.<br> + * + * @return <p> + * Count of participants, 0 if no campaign <br> + * could be found for the id.<br> */ CampaignUtils.getParticipantCount = function(pCampaignId) { @@ -89,8 +105,11 @@ CampaignUtils.getParticipantCount = function(pCampaignId) } /** - * The max participants value for the given campaignstep - * @return max count of participants, 0 if no campaignstep could be found for the id + * The max participants value for the given campaignstep.<br> + * + * @return <p> + * Maximum count of participants, 0 if no <br> + * campaignstep could be found for the id.<br> */ CampaignUtils.getMaxParticipantCountForStep = function(pCampaignStepId) { @@ -100,6 +119,14 @@ CampaignUtils.getMaxParticipantCountForStep = function(pCampaignStepId) .cell(true, 0); } +/** + * Returns how much steps a campaign have.<br> + * + * @param {String} pCampaignId <p> + * The corresponding campaign id.<br> + * @return {String} <p> + * Number of steps corresponds to the given campaign id.<br> + */ CampaignUtils.getStepCount = function(pCampaignId) { return newSelect("count(*)") @@ -108,31 +135,73 @@ CampaignUtils.getStepCount = function(pCampaignId) .cell(true, 0); } +/** + * Gets the campaign status back, correpsonds to the given campaign id.<br> + * + * @param {String} <p> + * The campaign id.<br> + * @return {String} <p> + * The view value of the campaign status (keyword). + */ CampaignUtils.getCampaignStatusByCampaignId = function(pCampaignId) { let campaignState = $KeywordRegistry.campaignState(); let statusId = newSelect("CAMPAIGN.STATUS") - .from("CAMPAIGN") - .whereIfSet("CAMPAIGN.CAMPAIGNID", pCampaignId) - .cell(true); + .from("CAMPAIGN") + .whereIfSet("CAMPAIGN.CAMPAIGNID", pCampaignId) + .cell(true); return KeywordUtils.getViewValue(campaignState, statusId); } -CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, pPreviousCampaignstepId) +/** + * Creates an entry in the CAMPAIGNPARTICIPANTLOG table.<br> + * + * @param {String} pCampaignId <p> + * The corresponding campaign id.<br> + * @param {String} pCampaignStepId <p> + * The current campaign step id.<br> + * @param {String} pContactId <p> + * The contact id,<br> + * @param {String} pCampaignParticipantId <p> + * The contact id of the campaign participant.<br> + * @param {String} pPreviousCampaignStepId <p> + * The id of the previous campaign step.<br> + * @return {Boolean} <p> + * Returns true in case the entry was successfully made.<br> + */ +CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, pPreviousCampaignStepId) { let colsCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnNames(); - let valsCampaignParticipantLog = new Array(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"), pPreviousCampaignstepId); + let valsCampaignParticipantLog = new Array(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"), pPreviousCampaignStepId); let rows = db.insertData("CAMPAIGNPARTICIPANTLOG", colsCampaignParticipantLog, null, valsCampaignParticipantLog); return (rows == 1); } +/** + * Returns the corresponding column names of the table: <b>CAMPAIGNPARTICIPANTLOG</b>.<br> + * + * @return {Array} <p> + * The column names.<br> + */ CampaignUtils.getParticipantLogInsertColumnNames = function() { return ["CAMPAIGNPARTICIPANT_ID", "CAMPAIGN_ID", "CAMPAIGNSTEP_ID", "CAMPAIGNPARTICIPANTLOGID", "USER_NEW", "DATE_NEW", "PREVIOUS_CAMPAIGNSTEP_ID"]; } +/** + * Opens the CampaignAddParticipants context in new mode. + * + * @param {String} pParticipantIds <p> + * The ids of the participant which you want to move to<br> + * the next campaign step.<br> + * @param {String} pCampaignId <p> + * The id of the campaign.<br> + * @param {String} pCampaignStepId <p> + * The id of the new campaign step.<br> + * + */ CampaignUtils.openSetCampaignStepViewByRowIds = function(pParticipantIds, pCampaignId, pCampaignStepId) { var params = {}; @@ -144,6 +213,17 @@ CampaignUtils.openSetCampaignStepViewByRowIds = function(pParticipantIds, pCampa neon.openContext("CampaignAddParticipants", "CampaignAddParticipantsEdit_view", null, neon.OPERATINGSTATE_NEW, params); } +/** + * Opens the CampaignAddParticipants context in new mode.<br> + * + * @param {String} pCondition <p> + * The condition which will be used to select the specific<br> + * participants, which campaign step shall be updated.<br> + * @param {String} pCampaignId <p> + * The id of the campaign.<br> + * @param {String} pCampaignStepId <p> + * The id of the new campaign step.<br> + */ CampaignUtils.openSetCampaignStepViewByCondition = function(pCondition, pCampaignId, pCampaignStepId) { var params = {}; @@ -156,9 +236,11 @@ CampaignUtils.openSetCampaignStepViewByCondition = function(pCondition, pCampaig } /** - * Opens the view to create a new Step in the specified campaign + * Opens the CampaignStep context in new mode.<br> * - * @param {String} pCampaignId of the campaign for which the step should be created + * @param {String} pCampaignId <p> + * The id of the campaign on which you want to create a new<br> + * campaign step.<br> */ CampaignUtils.openNewCampaignStepView = function(pCampaignId) { @@ -171,7 +253,8 @@ CampaignUtils.openNewCampaignStepView = function(pCampaignId) } /** - * Opens the view to create a new campaign + * Opens the Campaign context in new mode.<br> + * */ CampaignUtils.openNewCampaignView = function() { @@ -180,6 +263,14 @@ CampaignUtils.openNewCampaignView = function() neon.openContext("Campaign", "CampaignEdit_view", null, neon.OPERATINGSTATE_NEW, params); } +/** + * Returns the id of the first campaign step.<br> + * + * @param {String} pCampaignId <p> + * The id of the campaign, from which you want<br> + * the first campaign step back.<br> + * @return {String} The id of the first campaign step.<br> + */ CampaignUtils.getDefaultCampaignStep = function(pCampaignId) { return newSelect("CAMPAIGNSTEPID") @@ -189,6 +280,15 @@ CampaignUtils.getDefaultCampaignStep = function(pCampaignId) .cell(); } +/** + * Returns the start date to the corresponding campaign id.<br> + * + * @param {String} pCapmaignId <p> + * The corresponding campaign id.<br> + * @return {String} <p> + * The end date in this format:<br> + * <b>yyyy-mm-dd</b> + */ CampaignUtils.getCampaignStartDate = function(pCapmaignId) { return newSelect("DATE_START") @@ -198,6 +298,15 @@ CampaignUtils.getCampaignStartDate = function(pCapmaignId) .cell(true); } +/** + * Returns the end date to the corresponding campaign id.<br> + * + * @param {String} pCapmaignId <p> + * The corresponding campaign id.<br> + * @return {String} <p> + * The end date in this format:<br> + * <b>yyyy-mm-dd</b> + */ CampaignUtils.getCampaignEndDate = function(pCapmaignId) { return newSelect("DATE_END") @@ -207,6 +316,14 @@ CampaignUtils.getCampaignEndDate = function(pCapmaignId) .cell(true); } +/** + * Returns the, to the current system language, translated<br> + * message that the maximum participant count has to be equal<br> + * or greater than the count of the current participants.<br> + * + * @return {String} <p> + * The translated string.<br> + */ CampaignUtils.getMaxParticipantsValidationMessage = function() { //todo how/where should this text be stored? @@ -214,12 +331,15 @@ CampaignUtils.getMaxParticipantsValidationMessage = function() } /** - * Deletes a single campaign step and all related data including: - * Participant logs - * Participants - * Costs - * The step - * @param {String} pCampaignStepId ID of the campaign step to delete + * Deletes a single campaign step and all related data including:<br> + * <ul> + * <li>participant logs</li> + * <li>participants</li> + * <li>costs</li> + * <li>the step</li> + * + * @param {String} pCampaignStepId <p> + * The corresponding id of the campaign step.<br> */ CampaignUtils.deleteCampaignStepData = function(pCampaignStepId) { @@ -239,12 +359,16 @@ CampaignUtils.deleteCampaignStepData = function(pCampaignStepId) } /** - * Deletes a campaign and all related data including: - * All campaign steps including all step related data - * All members - * All costs - * And the campaign itself - * @param {String} pCampaignId ID of the Campaign to delete + * Deletes a campaign and all related data including:<br> + * <ul> + * <li>all campaign steps including all step related data</li> + * <li>all members</li> + * <li>all costs</li> + * <li>the campaign itself</li> + * </ul> + * + * @param {String} pCampaignId <p> + * The corresponding id of the campaign id.<br> */ CampaignUtils.deleteCampaignData = function(pCampaignId) { @@ -268,6 +392,16 @@ CampaignUtils.deleteCampaignData = function(pCampaignId) db.deletes(campaignRelated) } +/** + * Updates the start and the end date of the campaign step.<br> + * + * @param {String} pCampaignStepId <p> + * The id of the campaign step.<br> + * @param {String} pDateStart <p> + * The new start date.<br> + * @param {String} pDateEnd <p> + * The new end date.<br> + */ CampaignUtils.updateCampaignStep = function(pCampaignStepId, pDateStart, pDateEnd) { if(pCampaignStepId == null || pCampaignStepId == "") @@ -279,19 +413,38 @@ CampaignUtils.updateCampaignStep = function(pCampaignStepId, pDateStart, pDateEn campaignStepIdCondition.updateData(true, "CAMPAIGNSTEP", columnsToUpdate, null, newValues); } -CampaignUtils.checkforCommRestrictions = function(contactid, campaignstepid) + +/** + * Checks whether the given contact in the campaign step<br> + * has communication restrictions for a specific medium.<br> + * + * @param {String} pContactId <p> + * The corresponding id of the contact.<br> + * @param {String} pCampaignStepId <p> + * The corresponding id of the campaign step.<br> + * @return <p> + * Returns the medium, on which the contact has<br> + * a communication restriction set.<br> + */ +CampaignUtils.checkforCommRestrictions = function(pContactId, pCampaignStepId) { return newSelect("MEDIUM") .from("CAMPAIGNSTEP") - .where("COMMRESTRICTION.CONTACT_ID", contactid) + .where("COMMRESTRICTION.CONTACT_ID", pContactId) .join("COMMRESTRICTION", "MEDIUM = STEPMEDIUM") - .and("CAMPAIGNSTEP.CAMPAIGNSTEPID", campaignstepid) + .and("CAMPAIGNSTEP.CAMPAIGNSTEPID", pCampaignStepId) .cell(); } /** - * @param {SqlBuilder} pWhereCondition an SqlBuilder object containing a condition to select from campaignparticipant - * @return {String} the counts (as string) + * Returns number of participants on which the given<br> + * where condition matches.<br> + * + * @param {Object} pWhereCondition <p> + * An SqlBuilder object containing a condition to<br> + * select the corresponding campaign participants.<br> + * @return {String} <p> + * The counting.<br> */ CampaignUtils.GetParticipantsCountByCondition = function(pWhereCondition) { @@ -306,9 +459,15 @@ CampaignUtils.GetParticipantsCountByCondition = function(pWhereCondition) } /** - * @param {SqlBuilder} pWhereCondition - * @param {Boolean} pRightJoinContacts - * @return {String} the counts (as string) + * Returns the number of the contact which are already added to a campaign.<br> + * + * @param {Object} pWhereCondition <p> + * An SqlBuilder object containing a condition to<br> + * select the corresponding campaign participants.<br> + * @param {Boolean} pRightJoinContacts <p> + * If this true, a prefix will used to do a right join.<br> + * @return {String} <p> + * The number of participants.<br> */ CampaignUtils.GetParticipantsAlreadyAddedCountByCondition = function(pWhereCondition, pRightJoinContacts) { @@ -331,6 +490,17 @@ CampaignUtils.GetParticipantsAlreadyAddedCountByCondition = function(pWhereCondi return select.cell(); } +/** + * Returns the contact ids which aren't in the given campaign.<br> + * + * @param {String} pCampaignId <p> + * The id of the campaign.<br> + * @param {String[]} pParticipantRowIds <p> + * The participant ids.<br> + * @return {String[]} <p> + * The contact ids which arent in the<br> + * given campaign.<br> + */ CampaignUtils.GetContactIdsNotInCampaignByRowIds = function(pCampaignId, pParticipantRowIds) { return newSelect("CONTACT.CONTACTID") @@ -344,6 +514,21 @@ CampaignUtils.GetContactIdsNotInCampaignByRowIds = function(pCampaignId, pPartic .arrayColumn(); } +/** + * Returns the contact ids which arent in the campaign<br> + * with the given campaign id.<br> + * + * @param {String} pCampaignId <p> + * The id of the campaign.<br> + * @param {String} pCondition (optional) <p> + * An condition which could used to<br> + * limit the search result.<br> + * @param {Boolean} pRightJoinContacts <p> + * Case if its true, a prefix will used<br> + * to do a right join.<br> + * @return {String[]} <p> + * The contact ids they arent in the campaign.<br> + */ CampaignUtils.GetContactIdsNotInCampaignByCondition = function(pCampaignId, pCondition, pRightJoinContacts) { let query = newSelect("CONTACT.CONTACTID").from("PERSON"); @@ -368,6 +553,19 @@ CampaignUtils.GetContactIdsNotInCampaignByCondition = function(pCampaignId, pCon return query.arrayColumn(); } +/** + * Returns the contact ids which are in the campaign,<br> + * with the given campaign id.<br> + * + * @param {String} pCampaignId <p> + * The id of the campaign.<br> + * @param {String} pCondition <p> + * The condition which shall be used, to<br> + * limit the search result.<br> + * @return {String[]} <p> + * The contact ids which are in the given<br> + * campaign.<br> + */ CampaignUtils.GetContactIdsInCampaignByCondition = function(pCampaignId, pCondition, pRightJoinContacts) { let query = newSelect("CONTACT.CONTACTID").from("CONTACT"); @@ -385,6 +583,9 @@ CampaignUtils.GetContactIdsInCampaignByCondition = function(pCampaignId, pCondit return query.arrayColumn(); } +/** + * + */ CampaignUtils.GetContactCountByCondition = function(pCondition, pLookInCampaignOnly, pRightJoinContacts) { let query = newSelect("count(*)").from("PERSON"); @@ -407,13 +608,20 @@ CampaignUtils.GetContactCountByCondition = function(pCondition, pLookInCampaignO } /** - * opens an campaign in NEW mode with values from root campaign + * Does a copy from the campaign, with the given campaign<br> + * id and the other values from the parameters.<br> * - * @param {String} pCampaignid - * @param {String} pDescription - * @param {String} pEmplContactId - * @param {String} pName - * @param {String} pState + * @param {String} pCampaignid <p> + * The id of the source campaign.<br> + * @param {String} pDescription <p> + * The new description.<br> + * @param {String} pEmplContactId <p> + * The id of the contact which is<br> + * responsible for this campaign.<br> + * @param {String} pName <p> + * The new name of the campaign.<br> + * @param {String} pState <p> + * The state of the campaign.<br> */ CampaignUtils.copyCampaign = function(pCampaignid, pDescription, pEmplContactId, pName, pState) { @@ -428,10 +636,12 @@ CampaignUtils.copyCampaign = function(pCampaignid, pDescription, pEmplContactId, } /** - * copies all campaign steps from one campaign to another + * Copies all campaign steps from one campaign to another.<br> * - * @param {String} pSourceCampaignId - * @param {String} pTargetCampaignId + * @param {String} pSourceCampaignId <p> + * The id of the source campaign.<br> + * @param {String} pTargetCampaignId <p> + * The id of the target campaign.<br> */ CampaignUtils.copyCampaignSteps = function(pSourceCampaignId, pTargetCampaignId) { @@ -447,41 +657,27 @@ CampaignUtils.copyCampaignSteps = function(pSourceCampaignId, pTargetCampaignId) } /** - * Methods for campaignmanagement. - * Do not create an instance of this! + * Methods for campaignmanagement.<br> + * <b>Do not create an instance of this!</b> * * @ignore * @class */ function _CampaignUtils() {} -_CampaignUtils._selectFromContactWithJoin = function(pSelectFields, pCampaignId, pWhereCondition) -{ - let query = newSelect(pSelectFields) - .from("PERSON") - .join("CONTACT", "CONTACT.PERSON_ID = PERSON.PERSONID") - .join("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID") - .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") - .where("CONTACT.CONTACTID", - newSelect("CONTACT_ID") - .from("CAMPAIGNPARTICIPANT") - .where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", pCampaignId) - , SqlBuilder.NOT_IN()); - - if (pWhereCondition != "") - query.and(pWhereCondition); - - return query; -} - /** - * Open EditView to Add Participants to a Campaignstep + * Opens the context in new mode to add participants to a campaign step.<br> * - * @param {String} pContext req name of the context - * @param {String} pTargetDataExpression req - * @param {String} pDataExpressionParameterName req parameter for the entity (CAMPAIGNSTEP) - * @param {String} pView req targeting view - * @param {String} pSourceTableName req + * @param {String} pContext <p> + * Name of the context. (e.g.: "CampaignAddParticipants")<br> + * @param {String} pTargetDataExpression <p> + * The target data expression.<br> + * @param {String} pDataExpressionParameterName <p> + * Parameter for the entity (CAMPAIGNSTEP).<br> + * @param {String} pView <p> + * Targeting view.<br> + * @param {String} pSourceTableName <p> + * The name of the source table.<br> * */ _CampaignUtils._openAddParticipantContext = function(pContext, pTargetDataExpression, pDataExpressionParameterName, pView, pSourceTableName) diff --git a/process/Classification_lib/process.js b/process/Classification_lib/process.js index 94dd142e6d231a5db377a0cef0eaa1ba3148a553..f895ecbc55da6199cfee1524beba7684fff3966d 100644 --- a/process/Classification_lib/process.js +++ b/process/Classification_lib/process.js @@ -3,8 +3,8 @@ import("system.db"); import("Sql_lib"); /** - * Methods to manage classifications. - * Do not create an instance of this! + * Methods to manage classifications.<br> + * <b>Do not create an instance of this!</b> * * @class */ @@ -13,12 +13,20 @@ function ClassificationUtils() {} /** * Get the score of the classification. You can get all groups at once or only the score for one group. * - * @param {String} pClassificationType the classification-type (usage) e.g. the Keyid from Keyord ClassificationType - * @param {String} pObjectType the object type - * @param {String} pObjectRowid the rowid - * @param {String} [pClassificationGroup=undefined] the classification group. If it is undefined, the classification for all groups are returned as Object(-map) - * - * @return {Object} return all scores as Object-map. E.g. {"scoreGroup1": 0, "scoreGroup2": 20} + * @param {String} pClassificationType <p> + * The classification-type (usage) e.g. the key id<br> + * from keyword 'ClassificationType'.<br> + * @param {String} pObjectType <p> + * The object type.<br> + * @param {String} pObjectRowid <p> + * The row id.<br> + * @param {String} pClassificationGroup=undefined (optional) <p> + * The classification group. If it is undefined,<br> + * the classification for all groups are returned <br> + * as Object(-map)<br> + * @return {Object} <p> + * Returns all scores as object-map.<br> + * (e.g. {"scoreGroup1": 0, "scoreGroup2": 20}) */ ClassificationUtils.getScore = function(pClassificationType, pObjectType, pObjectRowid, pClassificationGroup) { @@ -43,13 +51,18 @@ ClassificationUtils.getScore = function(pClassificationType, pObjectType, pObjec } /** - * get all classifications for one dataset as String. Each char represents one classification. - * - * @param {String} pClassificationType the classification-type (usage) e.g. the Keyid from Keyord ClassificationType - * @param {String} pObjectType the object type - * @param {String} pObjectRowid the rowid + * Get all classifications for one dataset as String.<br> + * Each char represents one classification.<br> * - * @return {String} the resulting classification. E.g. "ACB" + * @param {String} pClassificationType <p> + * The classification-type (usage)<br> + * (e.g. the key id from keyword ClassificationType) + * @param {String} pObjectType <p> + * The object type.<br> + * @param {String} pObjectRowid <p> + * The row id.<br> +* @return {String} <p> +* The resulting classification. (e.g. "ACB")<br> */ ClassificationUtils.getClass = function(pClassificationType, pObjectType, pObjectRowid) { @@ -61,15 +74,20 @@ ClassificationUtils.getClass = function(pClassificationType, pObjectType, pObjec } /** - * get the classification for a score. - * The classes are hardcoded like this: - * >=0 to 25: D - * > 25 to 50: C - * > 50 to 75: B - * > 75 to 100: A - * < 0 || > 100: _ + * Get the classification for a score.<br> + * The classes are hardcoded like this:<br> * - * @return {String} + * @param {String} pScore <p> + * The score:<br> + * <ul> + * <li>>=0 to 25: D</li> + * <li>> 25 to 50: C</li> + * <li>> 50 to 75: B</li> + * <li>> 75 to 100: A</li> + * <li>< 0 || > 100: _</li> + * </ul> + * @return {String} <p> + * Returns the corresponding classification.<br> */ ClassificationUtils.mapToClass = function(pScore) { @@ -87,14 +105,18 @@ ClassificationUtils.mapToClass = function(pScore) /** - * get the lowest Score for a Letter. - * The classes are hardcoded like this: - * >=0 to 25: D - * > 25 to 50: C - * > 50 to 75: B - * > 75 to 100: A - * - * @return {Array} [min, max] Points the Letter is between + * Get the lowest score for a letter.<br> + * The classes are hardcoded like this:<br> + * <ul> + * <li>>=0 to 25: D</li> + * <li>> 25 to 50: C</li> + * <li>> 50 to 75: B</li> + * <li>> 75 to 100: A</li> + * </ul> + * @param {String} pLetter <p> + * The letter which stands for the classification.<br> + * @return {Array} <p> + * Points the Letter is between (min, max).<br> */ ClassificationUtils.mapClassLetter = function(pLetter) { @@ -120,20 +142,22 @@ ClassificationUtils.mapClassLetter = function(pLetter) /** - * Get all possible groupnames for a classificationtype - * Either as [["group", "group"]] (for the possible items process) - * Or as [["group"]]. + * Get all possible groupnames for a classificationtype.<br> + * Either as [["group", "group"]] (for the possible items process). + * Or as [["group"]].<br> * - * @param {String} pClassificationtype the classificationtype - * @param {Boolean} pTwoCol use two columns (for possible items process) + * @param {String} pClassificationtype <p> + * The classification type.<br> + * @param {Boolean} pTwoCol <p> + * Use two columns (for possible items process).<br> */ ClassificationUtils.getAllGroups = function(pClassificationtype, pTwoCol) { var sql = new SqlBuilder() - .select(["distinct CLASSIFICATIONGROUP", (pTwoCol ? "CLASSIFICATIONGROUP" : "")]) - .from("CLASSIFICATIONTYPE") - .where("CLASSIFICATIONTYPE.CLASSIFICATIONTYPE", pClassificationtype) - .orderBy("CLASSIFICATIONGROUP"); + .select(["distinct CLASSIFICATIONGROUP", (pTwoCol ? "CLASSIFICATIONGROUP" : "")]) + .from("CLASSIFICATIONTYPE") + .where("CLASSIFICATIONTYPE.CLASSIFICATIONTYPE", pClassificationtype) + .orderBy("CLASSIFICATIONGROUP"); if (pTwoCol) return sql.table(); @@ -142,9 +166,11 @@ ClassificationUtils.getAllGroups = function(pClassificationtype, pTwoCol) } /** - * Load the classificationgroup for a classificaitonTypeId from the db. + * Load the classification group for a classificaiton type<br> + * id from the db.<br> * - * @param {String} pClassificationtypeId the id + * @param {String} pClassificationtypeId <p> + * The id of the classification type.<br> */ ClassificationUtils.getGroupFromDb = function(pClassificationtypeId) { @@ -159,9 +185,12 @@ ClassificationUtils.getGroupFromDb = function(pClassificationtypeId) * Update the groupname. Checks if it is already used and only updates it, if not. * TODO: message to the user if it failed? (or return value - bool?) * - * @param {String} pOldName the name it was before - * @param {String} pNewName the new name - * @param {String} pClassificationType the classificationtype + * @param {String} pOldName <p> + * The old name, which shall be changed.<br> + * @param {String} pNewName <p> + * The new name.<br> + * @param {String} pClassificationType <p> + * The classification type.<br> */ ClassificationUtils.changeGroupName = function(pOldName, pNewName, pClassificationType) { @@ -175,11 +204,14 @@ ClassificationUtils.changeGroupName = function(pOldName, pNewName, pClassificati } /** - * get the classificationType for the current classification (either vom parameter or selection-variable) - * @param {String} pParamField the parameter field name. e.G. "$param.ClassificationType_param" - * @param {String} pSelectionField the parameter field name. e.G. "$sys.selectionRows" + * Get the classificationType for the current classification (either vom parameter or selection-variable) * - * @return {String} the type (or undefined) + * @param {String} pParamField <p> + * The parameter field name. (e.g.: "$param.ClassificationType_param")<br> + * @param {String} pSelectionField <p> + * The parameter field name. (e.g.: "$sys.selectionRows")<br> + * @return {String} <p> + * The type (or undefined).<br> */ ClassificationUtils.getUsageType = function(pParamField, pSelectionField) { @@ -198,10 +230,12 @@ ClassificationUtils.getUsageType = function(pParamField, pSelectionField) } /** - * Update the coreName of a type + * Update the coreName of a type.<br> * - * @param {String} pNewScoreName - * @param {String} pClassificationTypeId + * @param {String} pNewScoreName <p> + * The new score name.<br> + * @param {String} pClassificationTypeId <p> + * The id of the classification type.<br> */ ClassificationUtils.changeScoreName = function(pNewScoreName, pClassificationTypeId) { diff --git a/process/Communication_lib/process.js b/process/Communication_lib/process.js index 74aad0b75f22a1eaa22fe662e95dd798a0109475..c9f1422579317ca168f8bd4c641258a9143fcba1 100644 --- a/process/Communication_lib/process.js +++ b/process/Communication_lib/process.js @@ -10,17 +10,21 @@ import("KeywordRegistry_basic"); import("Keyword_lib"); /** - * provides static methods for Comm - * do not create an instance of this + * Provides static methods for communication.<br> + * <b>Do not create an instance of this!</b> * * @class */ function CommUtil(){} /** - * returns the ids of COMMUNICATION.MEDIUM that are clustered unter a specific category - * @param {String} pCategory value of the keyword "COMMUNICATION.MEDIUM" custom.category; e.g. "PHONE" - * @return {String[]} array of the medium-ids + * Returns the ids of COMMUNICATION.MEDIUM that are clustered under a specific category.<br> + * + * @param {String} pCategory <p> + * Value of the keyword "COMMUNICATION.MEDIUM".<br> + * (custom.category: e.g. "PHONE")<br> + * @return {String[]} <p> + * Array of the medium ids.<br> */ CommUtil.getMediumIdsByCategory = function (pCategory) { @@ -36,12 +40,24 @@ CommUtil.getMediumIdsByCategory = function (pCategory) }; /** - * sets the standard address for COMMUNICATION entries for a specific category; - * does not verify if the COMMUNICATIONID you provide has the given category - * @param {String} pAffectedRowId a refencial ID whoes COMMs should be modified (a CONTACTID) - * @param {String} pNewStandardCommId COMMUNICATIONID of the new ISSTANDARD comm-entry; can be an empty string if no new standard adress shall be set but the old standard removed - * @param {String} pCategory value of the keyword "COMMUNICATION.MEDIUM" custom.category; e.g. "PHONE"; the ISSTANDARD of this category is set - * @return {null} currently returns always null; reserved for future + * Sets the standard address for COMMUNICATION entries for a specific category. + * Does not verify if the COMMUNICATIONID you provide has the given category.<br> + * + * @param {String} pAffectedRowId <p> + * A refencial id whose communication entries should be modified.<br> + * (e.g.: a CONTACTID)<br> + * @param {String} pNewStandardCommId <p> + * COMMUNICATIONID of the new ISSTANDARD <br> + * communication entry can be an empty string <br> + * if no new standard adress shall be set but <br> + * the old standard removed.<br> + * @param {String} pCategory <p> + * Value of the keyword "COMMUNICATION.MEDIUM"<br> + * custom.category e.g.: "PHONE" the ISSTANDARD of <br> + * this category is set.<br> + * @return {null} <p> + * Currently returns always null + * (reserved for future). */ CommUtil.setStandardForCategory = function(pAffectedRowId, pNewStandardCommId, pCategory) { @@ -80,11 +96,17 @@ CommUtil.setStandardForCategory = function(pAffectedRowId, pNewStandardCommId, p }; /** - * sets the standard PHONE-entry for COMMUNICATION - * does not verify if the COMMUNICATIONID you provide is actually PHONE-COMMUNICATION - * @param {String} pAffectedRowId a refencial ID whoes COMMs should be modified (a CONTACTID) - * @param {String} pNewStandardCommId COMMUNICATIONID of the new ISSTANDARD comm-entry - * @return {null} currently returns always null; reserved for future + * Sets the standard PHONE-entry for COMMUNICATION.<br> + * Does not verify if the COMMUNICATIONID you provide is actually PHONE-COMMUNICATION.<br> + * + * @param {String} pAffectedRowId <p> + * A refencial id whose communication entries should be modified.<br> + * (e.g.: a CONTACTID)<br> + * @param {String} pNewStandardCommId <p> + * COMMUNICATIONID of the new ISSTANDARD communication entries.<br> + * @return {null} <p> + * Currently returns always null.<br> + * (reserved for future) */ CommUtil.setStandardPhone = function(pAffectedRowId, pNewStandardCommId) { @@ -92,11 +114,17 @@ CommUtil.setStandardPhone = function(pAffectedRowId, pNewStandardCommId) }; /** - * sets the standard EMAIL-entry for COMMUNICATION - * does not verify if the COMMUNICATIONID you provide is actually EMAIL-COMMUNICATION - * @param {String} pAffectedRowId a refencial ID whoes COMMs should be modified (a CONTACTID) - * @param {String} pNewStandardCommId COMMUNICATIONID of the new ISSTANDARD comm-entry - * @return {null} currently returns always null; reserved for future + * Sets the standard EMAIL-entry for COMMUNICATION.<br> + * Does not verify if the COMMUNICATIONID you provide is actually EMAIL-COMMUNICATION + * + * @param {String} pAffectedRowId <p> + * A refencial ID whose communication entries should be modified.<br> + * (e.g.: a CONTACTID)<br> + * @param {String} pNewStandardCommId <p> + * COMMUNICATIONID of the new ISSTANDARD comm-entry.<br> + * @return {null} <p> + * Currently returns always null.<br> + * (reserved for future) */ CommUtil.setStandardMail = function(pAffectedRowId, pNewStandardCommId) { @@ -104,10 +132,16 @@ CommUtil.setStandardMail = function(pAffectedRowId, pNewStandardCommId) }; /** - * returns a sub sql-string (without bracets) for getting the standard address of a COMMUNICATION - * @param {String} pCategory value of the keyword "COMMUNICATION.MEDIUM" custom.category; e.g. "PHONE" - * @param {String|SqlBuilder} [pContactField=CONTACT.CONTACTID] SQL-fieldname that shall be used for filtering the CONTACT_ID, this can be a string(fieldname) or an SqlBuilder object - * @return {String} sub-sql + * Returns a sub sql-string (without brackets) for getting the standard address of a COMMUNICATION.<br> + * + * @param {String} pCategory <p> + * Value of the keyword "COMMUNICATION.MEDIUM".<br> + * (custom.category; e.g. "PHONE")<br> + * @param {String|Object} pContactField=CONTACT.CONTACTID (optional) <p> + * SQL-fieldname that shall be used for filtering the CONTACT_ID, <br> + * this can be a string(fieldname) or an SqlBuilder object.<br> + * @return {String} <p> + * Sub-sql.<br> */ CommUtil.getStandardSubSqlForCategory = function(pCategory, pContactField) { @@ -141,9 +175,13 @@ CommUtil.getStandardSubSqlForCategory = function(pCategory, pContactField) }; /** - * returns a sub sql-string (without bracets) for getting the standard address of a PHONE-COMMUNICATION - * @param {String|SqlBuilder} [pContactField=CONTACT.CONTACTID] SQL-fieldname that shall be used for filtering the CONTACT_ID, this can be a string(fieldname) or an SqlBuilder object - * @return {String} sub-sql + * Returns a sub sql-string (without brackets) for getting the standard address of a PHONE-COMMUNICATION.<br> + * + * @param {String|Object} pContactField=CONTACT.CONTACTID (optional) <p> + * SQL-fieldname that shall be used for filtering the CONTACT_ID,<br> + * this can be a string(fieldname) or an SqlBuilder object.<br> + * @return {String} <p> + * Sub-sql.<br> */ CommUtil.getStandardSubSqlPhone = function(pContactField) { @@ -151,9 +189,13 @@ CommUtil.getStandardSubSqlPhone = function(pContactField) }; /** - * returns a sub sql-string (without bracets) for getting the standard address of a EMAIL-COMMUNICATION - * @param {String|SqlBuilder} [pContactField=CONTACT.CONTACTID] SQL-fieldname that shall be used for filtering the CONTACT_ID, this can be a string(fieldname) or an SqlBuilder object - * @return {String} sub-sql + * Returns a sub sql-string (without brackets) for getting the standard address of a EMAIL-COMMUNICATION.<br> + * + * @param {String|Object} pContactField=CONTACT.CONTACTID <p> + * SQL-fieldname that shall be used for filtering the CONTACT_ID, <br> + * this can be a string(fieldname) or an SqlBuilder object.<br> + * @return {String} <p> + * Sub-sql.<br> */ CommUtil.getStandardSubSqlMail = function(pContactField) { @@ -161,11 +203,12 @@ CommUtil.getStandardSubSqlMail = function(pContactField) }; /** - * returns a the standard address of a EMAIL-COMMUNICATION - * - * @param {String} pContactId the contactId + * Returns a the standard address of a EMAIL-COMMUNICATION.<br> * - * @return {String} email address + * @param {String} pContactId <p> + * The contact id.<br> + * @return {String} <p> + * Email address.<br> */ CommUtil.getStandardMail = function (pContactId) { @@ -174,26 +217,33 @@ CommUtil.getStandardMail = function (pContactId) } /** - * provides static methods for validation of communication data - * do not create an instance of this + * Provides static methods for validation of communication data.<br> + * <b>Do not create an instance of this!</b> * * @class */ function CommValidationUtil() {} /** - * creates a function depending on a given COMMUNICATION-category (like PHONE, EMAIL, etc.) or null if no validation-function was defined for the given category - * @param {string} commCategory category that determines which function shall be created, e.g. "EMAIL" - * @return {function} function that receives the following arguments: - * <br/> - commAddress - * <br/> - extensions - * <br/>the function has to return null if everything is OK or a value with details if validation failed + * Creates a function depending on a given COMMUNICATION-category (like PHONE, EMAIL, etc.) <br> + * or null if no validation-function was defined for the given category.<br> + * + * @param {String} pCommCategory <p> + * Category that determines which function shall be created, e.g. "EMAIL".<br> + * @return {Object} <p> + * Function that receives the following arguments:<br> + * <ul> + * <li>commAddress</li> + * <li>extensions</li> + * </ul> + * The function has to return null if everything is OK or<br> + * a value with details if validation failed.<br> */ -CommValidationUtil.makeValidationFn = function (commCategory) +CommValidationUtil.makeValidationFn = function (pCommCategory) { var callbackFn; - switch (commCategory.trim()) { + switch (pCommCategory.trim()) { case "EMAIL": callbackFn = function (addrValue){ if (!mail.isValidMailAddress(addrValue, true)) @@ -227,8 +277,11 @@ CommValidationUtil.makeValidationFn = function (commCategory) }; /** - * 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 + * Returns a blueprint for validation extensions. These extensions are needed for validating communication data and can be passed to other functions.<br> + * + * @return {Object} <p> + * A object with properties that have a specific default value.<br> + * Normally you want to overwrite that value.<br> */ CommValidationUtil.getExtensionsBlueprint = function() { diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index a56abb83043e283631ffdaf4d36b89513e075457..6f66eddba14a1eb66543e240cb9292a85e696295 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -2961,22 +2961,26 @@ SqlMaskingUtils.prototype.getConcatSymbol = function() { } /** -* returns the trim function depending on the database behin the given alias -* note that this function does not verifiy where the types of your expression are trimable or not +* Returns the trim function, which removes the<br> +* leading and trailing spaces in a string, depending<br> +* on the database behind the given alias note that<br> +* this function does not verifiy where the types of<br> +* your expression are trimable or not.<br> * -* @param {String} field expression that shall be trimmed -* -* @return {String} +* @param {String} pField <p> +* Expression that shall be trimmed.<br> +* @return {String} <p> +* Returns the trimmed string.<br> */ -SqlMaskingUtils.prototype.trim = function(field) { +SqlMaskingUtils.prototype.trim = function(pField) { var dbType, resultStr; dbType = this.dbType; switch(dbType) { case db.DBTYPE_SQLSERVER2000: - resultStr = "ltrim(rtrim(" + field + "))"; + resultStr = "ltrim(rtrim(" + pField + "))"; break; default: - resultStr = "trim(" + field + ")" + resultStr = "trim(" + pField + ")" break; } return resultStr;