Login aus ccm-core umgestellt von old style package auf new style legacy free application. Login Checkbox *Login merken* provisorisch repariert. Update scripts müssen noch erstellt werden.
Weiterer Teil um ccm-docmngr umzustellen und in Gang zu bringen. Ist zur Zeit noch nicht lauffähig. git-svn-id: https://svn.libreccm.org/ccm/trunk@1545 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c757188e00
commit
a8764bf7ad
|
|
@ -124,8 +124,8 @@
|
|||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
<servlet-name>login</servlet-name>
|
||||
<servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
|
|
@ -143,6 +143,11 @@
|
|||
<servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<servlet-class>com.arsdigita.web.OIDRedirectServlet</servlet-class>
|
||||
|
|
@ -465,8 +470,8 @@
|
|||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
<servlet-name>login</servlet-name>
|
||||
<url-pattern>/login/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
|
|
@ -484,6 +489,11 @@
|
|||
<url-pattern>/admin-permissions/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<url-pattern>/redirect/*</url-pattern>
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@
|
|||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
<servlet-name>login</servlet-name>
|
||||
<servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
|
|
@ -143,6 +143,11 @@
|
|||
<servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<servlet-class>com.arsdigita.web.OIDRedirectServlet</servlet-class>
|
||||
|
|
@ -465,8 +470,8 @@
|
|||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
<servlet-name>login</servlet-name>
|
||||
<url-pattern>/login/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
|
|
@ -484,6 +489,11 @@
|
|||
<url-pattern>/admin-permissions/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<url-pattern>/redirect/*</url-pattern>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<xsl:import href="../../bebop/xsl/DimensionalNavbar.xsl"/>
|
||||
<xsl:import href="CMSContainer.xsl"/>
|
||||
<xsl:import href="../../bebop/xsl/DataTable.xsl"/>
|
||||
<xsl:import href="../../acs-admin/xsl/split-panel.xsl"/>
|
||||
<xsl:import href="../../admin/xsl/split-panel.xsl"/>
|
||||
<xsl:import href="admin/cms-admin.xsl"/>
|
||||
|
||||
<xsl:param name="context-prefix"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// Copyright (C) 2012 Peter Boy All Rights Reserved.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation; either version 2.1 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// $Id: Login.pdl 1550 2012-03-22 11:50:59Z pboy $
|
||||
model com.arsdigita.ui.login;
|
||||
|
||||
import com.arsdigita.web.Application;
|
||||
|
||||
object type Login extends Application {
|
||||
// Nothing to store yet
|
||||
// reference key (login_app.application_id);
|
||||
}
|
||||
|
||||
|
|
@ -56,6 +56,7 @@ public class CheckboxGroup extends OptionGroup implements BebopConstants {
|
|||
/** The XML tag.
|
||||
* @return The tag to be used for the top level DOM element
|
||||
* generated for this type of Widget. */
|
||||
@Override
|
||||
protected String getElementTag() {
|
||||
return BEBOP_CHECKBOXGROUP;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import org.apache.log4j.Logger;
|
|||
* This class is a servlet based version of BebopMapDispatcher and associated
|
||||
* classes and is generally used in the same way by legacy free applications.
|
||||
*
|
||||
* Subclasses usually overwrite the doService method to create Page objects
|
||||
* Subclasses usually overwrite the doInit() method to create Page objects
|
||||
* and use this.put method to construct the mapping.
|
||||
*
|
||||
* Subclasses may overwrite the doService method to add additional functionality,
|
||||
|
|
@ -116,7 +116,9 @@ public class BebopApplicationServlet extends BaseApplicationServlet {
|
|||
}
|
||||
|
||||
/**
|
||||
* disable client/middleware caching of specified page (Chris Gilbert).
|
||||
* Adds the provided page as specified by its pathInfo information to an
|
||||
* internal list of pages for which client/middleware caching will be
|
||||
* disabled when serving the page (added by Chris Gilbert).
|
||||
*
|
||||
* @param pathInfo - the same path used to add the page when put was called
|
||||
*/
|
||||
|
|
@ -156,6 +158,7 @@ public class BebopApplicationServlet extends BaseApplicationServlet {
|
|||
if (m_clientCacheDisabledPages.contains(pathInfo)) {
|
||||
DispatcherHelper.cacheDisable(sresp);
|
||||
}
|
||||
preprocessRequest(sreq, sresp, app, pathInfo);
|
||||
final Document doc = page.buildDocument(sreq, sresp);
|
||||
DeveloperSupport.endStage("Dispatcher page.buildDocument");
|
||||
|
||||
|
|
@ -166,4 +169,18 @@ public class BebopApplicationServlet extends BaseApplicationServlet {
|
|||
DeveloperSupport.endStage("Dispatcher presMgr.servePage");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the opportunity for subclasses to do some preprocessing
|
||||
* of a given url, before it is handed off to main service process.
|
||||
* One typical action is to ensure permissions.
|
||||
*/
|
||||
protected void preprocessRequest(HttpServletRequest sreq,
|
||||
HttpServletResponse sresp,
|
||||
Application app,
|
||||
String url)
|
||||
throws ServletException, IOException {
|
||||
// Nothing to do by default.
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import com.arsdigita.search.converter.OOConverter;
|
|||
import com.arsdigita.search.converter.WordConverter;
|
||||
import com.arsdigita.search.converter.TextConverter;
|
||||
|
||||
import com.arsdigita.ui.login.Login;
|
||||
import com.arsdigita.ui.permissions.Permissions;
|
||||
import com.arsdigita.webdevsupport.WebDevSupport;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -151,6 +152,15 @@ public class Initializer extends CompoundInitializer {
|
|||
}
|
||||
});
|
||||
|
||||
e.getFactory().registerInstantiator
|
||||
(Login.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(final DataObject data) {
|
||||
return new Login(data);
|
||||
}
|
||||
});
|
||||
|
||||
e.getFactory().registerInstantiator
|
||||
(Admin.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,16 @@ public final class DispatcherConfig extends AbstractConfig {
|
|||
private final Parameter m_staticURLPrefix;
|
||||
private final Parameter m_cachingActive;
|
||||
private final Parameter m_defaultExpiry;
|
||||
private final Parameter m_defaultPageClass;
|
||||
|
||||
/** Default top-level container for all Bebop components and containersPage.
|
||||
* to use for dispatching Bebop pages. A custom installation may provide
|
||||
* it's own implementation. Use with care because all pages inherit from
|
||||
* this class!
|
||||
* Default is {@see com.arsdigita.bebop.Page} */
|
||||
private final Parameter m_defaultPageClass= new
|
||||
StringParameter("waf.dispatcher.default_page_class",
|
||||
Parameter.OPTIONAL,
|
||||
"com.arsdigita.bebop.Page");
|
||||
|
||||
public DispatcherConfig() {
|
||||
m_staticURLPrefix = new StringParameter
|
||||
|
|
@ -52,11 +61,6 @@ public final class DispatcherConfig extends AbstractConfig {
|
|||
("waf.dispatcher.default_expiry", Parameter.REQUIRED,
|
||||
new Integer(259200));
|
||||
|
||||
m_defaultPageClass = new StringParameter
|
||||
("waf.dispatcher.default_page_class",
|
||||
Parameter.OPTIONAL,
|
||||
"com.arsdigita.bebop.Page");
|
||||
|
||||
register(m_staticURLPrefix);
|
||||
register(m_cachingActive);
|
||||
register(m_defaultExpiry);
|
||||
|
|
@ -90,6 +94,12 @@ public final class DispatcherConfig extends AbstractConfig {
|
|||
return (Integer)get(m_defaultExpiry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the top-level container for all Bebop components and
|
||||
* containersPage to use by dispatcher.
|
||||
* Most installation should use the provided default implementation in
|
||||
* {@see com.arsdigita.bebop.Page}
|
||||
*/
|
||||
public String getDefaultPageClass() {
|
||||
return (String)get(m_defaultPageClass);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@ waf.dispatcher.static_url_prefix.title=Static URL Prefix
|
|||
waf.dispatcher.static_url_prefix.purpose=Prefix used for serving static files
|
||||
waf.dispatcher.static_url_prefix.example=/STATIC/
|
||||
waf.dispatcher.static_url_prefix.format=[url]
|
||||
|
||||
waf.dispatcher.is_caching_active.title=Dispatcher caching enabled
|
||||
waf.dispatcher.is_caching_active.purpose=Toggle whether or not to use HTTP/1.1 caching
|
||||
waf.dispatcher.is_caching_active.example=true
|
||||
waf.dispatcher.is_caching_active.format=true|false
|
||||
|
||||
waf.dispatcher.default_expiry.title=Default cache expiration
|
||||
waf.dispatcher.default_expiry.purpose=Set the default expiration time for HTTP caching
|
||||
waf.dispatcher.default_expiry.example=259200
|
||||
waf.dispatcher.default_expiry.format=[integer]
|
||||
|
||||
waf.dispatcher.default_page_class.title=Default page class
|
||||
waf.dispatcher.default_page_class.purpose=the default page class
|
||||
waf.dispatcher.default_page_class.example=com.arsdigita.bebop.Page
|
||||
waf.dispatcher.default_page_class.format=[String]
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import com.arsdigita.portal.Portal;
|
|||
import com.arsdigita.runtime.ConfigError;
|
||||
import com.arsdigita.runtime.ScriptContext;
|
||||
import com.arsdigita.ui.admin.Admin;
|
||||
import com.arsdigita.ui.login.Login;
|
||||
import com.arsdigita.ui.permissions.Permissions;
|
||||
import com.arsdigita.ui.sitemap.SiteMap;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
|
@ -57,8 +58,8 @@ import com.arsdigita.web.Application;
|
|||
import com.arsdigita.web.ApplicationType;
|
||||
import com.arsdigita.web.Host;
|
||||
import com.arsdigita.web.Web;
|
||||
|
||||
import com.arsdigita.webdevsupport.WebDevSupport;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -127,7 +128,8 @@ public class CoreLoader extends PackageLoader {
|
|||
|
||||
private StringParameter m_dispatcher = new StringParameter
|
||||
("waf.login.dispatcher", Parameter.OPTIONAL,
|
||||
"com.arsdigita.ui.login.SubsiteDispatcher");
|
||||
"com.arsdigita.ui.login.DummyDispatcher");
|
||||
// "com.arsdigita.ui.login.SubsiteDispatcher");
|
||||
|
||||
private StringParameter m_resource = new StringParameter
|
||||
("waf.mime.resource", Parameter.OPTIONAL,
|
||||
|
|
@ -273,8 +275,8 @@ public class CoreLoader extends PackageLoader {
|
|||
// !! s_log.debug("CoreLoader: Going to execute loadBebop().");
|
||||
// !! loadBebop();
|
||||
|
||||
s_log.debug("CoreLoader: Going to execute loadWebDev().");
|
||||
loadWebDev(); // new style legacy free
|
||||
s_log.debug("CoreLoader: Going to execute loadLoginApp().");
|
||||
loadLoginApp();
|
||||
|
||||
s_log.debug("CoreLoader: Going to execute loadAdminApp().");
|
||||
loadAdminApp();
|
||||
|
|
@ -285,6 +287,9 @@ public class CoreLoader extends PackageLoader {
|
|||
s_log.debug("CoreLoader: Going to execute loadPermissionsApp().");
|
||||
loadPermissionsApp(); // new style legacy free
|
||||
|
||||
s_log.debug("CoreLoader: Going to execute loadWebDev().");
|
||||
loadWebDev(); // new style legacy free
|
||||
|
||||
s_log.debug("CoreLoader: Going to execute loadPortal().");
|
||||
loadPortal();
|
||||
|
||||
|
|
@ -467,32 +472,28 @@ public class CoreLoader extends PackageLoader {
|
|||
|
||||
|
||||
/**
|
||||
* Loads WebDeveloperSupport as a new style, legacy free application into
|
||||
* database and instantiate the (only) application instance.
|
||||
*
|
||||
* Public static access needed by upgrade script Upgrade664
|
||||
* @return webDevType ApplicationType
|
||||
* @return
|
||||
*/
|
||||
public static void loadWebDev() {
|
||||
private Application loadLoginApp() {
|
||||
|
||||
ApplicationType webDevType =
|
||||
new ApplicationType("WebDev Support",
|
||||
WebDevSupport.BASE_DATA_OBJECT_TYPE );
|
||||
webDevType.setDescription("WebDeveloper Support application");
|
||||
webDevType.save();
|
||||
ApplicationType loginType =
|
||||
new ApplicationType("login",
|
||||
Login.BASE_DATA_OBJECT_TYPE );
|
||||
loginType.setDescription("CCM user login application");
|
||||
loginType.save();
|
||||
|
||||
Application webDev = Application.createApplication(webDevType,
|
||||
"ds",
|
||||
"WebDeveloper Support",
|
||||
|
||||
Application login = Application.createApplication(loginType,
|
||||
"register",
|
||||
"CCM Login",
|
||||
null);
|
||||
webDev.setDescription("The default WEB developer service instance.");
|
||||
webDev.save();
|
||||
login.setDescription("CCM login instance");
|
||||
|
||||
return;
|
||||
return login;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
|
|
@ -584,6 +585,31 @@ public class CoreLoader extends PackageLoader {
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads WebDeveloperSupport as a new style, legacy free application into
|
||||
* database and instantiate the (only) application instance.
|
||||
*
|
||||
* Public static access needed by upgrade script Upgrade664
|
||||
* @return webDevType ApplicationType
|
||||
*/
|
||||
public static void loadWebDev() {
|
||||
|
||||
ApplicationType webDevType =
|
||||
new ApplicationType("WebDev Support",
|
||||
WebDevSupport.BASE_DATA_OBJECT_TYPE );
|
||||
webDevType.setDescription("WebDeveloper Support application");
|
||||
webDevType.save();
|
||||
|
||||
Application webDev = Application.createApplication(webDevType,
|
||||
"ds",
|
||||
"WebDeveloper Support",
|
||||
null);
|
||||
webDev.setDescription("The default WEB developer service instance.");
|
||||
webDev.save();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load core's basic portal infrastructure.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -421,7 +421,8 @@ class Load extends Command {
|
|||
}
|
||||
|
||||
if (!conflicts.isEmpty()) {
|
||||
System.err.println("conflicting tables: " + conflicts);
|
||||
System.err.println("conflicting tables (already exist): " +
|
||||
conflicts);
|
||||
}
|
||||
|
||||
if (conflicts.size() > 0 || missing.size() > 0) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
package com.arsdigita.ui;
|
||||
|
||||
import com.arsdigita.ui.login.Login;
|
||||
import com.arsdigita.ui.login.LoginServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -41,12 +43,7 @@ public abstract class UI {
|
|||
/** (Relative) URL for systems public top level page. */
|
||||
// In old LegacyInitializer ROOT_PAGE_KEY =pagemap.root= register/ | portal/
|
||||
private static final String s_rootPageURL = s_config.getRootPage();
|
||||
/** (Relative) URL for systems login page. */
|
||||
private static final String s_loginURL = s_config.getLogin();
|
||||
/** (Relative) URL for systems logout page. */
|
||||
private static final String s_logoutURL = s_config.getLogout();
|
||||
/**
|
||||
* */
|
||||
/** */
|
||||
private static final String s_userRedirectURL = s_config.getUserRedirect();
|
||||
/** (Relative) URL for workspace page. */
|
||||
private static final String s_workspaceURL = s_config.getWorkspace();
|
||||
|
|
@ -96,7 +93,7 @@ public abstract class UI {
|
|||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* Therefore the request parameter is not ignored! This variant is retained
|
||||
* for backwards compatibility only.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
* The leading slash is API change! It's impacts have to be checked. (2011-02)
|
||||
*
|
||||
* @return URL for top-level page as String
|
||||
*/
|
||||
|
|
@ -144,37 +141,11 @@ public abstract class UI {
|
|||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return URL for login page as String
|
||||
* @deprecated use Login.getLoginPageURL()() instead
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// LOGIN_PAGE_KEY = page.kernel.login = register/
|
||||
public static String getLoginPageURL() {
|
||||
return s_rootURL + s_loginURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) for a login expired info page.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// EXPIRED_PAGE_KEY =page.kernel.expired=register/login-expired/
|
||||
public static String getLoginExpiredPageURL() {
|
||||
return s_rootURL + s_loginURL + "login-expired/";
|
||||
return Login.getLoginPageURL();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -182,18 +153,11 @@ public abstract class UI {
|
|||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
* @deprecated use LoginServlet.getCookiesExplainPageURL() instead
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
//COOKIES_PAGE_KEY =page.kernel.cookies=register/explain-persistent-cookies/
|
||||
public static String getCookiesExplainPageURL() {
|
||||
return s_rootURL + s_loginURL + "explain-persistent-cookies/";
|
||||
return LoginServlet.getCookiesExplainPageURL();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -201,18 +165,11 @@ public abstract class UI {
|
|||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
* @deprecated use LoginServlet.getRecoverPasswordPageURL() instead
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// RECOVER_PAGE_KEY =page.kernel.recover = register/recover-password/
|
||||
public static String getRecoverPasswordPageURL() {
|
||||
return s_rootURL + s_loginURL + "recover-password/";
|
||||
return LoginServlet.getRecoverPasswordPageURL();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -220,56 +177,11 @@ public abstract class UI {
|
|||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
* @deprecated use LoginServlet.getEditUserProfilePageURL() instead
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// EDIT_PAGE_KEY = page.kernel.edit = register/edit-profile/
|
||||
public static String getEditUserProfilePageURL() {
|
||||
return s_rootURL + s_loginURL + "edit-profile/";
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) for an edit (change) password
|
||||
* page. It is relative to document root without any constant prefix if
|
||||
* there is one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher. The
|
||||
* leading slash it API change! It's impacts have to be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// CHANGE_PAGE_KEY = page.kernel.change = register/change-password/
|
||||
public static String getChangePasswordPageURL() {
|
||||
return s_rootURL + s_loginURL + "change-password/";
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) to an optional new user
|
||||
* registration page (accessible only if activated). It is relative to
|
||||
* document root without any constant prefix if there is one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// NEWUSER_PAGE_KEY = page.kernel.newuser = register/new-user/
|
||||
public static String getNewUserPageURL() {
|
||||
return s_rootURL + s_loginURL + "new-user/";
|
||||
return LoginServlet.getEditUserProfilePageURL();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -277,18 +189,11 @@ public abstract class UI {
|
|||
* is relative to document root without any constant prefix if there is one
|
||||
* configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return URL for logout page as String
|
||||
* @deprecated use LoginServlet.getLogoutPageURL() instead
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// LOGOUT_PAGE_KEY =page.kernel.logout=register/logout/
|
||||
public static String getLogoutPageURL() {
|
||||
return s_rootURL + s_logoutURL;
|
||||
return LoginServlet.getLogoutPageURL();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
package com.arsdigita.ui;
|
||||
|
||||
import com.arsdigita.runtime.AbstractConfig;
|
||||
import com.arsdigita.ui.login.Login;
|
||||
import com.arsdigita.ui.login.LoginServlet;
|
||||
import com.arsdigita.util.StringUtils;
|
||||
import com.arsdigita.util.parameter.StringParameter;
|
||||
import com.arsdigita.util.parameter.StringArrayParameter;
|
||||
|
|
@ -146,18 +148,6 @@ public class UIConfig extends AbstractConfig {
|
|||
private final Parameter m_rootPageURL = new StringParameter
|
||||
("core.ui.pagemap.root_page_url", Parameter.REQUIRED, "register/");
|
||||
|
||||
/**String containing the URL for the login page, Without leading slash but
|
||||
* with trailing slash in case of a directory. */
|
||||
// Old initializer: waf.pagemap.login
|
||||
private final Parameter m_loginURL = new StringParameter
|
||||
("core.ui.pagemap.login_url", Parameter.REQUIRED, "register/");
|
||||
|
||||
/** String containing the URL for the logout page, Without leading slash
|
||||
* but with trailing slash in case of a directory. */
|
||||
// Old initializer: waf.pagemap.logout
|
||||
private final Parameter m_logoutURL = new StringParameter
|
||||
("core.ui.pagemap.logout_url", Parameter.REQUIRED, "register/logout");
|
||||
|
||||
/** String containing the URL for a page which may perform a user specific
|
||||
* redirect if logged in or to a general public page if not. */
|
||||
// Used to be LOGIN_REDIRECT_PAGE_KEY in old kernel/security/initializer
|
||||
|
|
@ -185,8 +175,6 @@ public class UIConfig extends AbstractConfig {
|
|||
register(m_applicationLayouts);
|
||||
|
||||
register(m_rootPageURL);
|
||||
register(m_loginURL);
|
||||
register(m_logoutURL);
|
||||
register(m_userRedirectURL);
|
||||
register(m_workspaceURL);
|
||||
|
||||
|
|
@ -252,24 +240,6 @@ public class UIConfig extends AbstractConfig {
|
|||
return (String)get(m_rootPageURL) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve systems login page url.
|
||||
*
|
||||
* @return login page url
|
||||
*/
|
||||
public String getLogin() {
|
||||
return (String)get(m_loginURL) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve systems logout page url.
|
||||
*
|
||||
* @return logout page url
|
||||
*/
|
||||
public String getLogout() {
|
||||
return (String)get(m_logoutURL) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve systems user login redirect page url.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -13,16 +13,6 @@ core.ui.pagemap.root_page_url.purpose=Enter the relative URL for top-level page
|
|||
core.ui.pagemap.root_page_url.example=register/
|
||||
core.ui.pagemap.root_page_url.format=[string]
|
||||
|
||||
core.ui.pagemap.login_url.title=Login Page
|
||||
core.ui.pagemap.login_url.purpose=Enter the relative URL for the Login page (to document root and without constant prefix if configured)
|
||||
core.ui.pagemap.login_url.example=register/
|
||||
core.ui.pagemap.login_url.format=[string]
|
||||
|
||||
core.ui.pagemap.logout_url.title=Logout Page
|
||||
core.ui.pagemap.logout_url.purpose=Enter the relative URL for the Logout Page (to document root and without constant prefix if configured)
|
||||
core.ui.pagemap.logout_url.example=register/logout
|
||||
core.ui.pagemap.logout_url.format=[string]
|
||||
|
||||
core.ui.pagemap.user_redirect_url.title=User Redirect Page
|
||||
core.ui.pagemap.user_redirect_url.purpose=Enter the relative URL to a page which redirects the request according to the logged in user (if exists)
|
||||
core.ui.pagemap.user_redirect_url.example=pvt/
|
||||
|
|
@ -34,32 +24,6 @@ core.ui.pagemap.workspace_url.example=pvt/
|
|||
core.ui.pagemap.workspace_url.format=[string]
|
||||
|
||||
|
||||
|
||||
#waf.pagemap.newuser.title=New User Page
|
||||
#waf.pagemap.newuser.purpose=Enter the relative URL for the New User Page
|
||||
#waf.pagemap.newuser.example=register/new-user
|
||||
#waf.pagemap.newuser.format=[string]
|
||||
|
||||
#waf.pagemap.cookies.title=Cookies Explanation Page
|
||||
#waf.pagemap.cookies.purpose=Enter the relative URL for the Cookies explanation page
|
||||
#waf.pagemap.cookies.example=register/explain-persistent-cookies
|
||||
#waf.pagemap.cookies.format=[string]
|
||||
|
||||
#waf.pagemap.change.title=Change Password Page
|
||||
#waf.pagemap.change.purpose=Enter the relative URL for the Change Password Page
|
||||
#waf.pagemap.change.example=register/change-password
|
||||
#waf.pagemap.change.format=[string]
|
||||
|
||||
#waf.pagemap.recover.title=Recover Password Page
|
||||
#waf.pagemap.recover.purpose=Enter the relative URL for the Recover Password Page
|
||||
#waf.pagemap.recover.example=register/recover-password
|
||||
#waf.pagemap.recover.format=[string]
|
||||
|
||||
#waf.pagemap.expired.title=Expired Login Page
|
||||
#waf.pagemap.expired.purpose=Enter the relative URL for the expired login message
|
||||
#waf.pagemap.expired.example=register/login-expired
|
||||
#waf.pagemap.expired.format=[string]
|
||||
|
||||
#waf.pagemap.permission.title=Permissions Page
|
||||
#waf.pagemap.permission.purpose=Enter the relative URL for the main Permissions administration page
|
||||
#waf.pagemap.permission.example=permissions/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.ui.login;
|
||||
|
||||
import com.arsdigita.bebop.page.BebopMapDispatcher;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ElementComponent;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.PageFactory;
|
||||
import com.arsdigita.bebop.event.ActionListener;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
// import com.arsdigita.dispatcher.Dispatcher;
|
||||
// import com.arsdigita.dispatcher.DispatcherConfig;
|
||||
// import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
// import com.arsdigita.dispatcher.RequestContext;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
// import com.arsdigita.kernel.security.LegacyInitializer;
|
||||
import com.arsdigita.ui.UI;
|
||||
import com.arsdigita.web.URL;
|
||||
import com.arsdigita.web.ParameterMap;
|
||||
import com.arsdigita.web.ReturnSignal;
|
||||
import com.arsdigita.web.RedirectSignal;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.arsdigita.dispatcher.Dispatcher;
|
||||
import com.arsdigita.dispatcher.DispatcherConfig;
|
||||
import com.arsdigita.dispatcher.RequestContext;
|
||||
import java.io.IOException;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* DummyDispatcher for the old acs-subsite package login package.
|
||||
* Has to be deleted as soon as all application modules are legacy free!
|
||||
*
|
||||
* @author Sameer Ajmani
|
||||
* @version $Id: SubsiteDispatcher.java 1225 2006-06-19 09:27:21Z apevec
|
||||
**/
|
||||
public class DummyDispatcher extends BebopMapDispatcher {
|
||||
|
||||
public static final String APPLICATION_NAME = "login";
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(DummyDispatcher.class.getName());
|
||||
|
||||
// define namespace URI
|
||||
final static String SUBSITE_NS_URI =
|
||||
"http://www.arsdigita.com/subsite/1.0";
|
||||
|
||||
/** Dispatcher map class to store url - page mapping */
|
||||
public class SubsiteDispatcherMap extends HashMap implements Map {
|
||||
|
||||
public SubsiteDispatcherMap() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor initializes dispatcher by registering URLs with bebop pages.
|
||||
*/
|
||||
public DummyDispatcher() {
|
||||
s_log.debug("SubsiteDispatcher Constructor entered.");
|
||||
|
||||
Map map = new SubsiteDispatcherMap();
|
||||
|
||||
// special-case the empty URL
|
||||
// String redirect = LegacyInitializer.getURL(LegacyInitializer.ROOT_PAGE_KEY);
|
||||
String redirect = UI.getRootPageURL();
|
||||
Dispatcher root = new RedirectDispatcher(redirect);
|
||||
|
||||
map.put("", root);
|
||||
map.put("index", root);
|
||||
|
||||
|
||||
setMap(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds <url, page> to the given map. If the URL represents a directory
|
||||
* (ends with "/"), URL+"index" is also added to the map and URL-"/" is
|
||||
* redirected to URL.
|
||||
**/
|
||||
private void put(Map map, String url, Page page) {
|
||||
// String url = LegacyInitializer.getURL(key);
|
||||
if (url.startsWith("/")) {
|
||||
// Currently the getter method provide a leading slash (API change)
|
||||
// but the dispatcher needs an url without
|
||||
// Needs to be checked when the old style sitenode based Dispatcher
|
||||
// is eliminated.
|
||||
url = url.substring(1);
|
||||
}
|
||||
map.put(url, page);
|
||||
if (url.endsWith("/")) {
|
||||
map.put(url+"index", page);
|
||||
requireTrailingSlash(url.substring(0, url.length()-1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preprocessRequest(HttpServletRequest req,
|
||||
HttpServletResponse resp,
|
||||
RequestContext ctx,
|
||||
String url) {
|
||||
// Allow world caching for pages without authentication,
|
||||
// ie, /register, /register/explain-persistent-cookies,
|
||||
// /register/login-expired, /register/recover-password
|
||||
// NB, although you'd think /register is cachable, it
|
||||
// stores a timestamp in the login form :(
|
||||
//
|
||||
// url comes without leading "/" and we have to compensate for the
|
||||
// leading slash provided by the UI.get... methods here.
|
||||
if (("/"+url).equals(UI.getCookiesExplainPageURL()) ||
|
||||
// ("/"+url).equals(UI.getLoginExpiredPageURL()) ||
|
||||
("/"+url).equals(UI.getRecoverPasswordPageURL()) ) {
|
||||
DispatcherHelper.cacheForWorld(resp);
|
||||
} else {
|
||||
DispatcherHelper.cacheDisable(resp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private class RedirectDispatcher implements Dispatcher {
|
||||
private String m_path;
|
||||
|
||||
public RedirectDispatcher(String path) {
|
||||
m_path = path;
|
||||
}
|
||||
|
||||
public void dispatch(final HttpServletRequest req,
|
||||
final HttpServletResponse resp,
|
||||
final RequestContext actx)
|
||||
throws IOException, ServletException {
|
||||
// URL requires that its path argument start with a /,
|
||||
// while the old dispatcher stuff assumes paths do not
|
||||
// start with a slash. We translate.
|
||||
|
||||
final URL url = URL.there(req,
|
||||
"/" + m_path,
|
||||
new ParameterMap(req));
|
||||
|
||||
throw new RedirectSignal(url, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* Copyright (C) 2010 Peter Boy <pb@zes.uni-bremen.de> All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.ui.login;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationCollection;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Application domain class for the Login application.
|
||||
*
|
||||
* @author pb
|
||||
* @version $Id: Login.java $
|
||||
*/
|
||||
public class Login extends Application {
|
||||
|
||||
/** Logger instance for debugging */
|
||||
private static final Logger s_log = Logger.getLogger(Login.class);
|
||||
|
||||
// pdl stuff (constants)
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.ui.login.Login";
|
||||
|
||||
/** URL stub of Login page in ServletPath format (with leading slash and
|
||||
* without trailing slash */
|
||||
// Don't modify without adapting instantiation in Loader class and
|
||||
// updating existing databases (table applications)!
|
||||
protected static final String LOGIN_PAGE_URL = "/register";
|
||||
|
||||
/**
|
||||
* Constructor retrieving Login from the database usings its OID.
|
||||
*
|
||||
* @param obj
|
||||
* @throws DataObjectNotFoundException
|
||||
*/
|
||||
public Login(OID oid)
|
||||
throws DataObjectNotFoundException {
|
||||
|
||||
super(oid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a service domain object from the underlying data object.
|
||||
*
|
||||
* @param obj the DataObject
|
||||
*/
|
||||
public Login(DataObject obj) {
|
||||
super(obj);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter to retrieve the base database object type name
|
||||
*
|
||||
* @return base data aoject type as String
|
||||
*/
|
||||
@Override
|
||||
protected String getBaseDataObjectType() {
|
||||
return BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) into the system login page.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have to be checked. (2011-02)
|
||||
*
|
||||
* @return URL for login page as String
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// LOGIN_PAGE_KEY = page.kernel.login = register/
|
||||
public static String getLoginPageURL() {
|
||||
return LOGIN_PAGE_URL;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public String getServletPath() {
|
||||
return "/login";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -57,5 +57,8 @@ login.error.mismatchPassword=Le nouveau mot de passe doit \u00eatre identique da
|
|||
login.error.badPassword=Mot de passe erron\u00e9
|
||||
login.error.badAnswer=R\u00e9ponse erron\u00e9e
|
||||
login.error.badEmail=Cette adresse de messagerie est inconnue
|
||||
login.changePasswortForm.greeting=
|
||||
login.changePasswortForm.introText=
|
||||
login.changePasswortForm.greeting=Welcome {0}
|
||||
login.changePasswortForm.introText=To change your passwort please fill out this form.
|
||||
login.userRegistrationForm.newUserRegister=New users register here
|
||||
login.error.bannedEmail=User cannot currently access system
|
||||
login.error.loginFail=User cannot currently access system
|
||||
|
|
|
|||
|
|
@ -0,0 +1,420 @@
|
|||
/*
|
||||
* Copyright (C) 2012 Peter Boy All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.ui.login;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ElementComponent;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageFactory;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.bebop.page.BebopApplicationServlet;
|
||||
import com.arsdigita.bebop.event.ActionListener;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
import com.arsdigita.dispatcher.DispatcherConfig;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.ui.UI;
|
||||
|
||||
import com.arsdigita.web.ReturnSignal;
|
||||
import com.arsdigita.web.URL;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
// WORK IN PROGRESS
|
||||
//
|
||||
// (a) Funktionen von SubsiteDispatcher übertragen
|
||||
// Noch zu machen: preProcess für Handling caching
|
||||
// (b) Konfiguration in web.xml etc. *DONE*
|
||||
// (c) Einbau in core Load *DONE*
|
||||
// (d) Testen
|
||||
|
||||
|
||||
/**
|
||||
* Login Application Servlet class, central entry point to create and process
|
||||
* the Login application UI.
|
||||
*
|
||||
* It manages user registration page, new user page, user workspace, logout,
|
||||
* and permissions admin pages.
|
||||
*
|
||||
* @author Peter Boy <pboy@barkhof.uni-bremen.de>
|
||||
* @version $Id: LoginServlet.java 2161 2012-03-15 00:16:13Z pboy $
|
||||
*/
|
||||
public class LoginServlet extends BebopApplicationServlet {
|
||||
|
||||
/** Logger instance for debugging */
|
||||
private static final Logger s_log = Logger.getLogger(LoginServlet.class);
|
||||
|
||||
public static final String APPLICATION_NAME = "login";
|
||||
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String EDIT_USER_PROFILE_PATH_INFO = "/edit-profile/";
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String NEW_USER_PATH_INFO = "/new-user/";
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String CHANGE_USER_PASSWORD_PATH_INFO = "/change-password/";
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String RECOVER_USER_PASSWORD_PATH_INFO = "/recover-password/";
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String EXPLAIN_PERSISTENT_COOKIES_PATH_INFO =
|
||||
"/explain-persistent-cookies/";
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String LOGIN_EXPIRED_PATH_INFO = "/login-expired/";
|
||||
|
||||
/** PathInfo into the Login application to access the (optional) newUser
|
||||
* page. Ends with "/" because it is a servlet/directory
|
||||
*/
|
||||
public static final String LOGOUT_PATH_INFO = "/logout/";
|
||||
|
||||
// define namespace URI
|
||||
final static String SUBSITE_NS_URI = "http://www.arsdigita.com/subsite/1.0";
|
||||
|
||||
// define
|
||||
final static String s_loginURL = Login.LOGIN_PAGE_URL;
|
||||
// final static String s_loginURL = (Login.getLoginPageURL().endsWith("/") ?
|
||||
// Login.getLoginPageURL()
|
||||
// .substring(0,
|
||||
// Login.getLoginPageURL()
|
||||
// .length()-1) :
|
||||
// Login.getLoginPageURL() );
|
||||
|
||||
/**
|
||||
* User extension point used to create the pages to server and setup a
|
||||
* URL - page mapping.
|
||||
*
|
||||
* @throws ServletException
|
||||
*/
|
||||
@Override
|
||||
public void doInit() throws ServletException {
|
||||
|
||||
// Should be handled elsewhere, we have to check for it.
|
||||
// put("/",UI.getRootPageURL());
|
||||
|
||||
// Allow world caching for pages without authentication,
|
||||
// ie, /register, /register/explain-persistent-cookies,
|
||||
// /register/login-expired, /register/recover-password
|
||||
// NB, although you'd think /register is cachable, it
|
||||
// stores a timestamp in the login form :(
|
||||
|
||||
/* Create and add login page (index page of Login application) to the
|
||||
* page map. KernelSecurityConfig determines whether to create a link
|
||||
* to a NewUserRegistrationForm or to skip. */
|
||||
put("/" ,
|
||||
buildSimplePage("login.userRegistrationForm.title",
|
||||
new UserLoginForm( Kernel.getSecurityConfig()
|
||||
.isAutoRegistrationOn() ),
|
||||
"login"));
|
||||
disableClientCaching("/");
|
||||
|
||||
/* Create and add userEditPage to the page map. */
|
||||
put(EDIT_USER_PROFILE_PATH_INFO,
|
||||
buildSimplePage("login.userEditPage.title",
|
||||
new UserEditForm(), "edit") );
|
||||
disableClientCaching(EDIT_USER_PROFILE_PATH_INFO);
|
||||
|
||||
/* Determines if a NewUserRegistrationForm has to be created by quering
|
||||
* Kernel.getSecurityConfig() and acts appropriately */
|
||||
if (Kernel.getSecurityConfig().isAutoRegistrationOn()) {
|
||||
put(NEW_USER_PATH_INFO,
|
||||
buildSimplePage("login.userNewForm.title",
|
||||
new UserNewForm(),
|
||||
"register"));
|
||||
disableClientCaching(NEW_USER_PATH_INFO);
|
||||
}
|
||||
|
||||
/* Create ExplainPersistentCookiesPage and add to the page map */
|
||||
put(EXPLAIN_PERSISTENT_COOKIES_PATH_INFO,
|
||||
buildSimplePage("login.explainCookiesPage.title",
|
||||
new ElementComponent("subsite:explainPersistentCookies",
|
||||
SUBSITE_NS_URI),
|
||||
"cookies"));
|
||||
|
||||
/* Create ChangeUserPasswordPage and add to the page map */
|
||||
put(CHANGE_USER_PASSWORD_PATH_INFO,
|
||||
buildSimplePage("login.changePasswordPage.title",
|
||||
new ChangePasswordForm(),
|
||||
"changepassword"));
|
||||
disableClientCaching(CHANGE_USER_PASSWORD_PATH_INFO);
|
||||
|
||||
/* Build the password recover page, retrieve its URL and store in map */
|
||||
put(RECOVER_USER_PASSWORD_PATH_INFO,
|
||||
buildSimplePage("login.recoverPasswordPage.title",
|
||||
new RecoverPasswordPanel(),
|
||||
"recoverpassword"));
|
||||
|
||||
// Build the login expire page, retrieve its URL and store in map
|
||||
put(LOGIN_EXPIRED_PATH_INFO, buildExpiredPage());
|
||||
|
||||
/* Create Logout Page and add to the page map */
|
||||
put(LOGOUT_PATH_INFO, buildLogOutPage());
|
||||
disableClientCaching(LOGOUT_PATH_INFO);
|
||||
|
||||
|
||||
Page workspace = checkForPageSubClass();
|
||||
if (workspace == null)
|
||||
workspace = buildSimplePage("login.workspacePage.title",
|
||||
new UserInfo(),
|
||||
"workspace");
|
||||
put(UI.getWorkspaceURL(), workspace); // usually navigation/ or portal/
|
||||
disableClientCaching(UI.getWorkspaceURL());
|
||||
|
||||
// special case to handle pvt/home
|
||||
// String url = LegacyInitializer.getURL(LegacyInitializer.WORKSPACE_PAGE_KEY);
|
||||
// pboy: This page / url seems to be a left over from older versions,
|
||||
// currently not contained in source code.
|
||||
String url = UI.getWorkspaceURL();
|
||||
if (url.equals("pvt/")) {
|
||||
put("pvt/home", workspace);
|
||||
disableClientCaching("pvt/home");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check wether a custom base Page class (top-level container for all Bebop
|
||||
* components and containersPages) is configured and return the appropriate
|
||||
* Page. Here used (only) for UserInfo() workspace.
|
||||
*
|
||||
* @return Page to use for top-level container for all Bebop components and
|
||||
* containersPage, null to use default class
|
||||
*/
|
||||
private static Page checkForPageSubClass() {
|
||||
//check to see if there is subclass of Page defined in Config
|
||||
DispatcherConfig dc = DispatcherHelper.getConfig();
|
||||
String pageClass = dc.getDefaultPageClass();
|
||||
Page p = null;
|
||||
if (!pageClass.equals("com.arsdigita.bebop.Page")) {
|
||||
try {
|
||||
// afraid that we're assuming a no-arg constructor
|
||||
Class c = Class.forName(pageClass);
|
||||
p = (Page)c.newInstance();
|
||||
} catch (Exception e) {
|
||||
s_log.error("Unable to instantiate waf.dispatcher.default_page_class",e);
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Page with the given title and body component.
|
||||
*
|
||||
* @return the new Page
|
||||
**/
|
||||
private static Page buildSimplePage(String title, Component body, String id) {
|
||||
|
||||
Page page = PageFactory.buildPage(APPLICATION_NAME,
|
||||
new Label(LoginHelper.getMessage(title)),
|
||||
id);
|
||||
page.add(body);
|
||||
page.lock();
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a page informing the user the login has expired. Provides links
|
||||
* to login again, etc.
|
||||
*
|
||||
* @return Page (login expired info)
|
||||
*/
|
||||
private static Page buildExpiredPage() {
|
||||
Page page = PageFactory.buildPage(
|
||||
APPLICATION_NAME,
|
||||
new Label(LoginHelper.getMessage("login.loginExpiredPage.title"))
|
||||
);
|
||||
page.add(new SimpleContainer() {
|
||||
{ // constructor
|
||||
add(new Label(LoginHelper.getMessage
|
||||
("login.loginExpiredPage.before")));
|
||||
add(new DynamicLink("login.loginExpiredPage.link",
|
||||
Login.getLoginPageURL() ));
|
||||
add(new Label(LoginHelper.getMessage
|
||||
("login.loginExpiredPage.after")));
|
||||
add(new ElementComponent("subsite:explainLoginExpired",
|
||||
SUBSITE_NS_URI));
|
||||
}
|
||||
});
|
||||
page.lock();
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static Page buildLogOutPage() {
|
||||
Page page = PageFactory.buildPage(
|
||||
APPLICATION_NAME,
|
||||
new Label(LoginHelper.getMessage("Logout"))
|
||||
);
|
||||
page.addActionListener(new UserLogoutListener());
|
||||
page.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
final HttpServletRequest req = state.getRequest();
|
||||
|
||||
final String path = UI.getRootPageURL(req);
|
||||
|
||||
throw new ReturnSignal(req, URL.there(req, path));
|
||||
}
|
||||
});
|
||||
|
||||
page.lock();
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) to a user profile editig page.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have to be checked. (2011-02)
|
||||
*
|
||||
* @return url to EditUserProfile page as String
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// EDIT_PAGE_KEY = page.kernel.edit = register/edit-profile/
|
||||
public static String getEditUserProfilePageURL() {
|
||||
return s_loginURL + EDIT_USER_PROFILE_PATH_INFO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) to an optional new user
|
||||
* registration page (accessible only if activated). It is relative to
|
||||
* document root without any constant prefix if there is one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have to be checked. (2011-02)
|
||||
*
|
||||
* XXX In violation of the Servlet API the string does NOT start with a "/"
|
||||
* because currently the UI.getLoginPageURL() method provides a trailing
|
||||
* slash because it still follows the old application convention. Should
|
||||
* be reworked soon.
|
||||
*
|
||||
* @return url to new user registration page as String
|
||||
*/
|
||||
// In old LegacyInitializer
|
||||
// NEWUSER_PAGE_KEY = page.kernel.newuser = register/new-user/
|
||||
public static String getNewUserPageURL() {
|
||||
return s_loginURL + NEW_USER_PATH_INFO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) for a password recovery page.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
*/
|
||||
public static String getRecoverPasswordPageURL() {
|
||||
return s_loginURL + RECOVER_USER_PASSWORD_PATH_INFO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) for a cookie explanation page.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
*/
|
||||
public static String getCookiesExplainPageURL() {
|
||||
return s_loginURL + EXPLAIN_PERSISTENT_COOKIES_PATH_INFO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) for a login expired info page.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
* one configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return url String for new user registration page as String
|
||||
*/
|
||||
public static String getLoginExpiredPageURL() {
|
||||
return s_loginURL + LOGIN_EXPIRED_PATH_INFO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an absolute URL (leading slash) for the system logout page. It
|
||||
* is relative to document root without any constant prefix if there is one
|
||||
* configured.
|
||||
*
|
||||
* XXX This implementation starts with a leading slash and ends with a slash.
|
||||
* In previous configurations String urls began without a slash in order
|
||||
* to be able to provide a full URL which also contains the context part.
|
||||
* Since version 5.2 the context part is handled by (new) dispatcher.
|
||||
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
|
||||
*
|
||||
* @return URL for logout page as String
|
||||
*/
|
||||
public static String getLogoutPageURL() {
|
||||
return s_loginURL + LOGOUT_PATH_INFO;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -330,7 +330,7 @@ public class RecoverPasswordPanel extends SimpleContainer
|
|||
private static class MailSentPane extends ElementComponent {
|
||||
public MailSentPane() {
|
||||
super("subsite:recoverPasswordMailSent",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ public class RecoverPasswordPanel extends SimpleContainer
|
|||
private static class MailFailedPane extends ElementComponent {
|
||||
public MailFailedPane() {
|
||||
super("subsite:recoverPasswordMailFailed",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,299 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.ui.login;
|
||||
|
||||
import com.arsdigita.bebop.page.BebopMapDispatcher;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ElementComponent;
|
||||
import com.arsdigita.bebop.SimpleContainer;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.PageFactory;
|
||||
import com.arsdigita.bebop.event.ActionListener;
|
||||
import com.arsdigita.bebop.event.ActionEvent;
|
||||
// import com.arsdigita.dispatcher.Dispatcher;
|
||||
// import com.arsdigita.dispatcher.DispatcherConfig;
|
||||
// import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
// import com.arsdigita.dispatcher.RequestContext;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
// import com.arsdigita.kernel.security.LegacyInitializer;
|
||||
import com.arsdigita.ui.UI;
|
||||
import com.arsdigita.web.URL;
|
||||
import com.arsdigita.web.ParameterMap;
|
||||
import com.arsdigita.web.ReturnSignal;
|
||||
import com.arsdigita.web.RedirectSignal;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.arsdigita.dispatcher.Dispatcher;
|
||||
import com.arsdigita.dispatcher.DispatcherConfig;
|
||||
import com.arsdigita.dispatcher.RequestContext;
|
||||
import java.io.IOException;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* Dispatcher for the login package. Manages user registration page, new user
|
||||
* page, user workspace, logout, and permissions admin pages.
|
||||
*
|
||||
* @author Sameer Ajmani
|
||||
* @version $Id: SubsiteDispatcher.java 1225 2006-06-19 09:27:21Z apevec
|
||||
**/
|
||||
public class SubsiteDispatcher extends BebopMapDispatcher {
|
||||
|
||||
public static final String APPLICATION_NAME = "login";
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(SubsiteDispatcher.class.getName());
|
||||
|
||||
// define namespace URI
|
||||
final static String SUBSITE_NS_URI =
|
||||
"http://www.arsdigita.com/subsite/1.0";
|
||||
|
||||
/** Dispatcher map class to store url - page mapping */
|
||||
public class SubsiteDispatcherMap extends HashMap implements Map {
|
||||
|
||||
public SubsiteDispatcherMap() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor initializes dispatcher by registering URLs with bebop pages.
|
||||
*/
|
||||
public SubsiteDispatcher() {
|
||||
s_log.debug("SubsiteDispatcher Constructor entered.");
|
||||
|
||||
Map map = new SubsiteDispatcherMap();
|
||||
|
||||
// special-case the empty URL
|
||||
// String redirect = LegacyInitializer.getURL(LegacyInitializer.ROOT_PAGE_KEY);
|
||||
String redirect = UI.getRootPageURL();
|
||||
Dispatcher root = new RedirectDispatcher(redirect);
|
||||
|
||||
map.put("", root);
|
||||
map.put("index", root);
|
||||
|
||||
// put(map, LegacyInitializer.EDIT_PAGE_KEY, buildSimplePage
|
||||
put(map, UI.getEditUserProfilePageURL(), buildSimplePage
|
||||
("login.userEditPage.title",
|
||||
new UserEditForm(), "edit"));
|
||||
// put(map, LegacyInitializer.LOGIN_PAGE_KEY, buildSimplePage
|
||||
put(map, UI.getLoginPageURL(), buildSimplePage
|
||||
("login.userRegistrationForm.title",
|
||||
new UserRegistrationForm(
|
||||
Kernel.getSecurityConfig()
|
||||
.isAutoRegistrationOn()),
|
||||
"login"));
|
||||
if (Kernel.getSecurityConfig().isAutoRegistrationOn()) {
|
||||
// put(map, LegacyInitializer.NEWUSER_PAGE_KEY, buildSimplePage
|
||||
put(map, UI.getNewUserPageURL(), buildSimplePage
|
||||
("login.userNewForm.title",
|
||||
new UserNewForm(),
|
||||
"register"));
|
||||
}
|
||||
// put(map, LegacyInitializer.LOGOUT_PAGE_KEY, buildLogOutPage());
|
||||
put(map, UI.getLogoutPageURL(), buildLogOutPage());
|
||||
// put(map, LegacyInitializer.COOKIES_PAGE_KEY, buildSimplePage
|
||||
put(map, UI.getCookiesExplainPageURL(), buildSimplePage
|
||||
("login.explainCookiesPage.title", new ElementComponent
|
||||
("subsite:explainPersistentCookies", SUBSITE_NS_URI), "cookies"));
|
||||
// put(map, LegacyInitializer.CHANGE_PAGE_KEY, buildSimplePage
|
||||
put(map, UI.getChangePasswordPageURL(), buildSimplePage
|
||||
("login.changePasswordPage.title",
|
||||
new ChangePasswordForm(),
|
||||
"changepassword"));
|
||||
// put(map, LegacyInitializer.RECOVER_PAGE_KEY, buildSimplePage
|
||||
put(map, UI.getRecoverPasswordPageURL(), buildSimplePage
|
||||
("login.recoverPasswordPage.title",
|
||||
new RecoverPasswordPanel(),
|
||||
"recoverpassword"));
|
||||
|
||||
Page workspace = checkForPageSubClass();
|
||||
if (workspace == null) workspace = buildSimplePage
|
||||
("login.workspacePage.title",
|
||||
new UserInfo(),
|
||||
"workspace");
|
||||
// put(map, LegacyInitializer.WORKSPACE_PAGE_KEY, workspace);
|
||||
put(map, UI.getWorkspaceURL(), workspace);
|
||||
// put(map, LegacyInitializer.EXPIRED_PAGE_KEY, buildExpiredPage());
|
||||
put(map, UI.getLoginExpiredPageURL(), buildExpiredPage());
|
||||
|
||||
// special case to handle pvt/home
|
||||
// String url = LegacyInitializer.getURL(LegacyInitializer.WORKSPACE_PAGE_KEY);
|
||||
String url = UI.getWorkspaceURL();
|
||||
if (url.equals("pvt/")) {
|
||||
map.put("pvt/home", workspace);
|
||||
}
|
||||
|
||||
setMap(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds <url, page> to the given map. If the URL represents a directory
|
||||
* (ends with "/"), URL+"index" is also added to the map and URL-"/" is
|
||||
* redirected to URL.
|
||||
**/
|
||||
private void put(Map map, String url, Page page) {
|
||||
// String url = LegacyInitializer.getURL(key);
|
||||
if (url.startsWith("/")) {
|
||||
// Currently the getter method provide a leading slash (API change)
|
||||
// but the dispatcher needs an url without
|
||||
// Needs to be checked when the old style sitenode based Dispatcher
|
||||
// is eliminated.
|
||||
url = url.substring(1);
|
||||
}
|
||||
map.put(url, page);
|
||||
if (url.endsWith("/")) {
|
||||
map.put(url+"index", page);
|
||||
requireTrailingSlash(url.substring(0, url.length()-1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preprocessRequest(HttpServletRequest req,
|
||||
HttpServletResponse resp,
|
||||
RequestContext ctx,
|
||||
String url) {
|
||||
// Allow world caching for pages without authentication,
|
||||
// ie, /register, /register/explain-persistent-cookies,
|
||||
// /register/login-expired, /register/recover-password
|
||||
// NB, although you'd think /register is cachable, it
|
||||
// stores a timestamp in the login form :(
|
||||
//
|
||||
// url comes without leading "/" and we have to compensate for the
|
||||
// leading slash provided by the UI.get... methods here.
|
||||
if (("/"+url).equals(UI.getCookiesExplainPageURL()) ||
|
||||
("/"+url).equals(UI.getLoginExpiredPageURL()) ||
|
||||
("/"+url).equals(UI.getRecoverPasswordPageURL()) ) {
|
||||
DispatcherHelper.cacheForWorld(resp);
|
||||
} else {
|
||||
DispatcherHelper.cacheDisable(resp);
|
||||
}
|
||||
}
|
||||
|
||||
private static Page checkForPageSubClass() {
|
||||
//check to see if there is subclass of Page defined in Config
|
||||
DispatcherConfig dc = DispatcherHelper.getConfig();
|
||||
String pageClass = dc.getDefaultPageClass();
|
||||
Page p = null;
|
||||
if (!pageClass.equals("com.arsdigita.bebop.Page")) {
|
||||
try {
|
||||
// afraid that we're assuming a no-arg constructor
|
||||
Class c = Class.forName(pageClass);
|
||||
p = (Page)c.newInstance();
|
||||
} catch (Exception e) {
|
||||
s_log.error("Unable to instantiate waf.dispatcher.default_page_class",e);
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Page with the given title and body component.
|
||||
*
|
||||
* @return the new Page
|
||||
**/
|
||||
private static Page buildSimplePage(String title, Component body, String id) {
|
||||
Page page = PageFactory.buildPage(
|
||||
APPLICATION_NAME,
|
||||
new Label(LoginHelper.getMessage(title)),
|
||||
id);
|
||||
page.add(body);
|
||||
page.lock();
|
||||
return page;
|
||||
}
|
||||
|
||||
private static Page buildExpiredPage() {
|
||||
Page page = PageFactory.buildPage(
|
||||
APPLICATION_NAME,
|
||||
new Label(LoginHelper.getMessage("login.loginExpiredPage.title"))
|
||||
);
|
||||
page.add(new SimpleContainer() {
|
||||
{ // constructor
|
||||
add(new Label(LoginHelper.getMessage
|
||||
("login.loginExpiredPage.before")));
|
||||
add(new DynamicLink("login.loginExpiredPage.link",
|
||||
UI.getLoginPageURL() ));
|
||||
add(new Label(LoginHelper.getMessage
|
||||
("login.loginExpiredPage.after")));
|
||||
add(new ElementComponent("subsite:explainLoginExpired",
|
||||
SUBSITE_NS_URI));
|
||||
}
|
||||
});
|
||||
page.lock();
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static Page buildLogOutPage() {
|
||||
Page page = PageFactory.buildPage(
|
||||
APPLICATION_NAME,
|
||||
new Label(LoginHelper.getMessage("Logout"))
|
||||
);
|
||||
page.addActionListener(new UserLogoutListener());
|
||||
page.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
final HttpServletRequest req = state.getRequest();
|
||||
|
||||
final String path = UI.getRootPageURL(req);
|
||||
|
||||
throw new ReturnSignal(req, URL.there(req, path));
|
||||
}
|
||||
});
|
||||
|
||||
page.lock();
|
||||
return page;
|
||||
}
|
||||
|
||||
private class RedirectDispatcher implements Dispatcher {
|
||||
private String m_path;
|
||||
|
||||
public RedirectDispatcher(String path) {
|
||||
m_path = path;
|
||||
}
|
||||
|
||||
public void dispatch(final HttpServletRequest req,
|
||||
final HttpServletResponse resp,
|
||||
final RequestContext actx)
|
||||
throws IOException, ServletException {
|
||||
// URL requires that its path argument start with a /,
|
||||
// while the old dispatcher stuff assumes paths do not
|
||||
// start with a slash. We translate.
|
||||
|
||||
final URL url = URL.there(req,
|
||||
"/" + m_path,
|
||||
new ParameterMap(req));
|
||||
|
||||
throw new RedirectSignal(url, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
login.userEditPage.title=Edit Profile
|
||||
login.userEditPage.changePasswordLink=Change password
|
||||
login.workspacePage.title=Your workspace
|
||||
login.explainCookiesPage.title=Saving email address and password
|
||||
login.userInfo.logoutLink=Log out
|
||||
login.userInfo.editProfileLink=Edit profile
|
||||
login.userInfo.changePasswordLink=Change password
|
||||
login.userRegistrationForm.title=Log in
|
||||
login.userRegistrationForm.email=Your email address:
|
||||
login.userRegistrationForm.screenName=Your screen name:
|
||||
login.userRegistrationForm.password=Your password:
|
||||
login.userRegistrationForm.cookieOption=Remember this login?
|
||||
login.userRegistrationForm.explainCookieLink=(help)
|
||||
login.userRegistrationForm.forgotPasswordLink=Forgot your password?
|
||||
login.userRegistrationForm.newUserRegister=New users register here
|
||||
login.userNewForm.title=Register
|
||||
login.userNewForm.aboutYouSectionHeader=<h3>About You</h3>
|
||||
login.userNewForm.securitySectionHeader=<h3>Security</h3>
|
||||
login.userNewForm.securityBlurb=We need a password from you to protect your identity as you contribute to the Q&A, discussion forums, and other community activities on this site.
|
||||
login.userNewForm.passwordBlurb=Choose a password that contains a mix of uppercase letters, lowercase letters, digits, and other symbols. If you forget your password, our server will help you change it to a new one.
|
||||
login.userNewForm.questionBlurb=We need a customized question and answer so we can make sure only you can change your password.
|
||||
login.changePasswordForm.oldPasswordLabel=Old Password:
|
||||
login.changePasswordForm.newPasswordLabel=New Password (at least {0} characters, no whitespace):
|
||||
login.changePasswordForm.confirmPasswordLabel=Confirm Password:
|
||||
login.changePasswordForm.submit=Submit
|
||||
login.changePasswordForm.noUserError=User is not logged in
|
||||
login.changePasswordForm.badPasswordError=Incorrect Password
|
||||
login.changePasswordForm.mustDifferError=New password must differ from old
|
||||
login.changePasswordForm.mustMatchError=New passwords must match
|
||||
login.changePasswordForm.mailSubject=Your password has been changed
|
||||
login.changePasswordForm.mailBody=Dear {0},\n\nYour password has been changed successfully.\nIf you did not intend to change your password,\nplease reply to this mail and report this problem.
|
||||
login.changePasswordPage.title=Change Password
|
||||
login.recoverPassword.mailSubject=Change your password
|
||||
login.recoverPassword.mailBody=Dear {0},\n\nClick on this URL or paste it into your browser to change your password:\n{1}
|
||||
login.recoverPasswordPage.title=Recover Password
|
||||
login.loginExpiredPage.title=Login Expired
|
||||
login.loginExpiredPage.before=The login page has expired. Please\u0020
|
||||
login.loginExpiredPage.link=login
|
||||
login.loginExpiredPage.after=\u0020again.
|
||||
login.passwordValidation.minLengthError=Password must be at least {0} characters long
|
||||
login.passwordValidation.whitespaceError=Password must not contain whitespace
|
||||
login.passwordValidation.minTypesError=Password must contain {0} of these 4 character types: uppercase letters, lowercase letters, digits, and other symbols
|
||||
login.submit=Submit
|
||||
login.primaryEmail=Email Address:
|
||||
login.additionalEmail=Additional Email:
|
||||
login.firstName=First (Given) Name:
|
||||
login.lastName=Last (Family) Name:
|
||||
login.password=Password (at least {0} characters, no whitespace):
|
||||
login.passwordConfirm=Confirm Password:
|
||||
login.passwordQuestion=Question:
|
||||
login.passwordAnswer=Answer:
|
||||
login.url=Personal Home Page URL:
|
||||
login.screenName=Screen Name:
|
||||
login.bio=Biography:
|
||||
login.error.duplicateScreenName=Some other user has this screen name
|
||||
login.error.duplicateEmail=Some other user has this email address
|
||||
login.error.mismatchPassword=New passwords must match
|
||||
login.error.badPassword=Incorrect password
|
||||
login.error.badAnswer=Incorrect answer
|
||||
login.error.badEmail=Unrecognized email address
|
||||
login.error.bannedEmail=User cannot currently access system
|
||||
login.error.loginFail=Login failed
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
login.userEditPage.title=Profil editieren
|
||||
login.userEditPage.changePasswordLink=Passwort \u00E4ndern
|
||||
login.workspacePage.title=Ihr Arbeitsbereich
|
||||
login.explainCookiesPage.title=Sichern der E-Mail Adresse und des Passworts
|
||||
login.userInfo.logoutLink=Abmelden
|
||||
login.userInfo.editProfileLink=Profil editieren
|
||||
login.userInfo.changePasswordLink=Passwort \u00E4ndern
|
||||
login.userRegistrationForm.title=Anmelden
|
||||
login.userRegistrationForm.email=Ihre E-Mail Adresse:
|
||||
login.userRegistrationForm.screenName=Ihr Spitzname:
|
||||
login.userRegistrationForm.password=Ihr Passwort:
|
||||
login.userRegistrationForm.cookieOption=Diese Anmeldung erinnern?
|
||||
login.userRegistrationForm.explainCookieLink=(Hilfe)
|
||||
login.userRegistrationForm.forgotPasswordLink=Passwort vergessen?
|
||||
login.userRegistrationForm.newUserRegister=Neue Nutzer bitte hier registrieren
|
||||
login.userNewForm.title=Registrieren
|
||||
login.userNewForm.aboutYouSectionHeader=<h3>\u00DCber Sie</h3>
|
||||
login.userNewForm.securitySectionHeader=<h3>Sicherheit</h3>
|
||||
login.userNewForm.securityBlurb=Ein Passwort ist notwendig, um Ihre Identit\u00E4t zu sichern, wenn Sie Beitr\u00E4ge zu den Foren, Fragen & Antworten und anderen Aktivit\u00E4ten auf diesen Seiten erstellen.
|
||||
login.userNewForm.passwordBlurb=Choose a password that contains a mix of uppercase letters, lowercase letters, digits, and other symbols. If you forget your password, our server will help you change it to a new one.
|
||||
login.userNewForm.questionBlurb=We need a customized question and answer so we can make sure only you can change your password.
|
||||
login.changePasswordForm.oldPasswordLabel=Altes Passwort:
|
||||
login.changePasswordForm.newPasswordLabel=Neues Passwort (mindestens {0} Zeichen, keine Leertasten):
|
||||
login.changePasswordForm.confirmPasswordLabel=Passwort best\u00E4tigen:
|
||||
login.changePasswordForm.submit=Absenden
|
||||
login.changePasswordForm.noUserError=KeinBenutzer angemeldet
|
||||
login.changePasswordForm.badPasswordError=Falsches Passwort
|
||||
login.changePasswordForm.mustDifferError=New password must differ from old
|
||||
login.changePasswordForm.mustMatchError=New passwords must match
|
||||
login.changePasswordForm.mailSubject=Your password has been changed
|
||||
login.changePasswordForm.mailBody=Dear {0},\n\nYour password has been changed successfully.\nIf you did not intend to change your password,\nplease reply to this mail and report this problem.
|
||||
login.changePasswordPage.title=Change Password
|
||||
login.recoverPassword.mailSubject=Change your password
|
||||
login.recoverPassword.mailBody=Dear {0},\n\nClick on this URL or paste it into your browser to change your password:\n{1}
|
||||
login.recoverPasswordPage.title=Recover Password
|
||||
login.loginExpiredPage.title=Login Expired
|
||||
login.loginExpiredPage.before=The login page has expired. Please\u0020
|
||||
login.loginExpiredPage.link=login
|
||||
login.loginExpiredPage.after=\u0020again.
|
||||
login.passwordValidation.minLengthError=Password must be at least {0} characters long
|
||||
login.passwordValidation.whitespaceError=Password must not contain whitespace
|
||||
login.passwordValidation.minTypesError=Password must contain {0} of these 4 character types: uppercase letters, lowercase letters, digits, and other symbols
|
||||
login.submit=Submit
|
||||
login.primaryEmail=Email Address:
|
||||
login.additionalEmail=Additional Email:
|
||||
login.firstName=First (Given) Name:
|
||||
login.lastName=Last (Family) Name:
|
||||
login.password=Password (at least {0} characters, no whitespace):
|
||||
login.passwordConfirm=Confirm Password:
|
||||
login.passwordQuestion=Question:
|
||||
login.passwordAnswer=Answer:
|
||||
login.url=Personal Home Page URL:
|
||||
login.screenName=Screen Name:
|
||||
login.bio=Biography:
|
||||
login.error.duplicateScreenName=Some other user has this screen name
|
||||
login.error.duplicateEmail=Some other user has this email address
|
||||
login.error.mismatchPassword=New passwords must match
|
||||
login.error.badPassword=Incorrect password
|
||||
login.error.badAnswer=Incorrect answer
|
||||
login.error.badEmail=Unrecognized email address
|
||||
login.error.bannedEmail=User cannot currently access system
|
||||
login.error.loginFail=Login failed
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
login.userEditPage.title=Edit Profile
|
||||
login.userEditPage.changePasswordLink=Change password
|
||||
login.workspacePage.title=Your workspace
|
||||
login.explainCookiesPage.title=Saving email address and password
|
||||
login.userInfo.logoutLink=Log out
|
||||
login.userInfo.editProfileLink=Edit profile
|
||||
login.userInfo.changePasswordLink=Change password
|
||||
login.userRegistrationForm.title=Log in
|
||||
login.userRegistrationForm.email=Your email address:
|
||||
login.userRegistrationForm.screenName=Your screen name:
|
||||
login.userRegistrationForm.password=Your password:
|
||||
login.userRegistrationForm.cookieOption=Remember this login?
|
||||
login.userRegistrationForm.explainCookieLink=(help)
|
||||
login.userRegistrationForm.forgotPasswordLink=Forgot your password?
|
||||
login.userRegistrationForm.newUserRegister=New users register here
|
||||
login.userNewForm.title=Register
|
||||
login.userNewForm.aboutYouSectionHeader=<h3>About You</h3>
|
||||
login.userNewForm.securitySectionHeader=<h3>Security</h3>
|
||||
login.userNewForm.securityBlurb=We need a password from you to protect your identity as you contribute to the Q&A, discussion forums, and other community activities on this site.
|
||||
login.userNewForm.passwordBlurb=Choose a password that contains a mix of uppercase letters, lowercase letters, digits, and other symbols. If you forget your password, our server will help you change it to a new one.
|
||||
login.userNewForm.questionBlurb=We need a customized question and answer so we can make sure only you can change your password.
|
||||
login.changePasswordForm.oldPasswordLabel=Old Password:
|
||||
login.changePasswordForm.newPasswordLabel=New Password (at least {0} characters, no whitespace):
|
||||
login.changePasswordForm.confirmPasswordLabel=Confirm Password:
|
||||
login.changePasswordForm.submit=Submit
|
||||
login.changePasswordForm.noUserError=User is not logged in
|
||||
login.changePasswordForm.badPasswordError=Incorrect Password
|
||||
login.changePasswordForm.mustDifferError=New password must differ from old
|
||||
login.changePasswordForm.mustMatchError=New passwords must match
|
||||
login.changePasswordForm.mailSubject=Your password has been changed
|
||||
login.changePasswordForm.mailBody=Dear {0},\n\nYour password has been changed successfully.\nIf you did not intend to change your password,\nplease reply to this mail and report this problem.
|
||||
login.changePasswordPage.title=Change Password
|
||||
login.recoverPassword.mailSubject=Change your password
|
||||
login.recoverPassword.mailBody=Dear {0},\n\nClick on this URL or paste it into your browser to change your password:\n{1}
|
||||
login.recoverPasswordPage.title=Recover Password
|
||||
login.loginExpiredPage.title=Login Expired
|
||||
login.loginExpiredPage.before=The login page has expired. Please\u0020
|
||||
login.loginExpiredPage.link=login
|
||||
login.loginExpiredPage.after=\u0020again.
|
||||
login.passwordValidation.minLengthError=Password must be at least {0} characters long
|
||||
login.passwordValidation.whitespaceError=Password must not contain whitespace
|
||||
login.passwordValidation.minTypesError=Password must contain {0} of these 4 character types: uppercase letters, lowercase letters, digits, and other symbols
|
||||
login.submit=Submit
|
||||
login.primaryEmail=Email Address:
|
||||
login.additionalEmail=Additional Email:
|
||||
login.firstName=First (Given) Name:
|
||||
login.lastName=Last (Family) Name:
|
||||
login.password=Password (at least {0} characters, no whitespace):
|
||||
login.passwordConfirm=Confirm Password:
|
||||
login.passwordQuestion=Question:
|
||||
login.passwordAnswer=Answer:
|
||||
login.url=Personal Home Page URL:
|
||||
login.screenName=Screen Name:
|
||||
login.bio=Biography:
|
||||
login.error.duplicateScreenName=Some other user has this screen name
|
||||
login.error.duplicateEmail=Some other user has this email address
|
||||
login.error.mismatchPassword=New passwords must match
|
||||
login.error.badPassword=Incorrect password
|
||||
login.error.badAnswer=Incorrect answer
|
||||
login.error.badEmail=Unrecognized email address
|
||||
login.error.bannedEmail=User cannot currently access system
|
||||
login.error.loginFail=Login failed
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
login.userEditPage.title=Modifier ce profil
|
||||
login.userEditPage.changePasswordLink=Modifier le mot de passe
|
||||
login.workspacePage.title=Votre espace de travail
|
||||
login.explainCookiesPage.title=Enregistrement de l'adresse de messagerie et du mot de passe
|
||||
login.userInfo.logoutLink=Déconnexion
|
||||
login.userInfo.editProfileLink=Modifier ce profil
|
||||
login.userInfo.changePasswordLink=Modifier le mot de passe
|
||||
login.userRegistrationForm.title=Se connecter
|
||||
login.userRegistrationForm.email=Votre adresse de messagerie
|
||||
login.userRegistrationForm.screenName=Votre pseudonyme
|
||||
login.userRegistrationForm.password=Votre mot de passe
|
||||
login.userRegistrationForm.cookieOption=Retenir ce mot de passe?
|
||||
login.userRegistrationForm.explainCookieLink=(aide)
|
||||
login.userRegistrationForm.forgotPasswordLink=Vous avez oublié votre mot de passe?
|
||||
login.userNewForm.title=Créer votre compte
|
||||
login.userNewForm.aboutYouSectionHeader=<h3>A propos de vous</h3>
|
||||
login.userNewForm.securitySectionHeader=<h3>Securité</h3>
|
||||
login.userNewForm.securityBlurb=Merci de nous fournir un mot de passe afin que nous puissions protéger votre indentité lorsque vous participez aux Quiz, aux forum de discussions et aux autres activités communes sur notre site.
|
||||
login.userNewForm.passwordBlurb=Choisissez un mot de passe qui contienne un mélange de majuscules, de minuscules, de chiffres et d'autres caractères. Si vous oubliez votre mot de passe, notre serveur vous aidera à le remplacer par un nouveau
|
||||
login.userNewForm.questionBlurb=Merci de nous indiquer une question (et sa réponse) à laquelle vous seul pouvez répondre pour que nous puission nous assurer que vous serez le seul à pouvoir changer votre mot de passe
|
||||
login.changePasswordForm.oldPasswordLabel=Ancien mot de passe :
|
||||
login.changePasswordForm.newPasswordLabel=Nouveau mot de passe (au moins {0} caractère et pas d'espace):
|
||||
login.changePasswordForm.confirmPasswordLabel=Confirmation du nouveau mot de passe
|
||||
login.changePasswordForm.submit=Soumettre
|
||||
login.changePasswordForm.noUserError=L'utilisateur n'est pas connecté
|
||||
login.changePasswordForm.badPasswordError=Mot de passe erroné
|
||||
login.changePasswordForm.mustDifferError=Le nouveau mot de passe doit être différent de l'ancien
|
||||
login.changePasswordForm.mustMatchError=Le nouveau mot de passe doit être identique dans la zone de confirmation
|
||||
login.changePasswordForm.mailSubject=Votre mot de passe a été modifié
|
||||
login.changePasswordForm.mailBody=Cher {0}, \n\n Votre mot de passe a été modifié avec succès.\nSi vous n'avez pas souhaité changer votre mot de passe,\nmerci de répondre à ce message en faisant part de ce problème.
|
||||
login.changePasswordPage.title=Modifier le mot de passe
|
||||
login.recoverPassword.mailSubject=Modifier votre mot de passe
|
||||
login.recoverPassword.mailBody=Cher {0},\n\nCliquer sur cet URL ou recopiez le dans la barre d'adresse de votre navigateur pour modifier votre mot de passe:\n{1}
|
||||
login.recoverPasswordPage.title=Récupérer le mot de passe
|
||||
login.loginExpiredPage.title=Votre connexion a expiré
|
||||
login.loginExpiredPage.before=La page de connexion a expiré. Merci\u0020
|
||||
login.loginExpiredPage.link=de vous connecter
|
||||
login.loginExpiredPage.after=\u0020à nouveau
|
||||
login.passwordValidation.minLengthError=Le mot de passe doit faire au minimum {0} caractères de long
|
||||
login.passwordValidation.whitespaceError=Le mot de passe ne doit pas contenir d'espace
|
||||
login.passwordValidation.minTypesError=Le mot de passe doit contenir {0} de ces 4 types de caractères : majuscule, minuscule, chiffre ou autre symbole
|
||||
login.submit=Soumettre
|
||||
login.primaryEmail=Adresse de messagerie:
|
||||
login.additionalEmail=Adresse de messagerie supplémentaire
|
||||
login.firstName=Prénom:
|
||||
login.lastName=Nom:
|
||||
login.password=Mot de passe (au moins {0} caractère et pas d'espace):
|
||||
login.passwordConfirm=Confirmation du mot de passe
|
||||
login.passwordQuestion=Question:
|
||||
login.passwordAnswer=Réponse:
|
||||
login.url=URL de votre site web personnel
|
||||
login.screenName=Votre pseudonyme:
|
||||
login.bio=Biographie:
|
||||
login.error.duplicateScreenName=Un autre utilisateur utilise déjà ce pseudonyme
|
||||
login.error.duplicateEmail=Un autre utilisateur nous a déjà donner cette adresse de messagerie
|
||||
login.error.mismatchPassword=Le nouveau mot de passe doit être identique dans la zone de confirmation
|
||||
login.error.badPassword=Mot de passe erroné
|
||||
login.error.badAnswer=Réponse erronée
|
||||
login.error.badEmail=Cette adresse de messagerie est inconnue
|
||||
|
|
@ -92,7 +92,7 @@ public class UserInfo extends SimpleContainer {
|
|||
User user = getUser(state);
|
||||
|
||||
Element userElement = new Element("subsite:userInfo",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
|
||||
// check if Content-Center (CMS Workspace) is installed and
|
||||
// instantiated, if so collect all instantiated workspace apps.
|
||||
|
|
@ -141,7 +141,7 @@ public class UserInfo extends SimpleContainer {
|
|||
Element workspaceURL;
|
||||
Element contentCenters = userElement.newChildElement
|
||||
("subsite:contentCenters",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
|
||||
// step through instantiated workspaces (content-centers)
|
||||
Iterator centers = m_contentCenters.iterator();
|
||||
|
|
@ -154,14 +154,14 @@ public class UserInfo extends SimpleContainer {
|
|||
// Add an Element
|
||||
center = contentCenters.newChildElement
|
||||
("subsite:center",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
|
||||
// Add attribute name = URL without trailing/leading "/"
|
||||
center.addAttribute("name", workspaceInstance.getTitle());
|
||||
|
||||
workspaceURL = center.newChildElement(
|
||||
"subsite:url",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
|
||||
// get URL of Workspace application (instance)
|
||||
final URL url = URL.there(state.getRequest(),
|
||||
|
|
|
|||
|
|
@ -66,18 +66,23 @@ import org.apache.log4j.Logger;
|
|||
* A Bebop form that accepts login and password from the user and attempts
|
||||
* to authenticate and then log in the user.
|
||||
*
|
||||
* Depending on security configuration it may generate a link to a NewUser
|
||||
* registration form, where a new user may register itself. LoginServlet has
|
||||
* to ensure that this page is created appropriately and is available.
|
||||
*
|
||||
* @author Roger Hsueh
|
||||
* @author Michael Bryzek
|
||||
* @author Sameer Ajmani
|
||||
*
|
||||
* @version $Id: UserRegistrationForm.java 1230 2006-06-22 11:50:59Z apevec $
|
||||
* @version $Id: UserLoginForm.java 1230 2006-06-22 11:50:59Z apevec $
|
||||
*/
|
||||
public class UserRegistrationForm extends Form
|
||||
public class UserLoginForm extends Form
|
||||
implements LoginConstants, FormInitListener,
|
||||
FormValidationListener, FormProcessListener {
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(UserRegistrationForm.class);
|
||||
Logger.getLogger(UserLoginForm.class);
|
||||
|
||||
// package friendly static form name makes writing HttpUnitTest easier
|
||||
final static String FORM_NAME = "user-login";
|
||||
private CheckboxGroup m_isPersistent;
|
||||
|
|
@ -88,19 +93,29 @@ public class UserRegistrationForm extends Form
|
|||
private boolean m_autoRegistrationOn;
|
||||
private SecurityConfig securityConfig = SecurityConfig.getConfig();
|
||||
|
||||
public UserRegistrationForm() {
|
||||
/**
|
||||
* Default constructor delegates to a constructor which creates a LoginForm
|
||||
* without a link to a newUserRegistrationForm.
|
||||
*/
|
||||
public UserLoginForm() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public UserRegistrationForm(Container panel) {
|
||||
public UserLoginForm(Container panel) {
|
||||
this(panel, true);
|
||||
}
|
||||
|
||||
public UserRegistrationForm(boolean autoRegistrationOn) {
|
||||
public UserLoginForm(boolean autoRegistrationOn) {
|
||||
this(new BoxPanel(), autoRegistrationOn);
|
||||
}
|
||||
|
||||
public UserRegistrationForm(Container panel, boolean autoRegistrationOn) {
|
||||
/**
|
||||
* Constructor which does the real work, other constructors delegate to it.
|
||||
*
|
||||
* @param panel
|
||||
* @param autoRegistrationOn
|
||||
*/
|
||||
public UserLoginForm(Container panel, boolean autoRegistrationOn) {
|
||||
super(FORM_NAME, panel);
|
||||
|
||||
setMethod(Form.POST);
|
||||
|
|
@ -128,10 +143,8 @@ public class UserRegistrationForm extends Form
|
|||
add(m_password);
|
||||
|
||||
SimpleContainer cookiePanel = new BoxPanel(BoxPanel.HORIZONTAL);
|
||||
m_isPersistent =
|
||||
new CheckboxGroup(FORM_PERSISTENT_LOGIN_P);
|
||||
Label optLabel =
|
||||
new Label(LoginHelper.getMessage(
|
||||
m_isPersistent = new CheckboxGroup(FORM_PERSISTENT_LOGIN_P);
|
||||
Label optLabel = new Label(LoginHelper.getMessage(
|
||||
"login.userRegistrationForm.cookieOption"));
|
||||
Option opt = new Option(FORM_PERSISTENT_LOGIN_P_DEFAULT, optLabel);
|
||||
m_isPersistent.addOption(opt);
|
||||
|
|
@ -139,25 +152,26 @@ public class UserRegistrationForm extends Form
|
|||
m_isPersistent.setOptionSelected(FORM_PERSISTENT_LOGIN_P_DEFAULT);
|
||||
}
|
||||
cookiePanel.add(m_isPersistent);
|
||||
|
||||
cookiePanel.add(new DynamicLink(
|
||||
"login.userRegistrationForm.explainCookieLink",
|
||||
UI.getCookiesExplainPageURL()));
|
||||
LoginServlet.getCookiesExplainPageURL()));
|
||||
add(cookiePanel);
|
||||
|
||||
add(new Submit(SUBMIT), ColumnPanel.CENTER | ColumnPanel.FULL_WIDTH);
|
||||
|
||||
if (securityConfig.getEnableQuestion()) {
|
||||
add(new DynamicLink("login.userRegistrationForm.forgotPasswordLink",
|
||||
UI.getRecoverPasswordPageURL()));
|
||||
LoginServlet.getRecoverPasswordPageURL()));
|
||||
}
|
||||
|
||||
if (m_autoRegistrationOn) {
|
||||
add(new DynamicLink("login.userRegistrationForm.newUserRegister",
|
||||
UI.getNewUserPageURL()));
|
||||
LoginServlet.getNewUserPageURL()));
|
||||
}
|
||||
|
||||
add(new ElementComponent("subsite:promptToEnableCookiesMsg",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI));
|
||||
LoginServlet.SUBSITE_NS_URI));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -166,7 +180,7 @@ public class UserRegistrationForm extends Form
|
|||
private void setupLogin() {
|
||||
SimpleContainer loginMessage =
|
||||
new SimpleContainer("subsite:loginPromptMsg",
|
||||
SubsiteDispatcher.SUBSITE_NS_URI);
|
||||
LoginServlet.SUBSITE_NS_URI);
|
||||
|
||||
|
||||
if (KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
|
|
@ -236,10 +250,7 @@ public class UserRegistrationForm extends Form
|
|||
} catch (CredentialException e) {
|
||||
s_log.info("Invalid credential");
|
||||
|
||||
//final String path = LegacyInitializer.getFullURL
|
||||
// (LegacyInitializer.EXPIRED_PAGE_KEY, state.getRequest());
|
||||
final String path = UI.getLoginExpiredPageURL();
|
||||
|
||||
final String path = LoginServlet.getLoginExpiredPageURL();
|
||||
final URL url = com.arsdigita.web.URL.there(state.getRequest(),
|
||||
path);
|
||||
|
||||
|
|
@ -386,20 +397,42 @@ public class UserRegistrationForm extends Form
|
|||
**/
|
||||
protected boolean getPersistentLoginValue(PageState state,
|
||||
boolean defaultValue) {
|
||||
// CheckboxGroup gets you a StringArray
|
||||
String[] values = (String[]) m_isPersistent.getValue(state);
|
||||
if (values == null) {
|
||||
// Problem:
|
||||
// getValue(state) returns an Object of type StringArray, if the
|
||||
// Checkbox is marked.
|
||||
// It returns an object of type String if it is not marked / left empty.
|
||||
// Additionally, in some circumstances it may return null
|
||||
// ODD!!
|
||||
|
||||
Object persistentLoginValue = m_isPersistent.getValue(state);
|
||||
|
||||
String[] values;
|
||||
String value;
|
||||
|
||||
if (persistentLoginValue == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
String persistentLoginValue = (String) values[0];
|
||||
return "1".equals(persistentLoginValue);
|
||||
if (persistentLoginValue instanceof String[]) {
|
||||
values = (String[]) persistentLoginValue;
|
||||
return "1".equals(values[0]);
|
||||
}
|
||||
|
||||
if (persistentLoginValue instanceof String) {
|
||||
value = (String) persistentLoginValue;
|
||||
return "1".equals(value);
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
protected void redirectToNewUserPage(PageState state) {
|
||||
// String url = LegacyInitializer.getFullURL
|
||||
// (LegacyInitializer.NEWUSER_PAGE_KEY, state.getRequest());
|
||||
String url = UI.getNewUserPageURL();
|
||||
|
||||
String url = LoginServlet.getNewUserPageURL();
|
||||
|
||||
ParameterMap map = new ParameterMap();
|
||||
map.setParameter(LoginHelper.RETURN_URL_PARAM_NAME,
|
||||
|
|
@ -409,9 +442,12 @@ public class UserRegistrationForm extends Form
|
|||
map.setParameter(FORM_EMAIL,
|
||||
m_loginName.getValue(state));
|
||||
|
||||
final URL dest = com.arsdigita.web.URL.there(
|
||||
state.getRequest(), url, map);
|
||||
final URL dest = com.arsdigita.web.URL.there(state.getRequest(),
|
||||
url,
|
||||
map);
|
||||
|
||||
throw new RedirectSignal(dest, true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -793,7 +793,7 @@ public class Application extends Resource {
|
|||
* NOTE: According to Servlet API the path always starts with a leading '/'
|
||||
* and includes either the servlet name or a path to the servlet, but does
|
||||
* not include any extra path information or a query string. Returns an
|
||||
* empry string ("") is the servlet used was matched using the "/*" pattern.
|
||||
* empty string ("") is the servlet used was matched using the "/*" pattern.
|
||||
*
|
||||
* @return path name to the applications servlet/JSP
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="../../../packages/acs-admin/xsl/admin_en.xsl"/>
|
||||
<xsl:import href="../../../packages/admin/xsl/admin_en.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="../../../packages/login/xsl/login_en.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -5,11 +5,11 @@
|
|||
<!ENTITY copy "©" >
|
||||
]>
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:subsite="http://www.arsdigita.com/subsite/1.0"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0">
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="../../bebop/xsl/bebop.xsl"/>
|
||||
<xsl:import href="../../ui/xsl/ui.xsl"/>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ query ItemsInFolder {
|
|||
cms_items i,
|
||||
cms_folders f
|
||||
where
|
||||
i.item_id = f.folder_id(+)
|
||||
i.item_id = f.folder_id
|
||||
and i.parent_id = iif.item_id
|
||||
and i.version = :version
|
||||
and (exists (select 1 from cms_folders f where f.folder_id = i.item_id)
|
||||
|
|
@ -57,31 +57,24 @@ query ItemsInFolder {
|
|||
)
|
||||
and f.folder_id is null
|
||||
) as cnti,
|
||||
nvl2(pi.type_id, (
|
||||
select nvl(d.description, l.description)
|
||||
from cms_items i, cms_documents d, cms_doc_links l
|
||||
where
|
||||
i.item_id = pi.item_id
|
||||
and i.item_id = d.doc_id(+)
|
||||
and i.item_id = l.link_id(+)
|
||||
),
|
||||
|
||||
(select description from cms_doc_folders where doc_id = iif.item_id)
|
||||
) as description,
|
||||
(select dbms_lob.getLength(f.content)
|
||||
as description,
|
||||
(select f.length
|
||||
from cms_documents d, cms_files f
|
||||
where pi.item_id = d.doc_id(+) and f.file_id = d.asset_id) as length,
|
||||
where pi.item_id = d.doc_id and f.file_id = d.asset_id) as length,
|
||||
(select m.label
|
||||
from cms_documents d, cms_assets a, cms_mime_types m
|
||||
where pi.item_id = d.doc_id(+) and a.asset_id = d.asset_id and m.mime_type = a.mime_type
|
||||
where pi.item_id = d.doc_id and a.asset_id = d.asset_id and m.mime_type = a.mime_type
|
||||
) as mime_type,
|
||||
(select d.last_modified_cached from cms_documents d where pi.item_id = d.doc_id(+)) as modified
|
||||
(select d.last_modified_cached from cms_documents d where pi.item_id = d.doc_id) as modified
|
||||
from (
|
||||
select
|
||||
a.object_type, a.display_name, a.default_domain_class,
|
||||
i.master_id, i.item_id, i.parent_id, i.version, i.name,
|
||||
case when exists (select 1 from cms_items where master_id = i.item_id)
|
||||
then 1 else 0 end as has_live_version,
|
||||
case when 0 = nvl(f.folder_id, 0) then 0 else 1 end as is_folder,
|
||||
case when 0 = COALESCE(f.folder_id, 0) then 0 else 1 end as is_folder,
|
||||
f.label
|
||||
from
|
||||
cms_items i,
|
||||
|
|
@ -90,7 +83,7 @@ query ItemsInFolder {
|
|||
where
|
||||
i.item_id = a.object_id
|
||||
and
|
||||
i.item_id = f.folder_id(+)
|
||||
i.item_id = f.folder_id
|
||||
and
|
||||
i.parent_id = :parent
|
||||
and
|
||||
|
|
@ -108,11 +101,11 @@ query ItemsInFolder {
|
|||
i.parent_id = b.bundle_id
|
||||
and i.language = b.default_language
|
||||
and p.item_id = i.item_id
|
||||
and i.item_id = d.doc_id(+)
|
||||
and i.item_id = l.link_id(+)
|
||||
and i.item_id = d.doc_id
|
||||
and i.item_id = l.link_id
|
||||
) pi
|
||||
where
|
||||
iif.item_id = pi.bundle_id(+)
|
||||
iif.item_id = pi.bundle_id
|
||||
} map {
|
||||
item.id = iif.item_id;
|
||||
item.objectType = iif.object_type;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.arsdigita.util.UncheckedWrapperException;
|
|||
|
||||
public class DocFolder extends Folder implements Resource {
|
||||
|
||||
/** Private Logger instance for debugging purpose. */
|
||||
private final static org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(DocFolder.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,39 +31,55 @@ public final class DocMgrConfig extends AbstractConfig {
|
|||
|
||||
private static final Logger s_log = Logger.getLogger(DocMgrConfig.class);
|
||||
|
||||
private Parameter m_contentSection;
|
||||
private Parameter m_legacyFolderName;
|
||||
private Parameter m_internalGroupID;
|
||||
private Parameter m_rowsPerPage;
|
||||
private Parameter m_legacyFolderID;
|
||||
/** Private Object to hold one's own instance to return to users. */
|
||||
private static DocMgrConfig s_config;
|
||||
|
||||
public DocMgrConfig() {
|
||||
/**
|
||||
* Returns the singleton configuration record for DocMgr
|
||||
*
|
||||
* @return The <code>DocMgrConfig</code> record; it cannot be null
|
||||
*/
|
||||
public static synchronized DocMgrConfig getInstance() {
|
||||
if (s_config == null) {
|
||||
s_config = new DocMgrConfig();
|
||||
s_config.load();
|
||||
}
|
||||
|
||||
m_contentSection = new StringParameter
|
||||
return s_config;
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Parameter Sektion
|
||||
|
||||
private Parameter m_contentSection = new StringParameter
|
||||
("com.arsdigita.cms.docmgr.content_section",
|
||||
Parameter.REQUIRED,
|
||||
"content");
|
||||
|
||||
m_legacyFolderName = new StringParameter
|
||||
private Parameter m_legacyFolderName = new StringParameter
|
||||
("com.arsdigita.cms.docmgr.legacy_folder_name",
|
||||
Parameter.REQUIRED,
|
||||
"legacy");
|
||||
|
||||
m_legacyFolderID = new IntegerParameter
|
||||
private Parameter m_legacyFolderID = new IntegerParameter
|
||||
("com.arsdigita.cms.docmgr.legacy_folder_id",
|
||||
Parameter.REQUIRED,
|
||||
"-200");
|
||||
|
||||
|
||||
m_internalGroupID = new IntegerParameter
|
||||
-200);
|
||||
private Parameter m_internalGroupID = new IntegerParameter
|
||||
("com.arsdigita.cms.docmgr.internal_group_id",
|
||||
Parameter.REQUIRED,
|
||||
"-200");
|
||||
|
||||
m_rowsPerPage = new IntegerParameter
|
||||
-200);
|
||||
private Parameter m_rowsPerPage = new IntegerParameter
|
||||
("com.arsdigita.cms.docmgr.rows_per_page",
|
||||
Parameter.OPTIONAL,
|
||||
"20");
|
||||
20);
|
||||
|
||||
/**
|
||||
* Constructor registers Parameters and reads repository file if exist.
|
||||
*
|
||||
* Do NOT instantiate this class directly using its constructor but use
|
||||
* the provided getDocMgrConfig method above.
|
||||
*/
|
||||
public DocMgrConfig() {
|
||||
|
||||
register(m_contentSection);
|
||||
register(m_legacyFolderName);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.arsdigita.loader.PackageLoader;
|
|||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.portal.PortletType;
|
||||
import com.arsdigita.portal.apportlet.AppPortletSetup;
|
||||
import com.arsdigita.portal.apportlet.AppPortletType;
|
||||
import com.arsdigita.runtime.ScriptContext;
|
||||
import com.arsdigita.web.ApplicationSetup;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
|
|
@ -129,7 +130,7 @@ public class Loader extends PackageLoader {
|
|||
// formerly setupDocs()
|
||||
private ApplicationType loadDocRepositoryApplicationType() {
|
||||
|
||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
/* ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setKey("cmsdocs");
|
||||
setup.setTitle("Document Manager (CMS) Application");
|
||||
|
|
@ -145,6 +146,14 @@ public class Loader extends PackageLoader {
|
|||
});
|
||||
|
||||
return setup.run();
|
||||
*/
|
||||
/* Create new type legacy compatible application type */
|
||||
ApplicationType type = ApplicationType
|
||||
.createApplicationType("cmsdocs",
|
||||
"DocRepo",
|
||||
Repository.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher");
|
||||
type.setDescription("The document manager empowers users to share documents.");
|
||||
|
||||
|
||||
/* Legacy free initialization
|
||||
|
|
@ -162,10 +171,11 @@ public class Loader extends PackageLoader {
|
|||
// type.setDescription
|
||||
// ("The document repository empowers users to share documents.");
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
private ApplicationType setupCategoryBrowsing() {
|
||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
/* ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
setup.setApplicationObjectType(DocumentCategoryBrowserApplication
|
||||
.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setKey("cmsdocs-categories");
|
||||
|
|
@ -181,10 +191,20 @@ public class Loader extends PackageLoader {
|
|||
}
|
||||
});
|
||||
return setup.run();
|
||||
*/
|
||||
/* Create new type legacy compatible application type */
|
||||
ApplicationType type = ApplicationType
|
||||
.createApplicationType("cmsdocs-categories",
|
||||
"Browse Documents Application",
|
||||
DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher");
|
||||
type.setDescription("Browse documents by category.");
|
||||
|
||||
return type;
|
||||
|
||||
}
|
||||
private ApplicationType setupLegacyCategoryBrowsing() {
|
||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
/* ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
setup.setApplicationObjectType(LegacyCategoryBrowserApplication
|
||||
.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setKey("cmsdocs-categories-legacy");
|
||||
|
|
@ -200,6 +220,16 @@ public class Loader extends PackageLoader {
|
|||
}
|
||||
});
|
||||
return setup.run();
|
||||
*/
|
||||
/* Create new type legacy compatible application type */
|
||||
ApplicationType type = ApplicationType
|
||||
.createApplicationType("cmsdocs-categories-legacy",
|
||||
"Taxonomy Browser",
|
||||
LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher");
|
||||
type.setDescription("Browse documents by category.");
|
||||
|
||||
return type;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +276,7 @@ public class Loader extends PackageLoader {
|
|||
private void setupDocRepositoryPortlet(ApplicationType provider) {
|
||||
|
||||
// Create the document repository portlet
|
||||
AppPortletSetup setup = new AppPortletSetup(s_log);
|
||||
/* AppPortletSetup setup = new AppPortletSetup(s_log);
|
||||
|
||||
setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setTitle("Recently Updated Documents");
|
||||
|
|
@ -263,6 +293,16 @@ public class Loader extends PackageLoader {
|
|||
});
|
||||
|
||||
setup.run();
|
||||
*/
|
||||
AppPortletType type = AppPortletType.createAppPortletType(
|
||||
"Portal Bookmarks",
|
||||
PortletType.NARROW_PROFILE,
|
||||
RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
// type.setProviderApplicationType(provider);
|
||||
type.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription(
|
||||
"Displays the most recent documents in the document repository.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
|
||||
public class Repository extends Application {
|
||||
|
||||
private static Logger s_log =
|
||||
Logger.getLogger(Repository.class);
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.docmgr.Repository";
|
||||
|
||||
|
|
@ -57,9 +61,6 @@ public class Repository extends Application {
|
|||
return BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
|
||||
private static Logger s_log =
|
||||
Logger.getLogger(Repository.class);
|
||||
|
||||
// pdl constants
|
||||
public static final String OWNER = "ownerID";
|
||||
public static final String ROOT = "rootID";
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public class DocLinkInitializer extends ContentTypeInitializer {
|
|||
super("empty.pdl.mf", DocLink.BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/DocLink.xml";
|
||||
}
|
||||
|
|
@ -41,8 +42,10 @@ public class DocLinkInitializer extends ContentTypeInitializer {
|
|||
*
|
||||
* @return fully qualified path info string relative to document root
|
||||
*/
|
||||
@Override
|
||||
public String[] getStylesheets() {
|
||||
return new String[] {
|
||||
"/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" };
|
||||
"/themes/heirloom/contenttypes/DMDocLink.xsl" };
|
||||
// "/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public class DocumentInitializer extends ContentTypeInitializer {
|
|||
super("ccm-docmgr.pdl.mf", Document.BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/Document.xml";
|
||||
}
|
||||
|
|
@ -34,8 +35,10 @@ public class DocumentInitializer extends ContentTypeInitializer {
|
|||
*
|
||||
* @return fully qualified path info string reltive to document (context) root
|
||||
*/
|
||||
@Override
|
||||
public String[] getStylesheets() {
|
||||
return new String[] {
|
||||
"/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" };
|
||||
"/themes/heirloom/contenttypes/DMDocument.xsl" };
|
||||
// "/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,9 +50,11 @@ import com.arsdigita.web.ApplicationType;
|
|||
*
|
||||
* @version $Revision: #11 $ $Date: 2004/01/14 $
|
||||
*/
|
||||
|
||||
public class Initializer extends CompoundInitializer {
|
||||
|
||||
/** Private Logger instance for debugging purpose. */
|
||||
private static Logger s_log = Logger.getLogger(Initializer.class);
|
||||
|
||||
// private Configuration m_conf = new Configuration();
|
||||
|
||||
private static final String SEPARATOR = java.io.File.separator;
|
||||
|
|
@ -65,9 +67,9 @@ public class Initializer extends CompoundInitializer {
|
|||
public static final String INTERNAL_GROUP_ID = "internalGroupID";
|
||||
public static final String LEGACY_FOLDER_NAME = "legacyFolderName";
|
||||
|
||||
private static Logger s_log =
|
||||
Logger.getLogger(Initializer.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Initializer() {
|
||||
}
|
||||
|
||||
|
|
@ -78,11 +80,55 @@ public class Initializer extends CompoundInitializer {
|
|||
// return m_conf;
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
@Override
|
||||
public void init(DomainInitEvent e) {
|
||||
s_log.debug("Document (CCM) Manager is Domain initializing ... ");
|
||||
|
||||
setupDomainFactory();
|
||||
/* Register REPOSITORY application type.*/
|
||||
e.getFactory().registerInstantiator(
|
||||
Repository.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new Repository(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
/* Register Portlet DocumentBrowser. */
|
||||
e.getFactory().registerInstantiator(
|
||||
RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE,
|
||||
new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new RecentUpdatedDocsPortlet(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
/* Set up domain object factories for basic document manager
|
||||
* object types. */
|
||||
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new Document(dataObject);
|
||||
}
|
||||
}
|
||||
);
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new DocFolder(dataObject);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
startup();
|
||||
}
|
||||
|
||||
|
|
@ -98,15 +144,15 @@ public class Initializer extends CompoundInitializer {
|
|||
.getTransactionContext();
|
||||
txn.beginTxn();
|
||||
|
||||
ApplicationType docsAppType = setupDocs();
|
||||
setupDocManagerPortlet(docsAppType);
|
||||
// ApplicationType docsAppType = setupDocs();
|
||||
// setupDocManagerPortlet(docsAppType);
|
||||
|
||||
ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing();
|
||||
setupCategoryDocsPortlet(categoryBrowseDocsAppType);
|
||||
// ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing();
|
||||
// setupCategoryDocsPortlet(categoryBrowseDocsAppType);
|
||||
|
||||
ApplicationType legacyCategoryBrowseDocsAppType =
|
||||
setupLegacyCategoryBrowsing();
|
||||
setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType);
|
||||
// ApplicationType legacyCategoryBrowseDocsAppType =
|
||||
// setupLegacyCategoryBrowsing();
|
||||
// setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType);
|
||||
|
||||
// de-activate search for now
|
||||
//SearchUtils.setSearcher
|
||||
|
|
@ -240,28 +286,6 @@ public class Initializer extends CompoundInitializer {
|
|||
setup.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up domain object factories for basic document manager
|
||||
* object types.
|
||||
*/
|
||||
private void setupDomainFactory() {
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new Document(dataObject);
|
||||
}
|
||||
}
|
||||
);
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new DocFolder(dataObject);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown the document manager.
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ class FolderTable extends Table implements TableActionListener, DMConstants {
|
|||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(PageState s, Element p) {
|
||||
long start = System.currentTimeMillis();
|
||||
super.generateXML(s, p);
|
||||
|
|
@ -117,6 +118,7 @@ class FolderTable extends Table implements TableActionListener, DMConstants {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
p.addComponentStateParam(this, m_sources);
|
||||
|
|
@ -305,11 +307,17 @@ class FolderTable extends Table implements TableActionListener, DMConstants {
|
|||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder {
|
||||
|
||||
private final static Logger s_log = Logger.getLogger(FolderTableModelBuilder.class);
|
||||
private final static Logger s_log =
|
||||
Logger.getLogger(FolderTableModelBuilder.class);
|
||||
|
||||
public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("MMMMMMMMMMM d, yyyy");
|
||||
public static final SimpleDateFormat dateFormatter = new
|
||||
SimpleDateFormat("MMMMMMMMMMM d, yyyy");
|
||||
|
||||
private Tree m_tree;
|
||||
private FolderContentsTableForm m_parent;
|
||||
|
|
@ -361,7 +369,8 @@ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder
|
|||
|
||||
Folder parentFolder = new Folder(folderID);
|
||||
|
||||
m_collection = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.docmgr.ui.ItemsInFolder");
|
||||
m_collection = SessionManager.getSession().retrieveQuery(
|
||||
"com.arsdigita.cms.docmgr.ui.ItemsInFolder");
|
||||
m_collection.setParameter(Folder.PARENT, folderID);
|
||||
m_collection.setParameter(Folder.VERSION, parentFolder.getVersion());
|
||||
m_collection.addOrder("isFolder desc");
|
||||
|
|
@ -375,24 +384,34 @@ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder
|
|||
m_parent.hideEmptyLabel(state);
|
||||
}
|
||||
|
||||
int maxPages = (int) (size / m_rowsPerPage) + (size % m_rowsPerPage > 0 ? 1 : 0);
|
||||
int maxPages = (int) (size / m_rowsPerPage)
|
||||
+ (size % m_rowsPerPage > 0 ? 1 : 0);
|
||||
Integer pn = (Integer) state.getValue(m_parent.getPageNoParameter());
|
||||
int pageNo = (pn == null ? 0 : pn.intValue());
|
||||
int firstRowNo = ((int) (pageNo * m_rowsPerPage)) + 1;
|
||||
int lastRowNo = firstRowNo + m_rowsPerPage;
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("items count:" + size + "; items per page:" + m_rowsPerPage + "; max pages:" + maxPages +
|
||||
"; pageNo:" + pageNo + "; first row no:" + firstRowNo + "; last row no:" + lastRowNo);
|
||||
s_log.debug("items count:" + size + "; items per page:" +
|
||||
m_rowsPerPage + "; max pages:" + maxPages +
|
||||
"; pageNo:" + pageNo + "; first row no:" +
|
||||
firstRowNo + "; last row no:" + lastRowNo);
|
||||
}
|
||||
m_collection.setRange(new Integer(firstRowNo), new Integer(lastRowNo));
|
||||
|
||||
m_typeIdDocument = ContentType.findByAssociatedObjectType(Document.TYPE).getID();
|
||||
m_typeIdDocLink = ContentType.findByAssociatedObjectType(DocLink.TYPE).getID();
|
||||
m_typeIdDocFolder = ContentType.findByAssociatedObjectType(DocFolder.TYPE).getID();
|
||||
m_typeIdDocument = ContentType.findByAssociatedObjectType(
|
||||
Document.TYPE).getID();
|
||||
m_typeIdDocLink = ContentType.findByAssociatedObjectType(
|
||||
DocLink.TYPE).getID();
|
||||
m_typeIdDocFolder = ContentType.findByAssociatedObjectType(
|
||||
DocFolder.TYPE).getID();
|
||||
|
||||
m_user = Web.getContext().getUser();
|
||||
Application app = Web.getContext().getApplication();
|
||||
m_isManager = PermissionService.checkPermission(new PermissionDescriptor(PrivilegeDescriptor.ADMIN, app, m_user));
|
||||
m_isManager = PermissionService.checkPermission(new
|
||||
PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
||||
app,
|
||||
m_user)
|
||||
);
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
|
|
@ -439,7 +458,9 @@ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder
|
|||
}
|
||||
else if (isLink) {
|
||||
Repository rep = ((Document) resource).getRepository();
|
||||
String path = Web.getConfig().getDispatcherContextPath() + rep.getPath() + "/file?" + FILE_ID_PARAM_NAME + "="
|
||||
String path = Web.getConfig().getDispatcherContextPath()
|
||||
+ rep.getPath() + "/file?"
|
||||
+ FILE_ID_PARAM_NAME + "="
|
||||
+ resource.getID();
|
||||
Link l = new Link((String) resource.getTitle(), path);
|
||||
link.add(l);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:portal="http://www.uk.arsdigita.com/portal/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="../../../packages/docmgr/xsl/docs.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE stylesheet [
|
||||
<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
|
||||
]>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
version="1.0">
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE stylesheet [
|
||||
<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
|
||||
]>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
version="1.0">
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:forum="http://www.arsdigita.com/forum/1.0"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:portlet="http://www.uk.arsdigita.com/portlet/1.0"
|
||||
xmlns:portalserver="http://www.redhat.com/portalserver/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:output method="html"/>
|
||||
|
||||
<xsl:template match="bebop:portlet[@bebop:classname='com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet' and //bebop:page/@id='viewWorkspace']">
|
||||
<H3><xsl:value-of select="@title" /></H3>
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:portlet[@bebop:classname='com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortletRenderer' and //bebop:page/@id='viewWorkspace']">
|
||||
<xsl:choose>
|
||||
<xsl:when test="(../@style='W') or
|
||||
((../@style='WN') and (@cellNumber='1')) or
|
||||
((../@style='NW') and (@cellNumber='2')) or
|
||||
((../@style='WN') and (@cellNumber='3')) or
|
||||
((../@style='NWN') and (@cellNumber='2')) or
|
||||
((../@style='NNN') and (@cellNumber='1'))">
|
||||
<H3><xsl:value-of select="@title" /></H3>
|
||||
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tr>
|
||||
<td class="bglight"><b>5 Most Recent Items</b></td>
|
||||
<td width="100" align="right" class="bglight"><b>Size</b></td>
|
||||
<td width="100" align="right" class="bglight"><b>Modified</b></td>
|
||||
</tr>
|
||||
|
||||
<xsl:for-each select="descendant-or-self::bebop:tbody/bebop:trow">
|
||||
<xsl:if test="position()<='5'">
|
||||
<tr>
|
||||
<td class="bglight">
|
||||
<a href="{./bebop:cell[6]/bebop:link/@href}" title="Download this document"><xsl:value-of select="./bebop:cell[1]/bebop:link/bebop:label" /></a>
|
||||
</td>
|
||||
<td width="100" align="right" class="bglight">
|
||||
<xsl:apply-templates select="./bebop:cell[3]"/>
|
||||
</td>
|
||||
<td width="100" align="right" class="bglight">
|
||||
<xsl:call-template name="docmgrDate">
|
||||
<xsl:with-param name="date" select="./bebop:cell[5]/bebop:label" />
|
||||
</xsl:call-template>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:if test="contains(descendant-or-self::bebop:link[@class='actionLink']/bebop:label, 'New Document')">
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<a href="{./bebop:gridPanel/bebop:panelRow[1]/bebop:cell/bebop:link[@class='actionLink']/@href}">add a document</a>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<a href="{@applicationlink}">view all documents</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
||||
<H3><xsl:value-of select="@title" /></H3>
|
||||
<p>5 Most Recent Items</p>
|
||||
<ul>
|
||||
|
||||
<xsl:for-each select="descendant-or-self::bebop:tbody/bebop:trow">
|
||||
<xsl:if test="position()<='5'">
|
||||
<li>
|
||||
<a href="{./bebop:cell[6]/bebop:link/@href}" title="Download this document"><xsl:value-of select="./bebop:cell[1]/bebop:link/bebop:label" /></a>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
|
||||
</ul>
|
||||
|
||||
<xsl:if test="contains(descendant-or-self::bebop:link[@class='actionLink']/bebop:label, 'New Document')">
|
||||
<div>
|
||||
<a href="{./bebop:gridPanel/bebop:panelRow[1]/bebop:cell/bebop:link[@class='actionLink']/@href}">add a document</a>
|
||||
</div>
|
||||
</xsl:if>
|
||||
|
||||
<div>
|
||||
<a href="{@applicationlink}">view all documents</a>
|
||||
</div>
|
||||
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="docmgrDate">
|
||||
<xsl:param name="date" />
|
||||
|
||||
<xsl:if test="string($date)!='null'">
|
||||
<xsl:if test="string-length($date)!='0'">
|
||||
|
||||
<!-- Day -->
|
||||
<xsl:variable name="day-month" select="substring-before($date, '/0')"/>
|
||||
<xsl:variable name="day" select="substring-after($day-month, '/')"/>
|
||||
<xsl:variable name="month" select="substring-before($day-month, '/')"/>
|
||||
<xsl:variable name="year" select="substring-after($date, '/0')"/>
|
||||
|
||||
<xsl:if test="string-length($day)='1'">
|
||||
<xsl:text>0</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="$day" />
|
||||
<xsl:text>-</xsl:text>
|
||||
|
||||
<!-- Month -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$month='1'">01</xsl:when>
|
||||
<xsl:when test="$month='2'">02</xsl:when>
|
||||
<xsl:when test="$month='3'">03</xsl:when>
|
||||
<xsl:when test="$month='4'">04</xsl:when>
|
||||
<xsl:when test="$month='5'">05</xsl:when>
|
||||
<xsl:when test="$month='6'">06</xsl:when>
|
||||
<xsl:when test="$month='7'">07</xsl:when>
|
||||
<xsl:when test="$month='8'">08</xsl:when>
|
||||
<xsl:when test="$month='9'">09</xsl:when>
|
||||
<xsl:when test="$month='10'">10</xsl:when>
|
||||
<xsl:when test="$month='11'">11</xsl:when>
|
||||
<xsl:when test="$month='12'">12</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose><xsl:text>-</xsl:text>200<xsl:value-of select="substring($year, 1, 2 )" />
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -0,0 +1,598 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
xmlns:admin="http://www.arsdigita.com/admin-ui/1.0"
|
||||
xmlns:docs="http://www.redhat.com/docs/1.0">
|
||||
|
||||
|
||||
<xsl:import href="../../cms/xsl/cms.xsl"/>
|
||||
<xsl:import href="../../acs-admin/xsl/admin_en.xsl"/>
|
||||
<xsl:import href="../../categorization/xsl/categorization.xsl"/>
|
||||
<xsl:import href="../../bebop/xsl/DimensionalNavbar.xsl"/>
|
||||
<xsl:import href="../../toolbox/xsl/ControlBar.xsl"/>
|
||||
|
||||
<xsl:output method="html" indent="yes"/>
|
||||
|
||||
<xsl:param name="internal-theme"/>
|
||||
|
||||
|
||||
<xsl:template match="bebop:page[@class='DOCS']"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0">
|
||||
<html>
|
||||
<head>
|
||||
<title><xsl:value-of select="bebop:title"/></title>
|
||||
<!--
|
||||
<link href="/css/acs-master.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/packages/portalserver/www/css/portalserver.css" rel="stylesheet" type="text/css"/>
|
||||
<style type="text/css">
|
||||
BODY { background: white; color: black}
|
||||
.main {background-color: #ffffff;}
|
||||
table.globalHeader { background-color: rgb(225,225,225);}
|
||||
table.bottomRule { background: rgb(162,30,30);}
|
||||
table.topRuleNoTabs { background: rgb(162,30,30);}
|
||||
table.topRuleUnderTabs { background: rgb(162,30,30);}
|
||||
</style>
|
||||
-->
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="{$internal-theme}/css/acs-master.css" />
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="{$internal-theme}/packages/cms/xml/admin/cms-admin.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<xsl:apply-templates select="docs:header"/>
|
||||
<xsl:apply-templates select="docs:body"/>
|
||||
<xsl:apply-templates select="docs:footer"/>
|
||||
<xsl:apply-templates select="bebop:structure"/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- ContextBar formatting -->
|
||||
<xsl:template match="bebop:boxPanel[@class='ContextBar']">
|
||||
<xsl:apply-imports/>
|
||||
<hr />
|
||||
</xsl:template>
|
||||
|
||||
<!-- Table with alternate color for each column. -->
|
||||
<xsl:template match="bebop:table[@class='AlternateTable']"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0">
|
||||
<table>
|
||||
<xsl:for-each select="@*">
|
||||
<xsl:attribute name="{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:for-each>
|
||||
<xsl:apply-templates select="bebop:thead"/>
|
||||
<xsl:for-each select="bebop:tbody">
|
||||
<xsl:call-template name="AlternateTableBody"/>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="AlternateTableBody"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0">
|
||||
<tbody>
|
||||
<xsl:for-each select="bebop:trow">
|
||||
<tr>
|
||||
<xsl:attribute name="bgcolor">
|
||||
<xsl:choose>
|
||||
<xsl:when test="position() mod 2">#e1d5b0</xsl:when>
|
||||
<xsl:otherwise>#ffffff</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:for-each select="bebop:cell">
|
||||
<td>
|
||||
<xsl:for-each select="@align|@valign|@colspan|@width">
|
||||
<xsl:attribute name="{local-name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:for-each>
|
||||
<xsl:apply-templates/>
|
||||
</td>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:label[@class='isFile']">
|
||||
<img src="{$internal-theme}/images/file.gif" border="0">
|
||||
<xsl:attribute name="alt">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:label[@class='isFolder']">
|
||||
<img src="{$internal-theme}/images/folder.gif" border="0">
|
||||
<xsl:attribute name="alt">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="write-node">
|
||||
<xsl:param name="node"/>
|
||||
<xsl:param name="total-indent"/>
|
||||
<xsl:param name="level-indent">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:param>
|
||||
<xsl:for-each select="$node">
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(./bebop:label[@weight='b'])>0">split_pane_left_item_selected</xsl:when>
|
||||
<xsl:otherwise>split_pane_left_item</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of disable-output-escaping="yes" select="$total-indent"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="@collapsed='t'">
|
||||
<a href="{@href}">
|
||||
<img alt="Expand" border="0" height="11" width="11">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="//@assets"/>{$internal-theme}/images/plus-box.gif</xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:when test="@expanded='t'">
|
||||
<a href="{@href}">
|
||||
<img alt="Collapse" border="0" height="11" width="11">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="//@assets"/>{$internal-theme}/images/minus-box.gif</xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:when test="@radioGroup='t'">
|
||||
<input type="radio">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="@radioGroupName"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="value">
|
||||
<xsl:value-of select="@resourceID"/>
|
||||
</xsl:attribute>
|
||||
</input>
|
||||
<img alt="folder" border="0" height="24" width="24">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="//@assets"/>{$internal-theme}/images/folder.gif</xsl:attribute>
|
||||
</img>
|
||||
</xsl:when>
|
||||
<xsl:when test="@radioGroup='f'">
|
||||
<xsl:text>    
|
||||
</xsl:text>
|
||||
<img alt="folder" border="0" height="24" width="24">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="//@assets"/>{$internal-theme}/images/folder.gif</xsl:attribute>
|
||||
</img>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="*[position()=1]"/>
|
||||
</td>
|
||||
</tr>
|
||||
<xsl:for-each select="bebop:t_node">
|
||||
<xsl:call-template name="write-node">
|
||||
<xsl:with-param name="node" select="."/>
|
||||
<xsl:with-param name="total-indent">
|
||||
<xsl:copy-of select="$total-indent"/>
|
||||
<xsl:copy-of select="$level-indent"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- This adds a little space each time we move up in the hierarchy. -->
|
||||
<xsl:if test="count(bebop:t_node)>0">
|
||||
<tr>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td height="2"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="docs:error-label"
|
||||
xmlns:docs="http://www.arsdigita.com/docs/1.0">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@action='copy'">
|
||||
Unable to copy on following items.
|
||||
</xsl:when>
|
||||
<xsl:when test="@action='move'">
|
||||
Unable to move on following items.
|
||||
</xsl:when>
|
||||
<xsl:when test="@action='delete'">
|
||||
Unable to delete on following items.
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<ul>
|
||||
<xsl:for-each select="docs:item">
|
||||
<li><b><xsl:value-of select="@name"/></b></li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="docs:file-info">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Name:</td>
|
||||
<td><xsl:value-of select="docs:name"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description:</td>
|
||||
<td><xsl:value-of select="docs:description"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Size:</td>
|
||||
<td><xsl:value-of select="docs:size"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type:</td>
|
||||
<td><xsl:value-of select="docs:type"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Modified:</td>
|
||||
<td><xsl:value-of select="docs:last-modified"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Revision:</td>
|
||||
<td><xsl:value-of select="docs:revision"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Author:</td>
|
||||
<td><xsl:value-of select="docs:author"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>URI:</td>
|
||||
<td>
|
||||
<a href="{docs:uri}">
|
||||
<xsl:value-of select="docs:uri"/>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="docs:header">
|
||||
|
||||
<table id="global-header">
|
||||
<tr>
|
||||
<td id="context">
|
||||
<xsl:if test="bebop:dimensionalNavbar[@class = 'portalNavbar']">
|
||||
<xsl:apply-templates select="bebop:dimensionalNavbar[@class = 'portalNavbar']"/>
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td>
|
||||
<table id="global-links">
|
||||
<tr>
|
||||
<td style="margin: 0; border: 0; padding: 0; padding-right: 18px;">
|
||||
</td>
|
||||
<td class="global-link-icon">
|
||||
<a href="{../docs:global/bebop:link[@class = 'signoutLink']/@href}">
|
||||
<img src="{$internal-theme}/images/lock.png" height="18" width="14"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="global-link">
|
||||
<a href="{../docs:global/bebop:link[@class = 'signoutLink']/@href}">
|
||||
Sign out
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#878175">
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td height="1"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="setInside">
|
||||
<tr>
|
||||
<td class="setInside">
|
||||
<table class="localHeader">
|
||||
<tr>
|
||||
<td class="localTitle">
|
||||
<xsl:value-of select="../bebop:title"/>
|
||||
</td>
|
||||
<td class="localControl">
|
||||
<xsl:apply-templates select="bebop:link[@class = 'portalControlProfileLink']"/>
|
||||
<xsl:apply-templates select="bebop:link[@class = 'portalControl']"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="docs:body">
|
||||
<table class="setInside"><tr><td class="setInside">
|
||||
|
||||
<!-- XXX once we make portal tabs generate XML just like ordinary tabs, this rule repeat can go away. -->
|
||||
|
||||
<xsl:variable name="portalTabs" select="bebop:list[@class = 'portalTabs']"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="count($portalTabs/bebop:cell) > 1">
|
||||
<!--
|
||||
If there is only one tab in this portal, don't bother to
|
||||
display it.
|
||||
-->
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="tabs">
|
||||
<tr valign="bottom">
|
||||
<td class="trimSpace"><xsl:text> </xsl:text></td>
|
||||
<xsl:for-each select="$portalTabs/bebop:cell">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@selected">
|
||||
<!-- start currently active tab -->
|
||||
<td class="tabBeginning"><xsl:text>  </xsl:text></td>
|
||||
<td class="activeTab" nowrap="nowrap"><xsl:value-of select="bebop:portal/@title"/></td>
|
||||
<td class="tabEnd"><xsl:text>  </xsl:text></td>
|
||||
<td class="trimSpace"><xsl:text> </xsl:text></td>
|
||||
<!-- end currently active tab -->
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- start inactive tab -->
|
||||
<td>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr height="3">
|
||||
<td>
|
||||
<img src="{$internal-theme}/images/spacer.gif" height="3"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="23">
|
||||
<td class="tabBeginningOff"><xsl:text>  </xsl:text></td>
|
||||
<td class="inactiveTab" nowrap="nowrap"><xsl:apply-templates select="bebop:link"/></td>
|
||||
<td class="tabEndOff"><xsl:text>  </xsl:text></td>
|
||||
</tr>
|
||||
</table>
|
||||
<td class="trimSpace"><xsl:text> </xsl:text></td>
|
||||
</td>
|
||||
<!-- end inactive tab -->
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
<td class="trimSpace" width="100%"><xsl:text> </xsl:text></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="topRuleUnderTabs">
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
</xsl:when>
|
||||
<xsl:when test="not(bebop:tabbedPane)">
|
||||
<table class="topRuleNoTabs">
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
|
||||
<!-- end of div class="setInside" -->
|
||||
</td></tr></table>
|
||||
|
||||
<table class="bottomRule">
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:splitPanel">
|
||||
<table class="splitPanel">
|
||||
<xsl:if test="not(bebop:cell/bebop:label[text() = '&nbsp;'])">
|
||||
<tr>
|
||||
<td colspan="3" class="splitPanelHeader">
|
||||
<table width="100%" cellspacing="4" cellpadding="0" border="0">
|
||||
<tr><td><xsl:apply-templates select="bebop:cell[1]"/></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="inactiveTabColor" height="2">
|
||||
<img src="{$internal-theme}/images/spacer.gif" height="2"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
<tr>
|
||||
<td class="splitPanelLeft">
|
||||
<table width="100%" cellspacing="4" cellpadding="0" border="0">
|
||||
<tr><td><xsl:apply-templates select="bebop:cell[2]"/></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="inactiveTabColor" width="2">
|
||||
<img src="{$internal-theme}/images/spacer.gif" width="2"/>
|
||||
</td>
|
||||
<td class="splitPanelRight">
|
||||
<table width="100%" cellspacing="4" cellpadding="0" border="0">
|
||||
<tr><td><xsl:apply-templates select="bebop:cell[3]"/></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:tabbedPane">
|
||||
<xsl:variable name="tabs" select="bebop:tabStrip/bebop:tab"/>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="tabs">
|
||||
<tr>
|
||||
<td class="trimSpace"><xsl:text> </xsl:text></td>
|
||||
<xsl:for-each select="$tabs">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@current = 't'">
|
||||
<!-- start currently active tab -->
|
||||
<td class="tabBeginning"><xsl:text>  </xsl:text></td>
|
||||
<td class="activeTab" nowrap="nowrap"><xsl:value-of select="bebop:label"/></td>
|
||||
<td class="tabEnd"><xsl:text>  </xsl:text></td>
|
||||
<td class="trimSpace"><xsl:text> </xsl:text></td>
|
||||
<!-- end currently active tab -->
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- start inactive tab -->
|
||||
<td>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr height="3"><td></td></tr>
|
||||
<tr height="23">
|
||||
<td class="tabBeginningOff"><xsl:text>  </xsl:text></td>
|
||||
<td class="inactiveTab" nowrap="nowrap"><a href="{@href}"><xsl:apply-templates select="bebop:label"/></a>
|
||||
</td>
|
||||
<td class="tabEndOff"><xsl:text>  </xsl:text></td>
|
||||
</tr>
|
||||
</table>
|
||||
<td class="trimSpace"><xsl:text> </xsl:text></td>
|
||||
</td>
|
||||
<!-- end inactive tab -->
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
<td class="trimSpace" width="100%"><xsl:text> </xsl:text></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="topRuleUnderTabs">
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
|
||||
<xsl:apply-templates select="bebop:currentPane/*"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:table"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0">
|
||||
<table class="fancy">
|
||||
<xsl:for-each select="@*">
|
||||
<xsl:attribute name="{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:for-each>
|
||||
<xsl:apply-templates select="bebop:thead"/>
|
||||
<xsl:apply-templates select="bebop:tbody"/>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:table[@class='plain']"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0">
|
||||
<table>
|
||||
<xsl:for-each select="@*">
|
||||
<xsl:attribute name="{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:for-each>
|
||||
<xsl:apply-templates select="bebop:thead"/>
|
||||
<xsl:apply-templates select="bebop:tbody"/>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The template below overrides bebop Link.xsl action link spec so that
|
||||
we can have a different image -->
|
||||
<xsl:template name="bebop:actionLink" match="bebop:link[@class='actionLink']">
|
||||
<!-- Begin Image -->
|
||||
|
||||
<!-- Image JavaScript -->
|
||||
<script LANGUAGE="JavaScript">
|
||||
<![CDATA[ <!-- begin script ]]>
|
||||
|
||||
<!-- This is ugly, but I need the whole output on one line =p -->
|
||||
<![CDATA[ document.write(']]><a href="{@href}" onclick="{@onclick}"><img src="{$internal-theme}/images/action-generic.png" border="0" width="11" height="11"><xsl:attribute name="alt"><xsl:apply-templates mode="javascript-mode"/></xsl:attribute></img><![CDATA[')]]>
|
||||
<![CDATA[ document.write(']]></a><![CDATA[')]]>
|
||||
<![CDATA[ // end script --> ]]>
|
||||
</script>
|
||||
|
||||
<!-- Image No JavaScript -->
|
||||
<script LANGUAGE="JavaScript">
|
||||
<![CDATA[ <!-- begin script ]]>
|
||||
<![CDATA[document.write("\<!--") ]]>
|
||||
<![CDATA[ // end script --> ]]>
|
||||
</script>
|
||||
|
||||
<a href="{@href_no_javascript}">
|
||||
<img src="{$internal-theme}/images/action-generic.png" border="0"
|
||||
width="11" height="11">
|
||||
<xsl:attribute name="alt">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
</a>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
<![CDATA[ <!-- begin script ]]>
|
||||
<![CDATA[document.write("\<!--") ]]>
|
||||
<![CDATA[ // end script --> ]]>
|
||||
</script>
|
||||
|
||||
<!-- Begin Link -->
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
<![CDATA[ <!-- begin script ]]>
|
||||
|
||||
<!-- This is ugly, but I need the whole output on one line =p -->
|
||||
<![CDATA[ document.write(']]><a><xsl:for-each select="@*[name() != 'href_no_javascript']"><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:for-each><xsl:apply-templates mode="javascript-mode"/><![CDATA[')]]>
|
||||
<![CDATA[ document.write(']]></a><![CDATA[')]]>
|
||||
<![CDATA[ // end script --> ]]>
|
||||
</script>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
<![CDATA[ <!-- begin script ]]>
|
||||
<![CDATA[document.write("\<!--") ]]>
|
||||
<![CDATA[ // end script --> ]]>
|
||||
</script>
|
||||
<a>
|
||||
<xsl:for-each select="@*[name() != 'href']">
|
||||
<xsl:choose>
|
||||
<xsl:when test="name() = 'href_no_javascript'">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:when test="name() = 'onclick'">
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
<![CDATA[ <!-- begin script ]]>
|
||||
<![CDATA[ document.write("--\>") ]]>
|
||||
<![CDATA[ // end script --> ]]>
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:admin="http://www.arsdigita.com/docs-ui/1.0"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
exclude-result-prefixes="admin"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="docs.xsl"/>
|
||||
|
||||
<!-- this rule matches one user -->
|
||||
<xsl:template match="admin:userInfo">
|
||||
|
||||
<!-- Feature #166221 capitalize form labels -->
|
||||
<ul>
|
||||
<li> Name: <xsl:value-of select="@name"/> </li>
|
||||
<li> Email:
|
||||
<table>
|
||||
<xsl:apply-templates select="admin:email" />
|
||||
</table>
|
||||
</li>
|
||||
<li> Screen Name: <xsl:value-of select="@screenName"/> </li>
|
||||
<li> URL: <a href="{@URI}"><xsl:value-of select="@URI"/> </a> </li>
|
||||
<li> User ID: <xsl:value-of select="@id"/> </li>
|
||||
<li> Member State: <xsl:value-of select="@memberState"/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- used to format the list of actions available for one user -->
|
||||
<xsl:template match="admin:userActions">
|
||||
|
||||
<h3>Adminstrative Actions</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="password-update?user_id={@id}">Update password</a></li>
|
||||
<li><a href="login?user_id={@id}">Become this user</a></li>
|
||||
</ul>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- used to format the header of the password update page -->
|
||||
<xsl:template match="bebop:label[@class='UserPasswordHeader']">
|
||||
For <xsl:value-of select="text()"/>
|
||||
<hr />
|
||||
</xsl:template>
|
||||
|
||||
<!-- usage note displayed on the password-update page -->
|
||||
<xsl:template match="admin:PasswordNote">
|
||||
<h4>Note</h4>
|
||||
<p>If this user does not currently have an authentication record,
|
||||
one will be created when you submit this form and the account
|
||||
will be enabled for login to the system.</p>
|
||||
</xsl:template>
|
||||
|
||||
<!-- used to format primary email for display -->
|
||||
<xsl:template match="admin:email[@primary='t']">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="mailto:{@address}"><xsl:value-of select="@address"/></a>
|
||||
</td>
|
||||
<td>
|
||||
(primary)
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<!-- used to format non-primary email for display -->
|
||||
<xsl:template match="admin:email">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="mailto:{@address}"><xsl:value-of select="@address"/></a>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Access Denied Page -->
|
||||
<xsl:template match="bebop:label[@class='AccessDenied']">
|
||||
<hr />
|
||||
<p>You don't have permission to perform the requested action.</p>
|
||||
<hr />
|
||||
</xsl:template>
|
||||
|
||||
<!-- Display search error message -->
|
||||
<xsl:template match="bebop:list[@class='SearchResultList'][count(bebop:cell)=0]">
|
||||
<p><font color="red">Your search returned no results.</font></p>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Display search error message -->
|
||||
<xsl:template match="bebop:list[@class='SearchResultList'][count(bebop:cell)>0]">
|
||||
<p>Results matching your query:</p>
|
||||
<ul>
|
||||
<xsl:for-each select="bebop:cell">
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<!-- used to format the basic information and actions available for one group -->
|
||||
<xsl:template match="admin:groupInfo">
|
||||
|
||||
<ul>
|
||||
<li> Group Name: <xsl:value-of select="@name"/> </li>
|
||||
<li> Primary Email: <xsl:value-of select="@email"/> </li>
|
||||
</ul>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:list[@class='UserGroupsResultList'][count(bebop:cell)=0]">
|
||||
<p><font color="red">None</font></p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bebop:link[@class='deleteLink']">
|
||||
<xsl:text> </xsl:text>
|
||||
(<a href="{@href}" onclick="{@onclick}" class="action_link">
|
||||
<xsl:apply-templates/>
|
||||
</a>)
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
<!-- module ccm-ldn-search - servlet declarations BEGIN -->
|
||||
<servlet>
|
||||
<servlet-name>worker</servlet-name>
|
||||
<servlet-class>com.arsdigita.london.search.SearchWorkerServlet</servlet-class>
|
||||
<load-on-startup>4</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>search-files</servlet-name>
|
||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>template-path</param-name>
|
||||
<param-value>/templates/ccm-ldn-search</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>AxisServlet</servlet-name>
|
||||
<display-name>Apache-Axis Servlet</display-name>
|
||||
<servlet-class>
|
||||
org.apache.axis.transport.http.AxisServlet
|
||||
</servlet-class>
|
||||
</servlet>
|
||||
<!-- module ccm-ldn-search - servlet declarations END -->
|
||||
|
||||
<!-- module ccm-ldn-search - servlet mappings BEGIN -->
|
||||
<servlet-mapping>
|
||||
<servlet-name>search-files</servlet-name>
|
||||
<url-pattern>/ccm-ldn-search/files/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>AxisServlet</servlet-name>
|
||||
<url-pattern>/services/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<!-- module ccm-ldn-search - servlet mappings END -->
|
||||
|
||||
|
|
@ -28,7 +28,6 @@ import java.math.BigDecimal;
|
|||
* @version $Id: ServerCollection.java 287 2005-02-22 00:29:02Z sskracic $
|
||||
*/
|
||||
public class ServerCollection extends DomainCollection {
|
||||
public static final String versionId = "$Id: ServerCollection.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2003/10/21 12:37:13 $";
|
||||
|
||||
protected ServerCollection(DataCollection dataCollection) {
|
||||
super(dataCollection);
|
||||
|
|
|
|||
|
|
@ -18,9 +18,10 @@
|
|||
*/
|
||||
package com.arsdigita.portalserver.pslogin;
|
||||
|
||||
import com.arsdigita.ui.login.SubsiteDispatcher;
|
||||
// import com.arsdigita.ui.login.SubsiteDispatcher; DELETED!
|
||||
import com.arsdigita.kernel.security.Initializer;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.page.BebopMapDispatcher;
|
||||
import java.util.Map;
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -41,7 +42,8 @@ import java.util.Map;
|
|||
* rather than the default system portal
|
||||
* @author <a href="mailto:bryanche@arsdigita.com">Bryan Che</a>
|
||||
**/
|
||||
public class PSSubsiteDispatcher extends SubsiteDispatcher {
|
||||
// public class PSSubsiteDispatcher extends SubsiteDispatcher {
|
||||
public class PSSubsiteDispatcher extends BebopMapDispatcher {
|
||||
|
||||
private static Page s_psPage = new PSPage();
|
||||
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@
|
|||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
<servlet-name>login</servlet-name>
|
||||
<servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
|
|
@ -143,6 +143,11 @@
|
|||
<servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<servlet-class>com.arsdigita.web.OIDRedirectServlet</servlet-class>
|
||||
|
|
@ -465,8 +470,8 @@
|
|||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
<servlet-name>login</servlet-name>
|
||||
<url-pattern>/login/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
|
|
@ -484,6 +489,11 @@
|
|||
<url-pattern>/admin-permissions/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<url-pattern>/redirect/*</url-pattern>
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@
|
|||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
<servlet-name>login</servlet-name>
|
||||
<servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
|
|
@ -143,6 +143,11 @@
|
|||
<servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<servlet-class>com.arsdigita.web.OIDRedirectServlet</servlet-class>
|
||||
|
|
@ -267,13 +272,6 @@
|
|||
<!-- module ccm-rssfeed - servlet declaration END -->
|
||||
|
||||
<!-- module ccm-ldn-search - servlet declarations BEGIN -->
|
||||
<!--
|
||||
<servlet>
|
||||
<servlet-name>worker</servlet-name>
|
||||
<servlet-class>com.arsdigita.london.search.SearchWorkerServlet</servlet-class>
|
||||
<load-on-startup>4</load-on-startup>
|
||||
</servlet>
|
||||
-->
|
||||
<servlet>
|
||||
<servlet-name>search-files</servlet-name>
|
||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||
|
|
@ -472,8 +470,8 @@
|
|||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
<servlet-name>login</servlet-name>
|
||||
<url-pattern>/login/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
|
|
@ -491,6 +489,11 @@
|
|||
<url-pattern>/admin-permissions/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>webdevsupport</servlet-name>
|
||||
<url-pattern>/webdevsupport/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>oid-redirect</servlet-name>
|
||||
<url-pattern>/redirect/*</url-pattern>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<load>
|
||||
|
||||
<requires>
|
||||
<table name="inits"/>
|
||||
<table name="acs_objects"/>
|
||||
|
|
@ -10,13 +11,16 @@
|
|||
<initializer class="com.arsdigita.london.search.Initializer"/>
|
||||
<initializer class="com.arsdigita.london.terms.Initializer"/>
|
||||
</requires>
|
||||
|
||||
<provides>
|
||||
<!--
|
||||
<table name=""/>
|
||||
-->
|
||||
<initializer class="com.arsdigita.bundle.Initializer"/>
|
||||
</provides>
|
||||
|
||||
<scripts>
|
||||
<data class="com.arsdigita.bundle.Loader"/>
|
||||
</scripts>
|
||||
|
||||
</load>
|
||||
|
|
|
|||
Loading…
Reference in New Issue