Example usage for com.liferay.portal.kernel.security.permission ActionKeys UPDATE

List of usage examples for com.liferay.portal.kernel.security.permission ActionKeys UPDATE

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.security.permission ActionKeys UPDATE.

Prototype

String UPDATE

To view the source code for com.liferay.portal.kernel.security.permission ActionKeys UPDATE.

Click Source Link

Usage

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Removes the web content of the web content article matching the group,
 * article ID, and version, and language.
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  languageId the primary key of the language locale to remove
 * @return the updated web content article with the locale removed
 *///from   w w w  .  jav  a2 s. c o m
@Override
public JournalArticle removeArticleLocale(long groupId, String articleId, double version, String languageId)
        throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.removeArticleLocale(groupId, articleId, version, languageId);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Updates the web content article matching the version, replacing its
 * folder, title, description, content, and layout UUID.
 *
 * @param  userId the primary key of the user updating the web content
 *         article//from w w w.j a  v a 2s  . c o  m
 * @param  groupId the primary key of the web content article's group
 * @param  folderId the primary key of the web content article folder
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  titleMap the web content article's locales and localized titles
 * @param  descriptionMap the web content article's locales and localized
 *         descriptions
 * @param  content the HTML content wrapped in XML. For more information,
 *         see the content example in the {@link #updateArticle(long, long,
 *         String, double, String, ServiceContext)} description.
 * @param  layoutUuid the unique string identifying the web content
 *         article's display page
 * @param  serviceContext the service context to be applied. Can set the
 *         modification date, expando bridge attributes, asset category IDs,
 *         asset tag names, asset link entry IDs, asset priority, workflow
 *         actions, URL title, and can set whether to add the default
 *         command update for the web content article. With respect to
 *         social activities, by setting the service context's command to
 *         {@link com.liferay.portal.kernel.util.Constants#UPDATE}, the
 *         invocation is considered a web content update activity; otherwise
 *         it is considered a web content add activity.
 * @return the updated web content article
 */
@Override
public JournalArticle updateArticle(long userId, long groupId, long folderId, String articleId, double version,
        Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, String content, String layoutUuid,
        ServiceContext serviceContext) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.updateArticle(userId, groupId, folderId, articleId, version, titleMap,
            descriptionMap, content, layoutUuid, serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Updates the web content article with additional parameters.
 *
 * @param  groupId the primary key of the web content article's group
 * @param  folderId the primary key of the web content article folder
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  titleMap the web content article's locales and localized titles
 * @param  descriptionMap the web content article's locales and localized
 *         descriptions//from   www .  ja v a 2s  .  c om
 * @param  content the HTML content wrapped in XML. For more information,
 *         see the content example in the {@link #updateArticle(long, long,
 *         String, double, String, ServiceContext)} description.
 * @param  ddmStructureKey the primary key of the web content article's DDM
 *         structure, if the article is related to a DDM structure, or
 *         <code>null</code> otherwise
 * @param  ddmTemplateKey the primary key of the web content article's DDM
 *         template
 * @param  layoutUuid the unique string identifying the web content
 *         article's display page
 * @param  displayDateMonth the month the web content article is set to
 *         display
 * @param  displayDateDay the calendar day the web content article is set to
 *         display
 * @param  displayDateYear the year the web content article is set to
 *         display
 * @param  displayDateHour the hour the web content article is set to
 *         display
 * @param  displayDateMinute the minute the web content article is set to
 *         display
 * @param  expirationDateMonth the month the web content article is set to
 *         expire
 * @param  expirationDateDay the calendar day the web content article is set
 *         to expire
 * @param  expirationDateYear the year the web content article is set to
 *         expire
 * @param  expirationDateHour the hour the web content article is set to
 *         expire
 * @param  expirationDateMinute the minute the web content article is set to
 *         expire
 * @param  neverExpire whether the web content article is not set to auto
 *         expire
 * @param  reviewDateMonth the month the web content article is set for
 *         review
 * @param  reviewDateDay the calendar day the web content article is set for
 *         review
 * @param  reviewDateYear the year the web content article is set for review
 * @param  reviewDateHour the hour the web content article is set for review
 * @param  reviewDateMinute the minute the web content article is set for
 *         review
 * @param  neverReview whether the web content article is not set for review
 * @param  indexable whether the web content is searchable
 * @param  smallImage whether to update web content article's a small image.
 *         A file must be passed in as <code>smallImageFile</code> value,
 *         otherwise the current small image is deleted.
 * @param  smallImageURL the web content article's small image URL
 *         (optionally <code>null</code>)
 * @param  smallFile the web content article's new small image file
 *         (optionally <code>null</code>). Must pass in
 *         <code>smallImage</code> value of <code>true</code> to replace the
 *         article's small image file.
 * @param  images the web content's images (optionally <code>null</code>)
 * @param  articleURL the web content article's accessible URL (optionally
 *         <code>null</code>)
 * @param  serviceContext the service context to be applied. Can set the
 *         modification date, expando bridge attributes, asset category IDs,
 *         asset tag names, asset link entry IDs, asset priority, workflow
 *         actions, URL title, and can set whether to add the default
 *         command update for the web content article. With respect to
 *         social activities, by setting the service context's command to
 *         {@link com.liferay.portal.kernel.util.Constants#UPDATE}, the
 *         invocation is considered a web content update activity; otherwise
 *         it is considered a web content add activity.
 * @return the updated web content article
 */
@Override
public JournalArticle updateArticle(long groupId, long folderId, String articleId, double version,
        Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, String content,
        String ddmStructureKey, String ddmTemplateKey, String layoutUuid, int displayDateMonth,
        int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute,
        int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour,
        int expirationDateMinute, boolean neverExpire, int reviewDateMonth, int reviewDateDay,
        int reviewDateYear, int reviewDateHour, int reviewDateMinute, boolean neverReview, boolean indexable,
        boolean smallImage, String smallImageURL, File smallFile, Map<String, byte[]> images, String articleURL,
        ServiceContext serviceContext) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.updateArticle(getUserId(), groupId, folderId, articleId, version,
            titleMap, descriptionMap, content, ddmStructureKey, ddmTemplateKey, layoutUuid, displayDateMonth,
            displayDateDay, displayDateYear, displayDateHour, displayDateMinute, expirationDateMonth,
            expirationDateDay, expirationDateYear, expirationDateHour, expirationDateMinute, neverExpire,
            reviewDateMonth, reviewDateDay, reviewDateYear, reviewDateHour, reviewDateMinute, neverReview,
            indexable, smallImage, smallImageURL, smallFile, images, articleURL, serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Updates the web content article matching the version, replacing its
 * folder and content.//w w  w.j a va 2  s. co  m
 *
 * <p>
 * The web content articles hold HTML content wrapped in XML. The XML lets
 * you specify the article's default locale and available locales. Here is a
 * content example:
 * </p>
 *
 * <p>
 * <pre>
 * <code>
 * &lt;?xml version='1.0' encoding='UTF-8'?&gt;
 * &lt;root default-locale="en_US" available-locales="en_US"&gt;
 *    &lt;static-content language-id="en_US"&gt;
 *       &lt;![CDATA[&lt;p&gt;&lt;b&gt;&lt;i&gt;test&lt;i&gt; content&lt;b&gt;&lt;/p&gt;]]&gt;
 *    &lt;/static-content&gt;
 * &lt;/root&gt;
 * </code>
 * </pre>
 * </p>
 *
 * @param  groupId the primary key of the web content article's group
 * @param  folderId the primary key of the web content article folder
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  content the HTML content wrapped in XML.
 * @param  serviceContext the service context to be applied. Can set the
 *         modification date, expando bridge attributes, asset category IDs,
 *         asset tag names, asset link entry IDs, asset priority, workflow
 *         actions, URL title, and can set whether to add the default
 *         command update for the web content article. With respect to
 *         social activities, by setting the service context's command to
 *         {@link com.liferay.portal.kernel.util.Constants#UPDATE}, the
 *         invocation is considered a web content update activity; otherwise
 *         it is considered a web content add activity.
 * @return the updated web content article
 */
@Override
public JournalArticle updateArticle(long groupId, long folderId, String articleId, double version,
        String content, ServiceContext serviceContext) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.updateArticle(getUserId(), groupId, folderId, articleId, version, content,
            serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Updates the translation of the web content article.
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  locale the locale of the web content article's display template
 * @param  title the translated web content article title
 * @param  description the translated web content article description
 * @param  content the HTML content wrapped in XML. For more information,
 *         see the content example in the {@link #updateArticle(long, long,
 *         String, double, String, ServiceContext)} description.
 * @param  images the web content's images
 * @param  serviceContext the service context to be applied. Can set the
 *         modification date and URL title for the web content article.
 * @return the updated web content article
 *//*from w ww .j a v  a 2s. c o m*/
@Override
public JournalArticle updateArticleTranslation(long groupId, String articleId, double version, Locale locale,
        String title, String description, String content, Map<String, byte[]> images,
        ServiceContext serviceContext) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.updateArticleTranslation(groupId, articleId, version, locale, title,
            description, content, images, serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Updates the web content article matching the group, article ID, and
 * version, replacing its content./* w  w w. j  a  va2  s  .  co  m*/
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  content the HTML content wrapped in XML. For more information,
 *         see the content example in the {@link #updateArticle(long, long,
 *         String, double, String, ServiceContext)} description.
 * @return the updated web content article
 */
@Override
public JournalArticle updateContent(long groupId, String articleId, double version, String content)
        throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.updateContent(groupId, articleId, version, content);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Updates the workflow status of the web content article matching the
 * group, article ID, and version.// w  ww  .ja v  a 2 s . co  m
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  status the web content article's workflow status. For more
 *         information see {@link WorkflowConstants} for constants starting
 *         with the "STATUS_" prefix.
 * @param  articleURL the web content article's accessible URL
 * @param  serviceContext the service context to be applied. Can set the
 *         modification date, portlet preferences, and can set whether to
 *         add the default command update for the web content article.
 * @return the updated web content article
 */
@Override
public JournalArticle updateStatus(long groupId, String articleId, double version, int status,
        String articleURL, ServiceContext serviceContext) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.UPDATE);

    return journalArticleLocalService.updateStatus(getUserId(), groupId, articleId, version, status, articleURL,
            new HashMap<String, Serializable>(), serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalFeedServiceImpl.java

License:Open Source License

@Override
public JournalFeed updateFeed(long groupId, String feedId, String name, String description,
        String ddmStructureKey, String ddmTemplateKey, String ddmRendererTemplateKey, int delta,
        String orderByCol, String orderByType, String targetLayoutFriendlyUrl, String targetPortletId,
        String contentField, String feedType, double feedVersion, ServiceContext serviceContext)
        throws PortalException {

    JournalFeedPermission.check(getPermissionChecker(), groupId, feedId, ActionKeys.UPDATE);

    return journalFeedLocalService.updateFeed(groupId, feedId, name, description, ddmStructureKey,
            ddmTemplateKey, ddmRendererTemplateKey, delta, orderByCol, orderByType, targetLayoutFriendlyUrl,
            targetPortletId, contentField, feedType, feedVersion, serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalFolderServiceImpl.java

License:Open Source License

@Override
public JournalFolder moveFolder(long folderId, long parentFolderId, ServiceContext serviceContext)
        throws PortalException {

    JournalFolder folder = journalFolderLocalService.getFolder(folderId);

    JournalFolderPermission.check(getPermissionChecker(), folder, ActionKeys.UPDATE);

    return journalFolderLocalService.moveFolder(folderId, parentFolderId, serviceContext);
}

From source file:com.liferay.journal.service.impl.JournalFolderServiceImpl.java

License:Open Source License

@Override
public JournalFolder moveFolderFromTrash(long folderId, long parentFolderId, ServiceContext serviceContext)
        throws PortalException {

    JournalFolder folder = journalFolderLocalService.getFolder(folderId);

    JournalFolderPermission.check(getPermissionChecker(), folder, ActionKeys.UPDATE);

    return journalFolderLocalService.moveFolderFromTrash(getUserId(), folderId, parentFolderId, serviceContext);
}