Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix optional parameters in typings and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tineheller committed Jul 10, 2018
1 parent 513ba73 commit acc9536
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 67 deletions.
6 changes: 6 additions & 0 deletions portalscript/documentation/methodMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,9 +1365,15 @@ export const mapping = {
"removeProperty": [
"PropertyCache"
],
"addFileLink": [
"Register"
],
"getDocuments": [
"Register"
],
"removeFileLink": [
"Register"
],
"compOp": [
"RetrievalField"
],
Expand Down
80 changes: 40 additions & 40 deletions portalscript/documentation/portalscript-api.html

Large diffs are not rendered by default.

48 changes: 39 additions & 9 deletions portalscript/jsdoc/portalScripting.js
Original file line number Diff line number Diff line change
Expand Up @@ -2444,7 +2444,7 @@
* @param {string} fileType String value containing the technical name of the desired filetype
* @param {string} field String value containing the technical name of the desired enumeration field
* @param {string} techEnumValue String value containing the desired technical value of the enumeration entry
* @param {string} locale optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @param {string} [locale] optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @returns {string} String containing the ergonomic value of the enumeration value in the appropriate portal language
* @since ELC 3.51 / otrisPORTAL 5.1
* @see [context.getEnumErgValue]{@link context#getEnumErgValue} [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName} [context.getEnumValues]{@link context#getEnumValues} [context.getFromSystemTable]{@link context#getFromSystemTable}
Expand Down Expand Up @@ -2480,7 +2480,7 @@
* @description In multilanguage DOCUMENTS environments, usually the file fields are translated to the different locales by using the well known ergonomic label hack. The function is useful to output scripting generated information in the appropriate portal language of the web user who triggered the script execution.
* @param {string} fileType String value containing the technical name of the desired filetype
* @param {string} field String value containing the technical name of the desired field
* @param {string} locale optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @param {string} [locale] optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @returns {string} String containing the ergonomic description of the file field in the appropriate portal language
* @since ELC 3.51 / otrisPORTAL 5.1
* @see [context.getEnumErgValue]{@link context#getEnumErgValue} [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName} [context.getEnumValues]{@link context#getEnumValues} [context.getFromSystemTable]{@link context#getFromSystemTable}
Expand Down Expand Up @@ -2511,7 +2511,7 @@
* @summary Get the ergonomic label of a filetype.
* @description In multilanguage DOCUMENTS environments, usually the filetypes are translated to the different locales by using the well known ergonomic label hack. The function is useful to output scripting generated information in the appropriate portal language of the web user who triggered the script execution.
* @param {string} fileType String value containing the technical name of the desired filetype
* @param {string} locale optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @param {string} [locale] optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @returns {string} String containing the ergonomic description of the filetype in the appropriate portal language
* @since ELC 3.51 / otrisPORTAL 5.1
* @see [context.getEnumErgValue]{@link context#getEnumErgValue} [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName} [context.getEnumValues]{@link context#getEnumValues} [context.getFromSystemTable]{@link context#getFromSystemTable}
Expand Down Expand Up @@ -2554,7 +2554,7 @@
* @summary Retrieve a list of folders with identical name.
* @description Different folders might match an identical pattern, e.g. <code>"DE_20*"</code> for each folder like <code>"DE_2004"</code>, <code>"DE_2005"</code> and so on. If you need to perform some action with the different folders or their contents, it might be useful to retrieve an iterator (a list) of all these folders to loop through that list.
* @param {string} folderPattern the name pattern of the desired folder(s)
* @param {string} type optional parameter, a String value defining the type of folders to look for; allowed values are <code>"public"</code>, <code>"dynamicpublic"</code> and <code>"onlysubfolder"</code>
* @param {string} [type] optional parameter, a String value defining the type of folders to look for; allowed values are <code>"public"</code>, <code>"dynamicpublic"</code> and <code>"onlysubfolder"</code>
* @returns {FolderIterator} FolderIterator containing a list of all folders matching the specified name pattern
* @since ELC 3.50l01 / otrisPORTAL 5.0l01
* @example
Expand Down Expand Up @@ -2668,7 +2668,7 @@
* @summary Get the ergonomic label of a register.
* @param {string} fileTypeName String value containing the technical name of the desired filetype
* @param {string} registerName String value containing the technical name of the desired register
* @param {string} locale optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @param {string} [locale] optional String value with the locale abbreviation (according to the principal's configuration); if omitted, the current user's portal language is used automatically
* @returns {string} String containing the ergonomic description of the register in the appropriate portal language
* @since DOCUMENTS 4.0d HF1
* @see [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName}
Expand Down Expand Up @@ -2747,7 +2747,7 @@
* @summary Get an ArchiveConnection object.
* @description With this method you can get an ArchiveConnection object. This object offers several methods to use the EAS Interface, EBIS or the EASY ENTERPRISE XML-Server.
* Since archiveServerName: Documents 4.0
* @param {string} archiveServerName Optional string containing the archive server name; If the archive server is not defined, then the main archive server will be used
* @param {string} [archiveServerName] Optional string containing the archive server name; If the archive server is not defined, then the main archive server will be used
* @returns {ArchiveConnection} ArchiveConnection-Object or NULL, if failed
* @since ELC 3.60d / otrisPORTAL 6.0d
* @deprecated since DOCUMENTS 5.0a - Use Context.getArchiveConnection(String archiveServerName) instead
Expand Down Expand Up @@ -3629,7 +3629,6 @@
* @instance
* @summary Cancel edit mode for a file.
* @description If you switched a file to edit mode with the startEdit() method and if you want to cancel this (e.g. due to some error that has occurred in the mean time) this function should be used to destroy the scratch copy which has been created by the startEdit() instruction.
* Internal: since ELC 3.60e available for archive files
* @returns {boolean} <code>true</code> if successful, <code>false</code> in case of any error
* @since ELC 3.50 / otrisPORTAL 5.0
* @see [DocFile.startEdit]{@link DocFile#startEdit} [DocFile.commit]{@link DocFile#commit}
Expand Down Expand Up @@ -3879,7 +3878,6 @@
* @instance
* @summary Commit any changes to the DocFile object.
* @description This method is mandatory to apply changes to a file that has been switched to edit mode with the startEdit() method. It is strictly prohibited to execute the commit() method in a script which is attached to the onSave scripting hook.
* Internal: since ELC 3.60e available for archive files
* @returns {boolean} <code>true</code> if successful, <code>false</code> in case of any error
* @since ELC 3.50 / otrisPORTAL 5.0
* @see [DocFile.startEdit]{@link DocFile#startEdit} [DocFile.sync]{@link DocFile#sync} [DocFile.abort]{@link DocFile#abort}
Expand Down Expand Up @@ -4834,7 +4832,6 @@
* </ul>
*
* You should avoid using this function in scripts that are executed inside a workflow (signal exits, decisions etc.).
* Internal: since ELC 3.60e available for archive files
* @returns {boolean} <code>true</code> if successful, <code>false</code> in case of any error
* @since ELC 3.50 / otrisPORTAL 5.0
* @see [DocFile.abort]{@link DocFile#abort}
Expand Down Expand Up @@ -8505,6 +8502,21 @@
**/
/**
* @memberof Register
* @function addFileLink
* @instance
* @summary Adds a file to a file link register.
* @param {DocFile} file
* @returns {boolean} <code>true</code> if successful, <code>false</code> in case of any error
* @since DOCUMENTS 5.0d
* @example
* var file = context.file;
* var linkFile = context.createFile("Filetype1");
* var reg = file.getRegisterByName("flReg");
* if (!reg.addFileLink(linkFile))
* util.out(reg.getLastError());
**/
/**
* @memberof Register
* @function deleteDocument
* @instance
* @summary Delete a Document at the Register.
Expand Down Expand Up @@ -8609,6 +8621,24 @@
**/
/**
* @memberof Register
* @function removeFileLink
* @instance
* @summary Removes a file from a file link register.
* @param {DocFile} file
* @returns {boolean} <code>true</code> if successful, <code>false</code> in case of any error
* @since DOCUMENTS 5.0d
* @example
* var file = context.file;
* var reg = file.getRegisterByName("flReg");
* var frs = reg.getFiles();
* for (var linkFile = frs.first(); linkFile; linkFile = frs.next())
* {
* if (!reg.removeFileLink(linkFile))
* util.out(reg.getLastError());
* }
**/
/**
* @memberof Register
* @function setAttribute
* @instance
* @summary Set the String value of an attribute of the Register to the desired value.
Expand Down
27 changes: 18 additions & 9 deletions portalscript/typings/portalScripting.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ declare namespace context {
* @returns String containing the ergonomic value of the enumeration value in the appropriate portal language
* @see [context.getEnumErgValue]{@link context#getEnumErgValue} [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName} [context.getEnumValues]{@link context#getEnumValues} [context.getFromSystemTable]{@link context#getFromSystemTable}
*/
function getEnumErgValue(fileType: string, field: string, techEnumValue: string, locale: string): string;
function getEnumErgValue(fileType: string, field: string, techEnumValue: string, locale?: string): string;

/**
* In some cases it might be useful not only to access the selected value of an enumeration file field, but the list of all possible field values as well. This function creates an Array of String values (zero-based), and each index is one available value of the enumeration field. If the enumeration field is configured to sort the values alphabetically, this option is respected.
Expand All @@ -1230,7 +1230,7 @@ declare namespace context {
* @returns String containing the ergonomic description of the file field in the appropriate portal language
* @see [context.getEnumErgValue]{@link context#getEnumErgValue} [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName} [context.getEnumValues]{@link context#getEnumValues} [context.getFromSystemTable]{@link context#getFromSystemTable}
*/
function getFieldErgName(fileType: string, field: string, locale: string): string;
function getFieldErgName(fileType: string, field: string, locale?: string): string;

/**
* If the file does not exist or the user in whose context the script is executed is not allowed to access the file, then the return value will be <code>null</code>.
Expand All @@ -1247,7 +1247,7 @@ declare namespace context {
* @returns String containing the ergonomic description of the filetype in the appropriate portal language
* @see [context.getEnumErgValue]{@link context#getEnumErgValue} [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName} [context.getEnumValues]{@link context#getEnumValues} [context.getFromSystemTable]{@link context#getFromSystemTable}
*/
function getFileTypeErgName(fileType: string, locale: string): string;
function getFileTypeErgName(fileType: string, locale?: string): string;

/**
*
Expand All @@ -1274,7 +1274,7 @@ declare namespace context {
* @param type optional parameter, a String value defining the type of folders to look for; allowed values are <code>"public"</code>, <code>"dynamicpublic"</code> and <code>"onlysubfolder"</code>
* @returns FolderIterator containing a list of all folders matching the specified name pattern
*/
function getFoldersByName(folderPattern: string, type: string): FolderIterator;
function getFoldersByName(folderPattern: string, type?: string): FolderIterator;

/**
* It might be inconvenient to maintain the different output Strings of localized PortalScripts, if this requires to edit the scripts themselves. This function adds a convenient way to directly access the system messages table which you may maintain in the Windows Portal Client. This enables you to add your own system message table entries in your different portal languages and to directly access them in your scripts.
Expand Down Expand Up @@ -1338,7 +1338,7 @@ declare namespace context {
* @returns String containing the ergonomic description of the register in the appropriate portal language
* @see [context.getFieldErgName]{@link context#getFieldErgName} [context.getFileTypeErgName]{@link context#getFileTypeErgName}
*/
function getRegisterErgName(fileTypeName: string, registerName: string, locale: string): string;
function getRegisterErgName(fileTypeName: string, registerName: string, locale?: string): string;

/**
*
Expand Down Expand Up @@ -1384,7 +1384,7 @@ declare namespace context {
* @returns ArchiveConnection-Object or NULL, if failed
* @deprecated since DOCUMENTS 5.0a - Use Context.getArchiveConnection(String archiveServerName) instead
*/
function getXMLServer(archiveServerName: string): ArchiveConnection;
function getXMLServer(archiveServerName?: string): ArchiveConnection;

/**
*
Expand Down Expand Up @@ -1830,7 +1830,6 @@ declare interface DocFile {
fieldName: any;
/**
* If you switched a file to edit mode with the startEdit() method and if you want to cancel this (e.g. due to some error that has occurred in the mean time) this function should be used to destroy the scratch copy which has been created by the startEdit() instruction.
* Internal: since ELC 3.60e available for archive files
* @returns <code>true</code> if successful, <code>false</code> in case of any error
* @see [DocFile.startEdit]{@link DocFile#startEdit} [DocFile.commit]{@link DocFile#commit}
*/
Expand Down Expand Up @@ -1926,7 +1925,6 @@ declare interface DocFile {
clearFollowUpDate(pUser: SystemUser): boolean;
/**
* This method is mandatory to apply changes to a file that has been switched to edit mode with the startEdit() method. It is strictly prohibited to execute the commit() method in a script which is attached to the onSave scripting hook.
* Internal: since ELC 3.60e available for archive files
* @returns <code>true</code> if successful, <code>false</code> in case of any error
* @see [DocFile.startEdit]{@link DocFile#startEdit} [DocFile.sync]{@link DocFile#sync} [DocFile.abort]{@link DocFile#abort}
*/
Expand Down Expand Up @@ -2393,7 +2391,6 @@ declare interface DocFile {
* </ul>
*
* You should avoid using this function in scripts that are executed inside a workflow (signal exits, decisions etc.).
* Internal: since ELC 3.60e available for archive files
* @returns <code>true</code> if successful, <code>false</code> in case of any error
* @see [DocFile.abort]{@link DocFile#abort}
*/
Expand Down Expand Up @@ -4245,6 +4242,12 @@ declare interface Register {
* Since ELC 3.60i / otrisPORTAL 6.0i available for archive files
*/
type: string;
/**
*
* @param file
* @returns <code>true</code> if successful, <code>false</code> in case of any error
*/
addFileLink(file: DocFile): boolean;
/**
* With the necessary access rights the user can delete a Document at the Register.
* @param doc Document to delete
Expand Down Expand Up @@ -4292,6 +4295,12 @@ declare interface Register {
* @returns <code>String</code> with the object-id
*/
getOID(oidLow?: boolean): string;
/**
*
* @param file
* @returns <code>true</code> if successful, <code>false</code> in case of any error
*/
removeFileLink(file: DocFile): boolean;
/**
*
* Since ELC 3.60i / otrisPORTAL 6.0i available for archive files
Expand Down
Loading

0 comments on commit acc9536

Please sign in to comment.