Example usage for com.liferay.portal.kernel.repository Repository updateFolder

List of usage examples for com.liferay.portal.kernel.repository Repository updateFolder

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.repository Repository updateFolder.

Prototype

public Folder updateFolder(long folderId, String name, String description, ServiceContext serviceContext)
            throws PortalException;

Source Link

Usage

From source file:com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl.java

License:Open Source License

/**
 * Updates the folder./*w  ww . j av  a 2s. co m*/
 *
 * @param  folderId the primary key of the folder
 * @param  name the folder's new name
 * @param  description the folder's new description
 * @param  serviceContext the service context to be applied. In a Liferay
 *         repository, it may include:  <ul> <li> defaultFileEntryTypeId -
 *         the file entry type to default all Liferay file entries to </li>
 *         <li> fileEntryTypeSearchContainerPrimaryKeys - a comma-delimited
 *         list of file entry type primary keys allowed in the given folder
 *         and all descendants </li> <li> overrideFileEntryTypes - boolean
 *         specifying whether to override ancestral folder's restriction of
 *         file entry types allowed </li> <li> workflowDefinitionXYZ - the
 *         workflow definition name specified per file entry type. The
 *         parameter name must be the string <code>workflowDefinition</code>
 *         appended by the <code>fileEntryTypeId</code> (optionally
 *         <code>0</code>). </li> </ul>
 * @return the folder
 * @throws PortalException if the current or new parent folder could not be
 *         found or if the new parent folder's information was invalid
 * @throws SystemException if a system exception occurred
 */
public Folder updateFolder(long folderId, String name, String description, ServiceContext serviceContext)
        throws PortalException, SystemException {

    Repository repository = null;

    if (folderId == DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
        repository = getRepository(serviceContext.getScopeGroupId());
    } else {
        repository = getRepository(folderId, 0, 0);
    }

    return repository.updateFolder(folderId, name, description, serviceContext);
}