001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018:
019: package de.schlund.pfixxml.config;
020:
021: import java.util.List;
022: import java.util.Map;
023: import java.util.Properties;
024:
025: import de.schlund.pfixcore.auth.AuthConstraint;
026: import de.schlund.pfixcore.auth.Role;
027: import de.schlund.pfixcore.auth.RoleProvider;
028: import de.schlund.pfixcore.workflow.ContextInterceptor;
029: import de.schlund.pfixcore.workflow.ContextResource;
030:
031: /**
032: * Provides configuration for a context instance.
033: *
034: * @author Sebastian Marsching <sebastian.marsching@1und1.de>
035: */
036: public interface ContextConfig {
037:
038: /**
039: * Returns name of auth page or <code>null</code> if there is no need for
040: * the context to require user authentication.
041: * @return
042: */
043: String getAuthPage();
044:
045: /**
046: * Returns name of the flow to use when the user enters the site without
047: * specifying a specific page.
048: *
049: * @return name of default flow
050: */
051: String getDefaultFlow();
052:
053: /**
054: * Returns a list of the configuration for all context resources that should
055: * be created by the context.
056: *
057: * @return list of configuration for alle context resources
058: */
059: List<? extends ContextResourceConfig> getContextResourceConfigs();
060:
061: /**
062: * Returns the configuration for the context resource of the specified class
063: *
064: * @param clazz class of the context resource
065: * @return configuration object for the context resource
066: */
067: ContextResourceConfig getContextResourceConfig(
068: Class<? extends ContextResource> clazz);
069:
070: /**
071: * Returns a map that maps interfaces to the corresponding context resource
072: * configurations.
073: *
074: * @return map containing interface to context resource configuration mapping
075: */
076: Map<Class<? extends ContextResource>, ? extends ContextResourceConfig> getInterfaceToContextResourceMap();
077:
078: /**
079: * Returns a list of configurations for all pageflows.
080: *
081: * @return list of pageflow configurations
082: */
083: List<? extends PageFlowConfig> getPageFlowConfigs();
084:
085: /**
086: * Returns the configuration for the pageflow specified by <code>name</code>.
087: *
088: * @param name name of the pageflow
089: * @return pageflow configuration
090: */
091: PageFlowConfig getPageFlowConfig(String name);
092:
093: /**
094: * Returns a list of configurations for all pagerequests.
095: *
096: * @return list of all pagerequest configurations.
097: */
098: List<? extends PageRequestConfig> getPageRequestConfigs();
099:
100: /**
101: * Returns the configuration for the pagerequest specified by <code>name</code>.
102: *
103: * @param name name of the pagerequest
104: * @return pagerequest configuration
105: */
106: PageRequestConfig getPageRequestConfig(String name);
107:
108: /**
109: * Returns a list of all start interceptors.
110: *
111: * @return list of start interceptors
112: */
113: List<Class<? extends ContextInterceptor>> getStartInterceptors();
114:
115: /**
116: * Returns a list of all end interceptors.
117: *
118: * @return list of end interceptors
119: */
120: List<Class<? extends ContextInterceptor>> getEndInterceptors();
121:
122: /**
123: * Returns the path to the file containing the navigation tree. The path
124: * is specified relative to the Pustefix docroot.
125: *
126: * @return path to navigation structure XML file
127: */
128: String getNavigationFile();
129:
130: /**
131: * Returns configuration properties for the context instance.
132: *
133: * @return properties specifying additional configuration options for
134: * the context
135: */
136: Properties getProperties();
137:
138: /**
139: * Returns true if the context shall synchronize on session objects to ensure
140: * that only one request is concurrently processed per session.
141: *
142: * @return flag indicating whether to synchronize on sessions
143: */
144: boolean isSynchronized();
145:
146: Role getRole(String roleName);
147:
148: Map<String, Role> getRoles();
149:
150: List<Role> getInitialRoles();
151:
152: boolean hasRoles();
153:
154: RoleProvider getRoleProvider();
155:
156: AuthConstraint getDefaultAuthConstraint();
157:
158: }
|