1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.layout.impl;
18
19 import java.util.Map;
20
21 import org.apache.commons.logging.Log;
22 import org.apache.commons.logging.LogFactory;
23 import org.apache.jetspeed.ajax.AjaxAction;
24 import org.apache.jetspeed.ajax.AjaxBuilder;
25 import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
26 import org.apache.jetspeed.om.common.SecuredResource;
27 import org.apache.jetspeed.page.PageManager;
28
29 /***
30 * Abstract Get Resource aaction for folders, pages and links
31 *
32 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
33 * @version $Id: $
34 */
35 public abstract class BaseGetResourceAction
36 extends BasePortletAction
37 implements AjaxAction, AjaxBuilder, Constants
38 {
39 protected static final Log log = LogFactory.getLog(BaseSiteUpdateAction.class);
40
41 public BaseGetResourceAction(String template,
42 String errorTemplate,
43 PageManager pageManager)
44 {
45 super(template, errorTemplate, pageManager);
46 }
47
48 public BaseGetResourceAction(String template,
49 String errorTemplate,
50 PortletActionSecurityBehavior securityBehavior)
51 {
52 super(template, errorTemplate, securityBehavior);
53 }
54
55 public BaseGetResourceAction(String template,
56 String errorTemplate,
57 PageManager pageManager,
58 PortletActionSecurityBehavior securityBehavior)
59 {
60 super(template, errorTemplate, pageManager, securityBehavior);
61 }
62
63 protected void putSecurityInformation(Map resultMap, SecuredResource resource)
64 {
65 if (resource.getSecurityConstraints() != null)
66 {
67 resultMap.put(SECURITY_REFS, resource.getSecurityConstraints().getSecurityConstraintsRefs());
68 resultMap.put(SECURITY_DEFS, resource.getSecurityConstraints().getSecurityConstraints());
69 resultMap.put(SECURITY_OWNER, resource.getSecurityConstraints().getOwner());
70 }
71 }
72 }