/**
* 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.
*
visibleInMenus.
* The property value must be of type Boolean.
shortId.
* The property value must be of type String.
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)}.
*
robotsIndex.
* The property value must be of type Boolean.
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).
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 propertylastModifiedDate.
* 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).
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 propertylastPublishDate.
* 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).
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 propertypublishDate.
* 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).
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).
*
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 benull
* @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:
*IllegalArgumentException is thrown
*
* 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 benull
* @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: *
*IllegalArgumentException is thrown
*
* 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.
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.
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;