01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
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 extends BasePortletAction
36: implements AjaxAction, AjaxBuilder, Constants {
37: protected static final Log log = LogFactory
38: .getLog(BaseSiteUpdateAction.class);
39:
40: public BaseGetResourceAction(String template, String errorTemplate,
41: PageManager pageManager) {
42: super (template, errorTemplate, pageManager);
43: }
44:
45: public BaseGetResourceAction(String template, String errorTemplate,
46: PortletActionSecurityBehavior securityBehavior) {
47: super (template, errorTemplate, securityBehavior);
48: }
49:
50: public BaseGetResourceAction(String template, String errorTemplate,
51: PageManager pageManager,
52: PortletActionSecurityBehavior securityBehavior) {
53: super (template, errorTemplate, pageManager, securityBehavior);
54: }
55:
56: protected void putSecurityInformation(Map resultMap,
57: SecuredResource resource) {
58: if (resource.getSecurityConstraints() != null) {
59: resultMap.put(SECURITY_REFS, resource
60: .getSecurityConstraints()
61: .getSecurityConstraintsRefs());
62: resultMap.put(SECURITY_DEFS, resource
63: .getSecurityConstraints().getSecurityConstraints());
64: resultMap.put(SECURITY_OWNER, resource
65: .getSecurityConstraints().getOwner());
66: }
67: }
68: }
|