1
22
23 package com.liferay.portal.service.impl;
24
25 import com.liferay.portal.SystemException;
26 import com.liferay.portal.kernel.plugin.PluginPackage;
27 import com.liferay.portal.kernel.portlet.FriendlyURLMapper;
28 import com.liferay.portal.kernel.util.GetterUtil;
29 import com.liferay.portal.kernel.util.ListUtil;
30 import com.liferay.portal.kernel.util.StringPool;
31 import com.liferay.portal.kernel.util.Validator;
32 import com.liferay.portal.model.CompanyConstants;
33 import com.liferay.portal.model.EventDefinition;
34 import com.liferay.portal.model.Portlet;
35 import com.liferay.portal.model.PortletApp;
36 import com.liferay.portal.model.PortletCategory;
37 import com.liferay.portal.model.PortletConstants;
38 import com.liferay.portal.model.PortletFilter;
39 import com.liferay.portal.model.PortletInfo;
40 import com.liferay.portal.model.PortletURLListener;
41 import com.liferay.portal.model.PublicRenderParameter;
42 import com.liferay.portal.model.impl.EventDefinitionImpl;
43 import com.liferay.portal.model.impl.PortletAppImpl;
44 import com.liferay.portal.model.impl.PortletFilterImpl;
45 import com.liferay.portal.model.impl.PortletImpl;
46 import com.liferay.portal.model.impl.PortletURLListenerImpl;
47 import com.liferay.portal.model.impl.PublicRenderParameterImpl;
48 import com.liferay.portal.service.base.PortletLocalServiceBaseImpl;
49 import com.liferay.portal.util.ContentUtil;
50 import com.liferay.portal.util.DocumentUtil;
51 import com.liferay.portal.util.PortalUtil;
52 import com.liferay.portal.util.PortletKeys;
53 import com.liferay.portal.util.PropsValues;
54 import com.liferay.portal.util.QNameUtil;
55 import com.liferay.portlet.PortletPreferencesSerializer;
56
57 import java.io.IOException;
58 import java.io.StringWriter;
59
60 import java.util.ArrayList;
61 import java.util.HashMap;
62 import java.util.HashSet;
63 import java.util.Iterator;
64 import java.util.LinkedHashSet;
65 import java.util.List;
66 import java.util.Map;
67 import java.util.Set;
68 import java.util.concurrent.ConcurrentHashMap;
69
70 import javax.portlet.PortletMode;
71 import javax.portlet.PreferencesValidator;
72
73 import javax.xml.namespace.QName;
74
75 import org.apache.commons.logging.Log;
76 import org.apache.commons.logging.LogFactory;
77
78 import org.dom4j.Document;
79 import org.dom4j.DocumentException;
80 import org.dom4j.Element;
81 import org.dom4j.io.OutputFormat;
82 import org.dom4j.io.XMLWriter;
83
84
91 public class PortletLocalServiceImpl extends PortletLocalServiceBaseImpl {
92
93 public void destroyPortlet(Portlet portlet) {
94 Map<String, Portlet> portletsPool = _getPortletsPool();
95
96 portletsPool.remove(portlet.getRootPortletId());
97
98 PortletApp portletApp = portlet.getPortletApp();
99
100 _portletAppsPool.remove(portletApp.getServletContextName());
101
102 _clearCaches();
103 }
104
105 public PortletCategory getEARDisplay(String xml) throws SystemException {
106 try {
107 return _readLiferayDisplayXML(xml);
108 }
109 catch (DocumentException de) {
110 throw new SystemException(de);
111 }
112 }
113
114 public PortletCategory getWARDisplay(String servletContextName, String xml)
115 throws SystemException {
116
117 try {
118 return _readLiferayDisplayXML(servletContextName, xml);
119 }
120 catch (DocumentException de) {
121 throw new SystemException(de);
122 }
123 }
124
125 public List<FriendlyURLMapper> getFriendlyURLMappers() {
126 return _getFriendlyURLMappers();
127 }
128
129 public Portlet getPortletById(long companyId, String portletId)
130 throws SystemException {
131
132 portletId = PortalUtil.getJsSafePortletId(portletId);
133
134 Portlet portlet = null;
135
136 Map<String, Portlet> companyPortletsPool = _getPortletsPool(companyId);
137
138 String rootPortletId = PortletConstants.getRootPortletId(portletId);
139
140 if (portletId.equals(rootPortletId)) {
141 portlet = companyPortletsPool.get(portletId);
142 }
143 else {
144 portlet = companyPortletsPool.get(rootPortletId);
145
146 if (portlet != null) {
147 portlet = portlet.getClonedInstance(portletId);
148 }
149 }
150
151 if ((portlet == null) &&
152 (!portletId.equals(PortletKeys.LIFERAY_PORTAL))) {
153
154 if (_log.isWarnEnabled()) {
155 _log.warn(
156 "Portlet not found for " + companyId + " " + portletId);
157 }
158 }
159
160 return portlet;
161 }
162
163 public Portlet getPortletByStrutsPath(long companyId, String strutsPath)
164 throws SystemException {
165
166 return getPortletById(companyId, _getPortletId(strutsPath));
167 }
168
169 public List<Portlet> getPortlets() {
170 Map<String, Portlet> portletsPool = _getPortletsPool();
171
172 return ListUtil.fromCollection(portletsPool.values());
173 }
174
175 public List<Portlet> getPortlets(long companyId) throws SystemException {
176 return getPortlets(companyId, true, true);
177 }
178
179 public List<Portlet> getPortlets(
180 long companyId, boolean showSystem, boolean showPortal)
181 throws SystemException {
182
183 Map<String, Portlet> portletsPool = _getPortletsPool(companyId);
184
185 List<Portlet> portlets = ListUtil.fromCollection(portletsPool.values());
186
187 if (!showSystem || !showPortal) {
188 Iterator<Portlet> itr = portlets.iterator();
189
190 while (itr.hasNext()) {
191 Portlet portlet = itr.next();
192
193 if (showPortal &&
194 portlet.getPortletId().equals(PortletKeys.PORTAL)) {
195
196 }
197 else if (!showPortal &&
198 portlet.getPortletId().equals(PortletKeys.PORTAL)) {
199
200 itr.remove();
201 }
202 else if (!showSystem && portlet.isSystem()) {
203 itr.remove();
204 }
205 }
206 }
207
208 return portlets;
209 }
210
211 public boolean hasPortlet(long companyId, String portletId)
212 throws SystemException {
213
214 portletId = PortalUtil.getJsSafePortletId(portletId);
215
216 Portlet portlet = null;
217
218 Map<String, Portlet> companyPortletsPool = _getPortletsPool(companyId);
219
220 String rootPortletId = PortletConstants.getRootPortletId(portletId);
221
222 if (portletId.equals(rootPortletId)) {
223 portlet = companyPortletsPool.get(portletId);
224 }
225 else {
226 portlet = companyPortletsPool.get(rootPortletId);
227 }
228
229 if (portlet == null) {
230 return false;
231 }
232 else {
233 return true;
234 }
235 }
236
237 public void initEAR(String[] xmls, PluginPackage pluginPackage) {
238
239
241 _portletAppsPool.clear();
242 _portletsPool.clear();
243 _companyPortletsPool.clear();
244 _portletIdsByStrutsPath.clear();
245 _friendlyURLMapperPortlets.clear();
246
247 Map<String, Portlet> portletsPool = _getPortletsPool();
248
249 try {
250 List<String> servletURLPatterns = _readWebXML(xmls[4]);
251
252 Set<String> portletIds = _readPortletXML(
253 xmls[0], portletsPool, servletURLPatterns, pluginPackage);
254
255 portletIds.addAll(_readPortletXML(
256 xmls[1], portletsPool, servletURLPatterns, pluginPackage));
257
258 Set<String> liferayPortletIds =
259 _readLiferayPortletXML(xmls[2], portletsPool);
260
261 liferayPortletIds.addAll(
262 _readLiferayPortletXML(xmls[3], portletsPool));
263
264
266 Iterator<String> portletIdsItr = portletIds.iterator();
267
268 while (portletIdsItr.hasNext()) {
269 String portletId = portletIdsItr.next();
270
271 if (_log.isWarnEnabled() &&
272 !liferayPortletIds.contains(portletId)) {
273
274 _log.warn(
275 "Portlet with the name " + portletId +
276 " is described in portlet.xml but does not " +
277 "have a matching entry in liferay-portlet.xml");
278 }
279 }
280
281
283 Iterator<String> liferayPortletIdsItr =
284 liferayPortletIds.iterator();
285
286 while (liferayPortletIdsItr.hasNext()) {
287 String portletId = liferayPortletIdsItr.next();
288
289 if (_log.isWarnEnabled() && !portletIds.contains(portletId)) {
290 _log.warn(
291 "Portlet with the name " + portletId +
292 " is described in liferay-portlet.xml but does " +
293 "not have a matching entry in portlet.xml");
294 }
295 }
296
297
299 Iterator<Map.Entry<String, Portlet>> portletPoolsItr =
300 portletsPool.entrySet().iterator();
301
302 while (portletPoolsItr.hasNext()) {
303 Map.Entry<String, Portlet> entry = portletPoolsItr.next();
304
305 Portlet portletModel = entry.getValue();
306
307 if (!portletModel.getPortletId().equals(PortletKeys.ADMIN) &&
308 !portletModel.getPortletId().equals(
309 PortletKeys.MY_ACCOUNT) &&
310 !portletModel.isInclude()) {
311
312 portletPoolsItr.remove();
313 }
314 }
315 }
316 catch (Exception e) {
317 _log.error(e, e);
318 }
319 }
320
321 public List<Portlet> initWAR(
322 String servletContextName, String[] xmls, PluginPackage pluginPackage) {
323
324 List<Portlet> portlets = new ArrayList<Portlet>();
325
326 Map<String, Portlet> portletsPool = _getPortletsPool();
327
328 try {
329 List<String> servletURLPatterns = _readWebXML(xmls[3]);
330
331 Set<String> portletIds = _readPortletXML(
332 servletContextName, xmls[0], portletsPool, servletURLPatterns,
333 pluginPackage);
334
335 portletIds.addAll(_readPortletXML(
336 servletContextName, xmls[1], portletsPool, servletURLPatterns,
337 pluginPackage));
338
339 Set<String> liferayPortletIds = _readLiferayPortletXML(
340 servletContextName, xmls[2], portletsPool);
341
342
344 Iterator<String> itr = portletIds.iterator();
345
346 while (itr.hasNext()) {
347 String portletId = itr.next();
348
349 if (_log.isWarnEnabled() &&
350 !liferayPortletIds.contains(portletId)) {
351
352 _log.warn(
353 "Portlet with the name " + portletId +
354 " is described in portlet.xml but does not " +
355 "have a matching entry in liferay-portlet.xml");
356 }
357 }
358
359
361 itr = liferayPortletIds.iterator();
362
363 while (itr.hasNext()) {
364 String portletId = itr.next();
365
366 if (_log.isWarnEnabled() && !portletIds.contains(portletId)) {
367 _log.warn(
368 "Portlet with the name " + portletId +
369 " is described in liferay-portlet.xml but does " +
370 "not have a matching entry in portlet.xml");
371 }
372 }
373
374
376 itr = portletIds.iterator();
377
378 while (itr.hasNext()) {
379 String portletId = itr.next();
380
381 Portlet portlet = _getPortletsPool().get(portletId);
382
383 portlets.add(portlet);
384 }
385 }
386 catch (Exception e) {
387 _log.error(e, e);
388 }
389
390 _clearCaches();
391
392 return portlets;
393 }
394
395 public Portlet updatePortlet(
396 long companyId, String portletId, String roles, boolean active)
397 throws SystemException {
398
399 portletId = PortalUtil.getJsSafePortletId(portletId);
400
401 Portlet portlet = portletPersistence.fetchByC_P(companyId, portletId);
402
403 if (portlet == null) {
404 long id = counterLocalService.increment();
405
406 portlet = portletPersistence.create(id);
407
408 portlet.setCompanyId(companyId);
409 portlet.setPortletId(portletId);
410 }
411
412 portlet.setRoles(roles);
413 portlet.setActive(active);
414
415 portletPersistence.update(portlet, false);
416
417 portlet = getPortletById(companyId, portletId);
418
419 portlet.setRoles(roles);
420 portlet.setActive(active);
421
422 return portlet;
423 }
424
425 private void _clearCaches() {
426
427
429 _portletIdsByStrutsPath.clear();
430
431
433 _companyPortletsPool.clear();
434 }
435
436 private List<FriendlyURLMapper> _getFriendlyURLMappers() {
437 List<FriendlyURLMapper> friendlyURLMappers =
438 new ArrayList<FriendlyURLMapper>(
439 _friendlyURLMapperPortlets.size());
440
441 Iterator<Map.Entry<String, Portlet>> itr =
442 _friendlyURLMapperPortlets.entrySet().iterator();
443
444 while (itr.hasNext()) {
445 Map.Entry<String, Portlet> entry = itr.next();
446
447 Portlet portlet = entry.getValue();
448
449 FriendlyURLMapper friendlyURLMapper =
450 portlet.getFriendlyURLMapperInstance();
451
452 if (friendlyURLMapper != null) {
453 friendlyURLMappers.add(friendlyURLMapper);
454 }
455 }
456
457 return friendlyURLMappers;
458 }
459
460 private PortletApp _getPortletApp(String servletContextName) {
461 PortletApp portletApp = _portletAppsPool.get(servletContextName);
462
463 if (portletApp == null) {
464 portletApp = new PortletAppImpl(servletContextName);
465
466 _portletAppsPool.put(servletContextName, portletApp);
467 }
468
469 return portletApp;
470 }
471
472 private String _getPortletId(String securityPath) {
473 if (_portletIdsByStrutsPath.size() == 0) {
474 Iterator<Portlet> itr = _getPortletsPool().values().iterator();
475
476 while (itr.hasNext()) {
477 Portlet portlet = itr.next();
478
479 _portletIdsByStrutsPath.put(
480 portlet.getStrutsPath(), portlet.getPortletId());
481 }
482 }
483
484 String portletId = _portletIdsByStrutsPath.get(securityPath);
485
486 if (Validator.isNull(portletId)) {
487 _log.error(
488 "Struts path " + securityPath + " is not mapped to a portlet " +
489 "in liferay-portlet.xml");
490 }
491
492 return portletId;
493 }
494
495 private List<Portlet> _getPortletsByPortletName(
496 String portletName, String servletContextName,
497 Map<String, Portlet> portletsPool) {
498
499 List<Portlet> portlets = null;
500
501 int pos = portletName.indexOf(StringPool.STAR);
502
503 if (pos == -1) {
504 portlets = new ArrayList<Portlet>();
505
506 String portletId = portletName;
507
508 if (Validator.isNotNull(servletContextName)) {
509 portletId =
510 portletId + PortletConstants.WAR_SEPARATOR +
511 servletContextName;
512 }
513
514 portletId = PortalUtil.getJsSafePortletId(portletId);
515
516 Portlet portlet = portletsPool.get(portletId);
517
518 if (portlet != null) {
519 portlets.add(portlet);
520 }
521
522 return portlets;
523 }
524
525 String portletNamePrefix = portletName.substring(0, pos);
526
527 portlets = _getPortletsByServletContextName(
528 servletContextName, portletsPool);
529
530 Iterator<Portlet> itr = portlets.iterator();
531
532 while (itr.hasNext()) {
533 Portlet portlet = itr.next();
534
535 if (!portlet.getPortletId().startsWith(portletNamePrefix)) {
536 itr.remove();
537 }
538 }
539
540 return portlets;
541 }
542
543 private List<Portlet> _getPortletsByServletContextName(
544 String servletContextName, Map<String, Portlet> portletsPool) {
545
546 List<Portlet> portlets = new ArrayList<Portlet>();
547
548 Iterator<Map.Entry<String, Portlet>> itr =
549 portletsPool.entrySet().iterator();
550
551 while (itr.hasNext()) {
552 Map.Entry<String, Portlet> entry = itr.next();
553
554 String portletId = entry.getKey();
555 Portlet portlet = entry.getValue();
556
557 if (Validator.isNotNull(servletContextName)) {
558 if (portletId.endsWith(
559 PortletConstants.WAR_SEPARATOR + servletContextName)) {
560
561 portlets.add(portlet);
562 }
563 }
564 else {
565 if (portletId.indexOf(PortletConstants.WAR_SEPARATOR) == -1) {
566 portlets.add(portlet);
567 }
568 }
569 }
570
571 return portlets;
572 }
573
574 private Map<String, Portlet> _getPortletsPool() {
575 return _portletsPool;
576 }
577
578 private Map<String, Portlet> _getPortletsPool(long companyId)
579 throws SystemException {
580
581 Map<String, Portlet> portletsPool = _companyPortletsPool.get(companyId);
582
583 if (portletsPool == null) {
584 portletsPool = new ConcurrentHashMap<String, Portlet>();
585
586 Map<String, Portlet> parentPortletsPool = _getPortletsPool();
587
588 if (parentPortletsPool == null) {
589
590
594 return portletsPool;
595 }
596
597 Iterator<Portlet> itr = parentPortletsPool.values().iterator();
598
599 while (itr.hasNext()) {
600 Portlet portlet = itr.next();
601
602 portlet = (Portlet)portlet.clone();
603
604 portlet.setCompanyId(companyId);
605
606 portletsPool.put(portlet.getPortletId(), portlet);
607 }
608
609 itr = portletPersistence.findByCompanyId(companyId).iterator();
610
611 while (itr.hasNext()) {
612 Portlet portlet = itr.next();
613
614 Portlet portletModel = portletsPool.get(portlet.getPortletId());
615
616
619 if (portletModel != null) {
620 portletModel.setPluginPackage(portlet.getPluginPackage());
621 portletModel.setDefaultPluginSetting(
622 portlet.getDefaultPluginSetting());
623 portletModel.setRoles(portlet.getRoles());
624 portletModel.setActive(portlet.getActive());
625 }
626 }
627
628 _companyPortletsPool.put(companyId, portletsPool);
629 }
630
631 return portletsPool;
632 }
633
634 private void _readLiferayDisplay(
635 String servletContextName, Element el, PortletCategory portletCategory,
636 Set<String> portletIds) {
637
638 Iterator<Element> itr1 = el.elements("category").iterator();
639
640 while (itr1.hasNext()) {
641 Element category = itr1.next();
642
643 String name = category.attributeValue("name");
644
645 PortletCategory curPortletCategory = new PortletCategory(name);
646
647 portletCategory.addCategory(curPortletCategory);
648
649 Set<String> curPortletIds = curPortletCategory.getPortletIds();
650
651 Iterator<Element> itr2 = category.elements("portlet").iterator();
652
653 while (itr2.hasNext()) {
654 Element portlet = itr2.next();
655
656 String portletId = portlet.attributeValue("id");
657
658 if (Validator.isNotNull(servletContextName)) {
659 portletId =
660 portletId + PortletConstants.WAR_SEPARATOR +
661 servletContextName;
662 }
663
664 portletId = PortalUtil.getJsSafePortletId(portletId);
665
666 portletIds.add(portletId);
667 curPortletIds.add(portletId);
668 }
669
670 _readLiferayDisplay(
671 servletContextName, category, curPortletCategory, portletIds);
672 }
673 }
674
675 private PortletCategory _readLiferayDisplayXML(String xml)
676 throws DocumentException {
677
678 return _readLiferayDisplayXML(null, xml);
679 }
680
681 private PortletCategory _readLiferayDisplayXML(
682 String servletContextName, String xml)
683 throws DocumentException {
684
685 PortletCategory portletCategory = new PortletCategory();
686
687 if (xml == null) {
688 xml = ContentUtil.get(
689 "com/liferay/portal/deploy/dependencies/liferay-display.xml");
690 }
691
692 Document doc = DocumentUtil.readDocumentFromXML(xml, true);
693
694 Element root = doc.getRootElement();
695
696 Set<String> portletIds = new HashSet<String>();
697
698 _readLiferayDisplay(
699 servletContextName, root, portletCategory, portletIds);
700
701
704 Set<String> undefinedPortletIds = new HashSet<String>();
705
706 Iterator<Portlet> itr = _getPortletsPool().values().iterator();
707
708 while (itr.hasNext()) {
709 Portlet portlet = itr.next();
710
711 String portletId = portlet.getPortletId();
712
713 PortletApp portletApp = portlet.getPortletApp();
714
715 if ((servletContextName != null) && (portletApp.isWARFile()) &&
716 (portletId.endsWith(
717 PortletConstants.WAR_SEPARATOR +
718 PortalUtil.getJsSafePortletId(servletContextName)) &&
719 (!portletIds.contains(portletId)))) {
720
721 undefinedPortletIds.add(portletId);
722 }
723 else if ((servletContextName == null) &&
724 (!portletApp.isWARFile()) &&
725 (portletId.indexOf(
726 PortletConstants.WAR_SEPARATOR) == -1) &&
727 (!portletIds.contains(portletId))) {
728
729 undefinedPortletIds.add(portletId);
730 }
731 }
732
733 if (undefinedPortletIds.size() > 0) {
734 PortletCategory undefinedCategory = new PortletCategory(
735 "category.undefined");
736
737 portletCategory.addCategory(undefinedCategory);
738
739 undefinedCategory.getPortletIds().addAll(undefinedPortletIds);
740 }
741
742 return portletCategory;
743 }
744
745 private Set<String> _readLiferayPortletXML(
746 String xml, Map<String, Portlet> portletsPool)
747 throws DocumentException {
748
749 return _readLiferayPortletXML(StringPool.BLANK, xml, portletsPool);
750 }
751
752 private Set<String> _readLiferayPortletXML(
753 String servletContextName, String xml,
754 Map<String, Portlet> portletsPool)
755 throws DocumentException {
756
757 Set<String> liferayPortletIds = new HashSet<String>();
758
759 if (xml == null) {
760 return liferayPortletIds;
761 }
762
763 Document doc = DocumentUtil.readDocumentFromXML(xml, true);
764
765 Element root = doc.getRootElement();
766
767 PortletApp portletApp = _getPortletApp(servletContextName);
768
769 Map<String, String> roleMappers = new HashMap<String, String>();
770
771 Iterator<Element> itr1 = root.elements("role-mapper").iterator();
772
773 while (itr1.hasNext()) {
774 Element roleMapper = itr1.next();
775
776 String roleName = roleMapper.elementText("role-name");
777 String roleLink = roleMapper.elementText("role-link");
778
779 roleMappers.put(roleName, roleLink);
780 }
781
782 Map<String, String> customUserAttributes =
783 portletApp.getCustomUserAttributes();
784
785 itr1 = root.elements("custom-user-attribute").iterator();
786
787 while (itr1.hasNext()) {
788 Element customUserAttribute = itr1.next();
789
790 String customClass = customUserAttribute.elementText(
791 "custom-class");
792
793 Iterator<Element> itr2 = customUserAttribute.elements(
794 "name").iterator();
795
796 while (itr2.hasNext()) {
797 Element nameEl = itr2.next();
798
799 String name = nameEl.getText();
800
801 customUserAttributes.put(name, customClass);
802 }
803 }
804
805 itr1 = root.elements("portlet").iterator();
806
807 while (itr1.hasNext()) {
808 Element portlet = itr1.next();
809
810 String portletId = portlet.elementText("portlet-name");
811
812 if (Validator.isNotNull(servletContextName)) {
813 portletId =
814 portletId + PortletConstants.WAR_SEPARATOR +
815 servletContextName;
816 }
817
818 portletId = PortalUtil.getJsSafePortletId(portletId);
819
820 if (_log.isDebugEnabled()) {
821 _log.debug("Reading portlet extension " + portletId);
822 }
823
824 liferayPortletIds.add(portletId);
825
826 Portlet portletModel = portletsPool.get(portletId);
827
828 if (portletModel != null) {
829 portletModel.setIcon(GetterUtil.getString(
830 portlet.elementText("icon"), portletModel.getIcon()));
831 portletModel.setVirtualPath(GetterUtil.getString(
832 portlet.elementText("virtual-path"),
833 portletModel.getVirtualPath()));
834 portletModel.setStrutsPath(GetterUtil.getString(
835 portlet.elementText("struts-path"),
836 portletModel.getStrutsPath()));
837
838 if (Validator.isNotNull(
839 portlet.elementText("configuration-path"))) {
840
841 _log.error(
842 "The configuration-path element is no longer " +
843 "supported. Use configuration-action-class " +
844 "instead.");
845 }
846
847 portletModel.setConfigurationActionClass(GetterUtil.getString(
848 portlet.elementText("configuration-action-class"),
849 portletModel.getConfigurationActionClass()));
850 portletModel.setIndexerClass(GetterUtil.getString(
851 portlet.elementText("indexer-class"),
852 portletModel.getIndexerClass()));
853 portletModel.setOpenSearchClass(GetterUtil.getString(
854 portlet.elementText("open-search-class"),
855 portletModel.getOpenSearchClass()));
856 portletModel.setSchedulerClass(GetterUtil.getString(
857 portlet.elementText("scheduler-class"),
858 portletModel.getSchedulerClass()));
859 portletModel.setPortletURLClass(GetterUtil.getString(
860 portlet.elementText("portlet-url-class"),
861 portletModel.getPortletURLClass()));
862
863 portletModel.setFriendlyURLMapperClass(GetterUtil.getString(
864 portlet.elementText("friendly-url-mapper-class"),
865 portletModel.getFriendlyURLMapperClass()));
866
867 if (Validator.isNull(
868 portletModel.getFriendlyURLMapperClass())) {
869
870 _friendlyURLMapperPortlets.remove(portletId);
871 }
872 else {
873 _friendlyURLMapperPortlets.put(portletId, portletModel);
874 }
875
876 portletModel.setURLEncoderClass(GetterUtil.getString(
877 portlet.elementText("url-encoder-class"),
878 portletModel.getURLEncoderClass()));
879 portletModel.setPortletDataHandlerClass(GetterUtil.getString(
880 portlet.elementText("portlet-data-handler-class"),
881 portletModel.getPortletDataHandlerClass()));
882 portletModel.setPortletLayoutListenerClass(GetterUtil.getString(
883 portlet.elementText("portlet-layout-listener-class"),
884 portletModel.getPortletLayoutListenerClass()));
885 portletModel.setPopMessageListenerClass(GetterUtil.getString(
886 portlet.elementText("pop-message-listener-class"),
887 portletModel.getPopMessageListenerClass()));
888 portletModel.setSocialActivityInterpreterClass(
889 GetterUtil.getString(
890 portlet.elementText(
891 "social-activity-interpreter-class"),
892 portletModel.getSocialActivityInterpreterClass()));
893 portletModel.setSocialRequestInterpreterClass(
894 GetterUtil.getString(
895 portlet.elementText(
896 "social-request-interpreter-class"),
897 portletModel.getSocialRequestInterpreterClass()));
898 portletModel.setPreferencesCompanyWide(GetterUtil.getBoolean(
899 portlet.elementText("preferences-company-wide"),
900 portletModel.isPreferencesCompanyWide()));
901 portletModel.setPreferencesUniquePerLayout(
902 GetterUtil.getBoolean(
903 portlet.elementText("preferences-unique-per-layout"),
904 portletModel.isPreferencesUniquePerLayout()));
905 portletModel.setPreferencesOwnedByGroup(GetterUtil.getBoolean(
906 portlet.elementText("preferences-owned-by-group"),
907 portletModel.isPreferencesOwnedByGroup()));
908 portletModel.setUseDefaultTemplate(GetterUtil.getBoolean(
909 portlet.elementText("use-default-template"),
910 portletModel.isUseDefaultTemplate()));
911 portletModel.setShowPortletAccessDenied(GetterUtil.getBoolean(
912 portlet.elementText("show-portlet-access-denied"),
913 portletModel.isShowPortletAccessDenied()));
914 portletModel.setShowPortletInactive(GetterUtil.getBoolean(
915 portlet.elementText("show-portlet-inactive"),
916 portletModel.isShowPortletInactive()));
917 portletModel.setActionURLRedirect(GetterUtil.getBoolean(
918 portlet.elementText("action-url-redirect"),
919 portletModel.isActionURLRedirect()));
920 portletModel.setRestoreCurrentView(GetterUtil.getBoolean(
921 portlet.elementText("restore-current-view"),
922 portletModel.isRestoreCurrentView()));
923 portletModel.setMaximizeEdit(GetterUtil.getBoolean(
924 portlet.elementText("maximize-edit"),
925 portletModel.isMaximizeEdit()));
926 portletModel.setMaximizeHelp(GetterUtil.getBoolean(
927 portlet.elementText("maximize-help"),
928 portletModel.isMaximizeHelp()));
929 portletModel.setPopUpPrint(GetterUtil.getBoolean(
930 portlet.elementText("pop-up-print"),
931 portletModel.isPopUpPrint()));
932 portletModel.setLayoutCacheable(GetterUtil.getBoolean(
933 portlet.elementText("layout-cacheable"),
934 portletModel.isLayoutCacheable()));
935 portletModel.setInstanceable(GetterUtil.getBoolean(
936 portlet.elementText("instanceable"),
937 portletModel.isInstanceable()));
938 portletModel.setUserPrincipalStrategy(GetterUtil.getString(
939 portlet.elementText("user-principal-strategy"),
940 portletModel.getUserPrincipalStrategy()));
941 portletModel.setPrivateRequestAttributes(GetterUtil.getBoolean(
942 portlet.elementText("private-request-attributes"),
943 portletModel.isPrivateRequestAttributes()));
944 portletModel.setPrivateSessionAttributes(GetterUtil.getBoolean(
945 portlet.elementText("private-session-attributes"),
946 portletModel.isPrivateSessionAttributes()));
947 portletModel.setRenderWeight(GetterUtil.getInteger(
948 portlet.elementText("render-weight"),
949 portletModel.getRenderWeight()));
950 portletModel.setAjaxable(GetterUtil.getBoolean(
951 portlet.elementText("ajaxable"),
952 portletModel.isAjaxable()));
953
954 List<String> headerPortalCssList =
955 portletModel.getHeaderPortalCss();
956
957 Iterator<Element> itr2 = portlet.elements(
958 "header-portal-css").iterator();
959
960 while (itr2.hasNext()) {
961 Element headerPortalCssEl = itr2.next();
962
963 headerPortalCssList.add(headerPortalCssEl.getText());
964 }
965
966 List<String> headerPortletCssList =
967 portletModel.getHeaderPortletCss();
968
969 List<Element> list = new ArrayList<Element>();
970
971 list.addAll(portlet.elements("header-css"));
972 list.addAll(portlet.elements("header-portlet-css"));
973
974 itr2 = list.iterator();
975
976 while (itr2.hasNext()) {
977 Element headerPortletCssEl = itr2.next();
978
979 headerPortletCssList.add(headerPortletCssEl.getText());
980 }
981
982 List<String> headerPortalJavaScriptList =
983 portletModel.getHeaderPortalJavaScript();
984
985 itr2 = portlet.elements("header-portal-javascript").iterator();
986
987 while (itr2.hasNext()) {
988 Element headerPortalJavaScriptEl = itr2.next();
989
990 headerPortalJavaScriptList.add(
991 headerPortalJavaScriptEl.getText());
992 }
993
994 List<String> headerPortletJavaScriptList =
995 portletModel.getHeaderPortletJavaScript();
996
997 list.clear();
998
999 list.addAll(portlet.elements("header-javascript"));
1000 list.addAll(portlet.elements("header-portlet-javascript"));
1001
1002 itr2 = list.iterator();
1003
1004 while (itr2.hasNext()) {
1005 Element headerPortletJavaScriptEl = itr2.next();
1006
1007 headerPortletJavaScriptList.add(
1008 headerPortletJavaScriptEl.getText());
1009 }
1010
1011 List<String> footerPortalCssList =
1012 portletModel.getFooterPortalCss();
1013
1014 itr2 = portlet.elements("footer-portal-css").iterator();
1015
1016 while (itr2.hasNext()) {
1017 Element footerPortalCssEl = itr2.next();
1018
1019 footerPortalCssList.add(footerPortalCssEl.getText());
1020 }
1021
1022 List<String> footerPortletCssList =
1023 portletModel.getFooterPortletCss();
1024
1025 itr2 = portlet.elements("footer-portlet-css").iterator();
1026
1027 while (itr2.hasNext()) {
1028 Element footerPortletCssEl = itr2.next();
1029
1030 footerPortletCssList.add(footerPortletCssEl.getText());
1031 }
1032
1033 List<String> footerPortalJavaScriptList =
1034 portletModel.getFooterPortalJavaScript();
1035
1036 itr2 = portlet.elements("footer-portal-javascript").iterator();
1037
1038 while (itr2.hasNext()) {
1039 Element footerPortalJavaScriptEl = itr2.next();
1040
1041 footerPortalJavaScriptList.add(
1042 footerPortalJavaScriptEl.getText());
1043 }
1044
1045 List<String> footerPortletJavaScriptList =
1046 portletModel.getFooterPortletJavaScript();
1047
1048 itr2 = portlet.elements("footer-portlet-javascript").iterator();
1049
1050 while (itr2.hasNext()) {
1051 Element footerPortletJavaScriptEl = itr2.next();
1052
1053 footerPortletJavaScriptList.add(
1054 footerPortletJavaScriptEl.getText());
1055 }
1056
1057 portletModel.setCssClassWrapper(GetterUtil.getString(
1058 portlet.elementText("css-class-wrapper"),
1059 portletModel.getCssClassWrapper()));
1060 portletModel.setFacebookIntegration(GetterUtil.getString(
1061 portlet.elementText("facebook-integration"),
1062 portletModel.getFacebookIntegration()));
1063 portletModel.setAddDefaultResource(GetterUtil.getBoolean(
1064 portlet.elementText("add-default-resource"),
1065 portletModel.isAddDefaultResource()));
1066 portletModel.setSystem(GetterUtil.getBoolean(
1067 portlet.elementText("system"),
1068 portletModel.isSystem()));
1069 portletModel.setActive(GetterUtil.getBoolean(
1070 portlet.elementText("active"),
1071 portletModel.isActive()));
1072 portletModel.setInclude(GetterUtil.getBoolean(
1073 portlet.elementText("include"),
1074 portletModel.isInclude()));
1075
1076 if (!portletModel.isAjaxable() &&
1077 (portletModel.getRenderWeight() < 1)) {
1078
1079 portletModel.setRenderWeight(1);
1080 }
1081
1082 portletModel.getRoleMappers().putAll(roleMappers);
1083 portletModel.linkRoles();
1084 }
1085 }
1086
1087 return liferayPortletIds;
1088 }
1089
1090 private Set<String> _readPortletXML(
1091 String xml, Map<String, Portlet> portletsPool,
1092 List<String> servletURLPatterns, PluginPackage pluginPackage)
1093 throws DocumentException, IOException {
1094
1095 return _readPortletXML(
1096 StringPool.BLANK, xml, portletsPool, servletURLPatterns,
1097 pluginPackage);
1098 }
1099
1100 private Set<String> _readPortletXML(
1101 String servletContextName, String xml,
1102 Map<String, Portlet> portletsPool, List<String> servletURLPatterns,
1103 PluginPackage pluginPackage)
1104 throws DocumentException, IOException {
1105
1106 Set<String> portletIds = new HashSet<String>();
1107
1108 if (xml == null) {
1109 return portletIds;
1110 }
1111
1112 Document doc = DocumentUtil.readDocumentFromXML(xml);
1113
1114 Element root = doc.getRootElement();
1115
1116 PortletApp portletApp = _getPortletApp(servletContextName);
1117
1118 portletApp.getServletURLPatterns().addAll(servletURLPatterns);
1119
1120 Set<String> userAttributes = portletApp.getUserAttributes();
1121
1122 Iterator<Element> itr1 = root.elements("user-attribute").iterator();
1123
1124 while (itr1.hasNext()) {
1125 Element userAttribute = itr1.next();
1126
1127 String name = userAttribute.elementText("name");
1128
1129 userAttributes.add(name);
1130 }
1131
1132 String defaultNamespace = root.elementText("default-namespace");
1133
1134 if (Validator.isNotNull(defaultNamespace)) {
1135 portletApp.setDefaultNamespace(defaultNamespace);
1136 }
1137
1138 itr1 = root.elements("event-definition").iterator();
1139
1140 while (itr1.hasNext()) {
1141 Element eventDefinitionEl = itr1.next();
1142
1143 Element qNameEl = eventDefinitionEl.element("qname");
1144 Element nameEl = eventDefinitionEl.element("name");
1145 String valueType = eventDefinitionEl.elementText("value-type");
1146
1147 QName qName = QNameUtil.getQName(
1148 qNameEl, nameEl, portletApp.getDefaultNamespace());
1149
1150 EventDefinition eventDefinition = new EventDefinitionImpl(
1151 qName, valueType, portletApp);
1152
1153 portletApp.addEventDefinition(eventDefinition);
1154 }
1155
1156 itr1 = root.elements("public-render-parameter").iterator();
1157
1158 while (itr1.hasNext()) {
1159 Element publicRenderParameterEl = itr1.next();
1160
1161 String identifier = publicRenderParameterEl.elementText(
1162 "identifier");
1163 Element qNameEl = publicRenderParameterEl.element("qname");
1164 Element nameEl = publicRenderParameterEl.element("name");
1165
1166 QName qName = QNameUtil.getQName(
1167 qNameEl, nameEl, portletApp.getDefaultNamespace());
1168
1169 PublicRenderParameter publicRenderParameter =
1170 new PublicRenderParameterImpl(identifier, qName, portletApp);
1171
1172 portletApp.addPublicRenderParameter(publicRenderParameter);
1173 }
1174
1175 itr1 = root.elements("container-runtime-option").iterator();
1176
1177 while (itr1.hasNext()) {
1178 Element containerRuntimeOption = itr1.next();
1179
1180 String name = containerRuntimeOption.elementText("name");
1181
1182 List<String> values = new ArrayList<String>();
1183
1184 for (Element value :
1185 (List<Element>)containerRuntimeOption.elements("value")) {
1186
1187 values.add(value.getTextTrim());
1188 }
1189
1190 portletApp.getContainerRuntimeOptions().put(
1191 name, values.toArray(new String[values.size()]));
1192 }
1193
1194 itr1 = root.elements("portlet").iterator();
1195
1196 while (itr1.hasNext()) {
1197 Element portlet = itr1.next();
1198
1199 String portletName = portlet.elementText("portlet-name");
1200
1201 String portletId = portletName;
1202
1203 if (Validator.isNotNull(servletContextName)) {
1204 portletId =
1205 portletId + PortletConstants.WAR_SEPARATOR +
1206 servletContextName;
1207 }
1208
1209 portletId = PortalUtil.getJsSafePortletId(portletId);
1210
1211 if (_log.isDebugEnabled()) {
1212 _log.debug("Reading portlet " + portletId);
1213 }
1214
1215 portletIds.add(portletId);
1216
1217 Portlet portletModel = portletsPool.get(portletId);
1218
1219 if (portletModel == null) {
1220 portletModel = new PortletImpl(
1221 CompanyConstants.SYSTEM, portletId);
1222
1223 portletsPool.put(portletId, portletModel);
1224 }
1225
1226 portletModel.setTimestamp(System.currentTimeMillis());
1227
1228 portletModel.setPluginPackage(pluginPackage);
1229 portletModel.setPortletApp(portletApp);
1230
1231 portletModel.setPortletName(portletName);
1232 portletModel.setDisplayName(GetterUtil.getString(
1233 portlet.elementText("display-name"),
1234 portletModel.getDisplayName()));
1235 portletModel.setPortletClass(GetterUtil.getString(
1236 portlet.elementText("portlet-class")));
1237
1238 Iterator<Element> itr2 = portlet.elements("init-param").iterator();
1239
1240 while (itr2.hasNext()) {
1241 Element initParam = itr2.next();
1242
1243 portletModel.getInitParams().put(
1244 initParam.elementText("name"),
1245 initParam.elementText("value"));
1246 }
1247
1248 Element expirationCache = portlet.element("expiration-cache");
1249
1250 if (expirationCache != null) {
1251 portletModel.setExpCache(new Integer(GetterUtil.getInteger(
1252 expirationCache.getText())));
1253 }
1254
1255 itr2 = portlet.elements("supports").iterator();
1256
1257 while (itr2.hasNext()) {
1258 Element supports = itr2.next();
1259
1260 String mimeType = supports.elementText("mime-type");
1261
1262 Set<String> mimeTypeModes =
1263 portletModel.getPortletModes().get(mimeType);
1264
1265 if (mimeTypeModes == null) {
1266 mimeTypeModes = new HashSet<String>();
1267
1268 portletModel.getPortletModes().put(mimeType, mimeTypeModes);
1269 }
1270
1271 mimeTypeModes.add(PortletMode.VIEW.toString().toLowerCase());
1272
1273 Iterator<Element> itr3 = supports.elements(
1274 "portlet-mode").iterator();
1275
1276 while (itr3.hasNext()) {
1277 Element portletMode = itr3.next();
1278
1279 mimeTypeModes.add(portletMode.getTextTrim().toLowerCase());
1280 }
1281 }
1282
1283 Set<String> supportedLocales = portletModel.getSupportedLocales();
1284
1285
1288 itr2 = portlet.elements("supported-locale").iterator();
1289
1290 while (itr2.hasNext()) {
1291 Element supportedLocaleEl = itr2.next();
1292
1293 String supportedLocale = supportedLocaleEl.getText();
1294
1295 supportedLocales.add(supportedLocale);
1296 }
1297
1298 portletModel.setResourceBundle(
1299 portlet.elementText("resource-bundle"));
1300
1301 Element portletInfo = portlet.element("portlet-info");
1302
1303 String portletInfoTitle = null;
1304 String portletInfoShortTitle = null;
1305 String portletInfoKeyWords = null;
1306
1307 if (portletInfo != null) {
1308 portletInfoTitle = portletInfo.elementText("title");
1309 portletInfoShortTitle = portletInfo.elementText("short-title");
1310 portletInfoKeyWords = portletInfo.elementText("keywords");
1311 }
1312
1313 portletModel.setPortletInfo(new PortletInfo(
1314 portletInfoTitle, portletInfoShortTitle, portletInfoKeyWords));
1315
1316 Element portletPreferences = portlet.element("portlet-preferences");
1317
1318 String defaultPreferences = null;
1319 String prefsValidator = null;
1320
1321 if (portletPreferences != null) {
1322 Element prefsValidatorEl =
1323 portletPreferences.element("preferences-validator");
1324
1325 if (prefsValidatorEl != null) {
1326 prefsValidator = prefsValidatorEl.getText();
1327
1328 portletPreferences.remove(prefsValidatorEl);
1329 }
1330
1331 StringWriter sw = new StringWriter();
1332
1333 XMLWriter writer = new XMLWriter(
1334 sw, OutputFormat.createCompactFormat());
1335
1336 writer.write(portletPreferences);
1337
1338 defaultPreferences = sw.toString();
1339 }
1340
1341 portletModel.setDefaultPreferences(defaultPreferences);
1342 portletModel.setPreferencesValidator(prefsValidator);
1343
1344 if (!portletApp.isWARFile() &&
1345 Validator.isNotNull(prefsValidator) &&
1346 PropsValues.PREFERENCE_VALIDATE_ON_STARTUP) {
1347
1348 try {
1349 PreferencesValidator prefsValidatorObj =
1350 PortalUtil.getPreferencesValidator(portletModel);
1351
1352 prefsValidatorObj.validate(
1353 PortletPreferencesSerializer.fromDefaultXML(
1354 defaultPreferences));
1355 }
1356 catch (Exception e) {
1357 if (_log.isWarnEnabled()) {
1358 _log.warn(
1359 "Portlet with the name " + portletId +
1360 " does not have valid default preferences");
1361 }
1362 }
1363 }
1364
1365 Set<String> unlikedRoles = portletModel.getUnlinkedRoles();
1366
1367 itr2 = portlet.elements("security-role-ref").iterator();
1368
1369 while (itr2.hasNext()) {
1370 Element role = itr2.next();
1371
1372 unlikedRoles.add(role.elementText("role-name"));
1373 }
1374
1375 itr2 = portlet.elements("supported-processing-event").iterator();
1376
1377 while (itr2.hasNext()) {
1378 Element supportedProcessingEvent = itr2.next();
1379
1380 Element qNameEl = supportedProcessingEvent.element("qname");
1381 Element nameEl = supportedProcessingEvent.element("name");
1382
1383 QName qName = QNameUtil.getQName(
1384 qNameEl, nameEl, portletApp.getDefaultNamespace());
1385
1386 portletModel.addProcessingEvent(qName);
1387 }
1388
1389 itr2 = portlet.elements("supported-publishing-event").iterator();
1390
1391 while (itr2.hasNext()) {
1392 Element supportedPublishingEvent = itr2.next();
1393
1394 Element qNameEl = supportedPublishingEvent.element("qname");
1395 Element nameEl = supportedPublishingEvent.element("name");
1396
1397 QName qName = QNameUtil.getQName(
1398 qNameEl, nameEl, portletApp.getDefaultNamespace());
1399
1400 portletModel.addPublishingEvent(qName);
1401 }
1402
1403 itr2 = portlet.elements(
1404 "supported-public-render-parameter").iterator();
1405
1406 while (itr2.hasNext()) {
1407 Element supportedPublicRenderParameter = itr2.next();
1408
1409 String identifier =
1410 supportedPublicRenderParameter.getTextTrim();
1411
1412 PublicRenderParameter publicRenderParameter =
1413 portletApp.getPublicRenderParameter(identifier);
1414
1415 if (publicRenderParameter == null) {
1416 _log.error(
1417 "Supported public render parameter references " +
1418 "unnknown identifier " + identifier);
1419
1420 continue;
1421 }
1422
1423 portletModel.addPublicRenderParameter(publicRenderParameter);
1424 }
1425 }
1426
1427 itr1 = root.elements("filter").iterator();
1428
1429 while (itr1.hasNext()) {
1430 Element filter = itr1.next();
1431
1432 String filterName = filter.elementText("filter-name");
1433 String filterClass = filter.elementText("filter-class");
1434
1435 Set<String> lifecycles = new LinkedHashSet<String>();
1436
1437 Iterator<Element> itr2 = filter.elements("lifecycle").iterator();
1438
1439 while (itr2.hasNext()) {
1440 Element lifecycle = itr2.next();
1441
1442 lifecycles.add(lifecycle.getText());
1443 }
1444
1445 Map<String, String> initParams = new HashMap<String, String>();
1446
1447 itr2 = filter.elements("init-param").iterator();
1448
1449 while (itr2.hasNext()) {
1450 Element initParam = itr2.next();
1451
1452 initParams.put(
1453 initParam.elementText("name"),
1454 initParam.elementText("value"));
1455 }
1456
1457 PortletFilter portletFilter = new PortletFilterImpl(
1458 filterName, filterClass, lifecycles, initParams, portletApp);
1459
1460 portletApp.addPortletFilter(portletFilter);
1461 }
1462
1463 itr1 = root.elements("filter-mapping").iterator();
1464
1465 while (itr1.hasNext()) {
1466 Element filterMapping = itr1.next();
1467
1468 String filterName = filterMapping.elementText("filter-name");
1469
1470 Iterator<Element> itr2 = filterMapping.elements(
1471 "portlet-name").iterator();
1472
1473 while (itr2.hasNext()) {
1474 Element portletNameEl = itr2.next();
1475
1476 String portletName = portletNameEl.getTextTrim();
1477
1478 PortletFilter portletFilter = portletApp.getPortletFilter(
1479 filterName);
1480
1481 if (portletFilter == null) {
1482 _log.error(
1483 "Filter mapping references unnknown filter name " +
1484 filterName);
1485
1486 continue;
1487 }
1488
1489 List<Portlet> portletModels = _getPortletsByPortletName(
1490 portletName, servletContextName, portletsPool);
1491
1492 if (portletModels.size() == 0) {
1493 _log.error(
1494 "Filter mapping with filter name " + filterName +
1495 " references unnknown portlet name " + portletName);
1496 }
1497
1498 for (Portlet portletModel : portletModels) {
1499 portletModel.getPortletFilters().put(
1500 filterName, portletFilter);
1501 }
1502 }
1503 }
1504
1505 itr1 = root.elements("listener").iterator();
1506
1507 while (itr1.hasNext()) {
1508 Element listener = itr1.next();
1509
1510 String listenerClass = listener.elementText("listener-class");
1511
1512 PortletURLListener portletURLListener = new PortletURLListenerImpl(
1513 listenerClass, portletApp);
1514
1515 portletApp.addPortletURLListener(portletURLListener);
1516 }
1517
1518 return portletIds;
1519 }
1520
1521 private List<String> _readWebXML(String xml) throws DocumentException {
1522 List<String> servletURLPatterns = new ArrayList<String>();
1523
1524 if (xml == null) {
1525 return servletURLPatterns;
1526 }
1527
1528 Document doc = DocumentUtil.readDocumentFromXML(xml);
1529
1530 Element root = doc.getRootElement();
1531
1532 Iterator<Element> itr = root.elements("servlet-mapping").iterator();
1533
1534 while (itr.hasNext()) {
1535 Element servletMapping = itr.next();
1536
1537 String urlPattern = servletMapping.elementText("url-pattern");
1538
1539 servletURLPatterns.add(urlPattern);
1540 }
1541
1542 return servletURLPatterns;
1543
1544 }
1545
1546 private static Log _log = LogFactory.getLog(PortletLocalServiceImpl.class);
1547
1548 private static Map<String, PortletApp> _portletAppsPool =
1549 new ConcurrentHashMap<String, PortletApp>();
1550 private static Map<String, Portlet> _portletsPool =
1551 new ConcurrentHashMap<String, Portlet>();
1552 private static Map<Long, Map<String, Portlet>> _companyPortletsPool =
1553 new ConcurrentHashMap<Long, Map<String, Portlet>>();
1554 private static Map<String, String> _portletIdsByStrutsPath =
1555 new ConcurrentHashMap<String, String>();
1556 private static Map<String, Portlet> _friendlyURLMapperPortlets =
1557 new ConcurrentHashMap<String, Portlet>();
1558
1559}