Introduction
Look for code samples on this side of the documentation.
Welcome to Pacenotes!
Scripted Rules
Most power of Pacenotes comes from scripted rules.
Execution Limits
Pacenotes enforces time and memory limits on custom scripted rules. If a rule runs for too long, or consumes too much memory, it will be cancelled and the report or health check will fail, with a message viewable in Operations Log.
Rule Entry Points
Each scripted rule needs to define an entry point that matches the intended use. This JavaScript function
Product Rules
function productRule(product, context) { ... }
Analyzes a product. Product rules should use context.flagFromProduct methods to flag products to be included into a report or provide a health check information.
Arguments | |
---|---|
product | Product being analyzed |
context | Context object that provides a number of utility methods and access to other components of a catalog or a content library. |
Content Rules
function contentRule(content, context) { ... }
Analyzes a content asset. Content rules should use context.flagFromContent methods to flag content assets to be included into a report or provide a health check information.
Arguments | |
---|---|
content | Content asset being analyzed |
context | Context object that provides a number of utility methods and access to other components of a catalog or a content library. |
Category Rules
function categoryRule(category, context) { ... }
Analyzes a category. Category rules should use context.flagFromCategory methods to flag categories to be included into a report or provide a health check information.
Arguments | |
---|---|
category | Category being analyzed |
context | Context object that provides a number of utility methods and access to other components of a catalog or a content library. |
Product KPI Rules
function productKpiRule(product, context) { ... }
Analyzes a product. KPI rules ignore flags created using context.flagFromProduct methods, and should use context.updateKpi methods instead.
Arguments | |
---|---|
product | Product being analyzed |
context | Context object that provides a number of utility methods and access to other components of a catalog or a content library. |
Content KPI Rules
function contentKpiRule(content, context) { ... }
Analyzes a content asset. KPI rules ignore flags created using context.flagFromProduct methods, and should use context.updateKpi methods instead.
Arguments | |
---|---|
content | Content asset being analyzed |
context | Context object that provides a number of utility methods and access to other components of a catalog or a content library. |
Category KPI Rules
function categoryKpiRule(category, context) { ... }
Analyzes a category. KPI rules ignore flags created using context.flagFromCategory methods, and should use context.updateKpi methods instead.
Arguments | |
---|---|
category | Category being analyzed |
context | Context object that provides a number of utility methods and access to other components of a catalog or a content library. |
Declaring Dependencies
A scripted rule may require a different product or content data in order to operate. For example, an "in-stock" rule would require a product data contained in a master or a site catalog, and an inventory list. A maximum price KPI rule, on the other hand, does not require an inventory, but relies on the availability of a pricebook.
Declaring rule dependencies
function productRule(product, context) {
// A rule that requires a master catalog, a site catalog,
// an inventory list, and a pricebook.
if (context.requires(context.REQUIRES_MASTER_CATALOG |
context.REQUIRES_SITE_CATALOG |
context.REQUIRES_INVENTORY |
context.REQUIRES_PRICEBOOK)) {
...
}
}
Rules should declare which data is required in order for the rule to be runnable using context.requires method.
Attribute Inheritance
Retrieve own or inherited attribute values
product.inheritAttributes().asString('attribute-name')
By default, product and content objects API retrieves only attributes owned by the respective object itself. This means, for example, if a script attempts to retrieve an attribute value, and a product or a content does not have the requested attribte, null would be returned, even if a parent object has a matching value. In order to enable automatic attribute inheritance, use inheritAttributes() method.
Locale Fallbacks
Find content assets that need body attribute to be translated to Italian
if (content.withoutLocaleFallback().asString('body', 'x-default') != null &&
content.withoutLocaleFallback().asString('body', 'it-IT') == null) {
// it-IT content is empty and needs to be localized.
context.flagFromContent(content, context.SEVERITY_CRITICAL);
}
Unlike attribute inheritance, locale fallbacks are enabled by default. As the result, if a script requests an attribute in a locale that does not have a value, Pacenotes scripting engine will use Site configuration to determine a fallback locale and attempt to retrieve a value in that locale instead. Use withoutLocaleFallback() method to disable this behavior. This would be useful, for example, when trying to determine content that is needed to be localized yet.
Historical Data
Pacenotes data engine maintains a number of previous snapshops for product, content, and active data feeds. These snapshots are used to calculate a
Feed | Comments |
---|---|
Products | History data is used to calculate a product's last modification timestamp, which is accessible using product.lastUpdated() method. Additionally, modification timestamp can be retrieved on per-attribute basis using product.lastModified() method. |
Content assets | History data is used to calculate a content's last modification timestamp, which is accessible using content.lastUpdated() method. Additionally, modification timestamp can be retrieved on per-attribute basis using content.lastModified() method. |
Active Data | History data is fully accessible using activeData.historyAsString, activeData.historyAsDecimal, or activeData.historyAsDateTime methods. |
Scripting Examples
Scripting API
Context Object
Constants
Constant | Comments |
---|---|
SEVERITY_CRITICAL | Use to generate a flag with Critical severity level. |
SEVERITY_MAJOR | Use to generate a flag with Major severity level. |
SEVERITY_MINOR | Use to generate a flag with Minor severity level. |
SEVERITY_INFORMATION | Use to generate a flag with Informational threat level. |
REQUIRES_MASTER_CATALOG | The rule will require a master catalog. |
REQUIRES_SITE_CATALOG | The rule will require a site catalog. |
REQUIRES_INVENTORY | The rule will require an inventory list. |
REQUIRES_PRICEBOOK | The rule will require a pricebook. |
REQUIRES_ACTIVE_DATA | The rule will require an active data list. |
REQUIRES_CONTENT | The rule will require a content library. |
KPI_EXACT | Updates KPI value to the exact given value. |
KPI_MIN | Calculates a minimum of all KPI values. |
KPI_MAX | Calculates a maximum of all KPI values. |
KPI_COUNT | Ignores the passed KPI value candidate, and simply counts a number of context.updateKpi calls instead. |
KPI_SUM | Calculates a sum of all KPI values. |
STRING_CONTAINS | Checks if a given string contains another string, case insensitive. |
STRING_BEGINS_WITH | Checks if a given string begins with another string, case insensitive. |
STRING_ENDS_WITH | Checks if a given string ends with another string, case insensitive. |
Methods
Method | Comments |
---|---|
context.locales ( ) → [string] |
Retrieves a string list of enabled locales. |
context.currencies ( ) → [string] |
Retrieves a string list of enabled currencies. |
context.siteCode ( ) → string |
Retrieves current site code. |
context.requires ( feeds ) → boolean |
Checks whether sites feeds contain all data required for rule to run. |
context.flagFromProduct ( product , severity , description, notes ) → void |
Flags a product. |
context.flagFromContent ( content , severity , description, notes ) → void |
Flags a content asset. |
context.flagFromCategory ( category , severity , description, notes ) → void |
Flags a category. |
context.variationPriced ( product , currency ) → boolean |
Checks if product has at least one priced variation. currency parameter is optional, and if omitted, current site's default currency will be used instead. |
context.variationInventory ( product ) → boolean |
Checks if product has at least one variation with inventory. |
context.primaryCategory ( product ) → Category |
Retrieves a product's primary category. |
context.classificationCategory ( product ) → Category |
Retrieves a product's classificiation category. |
context.price ( product , currency ) → Price |
Retrieves price information for the product. currency parameter is optional, and if omitted, current site's default currency will be used instead. |
context.ats ( product ) → Ats |
Gets product ATS data. |
context.activeData ( product ) → [ActiveData] |
Retrieves active data records for the given product. |
context.siteInventoryRecord ( product ) → SiteInventoryRecord |
Retrieves an inventory record from the first assigned inventory list. |
context.siteInventoryRecords ( product ) → [SiteInventoryRecord] |
Retrieves inventory records from all assigned inventory lists. |
context.sitePriceRecords ( product ) → [SitePriceRecord] |
Retrieves price records from all assigned pricebooks. |
context.sitePriceRecordFrom ( product , pricebookName ) → SitePriceRecord |
Retrieves the first matching price record from specific pricebook. Pricebook name can be partial, the first matching pricebook value will be returned if there are multiple name matches. If multiple pricebok entries are required, please use the previous method. |
context.isProductOnline ( product ) → boolean |
Checks if product is marked online. Both product own flag and parent product flags are considered. |
context.isProductOnlineNow ( product ) → boolean |
Checks if product is online at the current moment of time, taking online, online from and online to dates into the calculation. Both product own flag and parent product flags are considered. |
context.isCategorized ( product , searchMasterCatalogs ) → boolean |
Checks whether product or its parent is assigned to any category. Unless searchMasterCatalogs parameter is set to true, only site catalogs are considered when searching for assignments. |
context.isCategoryOnline ( category ) → boolean |
Checks if category is marked online. Only the category own state is considered, regardless of online dates. |
context.isCategoryOnlineNow ( category ) → boolean |
Checks if category is marked online, taking online, online from and online to dates into the calculation. Only the category own state is considered. |
context.isCategoryPathOnline ( category ) → boolean |
Checks if category is marked online. Both category own flag and parent category flags are considered. |
context.categoryAssignments ( product , searchMasterCatalogs ) → [CategoryAssignment] |
Gets all category assignments for the product, optionally searching master catalogs (i.e. only looking through site catalogs). |
context.assignedCategories ( product ) → [Category] |
Gets all categories that product is assigned to. |
context.assignedProducts ( category ) → [Product] |
Gets all products assigned to the category |
context.assignedProductsMissing ( category ) → [String] |
Gets all products assigned to the category but are missing from all catalogs. |
context.category ( categoryId ) → Category |
Resolves category by category id. |
context.isContentOnline ( content ) → boolean |
Checks if content is marked online. |
context.isFolderOnline ( folder ) → boolean |
Checks if folder is marked online. |
context.classificationFolder ( content ) → Folder |
Retrieves a content asset's classificiation folder. |
context.folderAssignments ( content ) → [FolderAssignment] |
Gets all folder assignments for the content. |
context.folder ( folderId ) → Folder |
Resolves folder by folder id. |
context.assignedFolders ( content ) → [Folder] |
Gets all folders that content asset is assigned to. |
context.updateKpi ( name , description , category , value , aggregator ) → void |
Updates a KPI value for KPI calculation rules. aggregator parameter must be one of context.KPI_EXACT, context.KPI_MIN, context.KPI_MAX, context.KPI_SUM, context.KPI_SUM constants. value parameter can be either a string, a number, or a date. |
context.kpiAsDecimal ( name ) → number |
Retrieves a KPI value and converts it to a number. If a KPI value cannot be represented as number, 0 is returned instead. |
context.kpiAsString ( name ) → string |
Retrieves a KPI values and converts it to a string. |
context.kpiAsDateTime ( name ) → Date |
Retrieves a KPI value and converts it to a date. If a KPI value cannot be represented as date, null is returned instead. |
Checking Images and Downloads
Sample rule to check images in the typical SiteGenesis site
function productRule(product, context) {
if (context.requires(context.REQUIRES_MASTER_CATALOG | context.REQUIRES_SITE_CATALOG | context.REQUIRES_INVENTORY | context.REQUIRES_PRICEBOOK)) {
if (product.isMaster()) {
var errors = '';
// Check all image groups...
var groups = product.imageGroups();
for (var groupIndex = 0; groupIndex < groups.length; groupIndex += 1) {
// Loop through images in the current group...
var images = groups[groupIndex].images();
for (var imageIndex = 0; imageIndex < images.length; imageIndex += 1) {
// Construct the full image URL (this is site specific)
var image = '...' + images[imageIndex].path();
// Check download
var error = context.wouldDownload(image);
// Build a list of all errors.
if (error) {
if (errors.length > 0) {
errors += ', ';
}
errors += images[imageIndex].path() + ' - ' + error;
}
}
}
if (errors !== '') {
context.flagFromProduct(product, context.SEVERITY_INFORMATION,
'Image Checks', errors);
}
}
}
}
Method | Comments |
---|---|
context.wouldDownload ( url ) → string |
Attempts to retrieve an image or a file at the given URL, and returns either null if successful, or a string with an error description. |
context.wouldDownloadWithTimeout ( url , seconds ) → string |
Same as previous method, except the download should complete within the given timeout. |
context.wouldDownloadWithTimeoutAndMinSize ( url , seconds , size ) → string |
Same as previous method, except additionally the download size should be greater than given lower bound. |
Adding Custom Attributes to Reports
JavaScript rules can generate custom attributes that may be included in reports.
Method | Comments |
---|---|
context.attributeForProduct ( product , name , value ) → void |
Adds a named attribute with a value for the given product. |
context.attributeForContent ( content , name , value ) → void |
Adds a named attribute with a value for the given content asset. |
context.attributeForCategory ( category , name , value ) → void |
Adds a named attribute with a value for the given category. |
Diagnostics and Logging Helpers
Method | Comments |
---|---|
context.logDebug ( message ) → void |
Add a debug level message to the job log. |
context.logError ( message ) → void |
Add an error level message (i.e. highlighted in red) to the job log. |
Product Object
Methods
Method | Comments |
---|---|
product.productId ( ) → string |
Retrieves the product ID. |
product.parentProductId ( ) → string |
Retrieves parent product ID. |
product.parentProduct ( ) → Product |
Retrieves parent product reference, if there is one, or returns null otherwise. |
product.lastUpdated ( ) → Date |
Retrieves product's last modification date, which is the greated modification date of all of product's attributes. |
product.isMaster ( ) → boolean |
Checks if the product is a master product. |
product.isVariant ( ) → boolean |
Checks if the product is a variant product. |
product.isStandard ( ) → boolean |
Checks if the product is a standard product without variants. |
product.isProductSet ( ) → boolean |
Checks if the product is a product set container. |
product.isVariationGroup ( ) → boolean |
Checks if the product is a variation group product. |
product.inheritAttributes ( ) → Product |
Returns a product attribute accessor that enables attribute inheritance, and thus will return parent's attribute values if an attribute is not found in the product itself. |
product.withoutLocaleFallback ( ) → Product |
Returns a product attribute access that disables automatic locale fallback. |
product.lastModified ( attributeName , locale, site ) → Date |
Retrieves attribute last modification date. Locale and site parameters are optional. |
product.asStringContains ( attributeName , substring , op , locale, site ) → boolean |
Checks for string occurrences in the attribute value. op parameter must be one of context.STRING_CONTAINS, context.STRING_BEGINS_WITH, or context.STRING_ENDS_WITH constants. |
product.asString ( attributeName , locale, site ) → string |
Retrieves attribute value and converts it to a string. |
product.asDecimal ( attributeName , locale, site ) → number |
Retrieves attribute value and converts it to a number. |
product.asBoolean ( attributeName , locale, site ) → boolean |
Retrieves attribute value and converts it to a boolean value. |
product.asDateTime ( attributeName , locale, site ) → Date |
Retrieves attribute value and converts it to a date. |
product.imageGroups ( ) → [ImageGroup] |
Retrieves product image groups. Images are typically configured for master products only. |
product.childProducts ( ) → [Product] |
Retrieves child products array. |
product.variationGroups ( ) → [Product] |
Retrieves variation groups of a product array. |
History Related Methods
Method | Comments |
---|---|
product.history ( ) → [HistoryAttributeEntry] |
Retrieves a list of all attributes associated with their respective modification timestamps. |
product.asStringAtTime ( when , attributeName , locale, site ) → string |
Retrieves attribute value and converts it to a string. |
product.asDecimalAtTime ( when , attributeName , locale, site ) → number |
Retrieves attribute value and converts it to a number. |
product.asBooleanAtTime ( when , attributeName , locale, site ) → boolean |
Retrieves attribute value and converts it to a boolean value. |
product.asDateTimeAtTime ( when , attributeName , locale, site ) → Date |
Retrieves attribute value and converts it to a date. |
Category Object
Methods
Method | Comments |
---|---|
category.categoryId ( ) → string |
Retrieves the category ID. |
category.parentCategoryId ( ) → string |
Retrieves the parent category ID. |
category.parentCategory ( ) → Category |
Retrieve the parent category reference. |
category.lastUpdated ( ) → Date |
Retrieves category's last modification date, which is the greated modification date of all of category's attributes. |
category.inheritAttributes ( ) → Category |
Returns a category attribute accessor that enables attribute inheritance, and thus will return parent's attribute values if an attribute is not found in the category itself. |
category.withoutLocaleFallback ( ) → Category |
Returns a category attribute access that disables automatic locale fallback. |
category.lastModified ( attributeName , locale, site ) → Date |
Retrieves attribute last modification date. Locale and site parameters are optional. |
category.asStringContains ( attributeName , substring , op , locale, site ) → boolean |
Checks for string occurrences in the attribute value. op parameter must be one of context.STRING_CONTAINS, context.STRING_BEGINS_WITH, or context.STRING_ENDS_WITH constants. |
category.asString ( attributeName , locale, site ) → string |
Retrieves attribute value and converts it to a string. |
category.asDecimal ( attributeName , locale, site ) → number |
Retrieves attribute value and converts it to a number. |
category.asBoolean ( attributeName , locale, site ) → boolean |
Retrieves attribute value and converts it to a boolean value. |
category.asDateTime ( attributeName , locale, site ) → Date |
Retrieves attribute value and converts it to a date. |
Image Group Object
Method | Comments |
---|---|
imageGroup.images ( ) → [Image] |
Retrives images array. |
imageGroup.viewType ( ) → string |
Returns associated view type. |
Image Object
Method | Comments |
---|---|
image.path ( ) → string |
Returns image path. |
Price Object
Method | Comments |
---|---|
priceRecord.hasRecords ( ) → boolean |
Checks if there are any price records for the product. |
priceRecord.minValue ( ) → number |
Returns minimal price value. |
priceRecord.maxValue ( ) → number |
Returns maximum price value. |
priceRecord.priced ( ) → boolean |
Checks if product has valid, non-zero price. |
Ats Object
Method | Comments |
---|---|
atsRecord.hasRecords ( ) → boolean |
Checks if there are any ATS records for the product. |
atsRecord.minValue ( ) → number |
Returns minimal ATS value. |
atsRecord.maxValue ( ) → number |
Returns maximum ATS value. |
atsRecord.available ( ) → boolean |
Checks if product has valid inventory. |
Site Inventory Record Object
Method | Comments |
---|---|
inventoryRecord.list ( ) → string |
Retrieves the associated inventory list name. |
inventoryRecord.allocation ( ) → number |
Returns inventory allocation number. |
inventoryRecord.allocationTimestamp ( ) → Date |
Returns inventory allocation timestamp. |
inventoryRecord.ats ( ) → number |
Current ATS levels. |
inventoryRecord.onOrder ( ) → number |
Returns on-order amount. |
inventoryRecord.turnover ( ) → number |
Returns turn-over levels. |
inventoryRecord.perpetual ( ) → boolean |
Checks if the inventory record has a perpetual allocation. |
inventoryRecord.inStockDate ( ) → Date |
Returns back-in-stock date. |
inventoryRecord.preorderBackorderAllocation ( ) → number |
Returns assigned preorder allocation. |
inventoryRecord.preorderBackorderHandling ( ) → string |
Platform specific; indicates preorder vs backorder handling of the inventory. |
Site Price Record Object
Method | Comments |
---|---|
priceRecord.pricebook ( ) → string |
Retrieves the associated pricebook name. |
priceRecord.price ( ) → number |
Returns the price value. |
priceRecord.quantity ( ) → number |
Returns the price table quantity. |
Inventory Custom Attributes Support
Check for a custom inventory attribute value:
function productRule(product, context) {
...
if (product.isVariant()) {
var inventory = context.siteInventoryRecord(product);
if (inventory && inventory.asDecimal('store-quantity') > 0) {
// Do something
}
}
...
}
Method | Comments |
---|---|
inventoryRecord.asBoolean ( name ) → boolean |
Retrieves an attribute value and converts it to a boolean. If the value cannot be represented as boolean True or False, False is returned instead. |
inventoryRecord.asDecimal ( name ) → number |
Retrieves an attribute value and converts it to a number. If the value cannot be represented as number, 0 is returned instead. |
inventoryRecord.asString ( name ) → string |
Retrieves an attribute value and converts it to a string. |
inventoryRecord.asDateTime ( name ) → Date |
Retrieves an attribute value and converts it to a date. If the value cannot be represented as date, null is returned instead. |
Category Assignment Object
Method | Comments |
---|---|
assignment.isPrimary ( ) → boolean |
Gets whether assignment refers to primary category. |
assignment.isClassification ( ) → boolean |
Gets whether assignment refers to classification category. |
assignment.categoryId ( ) → string |
Gets associated category id. |
assignment.catalogId ( ) → string |
Gets associated catalog id. |
ActiveData Object
See context.activeData method to retrieve active data record associated with a product.
Method | Comments |
---|---|
activeRecord.asDecimal ( attributeName ) → number |
Retrieves numeric active data attribute value. |
activeRecord.asDateTime ( attributeName ) → Date |
Retrieves date active data attribute value. |
activeRecord.asString ( attributeName ) → string |
Retrieves string active data attribute value. |
activeRecord.historyAsDecimal ( attributeName ) → [HistoryNumber] |
Retrieves all available historical attribute values and attempts to convert them to the number format. |
activeRecord.historyAsDateTime ( attributeName ) → [HistoryDateTime] |
Retrieves all available historical attribute values and attempts to convert them to the date format. |
activeRecord.historyAsString ( attributeName ) → [HistoryString] |
Retrieves all available historical attribute values and attempts to convert them to the string format. |
History Number Object
Method | Comments |
---|---|
historyEntry.when ( ) → Date |
Returns value modification timestamp. |
historyEntry.value ( ) → number |
Returns attribute value. |
History DateTime Object
Method | Comments |
---|---|
historyEntry.when ( ) → Date |
Returns value modification timestamp. |
historyEntry.value ( ) → Date |
Returns attribute value. |
History String Object
Method | Comments |
---|---|
historyEntry.when ( ) → Date |
Returns value modification timestamp. |
historyEntry.value ( ) → string |
Returns attribute value. |
History Attribute Entry Object
Method | Comments |
---|---|
historyEntry.attributeName ( ) → string |
Returns attribute name. |
historyEntry.locale ( ) → string |
Returns attribute locale. |
historyEntry.site ( ) → string |
Returns attribute site. |
historyEntry.timestamps ( ) → [Date] |
Returns a list of modification timestamps. |
Content Object
Method | Comments |
---|---|
content.contentId ( ) → string |
Retrieves the content ID. |
content.lastUpdated ( ) → Date |
Retrieves content's last modification date, which is the greated modification date of all of content's attributes. |
content.inheritAttributes ( ) → Content |
Returns a content attribute accessor that enables attribute inheritance, and thus will return parent's attribute values if an attribute is not found in the content itself. |
content.withoutLocaleFallback ( ) → Content |
Returns a content attribute access that disables automatic locale fallback. |
content.lastModified ( attributeName , locale, site ) → Date |
Retrieves attribute last modification date. Locale and site parameters are optional. |
content.asStringContains ( attributeName , substring , op , locale, site ) → boolean |
Checks for string occurrences in the attribute value. op parameter must be one of context.STRING_CONTAINS, context.STRING_BEGINS_WITH, or context.STRING_ENDS_WITH constants. |
content.asString ( attributeName , locale, site ) → string |
Retrieves attribute value and converts it to a string. |
content.asDecimal ( attributeName , locale, site ) → number |
Retrieves attribute value and converts it to a number. |
content.asBoolean ( attributeName , locale, site ) → boolean |
Retrieves attribute value and converts it to a boolean value. |
content.asDateTime ( attributeName , locale, site ) → Date |
Retrieves attribute value and converts it to a date. |
History Related Methods
Method | Comments |
---|---|
content.history ( ) → [HistoryAttributeEntry] |
Retrieves a list of all attributes associated with their respective modification timestamps. |
content.asStringAtTime ( when , attributeName , locale, site ) → string |
Retrieves attribute value and converts it to a string. |
content.asDecimalAtTime ( when , attributeName , locale, site ) → number |
Retrieves attribute value and converts it to a number. |
content.asBooleanAtTime ( when , attributeName , locale, site ) → boolean |
Retrieves attribute value and converts it to a boolean value. |
content.asDateTimeAtTime ( when , attributeName , locale, site ) → Date |
Retrieves attribute value and converts it to a date. |
Folder Object
Method | Comments |
---|---|
folder.folderId ( ) → string |
Retrieves the folder ID. |
folder.parentFolderId ( ) → string |
Retrieves the parent folder ID. |
folder.parentFolder ( ) → Folder |
Retrieves the parent folder. |
folder.lastUpdated ( ) → Date |
Retrieves folder's last modification date, which is the greated modification date of all of folder's attributes. |
folder.inheritAttributes ( ) → Folder |
Returns a folder attribute accessor that enables attribute inheritance, and thus will return parent's attribute values if an attribute is not found in the folder itself. |
folder.withoutLocaleFallback ( ) → Folder |
Returns a folder attribute access that disables automatic locale fallback. |
folder.lastModified ( attributeName , locale, site ) → Date |
Retrieves attribute last modification date. Locale and site parameters are optional. |
folder.asStringContains ( attributeName , substring , op , locale, site ) → boolean |
Checks for string occurrences in the attribute value. op parameter must be one of context.STRING_CONTAINS, context.STRING_BEGINS_WITH, or context.STRING_ENDS_WITH constants. |
folder.asString ( attributeName , locale, site ) → string |
Retrieves attribute value and converts it to a string. |
folder.asDecimal ( attributeName , locale, site ) → number |
Retrieves attribute value and converts it to a number. |
folder.asBoolean ( attributeName , locale, site ) → boolean |
Retrieves attribute value and converts it to a boolean value. |
folder.asDateTime ( attributeName , locale, site ) → Date |
Retrieves attribute value and converts it to a date. |
Folder Assignment Object
Method | Comments |
---|---|
assignment.isClassification ( ) → boolean |
Gets whether assignment refers to classification folder. |
assignment.folderId ( ) → string |
Gets associated folder id. |
assignment.libraryId ( ) → string |
Gets associated library id. |