/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; import type { String } from "../../types/java/lang/String"; import type { Map } from "../../types/java/util/Map"; import type { ArticleUtilConstants } from "../../types/senselogic/sitevision/api/render/velocity/VelocityAccess.ArticleUtilConstants"; /** * Article utility interface that handles nodes with primary node type sv:article. * *

* Note! This interface is used to create and update articles. You would typically use * {@link senselogic.sitevision.api.webresource.structure.StructureUtil} to move an article * and {@link senselogic.sitevision.api.webresource.structure.TrashcanUtil} to delete an article. * {@link senselogic.sitevision.api.webresource.webcontent.WebContentUtil} can be used to update the content * of an article. *

* *

* Important note! Methods in this interface operates in the * {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}. * Hence, if you create an article, updates the name of a article or such, the article must be published * (see {@link senselogic.sitevision.api.versioning.PublishingUtil}) * to have any effect in the {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION} *

* *

* An instance of the Sitevision class implementing this interface can be obtained via * {@link senselogic.sitevision.api.Utils#getArticleUtil()}. * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface. *

* @author Mikael Wikblom * @since Sitevision 2.6.2 */ export interface ArticleUtil extends ArticleUtilConstants { /** * Name of the property specifying if an article is visible in menus. It corresponds to the sv:article property visibleInMenus. *

The property value must be of type Boolean.

*/ PROPERTY_VISIBLE_IN_MENUS: "visibleInMenus"; /** * Name of the property specifying the short id of an article. It corresponds to the sv:article property shortId. *

The property value must be of type String.

*/ PROPERTY_SHORTID: "shortId"; /** * Name of the property specifying the locale used by an article. It corresponds to the sv:article property locale. *

* The property value must be of type Locale or a String that can be resolved to a non-null Locale * via {@link senselogic.sitevision.api.i18n.LocaleUtil#getLocaleByString(String)}. *

*/ PROPERTY_LOCALE: "locale"; /** * Name of the property specifying if an article is indexable. It corresponds to the sv:article property robotsIndex. *

The property value must be of type Boolean.

*/ PROPERTY_ROBOTS_INDEX: "robotsIndex"; /** * Name of the property specifying the creation date of an article. It corresponds to the sv:article property creationDate. *

The property value must be of type Date or a String on format yyyy-MM-dd HH:mm:ss where * HH:mm:ss is optional (defaults to 00:00:00).

*/ PROPERTY_CREATION_DATE: "creationDate"; /** * Name of the property specifying the creator of an article. It corresponds to the sv:article property createdBy. *

The property value must be a {@link javax.jcr.Node} with primary node type sv:user or sv:systemUser.

*/ PROPERTY_CREATED_BY: "createdBy"; /** * Name of the property specifying the last modified date of an article. It corresponds to the sv:article property lastModifiedDate. *

The property value must be of type Date or a String on format yyyy-MM-dd HH:mm:ss, where * HH:mm:ss is optional (defaults to 00:00:00).

*/ PROPERTY_LAST_MODIFIED_DATE: "lastModifiedDate"; /** * Name of the property specifying the last modifier of an article. It corresponds to the sv:article property lastModifiedBy. *

The property value must be a {@link javax.jcr.Node} with primary node type sv:user or sv:systemUser.

*/ PROPERTY_LAST_MODIFIED_BY: "lastModifiedBy"; /** * Name of the property specifying the last published date of an article. It corresponds to the sv:article property lastPublishDate. *

The property value must be of type Date or a String on format yyyy-MM-dd HH:mm:ss, where * HH:mm:ss is optional (defaults to 00:00:00).

* @since Sitevision 3.5.3 */ PROPERTY_LAST_PUBLISH_DATE: "lastPublishDate"; /** * Name of the property specifying the last publisher of an article. It corresponds to the sv:article property lastPublishedBy. *

The property value must be a {@link javax.jcr.Node} with primary node type sv:user or sv:systemUser.

* @since Sitevision 3.5.3 */ PROPERTY_LAST_PUBLISHED_BY: "lastPublishedBy"; /** * Name of the property specifying the published date of an article. It corresponds to the sv:article property publishDate. *

The property value must be of type Date or a String on format yyyy-MM-dd HH:mm:ss, where * HH:mm:ss is optional (defaults to 00:00:00).

* @since Sitevision 3.5.3 */ PROPERTY_PUBLISH_DATE: "publishDate"; /** * Name of the property specifying the publisher of an article. It corresponds to the sv:article property publishedBy. *

The property value must be a {@link javax.jcr.Node} with primary node type sv:user or sv:systemUser.

* @since Sitevision 3.5.3 */ PROPERTY_PUBLISHED_BY: "publishedBy"; /** *

* Name of the property specifying the last user to unpublish an article. * It corresponds to the sv:article property lastUnpublishedBy. *

* *

* The property value must be a {@link javax.jcr.Node} with primary node type sv:user or sv:systemUser. *

* @since Sitevision 2024.01.2 */ PROPERTY_LAST_UNPUBLISHED_BY: "lastUnpublishedBy"; /** *

* Name of the property specifying the last unpublished date of an article. * It corresponds to the sv:article property lastUnpublishDate. *

* *

* The property value must be of type Date or a String on format yyyy-MM-dd HH:mm:ss, * where HH:mm:ss is optional (defaults to 00:00:00). *

* @since Sitevision 2024.01.2 */ PROPERTY_LAST_UNPUBLISH_DATE: "lastUnpublishDate"; /** *

Creates an article as sub node to a specified parent. The parent must be a node with primary * node type sv:archive. If other parent is specified a ConstraintViolationException is thrown.

* *

Any name can be given a article, it should however not contain the character '/'.

* *

If no parent, no template or no name is specified a NullPointerException is thrown.

* *

The current user must be authorized to create pages, layouts and to do write operations on the parent node. A * ConstraintViolationException will be thrown if not.

* *

Note that a new article inherits metadata and permissions from its parent.

* *

Use {@link senselogic.sitevision.api.webresource.webcontent.WebContentUtil#updateContent(javax.jcr.Node, java.util.Map)} * to add content to the new article.

* @param aParent the parent node of the article. May not be null * @param aTemplate the template used for the article. May not be null * @param aName the name of the sv:article. May not be null * @return a sv:article node corresponding to the newly created article. Will never return null * @throws javax.jcr.nodetype.ConstraintViolationException if an invalid parent is specified or if the current user is not authorized to create the article * @throws RepositoryException if something else goes wrong * @see #createArticle(javax.jcr.Node, javax.jcr.Node, String, java.util.Map, java.util.Map) */ createArticle(aParent: Node, aTemplate: Node, aName: String | string): Node; /** *

Creates an article with properties and web content. The parent must be a node with primary node type sv:archive. * If other parent is specified a ConstraintViolationException is thrown. It is possible to provide the web content for the article * as well as article properties.

* *

Properties:

* *

* If an invalid value is provided for a property, an IllegalArgumentException is thrown *

* *

* Default values: *

* * *

The article content is specified using the * content map containing keys corresponding to layout names (e.g. "Huvudinnehåll") on the article and values containing the * HTML used to generate a portlet structure in the layout. The provided content is converted to * Sitevision text, table and image modules. It is also possible to specify that a horizontal or a vertical * layout should be created. For more information about the HTML to portlet mapping can be found in the * {@link senselogic.sitevision.api.webresource.webcontent.WebContentUtil} javadoc. * *

If no parent, no template or no name is specified a NullPointerException is thrown.

* *

The current user must be authorized to create pages, layouts and to do write operations on the parent node or * a ConstraintViolationException will be thrown.

* *

Note that a new page inherits metadata and permissions from its parent.

* @param aParent the parent node of the article. May not be null * @param aTemplate the sv:template node to be used for the article. May not be null * @param aName the name of the sv:article. May not be null * @param properties the article properties. May be null * @param content a map containing the HTML content. The keys must correspond to layout names on the node. May be null * @return a sv:article node corresponding to the newly created article. Will never return null * @throws javax.jcr.nodetype.ConstraintViolationException if an invalid parent is specified or if the current user is not authorized to create the article * @throws RepositoryException if something else goes wrong * @see #createArticle(javax.jcr.Node, javax.jcr.Node, String) */ createArticle( aParent: Node, aTemplate: Node, aName: String | string, properties: Map | {}, content: Map | {} ): Node; /** *

Updates the properties of an article. If no article is specified a NullPointerException * is thrown. If the node is not a sv:article an IllegalArgumentException is thrown.

* *

* Properties: *

* *

* If an invalid value is provided for a property, an IllegalArgumentException is thrown. *

* *

The current user must be authorized to do write operations on the article or * a ConstraintViolationException will be thrown.

* *

If no properties map is specified a NullPointerException is thrown.

* @param anArticle the sv:article that will be altered. May not be null * @param properties the article properties. May not be null * @throws javax.jcr.nodetype.ConstraintViolationException if the current user is not authorized to alter the article * @throws RepositoryException if something else goes wrong */ updateArticle(anArticle: Node, properties: Map | {}): void; /** *

Alters the name of an article. If no article is specified a NullPointerException * is thrown. If the node is not an sv:article an IllegalArgumentException is thrown.

* *

Any name can be given an article, it should however not contain the character '/'. If null is * provided a NullPointerException is thrown.

* *

The current user must be authorized to do write operations on the article or * a ConstraintViolationException will be thrown.

* @param anArticle the article that should be renamed. May not be null * @param aName the new name of the article. May not be null * @throws javax.jcr.nodetype.ConstraintViolationException if the current user is not authorized to alter the name of the article * @throws RepositoryException if something else goes wrong */ renameArticle(anArticle: Node, aName: String | string): void; } declare namespace ArticleUtil {} declare var articleUtil: ArticleUtil; export default articleUtil;