001: package wicket.settings;
002:
003: import java.util.Locale;
004:
005: import wicket.Application;
006: import wicket.application.IClassResolver;
007: import wicket.protocol.http.WebApplication;
008: import wicket.protocol.http.WebRequest;
009: import wicket.util.convert.IConverterFactory;
010:
011: /**
012: * Settings interface for application settings.
013: * <p>
014: * <i>internalErrorPage </i>- You can override this with your own page class to
015: * display internal errors in a different way.
016: * <p>
017: * <i>pageExpiredErrorPage </i>- You can override this with your own
018: * bookmarkable page class to display expired page errors in a different way.
019: * You can set property homePageRenderStrategy to choose from different ways the
020: * home page url shows up in your browser.
021: * <p>
022: * <b>A Converter Factory </b>- By overriding getConverterFactory(), you can
023: * provide your own factory which creates locale sensitive Converter instances.
024: *
025: * @author Jonathan Locke
026: */
027: public interface IApplicationSettings {
028: /**
029: * Gets the access denied page class.
030: *
031: * @return Returns the accessDeniedPage.
032: * @see IApplicationSettings#setAccessDeniedPage(Class)
033: */
034: Class getAccessDeniedPage();
035:
036: /**
037: * Gets the default resolver to use when finding classes
038: *
039: * @return Default class resolver
040: */
041: IClassResolver getClassResolver();
042:
043: /**
044: * Gets context path to use for absolute path generation. For example an
045: * Application Server that is used as a virtual server on a Webserver:
046: *
047: * <pre>
048: * appserver.com/context mapped to webserver/ (context path should be '/')
049: * </pre>
050: *
051: * @return The context path
052: *
053: * @see IApplicationSettings#setContextPath(String) what the possible values
054: * can be.
055: */
056: String getContextPath();
057:
058: /**
059: * Gets the converter factory.
060: *
061: * @return the converter factory
062: */
063: IConverterFactory getConverterFactory();
064:
065: /**
066: * @return Returns the defaultLocale.
067: */
068: Locale getDefaultLocale();
069:
070: /**
071: * Gets internal error page class.
072: *
073: * @return Returns the internalErrorPage.
074: * @see IApplicationSettings#setInternalErrorPage(Class)
075: */
076: Class getInternalErrorPage();
077:
078: /**
079: * Gets the page expired page class.
080: *
081: * @return Returns the pageExpiredErrorPage.
082: * @see IApplicationSettings#setPageExpiredErrorPage(Class)
083: */
084: Class getPageExpiredErrorPage();
085:
086: /**
087: * Sets the access denied page class. The class must be bookmarkable and
088: * must extend Page.
089: *
090: * @param accessDeniedPage
091: * The accessDeniedPage to set.
092: */
093: void setAccessDeniedPage(final Class accessDeniedPage);
094:
095: /**
096: * Sets the default class resolver to use when finding classes.
097: *
098: * @param defaultClassResolver
099: * The default class resolver
100: */
101: void setClassResolver(final IClassResolver defaultClassResolver);
102:
103: /**
104: * Sets context path to use for absolute path generation. For example an
105: * Application Server that is used as a virtual server on a Webserver:
106: *
107: * <pre>
108: * appserver.com/context mapped to webserver/ (context path should be '/')
109: * </pre>
110: *
111: * This method can be called in the init phase of the application with the
112: * servlet init parameter {@link Application#CONTEXTPATH} if it is specified
113: * or by the developer itself in the {@link WebApplication} init() method.
114: * If it is not set in the init phase of the application it will be set
115: * automatically on the context path of the request
116: * {@link WebRequest#getContextPath()}
117: *
118: * @param contextPath
119: * The context path to use.
120: */
121: void setContextPath(String contextPath);
122:
123: /**
124: * Sets converter factory
125: *
126: * @param factory
127: * new factory
128: */
129: void setConverterFactory(IConverterFactory factory);
130:
131: /**
132: * @param defaultLocale
133: * The defaultLocale to set.
134: */
135: void setDefaultLocale(Locale defaultLocale);
136:
137: /**
138: * Sets internal error page class. The class must be bookmarkable and must
139: * extend Page.
140: *
141: * @param internalErrorPage
142: * The internalErrorPage to set.
143: */
144: void setInternalErrorPage(final Class internalErrorPage);
145:
146: /**
147: * Sets the page expired page class. The class must be bookmarkable and must
148: * extend Page.
149: *
150: * @param pageExpiredErrorPage
151: * The pageExpiredErrorPage to set.
152: */
153: void setPageExpiredErrorPage(final Class pageExpiredErrorPage);
154: }
|