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
408 public long getGuestOrUserId() throws PortalException {
409 long userId = getUserId();
410
411 if (userId > 0) {
412 return userId;
413 }
414
415 long companyId = getCompanyId();
416
417 if (companyId > 0) {
418 return UserLocalServiceUtil.getDefaultUserId(getCompanyId());
419 }
420
421 return 0;
422 }
423
424
431 public String[] getGuestPermissions() {
432 return _modelPermissions.getActionIds(RoleConstants.GUEST);
433 }
434
435
442 @JSON(include = false)
443 public Map<String, String> getHeaders() {
444 return _headers;
445 }
446
447
453 public String getLanguageId() {
454 if (_languageId != null) {
455 return _languageId;
456 }
457
458 return LocaleUtil.toLanguageId(LocaleUtil.getMostRelevantLocale());
459 }
460
461
467 public String getLayoutFullURL() {
468 return _layoutFullURL;
469 }
470
471
477 public String getLayoutURL() {
478 return _layoutURL;
479 }
480
481 @JSON(include = false)
482 public LiferayPortletRequest getLiferayPortletRequest() {
483 if (_request == null) {
484 return null;
485 }
486
487 LiferayPortletRequest liferayPortletRequest =
488 (LiferayPortletRequest)_request.getAttribute(
489 JavaConstants.JAVAX_PORTLET_REQUEST);
490
491 return liferayPortletRequest;
492 }
493
494 @JSON(include = false)
495 public LiferayPortletResponse getLiferayPortletResponse() {
496 if (_request == null) {
497 return null;
498 }
499
500 LiferayPortletResponse liferayPortletResponse =
501 (LiferayPortletResponse)_request.getAttribute(
502 JavaConstants.JAVAX_PORTLET_RESPONSE);
503
504 return liferayPortletResponse;
505 }
506
507 public Locale getLocale() {
508 return LocaleUtil.fromLanguageId(_languageId);
509 }
510
511 public ModelPermissions getModelPermissions() {
512 return _modelPermissions;
513 }
514
515
522 public Date getModifiedDate() {
523 return _modifiedDate;
524 }
525
526
534 public Date getModifiedDate(Date defaultModifiedDate) {
535 if (_modifiedDate != null) {
536 return _modifiedDate;
537 }
538 else if (defaultModifiedDate != null) {
539 return defaultModifiedDate;
540 }
541 else {
542 return new Date();
543 }
544 }
545
546 public String getPathFriendlyURLPrivateGroup() {
547 return _pathFriendlyURLPrivateGroup;
548 }
549
550 public String getPathFriendlyURLPrivateUser() {
551 return _pathFriendlyURLPrivateUser;
552 }
553
554 public String getPathFriendlyURLPublic() {
555 return _pathFriendlyURLPublic;
556 }
557
558
564 public String getPathMain() {
565 return _pathMain;
566 }
567
568
573 public long getPlid() {
574 return _plid;
575 }
576
577
590 public String getPortalURL() {
591 return _portalURL;
592 }
593
594
601 public String getPortletId() {
602 if (_portletPreferencesIds == null) {
603 return null;
604 }
605
606 return _portletPreferencesIds.getPortletId();
607 }
608
609
621 public PortletPreferencesIds getPortletPreferencesIds() {
622 return _portletPreferencesIds;
623 }
624
625
631 public String getRemoteAddr() {
632 return _remoteAddr;
633 }
634
635
641 public String getRemoteHost() {
642 return _remoteHost;
643 }
644
645 @JSON(include = false)
646 public HttpServletRequest getRequest() {
647 return _request;
648 }
649
650 @JSON(include = false)
651 public HttpServletResponse getResponse() {
652 LiferayPortletResponse liferayPortletResponse =
653 getLiferayPortletResponse();
654
655 if (liferayPortletResponse == null) {
656 return null;
657 }
658
659 return PortalUtil.getHttpServletResponse(liferayPortletResponse);
660 }
661
662 public String getRootPortletId() {
663 String portletId = getPortletId();
664
665 if (portletId == null) {
666 return null;
667 }
668
669 return PortletConstants.getRootPortletId(portletId);
670 }
671
672 public Group getScopeGroup() throws PortalException {
673 return GroupLocalServiceUtil.getGroup(_scopeGroupId);
674 }
675
676
683 public long getScopeGroupId() {
684 return _scopeGroupId;
685 }
686
687 public ThemeDisplay getThemeDisplay() {
688 if (_request == null) {
689 return null;
690 }
691
692 return (ThemeDisplay)_request.getAttribute(WebKeys.THEME_DISPLAY);
693 }
694
695 public TimeZone getTimeZone() {
696 return _timeZone;
697 }
698
699
705 public String getUserAgent() {
706 if (_request == null) {
707 return null;
708 }
709
710 return _request.getHeader(HttpHeaders.USER_AGENT);
711 }
712
713
720 public String getUserDisplayURL() {
721 return _userDisplayURL;
722 }
723
724
729 public long getUserId() {
730 return _userId;
731 }
732
733
743 public String getUuid() {
744 String uuid = _uuid;
745
746 _uuid = null;
747
748 return uuid;
749 }
750
751 public String getUuidWithoutReset() {
752 return _uuid;
753 }
754
755
761 public int getWorkflowAction() {
762 return _workflowAction;
763 }
764
765
774 public boolean isAddGroupPermissions() {
775 return _addGroupPermissions;
776 }
777
778
787 public boolean isAddGuestPermissions() {
788 return _addGuestPermissions;
789 }
790
791 public boolean isAssetEntryVisible() {
792 return _assetEntryVisible;
793 }
794
795
802 public boolean isCommandAdd() {
803 if (Validator.equals(_command, Constants.ADD) ||
804 Validator.equals(_command, Constants.ADD_DYNAMIC) ||
805 Validator.equals(_command, Constants.ADD_MULTIPLE) ||
806 Validator.equals(_command, Constants.ADD_WEBDAV)) {
807
808 return true;
809 }
810 else {
811 return false;
812 }
813 }
814
815
822 public boolean isCommandUpdate() {
823 if (Validator.equals(_command, Constants.UPDATE) ||
824 Validator.equals(_command, Constants.UPDATE_AND_CHECKIN) ||
825 Validator.equals(_command, Constants.UPDATE_WEBDAV)) {
826
827 return true;
828 }
829 else {
830 return false;
831 }
832 }
833
834 public boolean isDeriveDefaultPermissions() {
835 return _deriveDefaultPermissions;
836 }
837
838
867 public boolean isFailOnPortalException() {
868 return _failOnPortalException;
869 }
870
871
878 public boolean isIndexingEnabled() {
879 return _indexingEnabled;
880 }
881
882
889 public boolean isSignedIn() {
890 return _signedIn;
891 }
892
893
900 public void merge(ServiceContext serviceContext) {
901 setAddGroupPermissions(serviceContext.isAddGroupPermissions());
902 setAddGuestPermissions(serviceContext.isAddGuestPermissions());
903
904 if (serviceContext.getAssetCategoryIds() != null) {
905 setAssetCategoryIds(serviceContext.getAssetCategoryIds());
906 }
907
908 setAssetEntryVisible(serviceContext.isAssetEntryVisible());
909
910 if (serviceContext.getAssetLinkEntryIds() != null) {
911 setAssetLinkEntryIds(serviceContext.getAssetLinkEntryIds());
912 }
913
914 if (serviceContext.getAssetPriority() > 0) {
915 setAssetPriority(serviceContext.getAssetPriority());
916 }
917
918 if (serviceContext.getAssetTagNames() != null) {
919 setAssetTagNames(serviceContext.getAssetTagNames());
920 }
921
922 if (serviceContext.getAttributes() != null) {
923 setAttributes(serviceContext.getAttributes());
924 }
925
926 if (Validator.isNotNull(serviceContext.getCommand())) {
927 setCommand(serviceContext.getCommand());
928 }
929
930 if (serviceContext.getCompanyId() > 0) {
931 setCompanyId(serviceContext.getCompanyId());
932 }
933
934 if (serviceContext.getCreateDate() != null) {
935 setCreateDate(serviceContext.getCreateDate());
936 }
937
938 if (Validator.isNotNull(serviceContext.getCurrentURL())) {
939 setCurrentURL(serviceContext.getCurrentURL());
940 }
941
942 setDeriveDefaultPermissions(
943 serviceContext.isDeriveDefaultPermissions());
944
945 if (serviceContext.getExpandoBridgeAttributes() != null) {
946 setExpandoBridgeAttributes(
947 serviceContext.getExpandoBridgeAttributes());
948 }
949
950 setFailOnPortalException(serviceContext.isFailOnPortalException());
951
952 if (serviceContext.getGroupPermissions() != null) {
953 setGroupPermissions(serviceContext.getGroupPermissions());
954 }
955
956 if (serviceContext.getGuestPermissions() != null) {
957 setGuestPermissions(serviceContext.getGuestPermissions());
958 }
959
960 if (serviceContext.getHeaders() != null) {
961 setHeaders(serviceContext.getHeaders());
962 }
963
964 setIndexingEnabled(serviceContext.isIndexingEnabled());
965 setLanguageId(serviceContext.getLanguageId());
966
967 if (Validator.isNotNull(serviceContext.getLayoutFullURL())) {
968 setLayoutFullURL(serviceContext.getLayoutFullURL());
969 }
970
971 if (Validator.isNotNull(serviceContext.getLayoutURL())) {
972 setLayoutURL(serviceContext.getLayoutURL());
973 }
974
975 if (serviceContext.getModifiedDate() != null) {
976 setModifiedDate(serviceContext.getModifiedDate());
977 }
978
979 if (Validator.isNotNull(
980 serviceContext.getPathFriendlyURLPrivateGroup())) {
981
982 setPathFriendlyURLPrivateGroup(
983 serviceContext.getPathFriendlyURLPrivateGroup());
984 }
985
986 if (Validator.isNotNull(
987 serviceContext.getPathFriendlyURLPrivateUser())) {
988
989 setPathFriendlyURLPrivateUser(
990 serviceContext.getPathFriendlyURLPrivateUser());
991 }
992
993 if (Validator.isNotNull(serviceContext.getPathFriendlyURLPublic())) {
994 setPathFriendlyURLPublic(serviceContext.getPathFriendlyURLPublic());
995 }
996
997 if (Validator.isNotNull(serviceContext.getPathMain())) {
998 setPathMain(serviceContext.getPathMain());
999 }
1000
1001 if (serviceContext.getPlid() > 0) {
1002 setPlid(serviceContext.getPlid());
1003 }
1004
1005 if (Validator.isNotNull(serviceContext.getPortalURL())) {
1006 setPortalURL(serviceContext.getPortalURL());
1007 }
1008
1009 if (serviceContext.getPortletPreferencesIds() != null) {
1010 setPortletPreferencesIds(serviceContext.getPortletPreferencesIds());
1011 }
1012
1013 if (Validator.isNotNull(serviceContext.getRemoteAddr())) {
1014 setRemoteAddr(serviceContext.getRemoteAddr());
1015 }
1016
1017 if (Validator.isNotNull(serviceContext.getRemoteHost())) {
1018 setRemoteHost(serviceContext.getRemoteHost());
1019 }
1020
1021 if (serviceContext.getScopeGroupId() > 0) {
1022 setScopeGroupId(serviceContext.getScopeGroupId());
1023 }
1024
1025 setSignedIn(serviceContext.isSignedIn());
1026
1027 if (serviceContext.getTimeZone() != null) {
1028 setTimeZone(serviceContext.getTimeZone());
1029 }
1030
1031 if (Validator.isNotNull(serviceContext.getUserDisplayURL())) {
1032 setUserDisplayURL(serviceContext.getUserDisplayURL());
1033 }
1034
1035 if (serviceContext.getUserId() > 0) {
1036 setUserId(serviceContext.getUserId());
1037 }
1038
1039
1040
1041
1042 if (Validator.isNotNull(serviceContext._uuid)) {
1043 setUuid(serviceContext._uuid);
1044 }
1045
1046 if (serviceContext.getWorkflowAction() > 0) {
1047 setWorkflowAction(serviceContext.getWorkflowAction());
1048 }
1049 }
1050
1051
1058 public Serializable removeAttribute(String name) {
1059 return _attributes.remove(name);
1060 }
1061
1062
1072 @Deprecated
1073 public void setAddCommunityPermissions(boolean addCommunityPermissions) {
1074 setAddGroupPermissions(addCommunityPermissions);
1075 }
1076
1077
1085 public void setAddGroupPermissions(boolean addGroupPermissions) {
1086 _addGroupPermissions = addGroupPermissions;
1087 }
1088
1089
1097 public void setAddGuestPermissions(boolean addGuestPermissions) {
1098 _addGuestPermissions = addGuestPermissions;
1099 }
1100
1101
1108 public void setAssetCategoryIds(long[] assetCategoryIds) {
1109 _assetCategoryIds = assetCategoryIds;
1110 }
1111
1112 public void setAssetEntryVisible(boolean assetEntryVisible) {
1113 _assetEntryVisible = assetEntryVisible;
1114 }
1115
1116
1124 public void setAssetLinkEntryIds(long[] assetLinkEntryIds) {
1125 _assetLinkEntryIds = assetLinkEntryIds;
1126 }
1127
1128
1134 public void setAssetPriority(double assetPriority) {
1135 _assetPriority = assetPriority;
1136 }
1137
1138
1145 public void setAssetTagNames(String[] assetTagNames) {
1146 _assetTagNames = assetTagNames;
1147 }
1148
1149
1155 public void setAttribute(String name, Serializable value) {
1156 _attributes.put(name, value);
1157 }
1158
1159
1166 public void setAttributes(Map<String, Serializable> attributes) {
1167 _attributes = attributes;
1168 }
1169
1170
1176 public void setCommand(String command) {
1177 _command = command;
1178 }
1179
1180
1190 @Deprecated
1191 public void setCommunityPermissions(String[] communityPermissions) {
1192 setGroupPermissions(communityPermissions);
1193 }
1194
1195
1201 public void setCompanyId(long companyId) {
1202 _companyId = companyId;
1203 }
1204
1205
1211 public void setCreateDate(Date createDate) {
1212 _createDate = createDate;
1213 }
1214
1215
1220 public void setCurrentURL(String currentURL) {
1221 _currentURL = currentURL;
1222 }
1223
1224 public void setDeriveDefaultPermissions(boolean deriveDefaultPermissions) {
1225 _deriveDefaultPermissions = deriveDefaultPermissions;
1226 }
1227
1228
1239 public void setExpandoBridgeAttributes(
1240 Map<String, Serializable> expandoBridgeAttributes) {
1241
1242 _expandoBridgeAttributes = expandoBridgeAttributes;
1243 }
1244
1245
1256 public void setFailOnPortalException(boolean failOnPortalException) {
1257 _failOnPortalException = failOnPortalException;
1258 }
1259
1260
1283 public void setFormDate(Date formDate) {
1284 _formDate = formDate;
1285 }
1286
1287
1294 public void setGroupPermissions(String[] groupPermissions) {
1295 _modelPermissions.addRolePermissions(
1296 RoleConstants.PLACEHOLDER_DEFAULT_GROUP_ROLE, groupPermissions);
1297 }
1298
1299
1307 public void setGuestPermissions(String[] guestPermissions) {
1308 _modelPermissions.addRolePermissions(
1309 RoleConstants.GUEST, guestPermissions);
1310 }
1311
1312
1319 public void setHeaders(Map<String, String> headers) {
1320 _headers = headers;
1321 }
1322
1323
1335 public void setIndexingEnabled(boolean indexingEnabled) {
1336 _indexingEnabled = indexingEnabled;
1337 }
1338
1339
1345 public void setLanguageId(String languageId) {
1346 _languageId = languageId;
1347 }
1348
1349
1355 public void setLayoutFullURL(String layoutFullURL) {
1356 _layoutFullURL = layoutFullURL;
1357 }
1358
1359
1365 public void setLayoutURL(String layoutURL) {
1366 _layoutURL = layoutURL;
1367 }
1368
1369 public void setModelPermissions(ModelPermissions modelPermissions) {
1370 _modelPermissions = modelPermissions;
1371 }
1372
1373
1379 public void setModifiedDate(Date modifiedDate) {
1380 _modifiedDate = modifiedDate;
1381 }
1382
1383 public void setPathFriendlyURLPrivateGroup(
1384 String pathFriendlyURLPrivateGroup) {
1385
1386 _pathFriendlyURLPrivateGroup = pathFriendlyURLPrivateGroup;
1387 }
1388
1389 public void setPathFriendlyURLPrivateUser(
1390 String pathFriendlyURLPrivateUser) {
1391
1392 _pathFriendlyURLPrivateUser = pathFriendlyURLPrivateUser;
1393 }
1394
1395 public void setPathFriendlyURLPublic(String pathFriendlyURLPublic) {
1396 _pathFriendlyURLPublic = pathFriendlyURLPublic;
1397 }
1398
1399
1405 public void setPathMain(String pathMain) {
1406 _pathMain = pathMain;
1407 }
1408
1409
1414 public void setPlid(long plid) {
1415 _plid = plid;
1416 }
1417
1418
1429 public void setPortalURL(String portalURL) {
1430 _portalURL = portalURL;
1431 }
1432
1433
1445 public void setPortletPreferencesIds(
1446 PortletPreferencesIds portletPreferencesIds) {
1447
1448 _portletPreferencesIds = portletPreferencesIds;
1449 }
1450
1451
1458 public void setRemoteAddr(String remoteAddr) {
1459 _remoteAddr = remoteAddr;
1460 }
1461
1462
1469 public void setRemoteHost(String remoteHost) {
1470 _remoteHost = remoteHost;
1471 }
1472
1473
1479 public void setRequest(HttpServletRequest request) {
1480 _request = request;
1481 }
1482
1483
1491 public void setScopeGroupId(long scopeGroupId) {
1492 _scopeGroupId = scopeGroupId;
1493 }
1494
1495
1501 public void setSignedIn(boolean signedIn) {
1502 _signedIn = signedIn;
1503 }
1504
1505 public void setTimeZone(TimeZone timeZone) {
1506 _timeZone = timeZone;
1507 }
1508
1509
1515 public void setUserDisplayURL(String userDisplayURL) {
1516 _userDisplayURL = userDisplayURL;
1517 }
1518
1519
1524 public void setUserId(long userId) {
1525 _userId = userId;
1526 }
1527
1528
1533 public void setUuid(String uuid) {
1534 _uuid = uuid;
1535 }
1536
1537
1544 public void setWorkflowAction(int workflowAction) {
1545 _workflowAction = workflowAction;
1546 }
1547
1548 public String translate(String pattern, Object... arguments) {
1549 Locale locale = getLocale();
1550
1551 return LanguageUtil.format(locale, pattern, arguments);
1552 }
1553
1554 public void validateModifiedDate(
1555 AuditedModel auditedModel, Class<? extends PortalException> clazz)
1556 throws PortalException {
1557
1558 int value = DateUtil.compareTo(
1559 auditedModel.getModifiedDate(), _formDate);
1560
1561 if (value > 0) {
1562 try {
1563 throw clazz.newInstance();
1564 }
1565 catch (IllegalAccessException iae) {
1566 throw new RuntimeException(iae);
1567 }
1568 catch (InstantiationException ie) {
1569 throw new RuntimeException(ie);
1570 }
1571 }
1572 }
1573
1574 private boolean _addGroupPermissions;
1575 private boolean _addGuestPermissions;
1576 private long[] _assetCategoryIds;
1577 private boolean _assetEntryVisible = true;
1578 private long[] _assetLinkEntryIds;
1579 private double _assetPriority;
1580 private String[] _assetTagNames;
1581 private Map<String, Serializable> _attributes;
1582 private String _command;
1583 private long _companyId;
1584 private Date _createDate;
1585 private String _currentURL;
1586 private boolean _deriveDefaultPermissions;
1587 private Map<String, Serializable> _expandoBridgeAttributes;
1588 private boolean _failOnPortalException = true;
1589 private Date _formDate;
1590 private transient Map<String, String> _headers;
1591 private boolean _indexingEnabled = true;
1592 private String _languageId;
1593 private String _layoutFullURL;
1594 private String _layoutURL;
1595 private ModelPermissions _modelPermissions = new ModelPermissions();
1596 private Date _modifiedDate;
1597 private String _pathFriendlyURLPrivateGroup;
1598 private String _pathFriendlyURLPrivateUser;
1599 private String _pathFriendlyURLPublic;
1600 private String _pathMain;
1601 private long _plid;
1602 private String _portalURL;
1603 private PortletPreferencesIds _portletPreferencesIds;
1604 private String _remoteAddr;
1605 private String _remoteHost;
1606 private transient HttpServletRequest _request;
1607 private long _scopeGroupId;
1608 private boolean _signedIn;
1609 private TimeZone _timeZone;
1610 private String _userDisplayURL;
1611 private long _userId;
1612 private String _uuid;
1613 private int _workflowAction = WorkflowConstants.ACTION_PUBLISH;
1614
1615 }