001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.json.JSON;
019 import com.liferay.portal.kernel.language.LanguageUtil;
020 import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
021 import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
022 import com.liferay.portal.kernel.servlet.HttpHeaders;
023 import com.liferay.portal.kernel.util.Constants;
024 import com.liferay.portal.kernel.util.DateUtil;
025 import com.liferay.portal.kernel.util.JavaConstants;
026 import com.liferay.portal.kernel.util.LocaleUtil;
027 import com.liferay.portal.kernel.util.Validator;
028 import com.liferay.portal.kernel.util.WebKeys;
029 import com.liferay.portal.kernel.workflow.WorkflowConstants;
030 import com.liferay.portal.model.AuditedModel;
031 import com.liferay.portal.model.Group;
032 import com.liferay.portal.model.PortletConstants;
033 import com.liferay.portal.model.PortletPreferencesIds;
034 import com.liferay.portal.model.Role;
035 import com.liferay.portal.model.RoleConstants;
036 import com.liferay.portal.security.permission.ResourceActionsUtil;
037 import com.liferay.portal.service.permission.ModelPermissions;
038 import com.liferay.portal.theme.ThemeDisplay;
039 import com.liferay.portal.util.PortalUtil;
040
041 import java.io.Serializable;
042
043 import java.util.ArrayList;
044 import java.util.Date;
045 import java.util.LinkedHashMap;
046 import java.util.List;
047 import java.util.Locale;
048 import java.util.Map;
049 import java.util.TimeZone;
050
051 import javax.servlet.http.HttpServletRequest;
052 import javax.servlet.http.HttpServletResponse;
053
054
069 @JSON
070 public class ServiceContext implements Cloneable, Serializable {
071
072
078 public ServiceContext() {
079 _attributes = new LinkedHashMap<>();
080 _expandoBridgeAttributes = new LinkedHashMap<>();
081 }
082
083
089 @Override
090 public Object clone() {
091 ServiceContext serviceContext = new ServiceContext();
092
093 serviceContext.setAddGroupPermissions(isAddGroupPermissions());
094 serviceContext.setAddGuestPermissions(isAddGuestPermissions());
095 serviceContext.setAssetCategoryIds(getAssetCategoryIds());
096 serviceContext.setAssetEntryVisible(isAssetEntryVisible());
097 serviceContext.setAssetLinkEntryIds(getAssetLinkEntryIds());
098 serviceContext.setAssetPriority(getAssetPriority());
099 serviceContext.setAssetTagNames(getAssetTagNames());
100 serviceContext.setAttributes(getAttributes());
101 serviceContext.setCommand(getCommand());
102 serviceContext.setCompanyId(getCompanyId());
103 serviceContext.setCreateDate(getCreateDate());
104 serviceContext.setCurrentURL(getCurrentURL());
105 serviceContext.setExpandoBridgeAttributes(getExpandoBridgeAttributes());
106 serviceContext.setFailOnPortalException(isFailOnPortalException());
107 serviceContext.setGroupPermissions(getGroupPermissions());
108 serviceContext.setGuestPermissions(getGuestPermissions());
109 serviceContext.setHeaders(getHeaders());
110 serviceContext.setIndexingEnabled(isIndexingEnabled());
111 serviceContext.setLanguageId(getLanguageId());
112 serviceContext.setLayoutFullURL(getLayoutFullURL());
113 serviceContext.setLayoutURL(getLayoutURL());
114 serviceContext.setModelPermissions(
115 (ModelPermissions)_modelPermissions.clone());
116 serviceContext.setModifiedDate(getModifiedDate());
117 serviceContext.setPathFriendlyURLPrivateGroup(
118 getPathFriendlyURLPrivateGroup());
119 serviceContext.setPathFriendlyURLPrivateUser(
120 getPathFriendlyURLPrivateUser());
121 serviceContext.setPathFriendlyURLPublic(getPathFriendlyURLPublic());
122 serviceContext.setPathMain(getPathMain());
123 serviceContext.setPlid(getPlid());
124 serviceContext.setPortalURL(getPortalURL());
125 serviceContext.setPortletPreferencesIds(getPortletPreferencesIds());
126 serviceContext.setRemoteAddr(getRemoteAddr());
127 serviceContext.setRemoteHost(getRemoteHost());
128 serviceContext.setRequest(getRequest());
129 serviceContext.setScopeGroupId(getScopeGroupId());
130 serviceContext.setSignedIn(isSignedIn());
131 serviceContext.setUserDisplayURL(getUserDisplayURL());
132 serviceContext.setUserId(getUserId());
133 serviceContext.setUuid(getUuid());
134 serviceContext.setWorkflowAction(getWorkflowAction());
135
136 return serviceContext;
137 }
138
139
144 public void deriveDefaultPermissions(long repositoryId, String modelName)
145 throws PortalException {
146
147 long siteGroupId = PortalUtil.getSiteGroupId(repositoryId);
148
149 Group siteGroup = GroupLocalServiceUtil.getGroup(siteGroupId);
150
151 Role defaultGroupRole = RoleLocalServiceUtil.getDefaultGroupRole(
152 siteGroupId);
153
154 List<String> groupPermissionsList = new ArrayList<>();
155 List<String> guestPermissionsList = new ArrayList<>();
156
157 String[] roleNames = {RoleConstants.GUEST, defaultGroupRole.getName()};
158
159 List<String> supportedActions =
160 ResourceActionsUtil.getModelResourceActions(modelName);
161 List<String> groupDefaultActions =
162 ResourceActionsUtil.getModelResourceGroupDefaultActions(modelName);
163 List<String> guestDefaultActions =
164 ResourceActionsUtil.getModelResourceGuestDefaultActions(modelName);
165 List<String> guestUnsupportedActions =
166 ResourceActionsUtil.getModelResourceGuestUnsupportedActions(
167 modelName);
168
169 for (String roleName : roleNames) {
170 for (String action : supportedActions) {
171 if (roleName.equals(RoleConstants.GUEST) &&
172 !guestUnsupportedActions.contains(action) &&
173 guestDefaultActions.contains(action) &&
174 siteGroup.hasPublicLayouts()) {
175
176 guestPermissionsList.add(action);
177 }
178 else if (roleName.equals(defaultGroupRole.getName()) &&
179 groupDefaultActions.contains(action)) {
180
181 groupPermissionsList.add(action);
182 }
183 }
184 }
185
186 String[] groupPermissions = groupPermissionsList.toArray(
187 new String[groupPermissionsList.size()]);
188
189 setGroupPermissions(groupPermissions);
190
191 String[] guestPermissions = guestPermissionsList.toArray(
192 new String[guestPermissionsList.size()]);
193
194 setGuestPermissions(guestPermissions);
195 }
196
197
208 @Deprecated
209 public boolean getAddCommunityPermissions() {
210 return isAddGroupPermissions();
211 }
212
213
220 public long[] getAssetCategoryIds() {
221 return _assetCategoryIds;
222 }
223
224
231 public long[] getAssetLinkEntryIds() {
232 return _assetLinkEntryIds;
233 }
234
235
241 public double getAssetPriority() {
242 return _assetPriority;
243 }
244
245
252 public String[] getAssetTagNames() {
253 return _assetTagNames;
254 }
255
256
263 public Serializable getAttribute(String name) {
264 return _attributes.get(name);
265 }
266
267
273 public Map<String, Serializable> getAttributes() {
274 return _attributes;
275 }
276
277
283 public String getCommand() {
284 return _command;
285 }
286
287
295 @Deprecated
296 public String[] getCommunityPermissions() {
297 return getGroupPermissions();
298 }
299
300
305 public long getCompanyId() {
306 return _companyId;
307 }
308
309
315 public Date getCreateDate() {
316 return _createDate;
317 }
318
319
328 public Date getCreateDate(Date defaultCreateDate) {
329 if (_createDate != null) {
330 return _createDate;
331 }
332 else if (defaultCreateDate != null) {
333 return defaultCreateDate;
334 }
335 else {
336 return new Date();
337 }
338 }
339
340
345 public String getCurrentURL() {
346 return _currentURL;
347 }
348
349
359 public Map<String, Serializable> getExpandoBridgeAttributes() {
360 return _expandoBridgeAttributes;
361 }
362
363
384 public Date getFormDate() {
385 return _formDate;
386 }
387
388
395 public String[] getGroupPermissions() {
396 return _modelPermissions.getActionIds(
397 RoleConstants.PLACEHOLDER_DEFAULT_GROUP_ROLE);
398 }
399
400
410 public long getGuestOrUserId() throws PortalException {
411 long userId = getUserId();
412
413 if (userId > 0) {
414 return userId;
415 }
416
417 long companyId = getCompanyId();
418
419 if (companyId > 0) {
420 return UserLocalServiceUtil.getDefaultUserId(getCompanyId());
421 }
422
423 return 0;
424 }
425
426
433 public String[] getGuestPermissions() {
434 return _modelPermissions.getActionIds(RoleConstants.GUEST);
435 }
436
437
444 @JSON(include = false)
445 public Map<String, String> getHeaders() {
446 return _headers;
447 }
448
449
455 public String getLanguageId() {
456 if (_languageId != null) {
457 return _languageId;
458 }
459
460 return LocaleUtil.toLanguageId(LocaleUtil.getMostRelevantLocale());
461 }
462
463
469 public String getLayoutFullURL() {
470 return _layoutFullURL;
471 }
472
473
479 public String getLayoutURL() {
480 return _layoutURL;
481 }
482
483 @JSON(include = false)
484 public LiferayPortletRequest getLiferayPortletRequest() {
485 if (_request == null) {
486 return null;
487 }
488
489 LiferayPortletRequest liferayPortletRequest =
490 (LiferayPortletRequest)_request.getAttribute(
491 JavaConstants.JAVAX_PORTLET_REQUEST);
492
493 return liferayPortletRequest;
494 }
495
496 @JSON(include = false)
497 public LiferayPortletResponse getLiferayPortletResponse() {
498 if (_request == null) {
499 return null;
500 }
501
502 LiferayPortletResponse liferayPortletResponse =
503 (LiferayPortletResponse)_request.getAttribute(
504 JavaConstants.JAVAX_PORTLET_RESPONSE);
505
506 return liferayPortletResponse;
507 }
508
509 public Locale getLocale() {
510 return LocaleUtil.fromLanguageId(_languageId);
511 }
512
513 public ModelPermissions getModelPermissions() {
514 return _modelPermissions;
515 }
516
517
524 public Date getModifiedDate() {
525 return _modifiedDate;
526 }
527
528
536 public Date getModifiedDate(Date defaultModifiedDate) {
537 if (_modifiedDate != null) {
538 return _modifiedDate;
539 }
540 else if (defaultModifiedDate != null) {
541 return defaultModifiedDate;
542 }
543 else {
544 return new Date();
545 }
546 }
547
548 public String getPathFriendlyURLPrivateGroup() {
549 return _pathFriendlyURLPrivateGroup;
550 }
551
552 public String getPathFriendlyURLPrivateUser() {
553 return _pathFriendlyURLPrivateUser;
554 }
555
556 public String getPathFriendlyURLPublic() {
557 return _pathFriendlyURLPublic;
558 }
559
560
566 public String getPathMain() {
567 return _pathMain;
568 }
569
570
575 public long getPlid() {
576 return _plid;
577 }
578
579
592 public String getPortalURL() {
593 return _portalURL;
594 }
595
596
603 public String getPortletId() {
604 if (_portletPreferencesIds == null) {
605 return null;
606 }
607
608 return _portletPreferencesIds.getPortletId();
609 }
610
611
623 public PortletPreferencesIds getPortletPreferencesIds() {
624 return _portletPreferencesIds;
625 }
626
627
633 public String getRemoteAddr() {
634 return _remoteAddr;
635 }
636
637
643 public String getRemoteHost() {
644 return _remoteHost;
645 }
646
647 @JSON(include = false)
648 public HttpServletRequest getRequest() {
649 return _request;
650 }
651
652 @JSON(include = false)
653 public HttpServletResponse getResponse() {
654 LiferayPortletResponse liferayPortletResponse =
655 getLiferayPortletResponse();
656
657 if (liferayPortletResponse == null) {
658 return null;
659 }
660
661 return PortalUtil.getHttpServletResponse(liferayPortletResponse);
662 }
663
664 public String getRootPortletId() {
665 String portletId = getPortletId();
666
667 if (portletId == null) {
668 return null;
669 }
670
671 return PortletConstants.getRootPortletId(portletId);
672 }
673
674 public Group getScopeGroup() throws PortalException {
675 return GroupLocalServiceUtil.getGroup(_scopeGroupId);
676 }
677
678
685 public long getScopeGroupId() {
686 return _scopeGroupId;
687 }
688
689 public ThemeDisplay getThemeDisplay() {
690 if (_request == null) {
691 return null;
692 }
693
694 return (ThemeDisplay)_request.getAttribute(WebKeys.THEME_DISPLAY);
695 }
696
697 public TimeZone getTimeZone() {
698 return _timeZone;
699 }
700
701
707 public String getUserAgent() {
708 if (_request == null) {
709 return null;
710 }
711
712 return _request.getHeader(HttpHeaders.USER_AGENT);
713 }
714
715
722 public String getUserDisplayURL() {
723 return _userDisplayURL;
724 }
725
726
731 public long getUserId() {
732 return _userId;
733 }
734
735
745 public String getUuid() {
746 String uuid = _uuid;
747
748 _uuid = null;
749
750 return uuid;
751 }
752
753 public String getUuidWithoutReset() {
754 return _uuid;
755 }
756
757
763 public int getWorkflowAction() {
764 return _workflowAction;
765 }
766
767
776 public boolean isAddGroupPermissions() {
777 return _addGroupPermissions;
778 }
779
780
789 public boolean isAddGuestPermissions() {
790 return _addGuestPermissions;
791 }
792
793 public boolean isAssetEntryVisible() {
794 return _assetEntryVisible;
795 }
796
797
804 public boolean isCommandAdd() {
805 if (Validator.equals(_command, Constants.ADD) ||
806 Validator.equals(_command, Constants.ADD_DYNAMIC) ||
807 Validator.equals(_command, Constants.ADD_MULTIPLE) ||
808 Validator.equals(_command, Constants.ADD_WEBDAV)) {
809
810 return true;
811 }
812 else {
813 return false;
814 }
815 }
816
817
824 public boolean isCommandUpdate() {
825 if (Validator.equals(_command, Constants.UPDATE) ||
826 Validator.equals(_command, Constants.UPDATE_AND_CHECKIN) ||
827 Validator.equals(_command, Constants.UPDATE_WEBDAV)) {
828
829 return true;
830 }
831 else {
832 return false;
833 }
834 }
835
836 public boolean isDeriveDefaultPermissions() {
837 return _deriveDefaultPermissions;
838 }
839
840
869 public boolean isFailOnPortalException() {
870 return _failOnPortalException;
871 }
872
873
880 public boolean isIndexingEnabled() {
881 return _indexingEnabled;
882 }
883
884
891 public boolean isSignedIn() {
892 return _signedIn;
893 }
894
895
902 public void merge(ServiceContext serviceContext) {
903 setAddGroupPermissions(serviceContext.isAddGroupPermissions());
904 setAddGuestPermissions(serviceContext.isAddGuestPermissions());
905
906 if (serviceContext.getAssetCategoryIds() != null) {
907 setAssetCategoryIds(serviceContext.getAssetCategoryIds());
908 }
909
910 setAssetEntryVisible(serviceContext.isAssetEntryVisible());
911
912 if (serviceContext.getAssetLinkEntryIds() != null) {
913 setAssetLinkEntryIds(serviceContext.getAssetLinkEntryIds());
914 }
915
916 if (serviceContext.getAssetPriority() > 0) {
917 setAssetPriority(serviceContext.getAssetPriority());
918 }
919
920 if (serviceContext.getAssetTagNames() != null) {
921 setAssetTagNames(serviceContext.getAssetTagNames());
922 }
923
924 if (serviceContext.getAttributes() != null) {
925 setAttributes(serviceContext.getAttributes());
926 }
927
928 if (Validator.isNotNull(serviceContext.getCommand())) {
929 setCommand(serviceContext.getCommand());
930 }
931
932 if (serviceContext.getCompanyId() > 0) {
933 setCompanyId(serviceContext.getCompanyId());
934 }
935
936 if (serviceContext.getCreateDate() != null) {
937 setCreateDate(serviceContext.getCreateDate());
938 }
939
940 if (Validator.isNotNull(serviceContext.getCurrentURL())) {
941 setCurrentURL(serviceContext.getCurrentURL());
942 }
943
944 setDeriveDefaultPermissions(
945 serviceContext.isDeriveDefaultPermissions());
946
947 if (serviceContext.getExpandoBridgeAttributes() != null) {
948 setExpandoBridgeAttributes(
949 serviceContext.getExpandoBridgeAttributes());
950 }
951
952 setFailOnPortalException(serviceContext.isFailOnPortalException());
953
954 if (serviceContext.getGroupPermissions() != null) {
955 setGroupPermissions(serviceContext.getGroupPermissions());
956 }
957
958 if (serviceContext.getGuestPermissions() != null) {
959 setGuestPermissions(serviceContext.getGuestPermissions());
960 }
961
962 if (serviceContext.getHeaders() != null) {
963 setHeaders(serviceContext.getHeaders());
964 }
965
966 setIndexingEnabled(serviceContext.isIndexingEnabled());
967 setLanguageId(serviceContext.getLanguageId());
968
969 if (Validator.isNotNull(serviceContext.getLayoutFullURL())) {
970 setLayoutFullURL(serviceContext.getLayoutFullURL());
971 }
972
973 if (Validator.isNotNull(serviceContext.getLayoutURL())) {
974 setLayoutURL(serviceContext.getLayoutURL());
975 }
976
977 if (serviceContext.getModifiedDate() != null) {
978 setModifiedDate(serviceContext.getModifiedDate());
979 }
980
981 if (Validator.isNotNull(
982 serviceContext.getPathFriendlyURLPrivateGroup())) {
983
984 setPathFriendlyURLPrivateGroup(
985 serviceContext.getPathFriendlyURLPrivateGroup());
986 }
987
988 if (Validator.isNotNull(
989 serviceContext.getPathFriendlyURLPrivateUser())) {
990
991 setPathFriendlyURLPrivateUser(
992 serviceContext.getPathFriendlyURLPrivateUser());
993 }
994
995 if (Validator.isNotNull(serviceContext.getPathFriendlyURLPublic())) {
996 setPathFriendlyURLPublic(serviceContext.getPathFriendlyURLPublic());
997 }
998
999 if (Validator.isNotNull(serviceContext.getPathMain())) {
1000 setPathMain(serviceContext.getPathMain());
1001 }
1002
1003 if (serviceContext.getPlid() > 0) {
1004 setPlid(serviceContext.getPlid());
1005 }
1006
1007 if (Validator.isNotNull(serviceContext.getPortalURL())) {
1008 setPortalURL(serviceContext.getPortalURL());
1009 }
1010
1011 if (serviceContext.getPortletPreferencesIds() != null) {
1012 setPortletPreferencesIds(serviceContext.getPortletPreferencesIds());
1013 }
1014
1015 if (Validator.isNotNull(serviceContext.getRemoteAddr())) {
1016 setRemoteAddr(serviceContext.getRemoteAddr());
1017 }
1018
1019 if (Validator.isNotNull(serviceContext.getRemoteHost())) {
1020 setRemoteHost(serviceContext.getRemoteHost());
1021 }
1022
1023 if (serviceContext.getScopeGroupId() > 0) {
1024 setScopeGroupId(serviceContext.getScopeGroupId());
1025 }
1026
1027 setSignedIn(serviceContext.isSignedIn());
1028
1029 if (serviceContext.getTimeZone() != null) {
1030 setTimeZone(serviceContext.getTimeZone());
1031 }
1032
1033 if (Validator.isNotNull(serviceContext.getUserDisplayURL())) {
1034 setUserDisplayURL(serviceContext.getUserDisplayURL());
1035 }
1036
1037 if (serviceContext.getUserId() > 0) {
1038 setUserId(serviceContext.getUserId());
1039 }
1040
1041
1042
1043
1044 if (Validator.isNotNull(serviceContext._uuid)) {
1045 setUuid(serviceContext._uuid);
1046 }
1047
1048 if (serviceContext.getWorkflowAction() > 0) {
1049 setWorkflowAction(serviceContext.getWorkflowAction());
1050 }
1051 }
1052
1053
1060 public Serializable removeAttribute(String name) {
1061 return _attributes.remove(name);
1062 }
1063
1064
1074 @Deprecated
1075 public void setAddCommunityPermissions(boolean addCommunityPermissions) {
1076 setAddGroupPermissions(addCommunityPermissions);
1077 }
1078
1079
1087 public void setAddGroupPermissions(boolean addGroupPermissions) {
1088 _addGroupPermissions = addGroupPermissions;
1089 }
1090
1091
1099 public void setAddGuestPermissions(boolean addGuestPermissions) {
1100 _addGuestPermissions = addGuestPermissions;
1101 }
1102
1103
1110 public void setAssetCategoryIds(long[] assetCategoryIds) {
1111 _assetCategoryIds = assetCategoryIds;
1112 }
1113
1114 public void setAssetEntryVisible(boolean assetEntryVisible) {
1115 _assetEntryVisible = assetEntryVisible;
1116 }
1117
1118
1126 public void setAssetLinkEntryIds(long[] assetLinkEntryIds) {
1127 _assetLinkEntryIds = assetLinkEntryIds;
1128 }
1129
1130
1136 public void setAssetPriority(double assetPriority) {
1137 _assetPriority = assetPriority;
1138 }
1139
1140
1147 public void setAssetTagNames(String[] assetTagNames) {
1148 _assetTagNames = assetTagNames;
1149 }
1150
1151
1157 public void setAttribute(String name, Serializable value) {
1158 _attributes.put(name, value);
1159 }
1160
1161
1168 public void setAttributes(Map<String, Serializable> attributes) {
1169 _attributes = attributes;
1170 }
1171
1172
1178 public void setCommand(String command) {
1179 _command = command;
1180 }
1181
1182
1192 @Deprecated
1193 public void setCommunityPermissions(String[] communityPermissions) {
1194 setGroupPermissions(communityPermissions);
1195 }
1196
1197
1203 public void setCompanyId(long companyId) {
1204 _companyId = companyId;
1205 }
1206
1207
1213 public void setCreateDate(Date createDate) {
1214 _createDate = createDate;
1215 }
1216
1217
1222 public void setCurrentURL(String currentURL) {
1223 _currentURL = currentURL;
1224 }
1225
1226 public void setDeriveDefaultPermissions(boolean deriveDefaultPermissions) {
1227 _deriveDefaultPermissions = deriveDefaultPermissions;
1228 }
1229
1230
1241 public void setExpandoBridgeAttributes(
1242 Map<String, Serializable> expandoBridgeAttributes) {
1243
1244 _expandoBridgeAttributes = expandoBridgeAttributes;
1245 }
1246
1247
1258 public void setFailOnPortalException(boolean failOnPortalException) {
1259 _failOnPortalException = failOnPortalException;
1260 }
1261
1262
1285 public void setFormDate(Date formDate) {
1286 _formDate = formDate;
1287 }
1288
1289
1296 public void setGroupPermissions(String[] groupPermissions) {
1297 _modelPermissions.addRolePermissions(
1298 RoleConstants.PLACEHOLDER_DEFAULT_GROUP_ROLE, groupPermissions);
1299 }
1300
1301
1309 public void setGuestPermissions(String[] guestPermissions) {
1310 _modelPermissions.addRolePermissions(
1311 RoleConstants.GUEST, guestPermissions);
1312 }
1313
1314
1321 public void setHeaders(Map<String, String> headers) {
1322 _headers = headers;
1323 }
1324
1325
1337 public void setIndexingEnabled(boolean indexingEnabled) {
1338 _indexingEnabled = indexingEnabled;
1339 }
1340
1341
1347 public void setLanguageId(String languageId) {
1348 _languageId = languageId;
1349 }
1350
1351
1357 public void setLayoutFullURL(String layoutFullURL) {
1358 _layoutFullURL = layoutFullURL;
1359 }
1360
1361
1367 public void setLayoutURL(String layoutURL) {
1368 _layoutURL = layoutURL;
1369 }
1370
1371 public void setModelPermissions(ModelPermissions modelPermissions) {
1372 _modelPermissions = modelPermissions;
1373 }
1374
1375
1381 public void setModifiedDate(Date modifiedDate) {
1382 _modifiedDate = modifiedDate;
1383 }
1384
1385 public void setPathFriendlyURLPrivateGroup(
1386 String pathFriendlyURLPrivateGroup) {
1387
1388 _pathFriendlyURLPrivateGroup = pathFriendlyURLPrivateGroup;
1389 }
1390
1391 public void setPathFriendlyURLPrivateUser(
1392 String pathFriendlyURLPrivateUser) {
1393
1394 _pathFriendlyURLPrivateUser = pathFriendlyURLPrivateUser;
1395 }
1396
1397 public void setPathFriendlyURLPublic(String pathFriendlyURLPublic) {
1398 _pathFriendlyURLPublic = pathFriendlyURLPublic;
1399 }
1400
1401
1407 public void setPathMain(String pathMain) {
1408 _pathMain = pathMain;
1409 }
1410
1411
1416 public void setPlid(long plid) {
1417 _plid = plid;
1418 }
1419
1420
1431 public void setPortalURL(String portalURL) {
1432 _portalURL = portalURL;
1433 }
1434
1435
1447 public void setPortletPreferencesIds(
1448 PortletPreferencesIds portletPreferencesIds) {
1449
1450 _portletPreferencesIds = portletPreferencesIds;
1451 }
1452
1453
1460 public void setRemoteAddr(String remoteAddr) {
1461 _remoteAddr = remoteAddr;
1462 }
1463
1464
1471 public void setRemoteHost(String remoteHost) {
1472 _remoteHost = remoteHost;
1473 }
1474
1475
1481 public void setRequest(HttpServletRequest request) {
1482 _request = request;
1483 }
1484
1485
1493 public void setScopeGroupId(long scopeGroupId) {
1494 _scopeGroupId = scopeGroupId;
1495 }
1496
1497
1503 public void setSignedIn(boolean signedIn) {
1504 _signedIn = signedIn;
1505 }
1506
1507 public void setTimeZone(TimeZone timeZone) {
1508 _timeZone = timeZone;
1509 }
1510
1511
1517 public void setUserDisplayURL(String userDisplayURL) {
1518 _userDisplayURL = userDisplayURL;
1519 }
1520
1521
1526 public void setUserId(long userId) {
1527 _userId = userId;
1528 }
1529
1530
1535 public void setUuid(String uuid) {
1536 _uuid = uuid;
1537 }
1538
1539
1546 public void setWorkflowAction(int workflowAction) {
1547 _workflowAction = workflowAction;
1548 }
1549
1550 public String translate(String pattern, Object... arguments) {
1551 Locale locale = getLocale();
1552
1553 return LanguageUtil.format(locale, pattern, arguments);
1554 }
1555
1556 public void validateModifiedDate(
1557 AuditedModel auditedModel, Class<? extends PortalException> clazz)
1558 throws PortalException {
1559
1560 int value = DateUtil.compareTo(
1561 auditedModel.getModifiedDate(), _formDate);
1562
1563 if (value > 0) {
1564 try {
1565 throw clazz.newInstance();
1566 }
1567 catch (IllegalAccessException iae) {
1568 throw new RuntimeException(iae);
1569 }
1570 catch (InstantiationException ie) {
1571 throw new RuntimeException(ie);
1572 }
1573 }
1574 }
1575
1576 private boolean _addGroupPermissions;
1577 private boolean _addGuestPermissions;
1578 private long[] _assetCategoryIds;
1579 private boolean _assetEntryVisible = true;
1580 private long[] _assetLinkEntryIds;
1581 private double _assetPriority;
1582 private String[] _assetTagNames;
1583 private Map<String, Serializable> _attributes;
1584 private String _command;
1585 private long _companyId;
1586 private Date _createDate;
1587 private String _currentURL;
1588 private boolean _deriveDefaultPermissions;
1589 private Map<String, Serializable> _expandoBridgeAttributes;
1590 private boolean _failOnPortalException = true;
1591 private Date _formDate;
1592 private transient Map<String, String> _headers;
1593 private boolean _indexingEnabled = true;
1594 private String _languageId;
1595 private String _layoutFullURL;
1596 private String _layoutURL;
1597 private ModelPermissions _modelPermissions = new ModelPermissions();
1598 private Date _modifiedDate;
1599 private String _pathFriendlyURLPrivateGroup;
1600 private String _pathFriendlyURLPrivateUser;
1601 private String _pathFriendlyURLPublic;
1602 private String _pathMain;
1603 private long _plid;
1604 private String _portalURL;
1605 private PortletPreferencesIds _portletPreferencesIds;
1606 private String _remoteAddr;
1607 private String _remoteHost;
1608 private transient HttpServletRequest _request;
1609 private long _scopeGroupId;
1610 private boolean _signedIn;
1611 private TimeZone _timeZone;
1612 private String _userDisplayURL;
1613 private long _userId;
1614 private String _uuid;
1615 private int _workflowAction = WorkflowConstants.ACTION_PUBLISH;
1616
1617 }