001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.service.impl;
016    
017    import com.liferay.portal.kernel.dao.orm.QueryDefinition;
018    import com.liferay.portal.kernel.exception.PortalException;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.ArrayUtil;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.workflow.WorkflowConstants;
023    import com.liferay.portal.security.permission.ActionKeys;
024    import com.liferay.portal.service.ServiceContext;
025    import com.liferay.portal.theme.ThemeDisplay;
026    import com.liferay.portlet.journal.model.JournalArticle;
027    import com.liferay.portlet.journal.model.JournalArticleConstants;
028    import com.liferay.portlet.journal.service.base.JournalArticleServiceBaseImpl;
029    import com.liferay.portlet.journal.service.permission.JournalArticlePermission;
030    import com.liferay.portlet.journal.service.permission.JournalPermission;
031    
032    import java.io.File;
033    import java.io.Serializable;
034    
035    import java.util.Date;
036    import java.util.HashMap;
037    import java.util.List;
038    import java.util.Locale;
039    import java.util.Map;
040    
041    /**
042     * @author Brian Wing Shun Chan
043     * @author Raymond Augé
044     * @author Levente Hudák
045     */
046    public class JournalArticleServiceImpl extends JournalArticleServiceBaseImpl {
047    
048            public JournalArticle addArticle(
049                            long groupId, long folderId, long classNameId, long classPK,
050                            String articleId, boolean autoArticleId,
051                            Map<Locale, String> titleMap, Map<Locale, String> descriptionMap,
052                            String content, String type, String structureId, String templateId,
053                            String layoutUuid, int displayDateMonth, int displayDateDay,
054                            int displayDateYear, int displayDateHour, int displayDateMinute,
055                            int expirationDateMonth, int expirationDateDay,
056                            int expirationDateYear, int expirationDateHour,
057                            int expirationDateMinute, boolean neverExpire, int reviewDateMonth,
058                            int reviewDateDay, int reviewDateYear, int reviewDateHour,
059                            int reviewDateMinute, boolean neverReview, boolean indexable,
060                            boolean smallImage, String smallImageURL, File smallFile,
061                            Map<String, byte[]> images, String articleURL,
062                            ServiceContext serviceContext)
063                    throws PortalException, SystemException {
064    
065                    JournalPermission.check(
066                            getPermissionChecker(), groupId, ActionKeys.ADD_ARTICLE);
067    
068                    return journalArticleLocalService.addArticle(
069                            getUserId(), groupId, folderId, classNameId, classPK, articleId,
070                            autoArticleId, JournalArticleConstants.VERSION_DEFAULT, titleMap,
071                            descriptionMap, content, type, structureId, templateId, layoutUuid,
072                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
073                            displayDateMinute, expirationDateMonth, expirationDateDay,
074                            expirationDateYear, expirationDateHour, expirationDateMinute,
075                            neverExpire, reviewDateMonth, reviewDateDay, reviewDateYear,
076                            reviewDateHour, reviewDateMinute, neverReview, indexable,
077                            smallImage, smallImageURL, smallFile, images, articleURL,
078                            serviceContext);
079            }
080    
081            public JournalArticle addArticle(
082                            long groupId, long folderId, long classNameId, long classPK,
083                            String articleId, boolean autoArticleId,
084                            Map<Locale, String> titleMap, Map<Locale, String> descriptionMap,
085                            String content, String type, String structureId, String templateId,
086                            String layoutUuid, int displayDateMonth, int displayDateDay,
087                            int displayDateYear, int displayDateHour, int displayDateMinute,
088                            int expirationDateMonth, int expirationDateDay,
089                            int expirationDateYear, int expirationDateHour,
090                            int expirationDateMinute, boolean neverExpire, int reviewDateMonth,
091                            int reviewDateDay, int reviewDateYear, int reviewDateHour,
092                            int reviewDateMinute, boolean neverReview, boolean indexable,
093                            String articleURL, ServiceContext serviceContext)
094                    throws PortalException, SystemException {
095    
096                    JournalPermission.check(
097                            getPermissionChecker(), groupId, ActionKeys.ADD_ARTICLE);
098    
099                    return journalArticleLocalService.addArticle(
100                            getUserId(), groupId, folderId, classNameId, classPK, articleId,
101                            autoArticleId, JournalArticleConstants.VERSION_DEFAULT, titleMap,
102                            descriptionMap, content, type, structureId, templateId, layoutUuid,
103                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
104                            displayDateMinute, expirationDateMonth, expirationDateDay,
105                            expirationDateYear, expirationDateHour, expirationDateMinute,
106                            neverExpire, reviewDateMonth, reviewDateDay, reviewDateYear,
107                            reviewDateHour, reviewDateMinute, neverReview, indexable, false,
108                            null, null, null, articleURL, serviceContext);
109            }
110    
111            public JournalArticle copyArticle(
112                            long groupId, String oldArticleId, String newArticleId,
113                            boolean autoArticleId, double version)
114                    throws PortalException, SystemException {
115    
116                    JournalPermission.check(
117                            getPermissionChecker(), groupId, ActionKeys.ADD_ARTICLE);
118    
119                    return journalArticleLocalService.copyArticle(
120                            getUserId(), groupId, oldArticleId, newArticleId, autoArticleId,
121                            version);
122            }
123    
124            public void deleteArticle(
125                            long groupId, String articleId, double version, String articleURL,
126                            ServiceContext serviceContext)
127                    throws PortalException, SystemException {
128    
129                    JournalArticlePermission.check(
130                            getPermissionChecker(), groupId, articleId, version,
131                            ActionKeys.DELETE);
132    
133                    journalArticleLocalService.deleteArticle(
134                            groupId, articleId, version, articleURL, serviceContext);
135            }
136    
137            public void deleteArticle(
138                            long groupId, String articleId, String articleURL,
139                            ServiceContext serviceContext)
140                    throws PortalException, SystemException {
141    
142                    JournalArticlePermission.check(
143                            getPermissionChecker(), groupId, articleId, ActionKeys.DELETE);
144    
145                    journalArticleLocalService.deleteArticle(
146                            groupId, articleId, serviceContext);
147            }
148    
149            public JournalArticle expireArticle(
150                            long groupId, String articleId, double version, String articleURL,
151                            ServiceContext serviceContext)
152                    throws PortalException, SystemException {
153    
154                    JournalArticlePermission.check(
155                            getPermissionChecker(), groupId, articleId, version,
156                            ActionKeys.EXPIRE);
157    
158                    return journalArticleLocalService.expireArticle(
159                            getUserId(), groupId, articleId, version, articleURL,
160                            serviceContext);
161            }
162    
163            public void expireArticle(
164                            long groupId, String articleId, String articleURL,
165                            ServiceContext serviceContext)
166                    throws PortalException, SystemException {
167    
168                    JournalArticlePermission.check(
169                            getPermissionChecker(), groupId, articleId, ActionKeys.EXPIRE);
170    
171                    journalArticleLocalService.expireArticle(
172                            getUserId(), groupId, articleId, articleURL, serviceContext);
173            }
174    
175            public JournalArticle getArticle(long id)
176                    throws PortalException, SystemException {
177    
178                    JournalArticle article = journalArticleLocalService.getArticle(id);
179    
180                    JournalArticlePermission.check(
181                            getPermissionChecker(), article, ActionKeys.VIEW);
182    
183                    return article;
184            }
185    
186            public JournalArticle getArticle(long groupId, String articleId)
187                    throws PortalException, SystemException {
188    
189                    JournalArticlePermission.check(
190                            getPermissionChecker(), groupId, articleId, ActionKeys.VIEW);
191    
192                    return journalArticleLocalService.getArticle(groupId, articleId);
193            }
194    
195            public JournalArticle getArticle(
196                            long groupId, String articleId, double version)
197                    throws PortalException, SystemException {
198    
199                    JournalArticlePermission.check(
200                            getPermissionChecker(), groupId, articleId, version,
201                            ActionKeys.VIEW);
202    
203                    return journalArticleLocalService.getArticle(
204                            groupId, articleId, version);
205            }
206    
207            public JournalArticle getArticle(
208                            long groupId, String className, long classPK)
209                    throws PortalException, SystemException {
210    
211                    JournalArticle article = journalArticleLocalService.getArticle(
212                            groupId, className, classPK);
213    
214                    JournalArticlePermission.check(
215                            getPermissionChecker(), groupId, article.getArticleId(),
216                            article.getVersion(), ActionKeys.VIEW);
217    
218                    return article;
219            }
220    
221            public JournalArticle getArticleByUrlTitle(long groupId, String urlTitle)
222                    throws PortalException, SystemException {
223    
224                    JournalArticle article =
225                            journalArticleLocalService.getArticleByUrlTitle(groupId, urlTitle);
226    
227                    JournalArticlePermission.check(
228                            getPermissionChecker(), article, ActionKeys.VIEW);
229    
230                    return article;
231            }
232    
233            public String getArticleContent(
234                            long groupId, String articleId, double version, String languageId,
235                            ThemeDisplay themeDisplay)
236                    throws PortalException, SystemException {
237    
238                    JournalArticlePermission.check(
239                            getPermissionChecker(), groupId, articleId, version,
240                            ActionKeys.VIEW);
241    
242                    return journalArticleLocalService.getArticleContent(
243                            groupId, articleId, version, null, languageId, themeDisplay);
244            }
245    
246            public String getArticleContent(
247                            long groupId, String articleId, String languageId,
248                            ThemeDisplay themeDisplay)
249                    throws PortalException, SystemException {
250    
251                    JournalArticlePermission.check(
252                            getPermissionChecker(), groupId, articleId, ActionKeys.VIEW);
253    
254                    return journalArticleLocalService.getArticleContent(
255                            groupId, articleId, null, languageId, themeDisplay);
256            }
257    
258            public List<JournalArticle> getArticles(long groupId, long folderId)
259                    throws SystemException {
260    
261                    return journalArticlePersistence.filterFindByG_F_NotST(
262                            groupId, folderId, WorkflowConstants.STATUS_IN_TRASH);
263            }
264    
265            public List<JournalArticle> getArticles(
266                            long groupId, long folderId, int start, int end,
267                            OrderByComparator obc)
268                    throws SystemException {
269    
270                    return journalArticlePersistence.filterFindByG_F_NotST(
271                            groupId, folderId, WorkflowConstants.STATUS_IN_TRASH, start, end,
272                            obc);
273            }
274    
275            public List<JournalArticle> getArticlesByArticleId(
276                            long groupId, String articleId, int start, int end,
277                            OrderByComparator obc)
278                    throws SystemException {
279    
280                    return journalArticlePersistence.filterFindByG_A(
281                            groupId, articleId, start, end, obc);
282            }
283    
284            public List<JournalArticle> getArticlesByLayoutUuid(
285                            long groupId, String layoutUuid)
286                    throws SystemException {
287    
288                    return journalArticlePersistence.filterFindByG_L(groupId, layoutUuid);
289            }
290    
291            public List<JournalArticle> getArticlesByStructureId(
292                            long groupId, long classNameId, String structureId, int status,
293                            int start, int end, OrderByComparator obc)
294                    throws SystemException {
295    
296                    QueryDefinition queryDefinition = new QueryDefinition(
297                            status, start, end, obc);
298    
299                    return journalArticleFinder.filterFindByG_C_S(
300                            groupId, classNameId, structureId, queryDefinition);
301            }
302    
303            public List<JournalArticle> getArticlesByStructureId(
304                            long groupId, String structureId, int start, int end,
305                            OrderByComparator obc)
306                    throws SystemException {
307    
308                    QueryDefinition queryDefinition = new QueryDefinition(
309                            WorkflowConstants.STATUS_ANY, start, end, obc);
310    
311                    return journalArticleFinder.filterFindByG_C_S(
312                            groupId, JournalArticleConstants.CLASSNAME_ID_DEFAULT, structureId,
313                            queryDefinition);
314            }
315    
316            public List<JournalArticle> getArticlesByUserId(
317                            long groupId, long userId, long classNameId, int start, int end,
318                            OrderByComparator obc)
319                    throws SystemException {
320    
321                    QueryDefinition queryDefinition = new QueryDefinition(
322                            WorkflowConstants.STATUS_ANY, start, end, obc);
323    
324                    return journalArticleFinder.filterFindByG_U_C(
325                            groupId, userId, classNameId, queryDefinition);
326            }
327    
328            public int getArticlesCount(long groupId, long folderId)
329                    throws SystemException {
330    
331                    return journalArticlePersistence.filterCountByG_F_NotST(
332                            groupId, folderId, WorkflowConstants.STATUS_IN_TRASH);
333            }
334    
335            public int getArticlesCountByArticleId(long groupId, String articleId)
336                    throws SystemException {
337    
338                    return journalArticlePersistence.filterCountByG_A(groupId, articleId);
339            }
340    
341            public int getArticlesCountByStructureId(
342                            long groupId, long classNameId, String structureId, int status)
343                    throws SystemException {
344    
345                    return journalArticleFinder.filterCountByG_C_S(
346                            groupId, classNameId, structureId, new QueryDefinition(status));
347            }
348    
349            public int getArticlesCountByStructureId(long groupId, String structureId)
350                    throws SystemException {
351    
352                    return getArticlesCountByStructureId(
353                            groupId, JournalArticleConstants.CLASSNAME_ID_DEFAULT, structureId,
354                            WorkflowConstants.STATUS_ANY);
355            }
356    
357            public int getArticlesCountByUserId(
358                            long groupId, long userId, long classNameId)
359                    throws SystemException {
360    
361                    return journalArticleFinder.filterCountByG_U_C(
362                            groupId, userId, classNameId,
363                            new QueryDefinition(WorkflowConstants.STATUS_ANY));
364            }
365    
366            public JournalArticle getDisplayArticleByUrlTitle(
367                            long groupId, String urlTitle)
368                    throws PortalException, SystemException {
369    
370                    JournalArticle article =
371                            journalArticleLocalService.getDisplayArticleByUrlTitle(
372                                    groupId, urlTitle);
373    
374                    JournalArticlePermission.check(
375                            getPermissionChecker(), article, ActionKeys.VIEW);
376    
377                    return article;
378            }
379    
380            public int getFoldersAndArticlesCount(long groupId, List<Long> folderIds)
381                    throws SystemException {
382    
383                    return journalArticlePersistence.filterCountByG_F(
384                            groupId,
385                            ArrayUtil.toArray(folderIds.toArray(new Long[folderIds.size()])));
386            }
387    
388            public JournalArticle getLatestArticle(long resourcePrimKey)
389                    throws PortalException, SystemException {
390    
391                    JournalArticlePermission.check(
392                            getPermissionChecker(), resourcePrimKey, ActionKeys.VIEW);
393    
394                    return journalArticleLocalService.getLatestArticle(resourcePrimKey);
395            }
396    
397            public JournalArticle getLatestArticle(
398                            long groupId, String articleId, int status)
399                    throws PortalException, SystemException {
400    
401                    JournalArticlePermission.check(
402                            getPermissionChecker(), groupId, articleId, status,
403                            ActionKeys.VIEW);
404    
405                    return journalArticleLocalService.getLatestArticle(
406                            groupId, articleId, status);
407            }
408    
409            public JournalArticle getLatestArticle(
410                            long groupId, String className, long classPK)
411                    throws PortalException, SystemException {
412    
413                    JournalArticle article = journalArticleLocalService.getLatestArticle(
414                            groupId, className, classPK);
415    
416                    JournalArticlePermission.check(
417                            getPermissionChecker(), groupId, article.getArticleId(),
418                            article.getVersion(), ActionKeys.VIEW);
419    
420                    return article;
421            }
422    
423            public void moveArticle(long groupId, String articleId, long newFolderId)
424                    throws PortalException, SystemException {
425    
426                    List<JournalArticle> articles = journalArticlePersistence.findByG_A(
427                            groupId, articleId);
428    
429                    for (JournalArticle article : articles) {
430                            JournalArticlePermission.check(
431                                    getPermissionChecker(), article, ActionKeys.UPDATE);
432    
433                            journalArticleLocalService.moveArticle(
434                                    groupId, articleId, newFolderId);
435                    }
436            }
437    
438            public JournalArticle moveArticleToTrash(long groupId, String articleId)
439                    throws PortalException, SystemException {
440    
441                    JournalArticlePermission.check(
442                            getPermissionChecker(), groupId, articleId, ActionKeys.DELETE);
443    
444                    return journalArticleLocalService.moveArticleToTrash(
445                            getUserId(), groupId, articleId);
446            }
447    
448            public void removeArticleLocale(long companyId, String languageId)
449                    throws PortalException, SystemException {
450    
451                    for (JournalArticle article :
452                                    journalArticlePersistence.findByCompanyId(companyId)) {
453    
454                            removeArticleLocale(
455                                    article.getGroupId(), article.getArticleId(),
456                                    article.getVersion(), languageId);
457                    }
458            }
459    
460            public JournalArticle removeArticleLocale(
461                            long groupId, String articleId, double version, String languageId)
462                    throws PortalException, SystemException {
463    
464                    JournalArticlePermission.check(
465                            getPermissionChecker(), groupId, articleId, version,
466                            ActionKeys.UPDATE);
467    
468                    return journalArticleLocalService.removeArticleLocale(
469                            groupId, articleId, version, languageId);
470            }
471    
472            public void restoreArticleFromTrash(long resourcePrimKey)
473                    throws PortalException, SystemException {
474    
475                    JournalArticle article = getLatestArticle(resourcePrimKey);
476    
477                    JournalArticlePermission.check(
478                            getPermissionChecker(), article, ActionKeys.DELETE);
479    
480                    journalArticleLocalService.restoreArticleFromTrash(
481                            getUserId(), article);
482            }
483    
484            public void restoreArticleFromTrash(long groupId, String articleId)
485                    throws PortalException, SystemException {
486    
487                    JournalArticle article = getLatestArticle(
488                            groupId, articleId, WorkflowConstants.STATUS_IN_TRASH);
489    
490                    restoreArticleFromTrash(article.getResourcePrimKey());
491            }
492    
493            public List<JournalArticle> search(
494                            long companyId, long groupId, List<Long> folderIds,
495                            long classNameId, String keywords, Double version, String type,
496                            String structureId, String templateId, Date displayDateGT,
497                            Date displayDateLT, int status, Date reviewDate, int start, int end,
498                            OrderByComparator obc)
499                    throws SystemException {
500    
501                    return journalArticleFinder.filterFindByKeywords(
502                            companyId, groupId, folderIds, classNameId, keywords, version, type,
503                            structureId, templateId, displayDateGT, displayDateLT, status,
504                            reviewDate, start, end, obc);
505            }
506    
507            public List<JournalArticle> search(
508                            long companyId, long groupId, List<Long> folderIds,
509                            long classNameId, String articleId, Double version, String title,
510                            String description, String content, String type, String structureId,
511                            String templateId, Date displayDateGT, Date displayDateLT,
512                            int status, Date reviewDate, boolean andOperator, int start,
513                            int end, OrderByComparator obc)
514                    throws SystemException {
515    
516                    QueryDefinition queryDefinition = new QueryDefinition(
517                            status, start, end, obc);
518    
519                    return journalArticleFinder.filterFindByC_G_F_C_A_V_T_D_C_T_S_T_D_R(
520                            companyId, groupId, folderIds, classNameId, articleId, version,
521                            title, description, content, type, structureId, templateId,
522                            displayDateGT, displayDateLT, reviewDate, andOperator,
523                            queryDefinition);
524            }
525    
526            public List<JournalArticle> search(
527                            long companyId, long groupId, List<Long> folderIds,
528                            long classNameId, String articleId, Double version, String title,
529                            String description, String content, String type,
530                            String[] structureIds, String[] templateIds, Date displayDateGT,
531                            Date displayDateLT, int status, Date reviewDate,
532                            boolean andOperator, int start, int end, OrderByComparator obc)
533                    throws SystemException {
534    
535                    QueryDefinition queryDefinition = new QueryDefinition(
536                            status, start, end, obc);
537    
538                    return journalArticleFinder.filterFindByC_G_F_C_A_V_T_D_C_T_S_T_D_R(
539                            companyId, groupId, folderIds, classNameId, articleId, version,
540                            title, description, content, type, structureIds, templateIds,
541                            displayDateGT, displayDateLT, reviewDate, andOperator,
542                            queryDefinition);
543            }
544    
545            public int searchCount(
546                            long companyId, long groupId, List<Long> folderIds,
547                            long classNameId, String keywords, Double version, String type,
548                            String structureId, String templateId, Date displayDateGT,
549                            Date displayDateLT, int status, Date reviewDate)
550                    throws SystemException {
551    
552                    return journalArticleFinder.filterCountByKeywords(
553                            companyId, groupId, folderIds, classNameId, keywords, version, type,
554                            structureId, templateId, displayDateGT, displayDateLT, status,
555                            reviewDate);
556            }
557    
558            public int searchCount(
559                            long companyId, long groupId, List<Long> folderIds,
560                            long classNameId, String articleId, Double version, String title,
561                            String description, String content, String type, String structureId,
562                            String templateId, Date displayDateGT, Date displayDateLT,
563                            int status, Date reviewDate, boolean andOperator)
564                    throws SystemException {
565    
566                    return journalArticleFinder.filterCountByC_G_F_C_A_V_T_D_C_T_S_T_D_R(
567                            companyId, groupId, folderIds, classNameId, articleId, version,
568                            title, description, content, type, structureId, templateId,
569                            displayDateGT, displayDateLT, reviewDate, andOperator,
570                            new QueryDefinition(status));
571            }
572    
573            public int searchCount(
574                            long companyId, long groupId, List<Long> folderIds,
575                            long classNameId, String articleId, Double version, String title,
576                            String description, String content, String type,
577                            String[] structureIds, String[] templateIds, Date displayDateGT,
578                            Date displayDateLT, int status, Date reviewDate,
579                            boolean andOperator)
580                    throws SystemException {
581    
582                    return journalArticleFinder.filterCountByC_G_F_C_A_V_T_D_C_T_S_T_D_R(
583                            companyId, groupId, folderIds, classNameId, articleId, version,
584                            title, description, content, type, structureIds, templateIds,
585                            displayDateGT, displayDateLT, reviewDate, andOperator,
586                            new QueryDefinition(status));
587            }
588    
589            public void subscribe(long groupId)
590                    throws PortalException, SystemException {
591    
592                    JournalPermission.check(
593                            getPermissionChecker(), groupId, ActionKeys.SUBSCRIBE);
594    
595                    journalArticleLocalService.subscribe(getUserId(), groupId);
596            }
597    
598            public void unsubscribe(long groupId)
599                    throws PortalException, SystemException {
600    
601                    JournalPermission.check(
602                            getPermissionChecker(), groupId, ActionKeys.SUBSCRIBE);
603    
604                    journalArticleLocalService.unsubscribe(getUserId(), groupId);
605            }
606    
607            public JournalArticle updateArticle(
608                            long userId, long groupId, long folderId, String articleId,
609                            double version, Map<Locale, String> titleMap,
610                            Map<Locale, String> descriptionMap, String content,
611                            String layoutUuid, ServiceContext serviceContext)
612                    throws PortalException, SystemException {
613    
614                    return journalArticleLocalService.updateArticle(
615                            userId, groupId, folderId, articleId, version, titleMap,
616                            descriptionMap, content, layoutUuid, serviceContext);
617            }
618    
619            public JournalArticle updateArticle(
620                            long groupId, long folderId, String articleId, double version,
621                            Map<Locale, String> titleMap, Map<Locale, String> descriptionMap,
622                            String content, String type, String structureId, String templateId,
623                            String layoutUuid, int displayDateMonth, int displayDateDay,
624                            int displayDateYear, int displayDateHour, int displayDateMinute,
625                            int expirationDateMonth, int expirationDateDay,
626                            int expirationDateYear, int expirationDateHour,
627                            int expirationDateMinute, boolean neverExpire, int reviewDateMonth,
628                            int reviewDateDay, int reviewDateYear, int reviewDateHour,
629                            int reviewDateMinute, boolean neverReview, boolean indexable,
630                            boolean smallImage, String smallImageURL, File smallFile,
631                            Map<String, byte[]> images, String articleURL,
632                            ServiceContext serviceContext)
633                    throws PortalException, SystemException {
634    
635                    JournalArticlePermission.check(
636                            getPermissionChecker(), groupId, articleId, version,
637                            ActionKeys.UPDATE);
638    
639                    return journalArticleLocalService.updateArticle(
640                            getUserId(), groupId, folderId, articleId, version, titleMap,
641                            descriptionMap, content, type, structureId, templateId, layoutUuid,
642                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
643                            displayDateMinute, expirationDateMonth, expirationDateDay,
644                            expirationDateYear, expirationDateHour, expirationDateMinute,
645                            neverExpire, reviewDateMonth, reviewDateDay, reviewDateYear,
646                            reviewDateHour, reviewDateMinute, neverReview, indexable,
647                            smallImage, smallImageURL, smallFile, images, articleURL,
648                            serviceContext);
649            }
650    
651            public JournalArticle updateArticle(
652                            long groupId, long folderId, String articleId, double version,
653                            String content, ServiceContext serviceContext)
654                    throws PortalException, SystemException {
655    
656                    JournalArticlePermission.check(
657                            getPermissionChecker(), groupId, articleId, version,
658                            ActionKeys.UPDATE);
659    
660                    return journalArticleLocalService.updateArticle(
661                            getUserId(), groupId, folderId, articleId, version, content,
662                            serviceContext);
663            }
664    
665            /**
666             * @deprecated {@link #updateArticleTranslation(long, String, double,
667             *             Locale, String, String, String, Map, ServiceContext)}
668             */
669            public JournalArticle updateArticleTranslation(
670                            long groupId, String articleId, double version, Locale locale,
671                            String title, String description, String content,
672                            Map<String, byte[]> images)
673                    throws PortalException, SystemException {
674    
675                    return updateArticleTranslation(
676                            groupId, articleId, version, locale, title, description, content,
677                            images, null);
678            }
679    
680            public JournalArticle updateArticleTranslation(
681                            long groupId, String articleId, double version, Locale locale,
682                            String title, String description, String content,
683                            Map<String, byte[]> images, ServiceContext serviceContext)
684                    throws PortalException, SystemException {
685    
686                    JournalArticlePermission.check(
687                            getPermissionChecker(), groupId, articleId, version,
688                            ActionKeys.UPDATE);
689    
690                    return journalArticleLocalService.updateArticleTranslation(
691                            groupId, articleId, version, locale, title, description, content,
692                            images, serviceContext);
693            }
694    
695            public JournalArticle updateContent(
696                            long groupId, String articleId, double version, String content)
697                    throws PortalException, SystemException {
698    
699                    JournalArticlePermission.check(
700                            getPermissionChecker(), groupId, articleId, version,
701                            ActionKeys.UPDATE);
702    
703                    return journalArticleLocalService.updateContent(
704                            groupId, articleId, version, content);
705            }
706    
707            public JournalArticle updateStatus(
708                            long groupId, String articleId, double version, int status,
709                            String articleURL, ServiceContext serviceContext)
710                    throws PortalException, SystemException {
711    
712                    JournalArticlePermission.check(
713                            getPermissionChecker(), groupId, articleId, version,
714                            ActionKeys.UPDATE);
715    
716                    return journalArticleLocalService.updateStatus(
717                            getUserId(), groupId, articleId, version, status, articleURL,
718                            new HashMap<String, Serializable>(), serviceContext);
719            }
720    
721    }