You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(48) |
Dec
(31) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(22) |
Feb
(68) |
Mar
(185) |
Apr
(11) |
May
(21) |
Jun
(23) |
Jul
(46) |
Aug
(69) |
Sep
(211) |
Oct
(26) |
Nov
(51) |
Dec
(52) |
| 2006 |
Jan
(13) |
Feb
(13) |
Mar
(8) |
Apr
(21) |
May
(17) |
Jun
(100) |
Jul
(34) |
Aug
(23) |
Sep
(26) |
Oct
(16) |
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(66) |
Oct
(10) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
(8) |
Jun
(5) |
Jul
(31) |
Aug
(8) |
Sep
(11) |
Oct
(6) |
Nov
|
Dec
|
| 2012 |
Jan
(13) |
Feb
(2) |
Mar
(9) |
Apr
(6) |
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(120) |
| 2013 |
Jan
(6) |
Feb
(35) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Author: pboy
Date: 2013-02-03 22:34:35 +0000 (Sun, 03 Feb 2013)
New Revision: 2493
Added:
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSItemSearchPage.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSSearchResultRedirector.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/contentsection/
trunk/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java
Modified:
trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java
trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java
trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContextBar.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
trunk/ccm-core/src/com/arsdigita/bebop/Completable.java
Log:
Added some preparation to migrate content section to legacy (dispatcher) free served bebop pages. Will be removed when migration completed.
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.cms;
import com.arsdigita.domain.DataObjectNotFoundException;
@@ -28,14 +29,15 @@
import org.apache.log4j.Logger;
/**
- * Application domain class for the CMS module user entry page (content-center)
+ * Application domain class for the CMS module user entry page
+ * (content-center)
*
* @author pb
* @version $Id: ContentCenter.java $
*/
public class ContentCenter extends Application {
- /** A logger instance, primarily to assist debugging . */
+ /** A logger instance, primarily to assist debugging. */
private static final Logger s_log = Logger.getLogger(ContentSection.class);
// pdl stuff (constants)
public static final String BASE_DATA_OBJECT_TYPE =
@@ -43,8 +45,6 @@
// general constants
public static final String PACKAGE_KEY = "content-center";
public static final String INSTANCE_NAME = "Content Center";
-// public static final String DISPATCHER_CLASS =
-// "com.arsdigita.cms.dispatcher.ContentCenterDispatcher";
/**
* Constructor retrieving a workspace from the database usings its OID.
@@ -57,8 +57,9 @@
}
/**
- * Constructor retrieving the contained <code>DataObject</code> from the
- * persistent storage mechanism with an <code>OID</code> specified by id.
+ * Constructor retrieving the contained <code>DataObject</code> from
+ * the persistent storage mechanism with an <code>OID</code> specified
+ * by id.
*
* @param id The <code>id</code> for the retrieved
* <code>DataObject</code>.
@@ -91,8 +92,9 @@
String title,
Application parent) {
- ContentCenter app =
- (ContentCenter) Application.createApplication(BASE_DATA_OBJECT_TYPE, urlName, title, parent);
+ ContentCenter app = (ContentCenter) Application
+ .createApplication(BASE_DATA_OBJECT_TYPE,
+ urlName, title, parent);
app.save();
@@ -106,7 +108,8 @@
* Therefore we simply may return the URL used to load and initialise the
* Content Center.
*
- * @return The URL of the CMS ContentCenter (currently including trailing slash)
+ * @return The URL of the CMS ContentCenter (currently including trailing
+ * slash)
*/
public static String getURL() {
// quick 'nd dirty!
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -21,6 +21,10 @@
import com.arsdigita.bebop.Page;
import com.arsdigita.cms.dispatcher.CMSPage;
import com.arsdigita.cms.dispatcher.SimpleCache;
+import com.arsdigita.cms.ui.CMSApplicationPage;
+import com.arsdigita.cms.ui.CMSItemSearchPage;
+import com.arsdigita.cms.ui.CMSSearchResultRedirector;
+// Old version (dispatcher based) of CMSItemSearchPage
import com.arsdigita.cms.ui.ItemSearchPage;
import com.arsdigita.cms.ui.contentcenter.MainPage;
import com.arsdigita.developersupport.DeveloperSupport;
@@ -43,6 +47,7 @@
import java.util.Map;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -91,19 +96,21 @@
if (s_log.isDebugEnabled()) {
s_log.info("starting doInit method");
}
-// DEPRECATED STUFF for servlet internally process pages, maybe required
+
+ // DEPRECATED STUFF for servlet internally process pages, maybe required
// for JSP extension.
- m_trailingSlashList = new ArrayList();
- requireTrailingSlash("");
+ // m_trailingSlashList = new ArrayList();
+ // requireTrailingSlash("");
// NEW STUFF here used to process the pages in this servlet
// Addresses previously noted in WEB-INF/resources/content-center-map.xml
// Obviously not required.
- addPage("/", new MainPage()); // index page at address ~/ds
- // addPage("/index/", new MainPage());
- //addPage("/ItemSearchPage/", new ItemSearchPage());
+ addPage("/", new MainPage()); // index page at address ~/cc
+ addPage("/index", new MainPage());
+ // addPage("/item-search", new CMSItemSearchPage());
+ // Old style
addPage("/item-search", new ItemSearchPage());
- // addPage("/SearchResultRedirector/", new CCSearchResultRedirector());
+ addPage("/searchredirect", new CMSSearchResultRedirector());
// STUFF to use for JSP extension, i.e. jsp's to try for URLs which are not
@@ -122,27 +129,25 @@
}
/**
- * Implements the (abstract) doService method of BaseApplicationServlet to
- * create the ContentCenter page.
+ * Implements the (abstract) doService method of BaseApplicationServlet
+ * to create the ContentCenter page.
*
* @see com.arsdigita.web.BaseApplicationServlet#doService
* (HttpServletRequest, HttpServletResponse, Application)
*/
protected void doService(HttpServletRequest sreq,
- HttpServletResponse sresp,
- Application app)
- throws ServletException, IOException {
+ HttpServletResponse sresp,
+ Application app)
+ throws ServletException, IOException {
if (s_log.isDebugEnabled()) {
s_log.info("starting doService method");
}
DeveloperSupport.startStage("ContentCenterServlet.doService");
- ContentCenter workspace = (ContentCenter) app;
+ // ContentCenter workspace = (ContentCenter) app;
- /*
- * Check user and privilegies
- */
+ /* Check user and privilegies */
if (Web.getContext().getUser() == null) { // user not logged in
throw new LoginSignal(sreq); // send to login page
}
@@ -165,14 +170,7 @@
}
-
- RequestContext ctx = DispatcherHelper.getRequestContext();
- String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext
- String originalUrl = ctx.getOriginalURL();
-
- String requestUri = sreq.getRequestURI();
-
- // New way to tetch the page
+ // New way to fetch the page
String pathInfo = sreq.getPathInfo();
Assert.exists(pathInfo, "String pathInfo");
if (pathInfo.length() > 1 && pathInfo.endsWith("/")) {
@@ -188,10 +186,10 @@
// probably want to redirect.
// Probably DEPRECATED with new access method or only relevant for jsp
// extension
- if (m_trailingSlashList.contains(url) && !originalUrl.endsWith("/")) {
- DispatcherHelper.sendRedirect(sresp, originalUrl + "/");
- return;
- }
+ // if (m_trailingSlashList.contains(url) && !originalUrl.endsWith("/")) {
+ // DispatcherHelper.sendRedirect(sresp, originalUrl + "/");
+ // return;
+ // }
final Page page = (Page) m_pages.get(pathInfo);
@@ -199,16 +197,18 @@
// Check user access.
checkUserAccess(sreq, sresp);
- //Lock the page
if (page instanceof CMSPage) {
+ // backwards compatibility fix until migration completed
final CMSPage cmsPage = (CMSPage) page;
+ final RequestContext ctx = DispatcherHelper.getRequestContext();
cmsPage.init();
cmsPage.dispatch(sreq, sresp, ctx);
} else {
- page.lock();
+ final CMSApplicationPage cmsAppPage = (CMSApplicationPage) page;
+ cmsAppPage.init(sreq,sresp,app);
// Serve the page.
- final Document doc = page.buildDocument(sreq, sresp);
+ final Document doc = cmsAppPage.buildDocument(sreq, sresp);
PresentationManager pm = Templating.getPresentationManager();
pm.servePage(doc, sreq, sresp);
@@ -231,7 +231,9 @@
sreq = DispatcherHelper.restoreOriginalRequest(sreq);
rd.forward(sreq, sresp);
} else {
- sresp.sendError(404, requestUri + " not found on this server.");
+ // String requestUri = sreq.getRequestURI();
+ sresp.sendError(404, sreq.getRequestURI() +
+ " not found on this server.");
}
}
@@ -244,7 +246,8 @@
} // END doService()
/**
- * Adds one pair of Url - Page to the internal hash map, used as a cache.
+ * Internal service mechod, adds one pair of Url - Page to the internal
+ * hash map, used as a cache.
*
* @param pathInfo url stub for a page to display
* @param page Page object to display
@@ -271,7 +274,8 @@
Iterator itr = s_pageURLs.keySet().iterator();
while (itr.hasNext()) {
String classname2 = (String) itr.next();
- s_log.debug("key: " + classname + " value: " + (String) s_pageURLs.get(classname2));
+ s_log.debug("key: " + classname + " value: "
+ + (String) s_pageURLs.get(classname2));
}
String url = (String) s_pageURLs.get(classname);
return url;
@@ -298,14 +302,13 @@
* @param actx The request context
**/
protected void checkUserAccess(final HttpServletRequest request,
- final HttpServletResponse response //,
+ final HttpServletResponse response //,
/// final RequestContext actx
)
throws ServletException {
if (!Web.getUserContext().isLoggedIn()) {
throw new LoginSignal(request);
-
}
}
@@ -317,8 +320,8 @@
* trying to redirect, wrap that exception in a ServletException
**/
protected void redirectToLoginPage(HttpServletRequest req,
- HttpServletResponse resp)
- throws ServletException {
+ HttpServletResponse resp)
+ throws ServletException {
String url = Util.getSecurityHelper()
.getLoginURL(req)
+ "?" + LoginHelper.RETURN_URL_PARAM_NAME
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -18,13 +18,16 @@
*/
package com.arsdigita.cms;
+import com.arsdigita.bebop.Page;
import com.arsdigita.caching.CacheTable;
import com.arsdigita.cms.dispatcher.CMSDispatcher;
+import com.arsdigita.cms.dispatcher.CMSPage;
import com.arsdigita.cms.dispatcher.ContentItemDispatcher;
import com.arsdigita.cms.dispatcher.ItemResolver;
import com.arsdigita.cms.dispatcher.TemplateResolver;
import com.arsdigita.cms.publishToFile.LocalRequestPassword;
import com.arsdigita.cms.lifecycle.Lifecycle;
+import com.arsdigita.cms.ui.CMSApplicationPage;
import com.arsdigita.dispatcher.AccessDeniedException;
import com.arsdigita.dispatcher.DispatcherHelper;
import com.arsdigita.dispatcher.RequestContext;
@@ -41,6 +44,8 @@
import com.arsdigita.persistence.Session;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.persistence.TransactionContext;
+import com.arsdigita.templating.PresentationManager;
+import com.arsdigita.templating.Templating;
import com.arsdigita.util.Assert;
import com.arsdigita.util.Classes;
import com.arsdigita.versioning.Versions;
@@ -49,6 +54,7 @@
import com.arsdigita.web.BaseApplicationServlet;
import com.arsdigita.web.LoginSignal;
import com.arsdigita.web.Web;
+import com.arsdigita.xml.Document;
import java.io.IOException;
import java.math.BigDecimal;
@@ -130,8 +136,14 @@
private static Map s_itemURLCacheMap = null;
private static boolean s_cacheItems = true;
- /** Path to directory containg ccm-cms template files */
+ // NEW STUFF here used to process the pages in this servlet
+ /** URL (pathinfo) -> Page object mapping. Based on it (and the http
+ * request url) the doService method selects a page to display */
+ private final Map m_pages = new HashMap();
+
+ /** Path to directory containg ccm-cms template (jsp) files */
private String m_templatePath;
+ // Probably compatibility stuff, based on dispatcher
/** Resolvers to find templages (JSP) and other stuff stored in file system.*/
private ApplicationFileResolver m_resolver;
@@ -172,6 +184,12 @@
s_log.debug("Template path is " + m_templatePath +
" with resolver " + m_resolver.getClass().getName());
}
+
+ // NEW STUFF here used to process the pages in this servlet
+ // addPage("/admin", new MainPage()); // index page at address ~/cs
+ // addPage("/admin/index.jsp", new MainPage());
+ // addPage("/admin/item.jsp", new MainPage());
+
}
/**
@@ -183,30 +201,74 @@
* (HttpServletRequest, HttpServletResponse, Application)}
*/
protected void doService( HttpServletRequest sreq,
- HttpServletResponse sresp,
- Application app)
+ HttpServletResponse sresp,
+ Application app)
throws ServletException, IOException {
ContentSection section = (ContentSection) app;
- String requestUri = sreq.getRequestURI();
+ // ////////////////////////////////////////////////////////////////////
+ // Prepare OLD style dispatcher based page service
+ // ////////////////////////////////////////////////////////////////////
/*
* NOTE:
* Resolves currently to SiteNodeRequestContext which will be removed.
+ * NOTE 2:
+ * SiteNodeRequestContext removed, resolves currently to
+ * KernelRequestContext which will be removed as well.
*/
RequestContext ctx = DispatcherHelper.getRequestContext();
- String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext
-
+ String url = ctx.getRemainingURLPart(); // here KernelRequestContext now
if (s_log.isInfoEnabled()) {
s_log.info("Resolving item URL " + url);
}
-
- //TODO: need to do a check for public page
-
final ItemResolver itemResolver = getItemResolver(section);
final ContentItem item = getItem(section, url, itemResolver);
- if (item != null) {
+
+ // ////////////////////////////////////////////////////////////////////
+ // Prepare NEW style servlet based bebpo page service
+ // ////////////////////////////////////////////////////////////////////
+ String pathInfo = sreq.getPathInfo();
+ Assert.exists(pathInfo, "String pathInfo");
+ if (pathInfo.length() > 1 && pathInfo.endsWith("/")) {
+ /* NOTE: ServletAPI specifies, pathInfo may be empty or will
+ * start with a '/' character. It currently carries a
+ * trailing '/' if a "virtual" page, i.e. not a real jsp, but
+ * result of a servlet mapping. But Application requires url
+ * NOT to end with a trailing '/' for legacy free applications. */
+ pathInfo = pathInfo.substring(0, pathInfo.length() - 1);
+ }
+ final Page page = (Page) m_pages.get(pathInfo);
+
+
+ // ////////////////////////////////////////////////////////////////////
+ // Serve the page
+ // ////////////////////////////////////////////////////////////////////
+ /* FIRST try new style servlet based service */
+ if (page != null) {
+
+ // Check user access.
+ // checkUserAccess(sreq, sresp); // done in individual pages ??
+
+ if (page instanceof CMSPage) {
+ // backwards compatibility fix until migration completed
+ final CMSPage cmsPage = (CMSPage) page;
+ // final RequestContext ctx = DispatcherHelper.getRequestContext();
+ cmsPage.init();
+ cmsPage.dispatch(sreq, sresp, ctx);
+ } else {
+ final CMSApplicationPage cmsAppPage = (CMSApplicationPage) page;
+ cmsAppPage.init(sreq,sresp,app);
+ // Serve the page.
+ final Document doc = cmsAppPage.buildDocument(sreq, sresp);
+
+ PresentationManager pm = Templating.getPresentationManager();
+ pm.servePage(doc, sreq, sresp);
+ }
+
+ /* SECONDLY try if we have to serve an item (old style dispatcher based */
+ } else if (item != null) {
/* We have to serve an item here */
String param = sreq.getParameter("transID");
@@ -229,15 +291,16 @@
serveItem(sreq, sresp, section, item);
+ /* OTHERWISE delegate to a JSP in file system */
} else {
-
+
/* We have to deal with a content-section, folder or an other bit*/
if (s_log.isInfoEnabled()) {
s_log.info("NOT serving content item");
}
-
+
/* Store content section in http request to make it available
- * or admin index,jsp */
+ * for admin index,jsp */
sreq.setAttribute(CONTENT_SECTION, section);
RequestDispatcher rd = m_resolver.resolve(m_templatePath,
@@ -250,11 +313,13 @@
rd.forward(sreq,sresp);
} else {
// sresp.sendError(404, packageURL + " not found on this server.");
+ String requestUri = sreq.getRequestURI(); // same as ctx.getRemainingURLPart()
sresp.sendError(404, requestUri + " not found on this server.");
}
}
- }
+ } // END doService
+
/**
*
* @param sreq
@@ -334,6 +399,25 @@
//use ContentItemDispatcher
m_disp.dispatch(sreq,sresp,ctx);
}
+
+ /**
+ * Internal service method, adds one pair of Url - Page to the internal
+ * hash map, used as a cache.
+ *
+ * @param pathInfo url stub for a page to display
+ * @param page Page object to display
+ */
+ private void addPage(final String pathInfo, final Page page) {
+
+ Assert.exists(pathInfo, String.class);
+ Assert.exists(page, Page.class);
+ // Current Implementation requires pathInfo to start with a leading '/'
+ // SUN Servlet API specifies: "PathInfo *may be empty* or will start
+ // with a '/' character."
+ Assert.isTrue(pathInfo.startsWith("/"), "path starts not with '/'");
+
+ m_pages.put(pathInfo, page);
+ }
/**
* Fetches the content section from the request attributes.
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -26,10 +26,13 @@
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.User;
import com.arsdigita.templating.PresentationManager;
+import com.arsdigita.web.Application;
import com.arsdigita.xml.Document;
import com.arsdigita.xml.Element;
import java.util.HashMap;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
@@ -44,20 +47,21 @@
/**
- * <p>A <tt>CMSApplicationPage</tt> is a Bebop {@link com.arsdigita.bebop.Page}
- * implementation serving as a base for any CMS pageElement served by a servlet. </p>
+ * A <tt>CMSApplicationPage</tt> is a Bebop {@link com.arsdigita.bebop.Page}
+ * implementation serving as a base for any CMS pageElement served by a
+ * servlet.
*
- * <p>It stores the current {@link com.arsdigita.cms.ContentSection} and, if
- * applicable, the {@link com.arsdigita.cms.ContentItem} in the pageElement state as
- * request local objects. Components that are part of the <tt>CMSPage</tt>
- * may access these objects by calling:</p>
+ * It stores the current {@link com.arsdigita.cms.ContentSection} and, if
+ * applicable, the {@link com.arsdigita.cms.ContentItem} in the pageElement
+ * state as request local objects. Components that are part of the
+ * <tt>CMSPage</tt> may access these objects by calling:
* <blockquote><code><pre>
* getContentSection(PageState state);
* </pre></code></blockquote>
*
* @author Michael Pih (pi...@ar...)
* @author Uday Mathur (um...@ar...)
- * @version $Id: CMSPage.java 2140 2011-01-16 12:04:20Z pboy $
+ * @version $Id: CMSApplicationPage.java 2140 2011-01-16 12:04:20Z pboy $
*/
public class CMSApplicationPage extends Page {
@@ -131,12 +135,18 @@
}
/**
- * Finishes and locks the pageElement. If the pageElement is already locked, does nothing.
+ * Finishes and locks the pageElement. If the pageElement is already
+ * locked, does nothing.
+ *
+ * Client classes may overwrite this method to add context specific bits
+ * to the page before it is locked.
*
- * This method is called by the {@link com.arsdigita.dispatcher.Dispatcher}
- * that initializes this pageElement.
+ * This method is called by the various servlets serving the various pages
+ * of the CMS package, before serving and displaying the page.
*/
- public synchronized void init() {
+ public synchronized void init(HttpServletRequest sreq,
+ HttpServletResponse sresp,
+ Application app) {
s_log.debug("Initializing the page");
if (!isLocked()) {
Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSItemSearchPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSItemSearchPage.java (rev 0)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSItemSearchPage.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -0,0 +1,345 @@
+/*
+ * Copyright (C) 2003-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.cms.ui;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.bebop.TabbedPane;
+import com.arsdigita.bebop.event.RequestEvent;
+import com.arsdigita.bebop.event.RequestListener;
+import com.arsdigita.bebop.parameters.BigDecimalParameter;
+import com.arsdigita.bebop.parameters.BooleanParameter;
+import com.arsdigita.bebop.parameters.IntegerParameter;
+import com.arsdigita.bebop.parameters.StringParameter;
+import com.arsdigita.cms.*;
+import com.arsdigita.cms.dispatcher.CMSPage;
+import com.arsdigita.cms.util.GlobalizationUtil;
+import com.arsdigita.dispatcher.RequestContext;
+import com.arsdigita.domain.DataObjectNotFoundException;
+import com.arsdigita.templating.PresentationManager;
+import com.arsdigita.templating.Templating;
+import com.arsdigita.util.UncheckedWrapperException;
+import com.arsdigita.web.Application;
+import com.arsdigita.web.Web;
+import com.arsdigita.xml.Document;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * The Item Search page.
+ *
+ * @author Scott Seago (sc...@ar...)
+ * @author Sören Bernstein (sbe...@qu...)
+ * @author Jens Pelzetter (je...@jp...)
+ */
+public class CMSItemSearchPage extends CMSApplicationPage {
+
+ private final static String XSL_CLASS = "CMS Admin";
+ private TabbedPane m_tabbedPane;
+ private ItemSearchFlatBrowsePane m_flatBrowse;
+ private ItemSearchBrowsePane m_browse;
+ private ItemSearchPopup m_search;
+ private ItemSearchCreateItemPane m_create;
+ private BigDecimalParameter m_sectionId;
+ private int m_lastTab;
+ private static final CMSConfig s_conf = CMSConfig.getInstance();
+ private static final boolean LIMIT_TO_CONTENT_SECTION = false;
+ public static final String CONTENT_SECTION = "section_id";
+
+ /**
+ * Construct a new ItemSearchPage
+ */
+ public CMSItemSearchPage() {
+ super(GlobalizationUtil.globalize("cms.ui.item_search.page_title").localize().toString(), new SimpleContainer());
+
+ setClassAttr("cms-admin");
+
+ addGlobalStateParam(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM));
+ addGlobalStateParam(new StringParameter(ItemSearchPopup.WIDGET_PARAM));
+ addGlobalStateParam(new StringParameter("searchWidget"));
+ addGlobalStateParam(new StringParameter("publishWidget"));
+ addGlobalStateParam(new StringParameter("defaultCreationFolder"));
+ addGlobalStateParam(new IntegerParameter("lastTab"));
+ addGlobalStateParam(new BooleanParameter("disableCreatePane"));
+ addGlobalStateParam(new BooleanParameter("editAfterCreate"));
+ m_sectionId = new BigDecimalParameter(CONTENT_SECTION);
+ addGlobalStateParam(m_sectionId);
+
+ m_flatBrowse = getFlatBrowsePane();
+ m_browse = getBrowsePane();
+ m_search = getSearchPane();
+ m_create = getCreatePane();
+
+ m_tabbedPane = createTabbedPane();
+ m_tabbedPane.setIdAttr("page-body");
+ add(m_tabbedPane);
+
+ addRequestListener(new RequestListener() {
+
+ public void pageRequested(final RequestEvent event) {
+ final PageState state = event.getPageState();
+
+ final String query = (String) state.getValue(new StringParameter(ItemSearchPopup.QUERY));
+ final Boolean disableCreatePane = (Boolean) state.getValue(new BooleanParameter("disableCreatePane"));
+
+ BigDecimal typeParam =
+ (BigDecimal) state.getValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM));
+ if ((typeParam == null) || disableCreatePane) {
+ m_tabbedPane.setTabVisible(state, m_create, false);
+ m_create.setVisible(state, false);
+ } else {
+ m_tabbedPane.setTabVisible(state, m_create, true);
+ m_create.setVisible(state, true);
+ }
+
+ if (state.getValue(new IntegerParameter("lastTab")) == null) {
+ if ((query == null) || query.isEmpty()) {
+ m_tabbedPane.setSelectedIndex(state, 1);
+ } else {
+ m_tabbedPane.setSelectedIndex(state, 0);
+ }
+
+// m_tabbedPane.setTabVisible(state, m_create, false);
+// m_create.setVisible(state, false);
+
+ }
+
+ state.setValue(new IntegerParameter("lastTab"), m_tabbedPane.getSelectedIndex(state));
+
+ if (state.getValue(new StringParameter("defaultCreationFolder")) != null) {
+ m_create.setDefaultFolder((String) state.getValue(new StringParameter("defaultCreationFolder")));
+ }
+
+ if (state.getValue(new BooleanParameter("editAfterCreate")) != null) {
+ m_create.setEditAfterCreate((Boolean) state.getValue(new BooleanParameter("editAfterCreate")));
+ }
+
+// if (m_lastTab != m_tabbedPane.getSelectedIndex(state)) {
+// m_lastTab = m_tabbedPane.getSelectedIndex(state);
+// return;
+// }
+//
+// //If create pane is selected do nothing (else we don't stay in the create pane)
+// if (m_tabbedPane.getCurrentPane(state) == m_create) {
+// return;
+// }
+//
+// if ((query == null) || query.isEmpty()) {
+// m_tabbedPane.setSelectedIndex(state, 1);
+// } else {
+// m_tabbedPane.setSelectedIndex(state, 1);
+// }
+
+// if (m_tabbedPane.getCurrentPane(state) == m_create) {
+// m_tabbedPane.setTabVisible(state, m_create, false);
+// m_create.setVisible(state, false);
+// }
+//
+// m_lastTab = m_tabbedPane.getSelectedIndex(state);
+ }
+
+ });
+
+// m_tabbedPane.addActionListener(new ActionListener() {
+//
+// public void actionPerformed(final ActionEvent event) {
+// final PageState state = event.getPageState();
+//
+// }
+//
+// });
+
+// m_flatBrowse.addProcessListener(new FormProcessListener() {
+//
+// public void process(final FormSectionEvent fse) throws FormProcessException {
+// if (m_flatBrowse.getSubmit().isSelected(fse.getPageState())) {
+// enableCreatePane(fse.getPageState());
+// }
+// }
+//
+// });
+ } // END constructor
+
+
+ /**
+ * Creates, and then caches, the Browse pane.
+ *
+ * Overriding this method to return null will prevent this tab from
+ * appearing. Note: not implemented yet.
+ */
+ protected ItemSearchBrowsePane getBrowsePane() {
+ if (m_browse == null) {
+ m_browse = new ItemSearchBrowsePane();
+ }
+
+ return m_browse;
+ }
+
+ /**
+ *
+ * @return
+ */
+ protected ItemSearchFlatBrowsePane getFlatBrowsePane() {
+ if (m_flatBrowse == null) {
+ m_flatBrowse = new ItemSearchFlatBrowsePane("flatBrowse");
+ }
+
+ return m_flatBrowse;
+ }
+
+ /**
+ * Creates, and then caches, the Creation pane.
+ * Overriding this method to return null will prevent this tab from
+ * appearing.
+ */
+ protected ItemSearchPopup getSearchPane() {
+ if (m_search == null) {
+ // Always search in every content section
+// m_search = new ItemSearchPopup(ContentItem.DRAFT, CMS.getConfig().limitToContentSection());
+ m_search = new ItemSearchPopup(ContentItem.DRAFT, LIMIT_TO_CONTENT_SECTION);
+ }
+
+ return m_search;
+ }
+
+ /**
+ *
+ * @return
+ */
+ protected ItemSearchCreateItemPane getCreatePane() {
+ if (m_create == null) {
+ m_create = new ItemSearchCreateItemPane(this);
+ }
+
+ return m_create;
+ }
+
+ /**
+ * Created the TabbedPane to use for this page.
+ *
+ * Sets the class attribute for this tabbed pane. The default implementation
+ * uses a {@link com.arsdigita.bebop.TabbedPane} and sets the class
+ * attribute to "CMS Admin." This implementation also adds tasks,
+ * content sections, and search panes.
+ *
+ * Developers can override this method to add only the tabs they want,
+ * or to add additional tabs after the default CMS tabs are added.
+ */
+ protected TabbedPane createTabbedPane() {
+ TabbedPane pane = new TabbedPane();
+ pane.setClassAttr(XSL_CLASS);
+
+
+ addToPane(pane, "flatBrowse", getFlatBrowsePane());
+ addToPane(pane, "browse", getBrowsePane());
+ addToPane(pane, "search", getSearchPane());
+ addToPane(pane, "create", getCreatePane());
+
+ if ("browse".equals(s_conf.getItemSearchDefaultTab())) {
+ pane.setDefaultPane(m_browse);
+ }
+ if ("search".equals(s_conf.getItemSearchDefaultTab())) {
+ pane.setDefaultPane(m_search);
+ }
+
+ //pane.setDefaultPane(m_flatBrowse);
+ pane.setDefaultPane(m_browse);
+
+ return pane;
+ }
+
+ /**
+ * Adds the specified component, with the specified tab name, to the
+ * tabbed pane only if it is not null.
+ *
+ * @param pane The pane to which to add the tab
+ * @param tabName The name of the tab if it's added
+ * @param comp The component to add to the pane
+ */
+ protected void addToPane(TabbedPane pane, String tabName, Component comp) {
+ if (comp != null) {
+
+ pane.addTab(GlobalizationUtil
+ .globalize("cms.ui.item_search." + tabName)
+ .localize().toString()
+ ,comp);
+
+ }
+ }
+
+
+ /**
+ * This strange voodoo from Dan. No idea what it does.
+ */
+// @Override
+ public void dispatch(final HttpServletRequest request,
+ final HttpServletResponse response,
+ RequestContext actx)
+ throws IOException, ServletException {
+ new CMSExcursion() {
+
+ @Override
+ public void excurse()
+ throws IOException, ServletException {
+ ContentSection section = null;
+ Application app = Web.getContext().getApplication();
+ if (app instanceof ContentSection) {
+ section = (ContentSection) app;
+ } else {
+ try {
+ section = new ContentSection((BigDecimal) m_sectionId.transformValue(request));
+ } catch (DataObjectNotFoundException ex) {
+ throw new UncheckedWrapperException(ex);
+ }
+ }
+ setContentSection(section);
+
+ final Document doc = buildDocument(request, response);
+ final PresentationManager pm =
+ Templating.getPresentationManager();
+
+ pm.servePage(doc, request, response);
+ }
+
+ }.run();
+ }
+
+ protected void setTabActive(final PageState state, final Component component, final boolean value) {
+ m_tabbedPane.setTabVisible(state, component, value);
+ }
+
+ protected void setTabActive(final PageState state, final int index, final boolean value) {
+ m_tabbedPane.setTabVisible(state, index, value);
+ }
+
+ protected void setDefaultCreationFolder(final Folder folder) {
+ m_create.setDefaultFolder(folder.getOID().toString());
+ }
+
+ protected void setEditAfterCreate(final boolean editAfterCreate) {
+ m_create.setEditAfterCreate(editAfterCreate);
+ }
+
+}
Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSSearchResultRedirector.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSSearchResultRedirector.java (rev 0)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSSearchResultRedirector.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -0,0 +1,120 @@
+/*
+ * 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.cms.ui;
+
+
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.cms.ContentItem;
+import com.arsdigita.cms.ContentSection;
+import com.arsdigita.cms.dispatcher.CMSPage;
+import com.arsdigita.cms.dispatcher.ItemResolver;
+import com.arsdigita.cms.util.GlobalizationUtil;
+import com.arsdigita.dispatcher.DispatcherHelper;
+import com.arsdigita.dispatcher.RequestContext;
+import com.arsdigita.util.UncheckedWrapperException;
+import java.io.IOException;
+import java.math.BigDecimal;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.log4j.Logger;
+
+
+/**
+ * Page for redirecting results of Search to the item to be
+ * displayed.
+ *
+ * @author Jeff Teeters (te...@ar...)
+ * @version $Id: SearchResultRedirector.java 287 2005-02-22 00:29:02Z sskracic $
+ *
+ */
+public class CMSSearchResultRedirector extends CMSApplicationPage {
+
+ /**
+ * Names of required parameters passed in the request
+ */
+ public static final String ITEM_ID = "item_id";
+ public static final String CONTEXT = "context";
+ private static final Logger s_log = Logger.getLogger(CMSSearchResultRedirector.class);
+
+ /**
+ * Construct a new SearchResultRedirector
+ */
+ public CMSSearchResultRedirector() {
+ super();
+ }
+
+
+ /***
+ * override dispatcher to do redirect to page displaying item.
+ ***/
+ public void dispatch(HttpServletRequest req,
+ HttpServletResponse resp, RequestContext actx) {
+
+ // Get item_id
+ BigDecimal id;
+
+ try {
+ id = new BigDecimal(getParam(ITEM_ID, req));
+ } catch (NumberFormatException e) {
+ s_log.error("Invalid CMS Item id", e);
+ String itemID = (String) getParam(ITEM_ID,req);
+ throw new RuntimeException( (String) GlobalizationUtil.globalize(
+ "cms.ui.invalid_item_id", new Object[] { itemID }).localize() + e.getMessage());
+ }
+
+ // Get context
+ String context = getParam(CONTEXT, req);
+
+ // Get section and item
+ ContentSection section;
+ ContentItem item = new ContentItem(id);
+ section = item.getContentSection();
+
+ // Get url
+ ItemResolver resolver = section.getItemResolver();
+ PageState state;
+ try {
+ state = new PageState(this, req, resp);
+ } catch (javax.servlet.ServletException ex) {
+ throw new UncheckedWrapperException("Servlet Error: " + ex.getMessage(), ex);
+ }
+ String url = resolver.generateItemURL ( state, item, section, context );
+
+ // redirect to url
+ try {
+ DispatcherHelper.sendRedirect(req, resp, url);
+ } catch (IOException e) {
+ UncheckedWrapperException.throwLoggedException(getClass(), "Could not redirect: " + e.getMessage(), e );
+ }
+ }
+
+
+ /**
+ * Get a parameter from the request
+ */
+
+ private String getParam ( String paramName, HttpServletRequest req) {
+ String [] params = req.getParameterValues(paramName);
+ if (params.length != 1) {
+ s_log.error("Not one " + paramName);
+ throw new RuntimeException("Not one " + paramName);
+ }
+ return params[0];
+ }
+}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContextBar.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContextBar.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContextBar.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -30,19 +30,21 @@
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.web.ParameterMap;
import com.arsdigita.web.URL;
-import org.apache.log4j.Logger;
import java.math.BigDecimal;
import java.util.List;
import java.util.Stack;
+import org.apache.log4j.Logger;
+
/**
- * <p>The context bar of the content section UI.</p>
+ * The context bar of the content section UI.
*
* @author Justin Ross <jr...@re...>
* @version $Id$
*/
-class ContentSectionContextBar extends WorkspaceContextBar {
+// class ContentSectionContextBar extends WorkspaceContextBar {
+public class ContentSectionContextBar extends WorkspaceContextBar {
private static final Logger s_log = Logger.getLogger
(ContentSectionContextBar.class);
@@ -66,10 +68,12 @@
if (item == null) {
s_log.warn("item is null");
} else if(item.getContentType() == null) {
- s_log.warn("item.getContentType() returns null. item.class.getName(): " + item.getClass().getName());
+ s_log.warn("item.getContentType() returns null. item.class.getName(): "
+ + item.getClass().getName());
}
isTemplate =
- item.getContentType().equals(ContentType.findByAssociatedObjectType(Template.BASE_DATA_OBJECT_TYPE));
+ item.getContentType().equals(ContentType
+ .findByAssociatedObjectType(Template.BASE_DATA_OBJECT_TYPE));
if (isTemplate) {
templateID = item.getID();
}
@@ -104,7 +108,8 @@
parent = folder.getParent();
currentFolderLabel = folder.getLabel();
- if (parent != null || folder.equals(section.getRootFolder())) {
+ if (parent != null || folder.equals(section
+ .getRootFolder())) {
params.setParameter
(ContentSectionPage.SET_FOLDER, folder.getID());
}
@@ -120,10 +125,12 @@
if (isTemplate) {
params.setParameter
- (ContentSectionPage.SET_TAB, new BigDecimal(ContentSectionPage.CONTENTTYPES_TAB));
+ ( ContentSectionPage.SET_TAB,
+ new BigDecimal(ContentSectionPage.CONTENTTYPES_TAB) );
params.setParameter(ContentSectionPage.SET_TEMPLATE, templateID);
}
- // add section-level entry. if this is for an item page, the URL will be for the root folder.
+ // add section-level entry. if this is for an item page, the URL
+ // will be for the root folder.
final URL url = URL.there
(state.getRequest(),
section.getPath() + "/" + PageLocations.SECTION_PAGE,
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -34,7 +34,6 @@
import com.arsdigita.cms.PageLocations;
import com.arsdigita.cms.SecurityManager;
import com.arsdigita.cms.dispatcher.CMSPage;
-import com.arsdigita.cms.util.SecurityConstants;
import com.arsdigita.cms.ui.category.CategoryAdminPane;
import com.arsdigita.cms.ui.cse.ContentSoonExpiredPane;
import com.arsdigita.cms.ui.folder.FolderAdminPane;
@@ -42,17 +41,18 @@
import com.arsdigita.cms.ui.role.RoleAdminPane;
import com.arsdigita.cms.ui.type.ContentTypeAdminPane;
import com.arsdigita.cms.ui.workflow.WorkflowAdminPane;
+import com.arsdigita.cms.util.SecurityConstants;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.kernel.User;
import com.arsdigita.toolbox.ui.LayoutPanel;
+import com.arsdigita.ui.DebugPanel;
import com.arsdigita.util.Assert;
-import com.arsdigita.ui.DebugPanel;
import com.arsdigita.web.Web;
+import javax.servlet.http.HttpServletRequest;
+
import org.apache.log4j.Logger;
-import javax.servlet.http.HttpServletRequest;
-
/**
* Contains the entire admin UI for a content section.
*
@@ -68,7 +68,7 @@
(ContentSectionPage.class);
public static final String RESOURCE_BUNDLE =
- "com.arsdigita.cms.CMSResources";
+ "com.arsdigita.cms.CMSResources";
/**
* The URL parameter that can be passed in in order to set the
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -1,7 +1,22 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright (C) 2011-2013 University of Bremen. 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.cms.ui;
import com.arsdigita.bebop.BoxPanel;
@@ -41,50 +56,101 @@
* @author Sören Bernstein (quasimodo) <sbe...@ze...>
* @author Jens Pelzetter <je...@jp...>
*/
-class ItemSearchCreateItemPane extends CMSContainer implements FormInitListener,
- FormProcessListener,
- FormSubmissionListener {
+class ItemSearchCreateItemPane extends CMSContainer
+ implements FormInitListener,
+ FormProcessListener,
+ FormSubmissionListener {
public static final String WIDGET_PARAM = "widget";
public static final String SEARCHWIDGET_PARAM = "searchWidget";
public static final String PUBLISHWIDGET_PARAM = "publishWidget";
+
private static final String CONTENT_TYPE_ID = "ct";
private static final String FOLDER_ID = "folder_id";
private static final String FLAT_FOLDER = "flatFolder";
- private final NewItemForm m_newItem;
+
private final SingleSelectionModel m_typeSel;
- private final FlatFolderPicker m_folderPicker;
- private final SingleSelectionModel m_model;
- private final FolderSelectionModel m_folderSel; // To support legacy UI code
private String defaultFolder;
private boolean editAfterCreate = true;
- private final CreationSelector m_creator;
private final ContentItemRequestLocal m_contentItem = new ContentItemRequestLocal() {
};
+
//private final Link m_selectCloseLink;
//private final Link m_selectEditLink;
- private final Link m_fallBackLink;
- private final SegmentedPanel m_segPanel;
- private final Segment m_creationSeg;
- private final Segment m_newItemSeg;
- private final Segment m_linkSeg;
+ // private final Link m_fallBackLink;
+ private Link m_fallBackLink;
+ // private final SegmentedPanel m_segPanel;
+ private SegmentedPanel m_segPanel;
+ // private final Segment m_creationSeg;
+ private Segment m_creationSeg;
+ // private final Segment m_newItemSeg;
+ private Segment m_newItemSeg;
+ private final Segment m_linkSeg = new Segment();
+ private final NewItemForm m_newItem = new SectionNewItemForm("newItem");
+ // private final SingleSelectionModel m_model;
+ private SingleSelectionModel m_model;
+ private final FolderSelectionModel m_folderSel; // To support legacy UI code
+ // private FolderSelectionModel m_folderSel; // To support legacy UI code
+ // private final CreationSelector m_creator;
+ private CreationSelector m_creator;
+ private final FlatFolderPicker m_folderPicker = new FlatFolderPicker(FLAT_FOLDER);
+
+ // ////////////////////////////////////////////////////////////////////////
+ //
+ // Quick 'nd Dirty interims solution
+ //
+ // While migrating the CMS pages from legacy dispatcher code to
+ // to new style, legacy free, servlet based pages we need two constructors.
+ // As soon as the migration is completed, the legacy tainted constructor
+ // has to be removed and the init() code can be part of the constructor
+ // again.
+ //
+ // ////////////////////////////////////////////////////////////////////////
+
+
+ /**
+ *
+ * @param parent
+ */
public ItemSearchCreateItemPane(final ItemSearchPage parent) {
super();
+ m_folderSel = new FolderSelectionModel(m_model);
+ m_typeSel = new ParameterSingleSelectionModel(new BigDecimalParameter(CONTENT_TYPE_ID));
+ init();
+ }
+ /**
+ *
+ * @param parent
+ */
+ public ItemSearchCreateItemPane(final CMSItemSearchPage parent) {
+ super();
+ m_folderSel = new FolderSelectionModel(m_model);
+ m_typeSel = new ParameterSingleSelectionModel(new BigDecimalParameter(CONTENT_TYPE_ID));
+ init();
+ }
+
+ /**
+ * Private service method to initialize all the instance properties.
+ * Used by constructors as a temporarly measure to be able to provide
+ * two constructors.
+ * Should be removed when migration completed (cf. note above).
+ */
+ private void init() {
m_segPanel = new SegmentedPanel("itemSearchCreate");
m_creationSeg = new Segment();
m_newItemSeg = new Segment();
- m_linkSeg = new Segment();
+ // m_linkSeg = new Segment();
- m_newItem = new SectionNewItemForm("newItem");
+ // m_newItem = new SectionNewItemForm("newItem");
m_model = new ParameterSingleSelectionModel(new BigDecimalParameter(FOLDER_ID));
- m_folderSel = new FolderSelectionModel(m_model);
+ // m_folderSel = new FolderSelectionModel(m_model);
this.setIdAttr("folder-new-item");
- m_typeSel = new ParameterSingleSelectionModel(new BigDecimalParameter(CONTENT_TYPE_ID));
+ // m_typeSel = new ParameterSingleSelectionModel(new BigDecimalParameter(CONTENT_TYPE_ID));
m_creator = new CreationSelector(m_typeSel, m_folderSel) {
@Override
@@ -101,8 +167,9 @@
m_creationSeg.add(new Label("<br/>", false));
final BoxPanel folderRow = new BoxPanel(BoxPanel.HORIZONTAL);
- folderRow.add(new Label(GlobalizationUtil.globalize("cms.ui.item_search.create.folder_select")));
- m_folderPicker = new FlatFolderPicker(FLAT_FOLDER);
+ folderRow.add(new Label(GlobalizationUtil.globalize(
+ "cms.ui.item_search.create.folder_select")));
+ // m_folderPicker = new FlatFolderPicker(FLAT_FOLDER);
folderRow.add(m_folderPicker);
m_newItem.add(folderRow);
m_newItemSeg.add(m_newItem);
@@ -298,8 +365,12 @@
m_segPanel.add(m_linkSeg);
- }
+ } // init
+ /**
+ *
+ * @param page
+ */
@Override
public void register(final Page page) {
super.register(page);
@@ -312,6 +383,11 @@
page.addComponentStateParam(this, m_folderSel.getStateParameter());
}
+ /**
+ *
+ * @param fse
+ * @throws FormProcessException
+ */
public void init(final FormSectionEvent fse) throws FormProcessException {
final PageState state = fse.getPageState();
final FormData data = fse.getFormData();
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java 2013-02-03 22:27:36 UTC (rev 2492)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -106,9 +106,6 @@
add(new DebugPanel());
- /* Page complete, locked now. */
- // lock();
- init();
}
/**
@@ -135,31 +132,6 @@
return m_search;
}
-/*
- private SimpleContainer makeHeader() {
- PrintListener l = new PrintListener() {
- public void prepare(PrintEvent event) {
- PageState state = event.getPageState();
- Link link = (Link) event.getTarget();
-
- User user = KernelHelper.getCurrentUser(state.getRequest());
-
- link.setChild(new Label(user.getName()));
- link.setTarget("/pvt/");
- }
- };
-
- SimpleContainer sc = new SimpleContainer();
- Label welcomeLabel = new Label(GlobalizationUtil.globalize("cms.ui.welcome"));
- Link nameLink = new Link(l);
-
- sc.add(welcomeLabel);
- sc.add(nameLink);
- return sc;
-
- }
-*/
-
/**
* Created the TabbedPane to use for this page. Sets the class
* attribute for this tabbed pane. The default implementation uses a
Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java (rev 0)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java 2013-02-03 22:34:35 UTC (rev 2493)
@@ -0,0 +1,478 @@
+/*
+ * 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.cms.ui.contentsection;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.SimpleComponent;
+import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.bebop.TabbedPane;
+import com.arsdigita.bebop.event.ActionEvent;
+import com.arsdigita.bebop.event.ActionListener;
+import com.arsdigita.bebop.event.PrintEvent;
+import com.arsdigita.bebop.event.PrintListener;
+import com.arsdigita.cms.CMS;
+import com.arsdigita.cms.ContentItem;
+import com.arsdigita.cms.ContentSection;
+import com.arsdigita.cms.ContentSectionServlet;
+import com.arsdigita.cms.PageLocations;
+import com.arsdigita.cms.SecurityManager;
+import com.arsdigita.cms.ui.*;
+import com.arsdigita.cms.ui.category.CategoryAdminPane;
+import com.arsdigita.cms.ui.cse.ContentSoonExpiredPane;
+import com.arsdigita.cms.ui.folder.FolderAdminPane;
+import com.arsdigita.cms.ui.lifecycle.LifecycleAdminPane;
+import com.arsdigita.cms.ui.role.RoleAdminPane;
+import com.arsdigita.cms.ui.type.ContentTypeAdminPane;
+import com.arsdigita.cms.ui.workflow.WorkflowAdminPane;
+import com.arsdigita.cms.util.SecurityConstants;
+import com.arsdigita.globalization.GlobalizedMessage;
+import com.arsdigita.kernel.User;
+import com.arsdigita.toolbox.ui.LayoutPanel;
+import com.arsdigita.ui.DebugPanel;
+import com.arsdigita.util.Assert;
+import com.arsdigita.web.Web;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.log4j.Logger;
+
+
+// ////////////////////////////////////////////////////////////////////////////
+// WORK IN PROGRESS - UNDER DEVELOPMENT!
+//
+// Migration of the Content Section main page from old style dispatcher based
+// UI to new style, legacy free UI based on servlet.
+// ////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * Contains the entire admin UI for a content section.
+ *
+ * @author Jack Chung
+ * @author Michael Pih
+ * @author Xixi D'Moon <xd...@re...>
+ * @author Justin Ross <jr...@re...>
+ * @author Peter Boy (pb...@ba...)
+ * @version $Id: ContentSectionPage.java 2224 2011-08-01 07:45:23Z pboy $
+ */
+public class MainPage extends CMSApplicationPage implements ActionListener {
+
+ private static final Logger s_log = Logger.getLogger
+ (ContentSectionPage.class);
+
+ public static final String RESOURCE_BUNDLE =
+ "com.arsdigita.cms.CMSResources";
+
+ /**
+ * The URL parameter that can be passed in in order to set the
+ * current folder. This is used in getting back to the correct
+ * level of folder expansion from content item page.
+ */
+ public static final String SET_FOLDER = "set_folder";
+
+ /**
+ * The URL param...
[truncated message content] |
|
From: <pb...@fe...> - 2013-02-03 22:27:45
|
Author: pboy
Date: 2013-02-03 22:27:36 +0000 (Sun, 03 Feb 2013)
New Revision: 2492
Modified:
trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java
trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java
trunk/ccm-portalserver/pdl/com/arsdigita/portalserver/Workspace.pdl
trunk/ccm-portalworkspace/pdl/com/arsdigita/portalworkspace/Workspace.pdl
Log:
PDL adjusted to removal of old style application code, backwards compatibility to contentcenter page handling added.
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java 2013-02-03 22:23:49 UTC (rev 2491)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentCenter.java 2013-02-03 22:27:36 UTC (rev 2492)
@@ -27,7 +27,6 @@
import org.apache.log4j.Logger;
-
/**
* Application domain class for the CMS module user entry page (content-center)
*
@@ -38,11 +37,9 @@
/** A logger instance, primarily to assist debugging . */
private static final Logger s_log = Logger.getLogger(ContentSection.class);
-
// pdl stuff (constants)
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.ContentCenter";
-
// general constants
public static final String PACKAGE_KEY = "content-center";
public static final String INSTANCE_NAME = "Content Center";
@@ -66,7 +63,7 @@
* @param id The <code>id</code> for the retrieved
* <code>DataObject</code>.
*/
- public ContentCenter(BigDecimal key) throws DataObjectNotFoundException {
+ public ContentCenter(BigDecimal key) throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, key));
}
@@ -95,15 +92,13 @@
Application parent) {
ContentCenter app =
- (ContentCenter) Application.createApplication
- (BASE_DATA_OBJECT_TYPE, urlName, title, parent);
+ (ContentCenter) Application.createApplication(BASE_DATA_OBJECT_TYPE, urlName, title, parent);
app.save();
return app;
}
-
/**
* Fetch the URL of the CMS ContentCenter.
*
@@ -115,20 +110,20 @@
*/
public static String getURL() {
// quick 'nd dirty!
- return "/"+PACKAGE_KEY;
+ return "/" + PACKAGE_KEY + "/";
- // Doesn't work as expected
- // see c.ad.ui.login.UserInfo for a working (hopefully) example.
- // ApplicationCollection apps = Application
- // .retrieveAllApplications(BASE_DATA_OBJECT_TYPE);
- // if (apps.next()) {
- // // Note: Currently only one Content Center application is allowed!
- // s_log.error("Instance of ContentCenter found!");
- // return apps.getPrimaryURL();
- // } else {
- // s_log.error("No instance of ContentCenter could be found!");
- // return null;
- // }
+ // Doesn't work as expected
+ // see c.ad.ui.login.UserInfo for a working (hopefully) example.
+ // ApplicationCollection apps = Application
+ // .retrieveAllApplications(BASE_DATA_OBJECT_TYPE);
+ // if (apps.next()) {
+ // // Note: Currently only one Content Center application is allowed!
+ // s_log.error("Instance of ContentCenter found!");
+ // return apps.getPrimaryURL();
+ // } else {
+ // s_log.error("No instance of ContentCenter could be found!");
+ // return null;
+ // }
}
/**
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java 2013-02-03 22:23:49 UTC (rev 2491)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java 2013-02-03 22:27:36 UTC (rev 2492)
@@ -16,12 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
package com.arsdigita.cms;
import com.arsdigita.bebop.Page;
-import com.arsdigita.cms.SecurityManager;
+import com.arsdigita.cms.dispatcher.CMSPage;
import com.arsdigita.cms.dispatcher.SimpleCache;
+import com.arsdigita.cms.ui.ItemSearchPage;
import com.arsdigita.cms.ui.contentcenter.MainPage;
import com.arsdigita.developersupport.DeveloperSupport;
import com.arsdigita.dispatcher.AccessDeniedException;
@@ -60,38 +60,28 @@
/** Logger instance for debugging */
private static Logger s_log = Logger
- .getLogger(ContentCenterServlet.class.getName());
-
+ .getLogger(ContentCenterServlet.class.getName());
// DEPRECATED STUFF follows. Should be no longer used, deleted in future!
/** The path of the file that maps resources. */
public final static String DEFAULT_MAP_FILE =
"/WEB-INF/resources/content-center-old-map.xml";
-
/** Mapping between a relative URL and the class name of a ResourceHandler.*/
// private static HashMap s_pageClasses = ContentCenterSetup.getURLToClassMap();
private static HashMap s_pageURLs = ContentCenterSetup.getClassToURLMap();
-
/** Instantiated ResourceHandlers cache. This allows for lazy loading. */
private static SimpleCache s_pages = new SimpleCache();
-
private ArrayList m_trailingSlashList = new ArrayList();
-
// NEW STUFF here used to process the pages in this servlet
-
/** URL (pathinfo) -> Page object mapping. Based on it (and the http
* request url) the doService method to selects a page to display */
private final Map m_pages = new HashMap();
-
-
// STUFF to use for JSP extension, i.e. jsp's to try for URLs which are not
// handled by the this servlet directly.
/** Path to directory containg ccm-cms template files */
private String m_templatePath;
-
/** Resolvers to find templates (JSP) and other stuff stored in file system.*/
private ApplicationFileResolver m_resolver;
-
/**
* Use parent's class initialization extension point to perform additional
* initialisation tasks.
@@ -110,9 +100,10 @@
// Addresses previously noted in WEB-INF/resources/content-center-map.xml
// Obviously not required.
addPage("/", new MainPage()); // index page at address ~/ds
- // addPage("/index/", new MainPage());
- // addPage("/ItemSearchPage/", new CCItemSearchPage());
- // addPage("/SearchResultRedirector/", new CCSearchResultRedirector());
+ // addPage("/index/", new MainPage());
+ //addPage("/ItemSearchPage/", new ItemSearchPage());
+ addPage("/item-search", new ItemSearchPage());
+ // addPage("/SearchResultRedirector/", new CCSearchResultRedirector());
// STUFF to use for JSP extension, i.e. jsp's to try for URLs which are not
@@ -123,14 +114,13 @@
m_templatePath = "/templates/ccm-cms/content-center";
Assert.exists(m_templatePath, String.class);
Assert.isTrue(m_templatePath.startsWith("/"),
- "template-path must start with '/'");
+ "template-path must start with '/'");
Assert.isTrue(!m_templatePath.endsWith("/"),
- "template-path must not end with '/'");
+ "template-path must not end with '/'");
/** Set TemplateResolver class */
m_resolver = Web.getConfig().getApplicationFileResolver();
}
-
/**
* Implements the (abstract) doService method of BaseApplicationServlet to
* create the ContentCenter page.
@@ -138,10 +128,10 @@
* @see com.arsdigita.web.BaseApplicationServlet#doService
* (HttpServletRequest, HttpServletResponse, Application)
*/
- protected void doService( HttpServletRequest sreq,
- HttpServletResponse sresp,
- Application app)
- throws ServletException, IOException {
+ protected void doService(HttpServletRequest sreq,
+ HttpServletResponse sresp,
+ Application app)
+ throws ServletException, IOException {
if (s_log.isDebugEnabled()) {
s_log.info("starting doService method");
@@ -170,13 +160,13 @@
sections.close();
if (!hasAccess) { // user has no access privilege
throw new AccessDeniedException(
- "User is not entitled to access any content section");
+ "User is not entitled to access any content section");
// throw new LoginSignal(sreq); // send to login page
}
-
-
- RequestContext ctx = DispatcherHelper.getRequestContext();
+
+
+ RequestContext ctx = DispatcherHelper.getRequestContext();
String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext
String originalUrl = ctx.getOriginalURL();
@@ -191,31 +181,39 @@
* trailing '/' if a "virtual" page, i.e. not a real jsp, but
* result of a servlet mapping. But Application requires url
* NOT to end with a trailing '/' for legacy free applications. */
- pathInfo = pathInfo.substring(0, pathInfo.length()-1);
+ pathInfo = pathInfo.substring(0, pathInfo.length() - 1);
}
// An empty remaining URL or a URL which doesn't end in trailing slash:
// probably want to redirect.
// Probably DEPRECATED with new access method or only relevant for jsp
// extension
- if ( m_trailingSlashList.contains(url) && !originalUrl.endsWith("/") ) {
+ if (m_trailingSlashList.contains(url) && !originalUrl.endsWith("/")) {
DispatcherHelper.sendRedirect(sresp, originalUrl + "/");
return;
}
final Page page = (Page) m_pages.get(pathInfo);
- if ( page != null ) {
+ if (page != null) {
// Check user access.
checkUserAccess(sreq, sresp);
- // Serve the page.
- final Document doc = page.buildDocument(sreq, sresp);
- PresentationManager pm = Templating.getPresentationManager();
- pm.servePage(doc, sreq, sresp);
- // page.init();
- // page.dispatch(sreq, sresp, ctx);
+ //Lock the page
+ if (page instanceof CMSPage) {
+ final CMSPage cmsPage = (CMSPage) page;
+ cmsPage.init();
+ cmsPage.dispatch(sreq, sresp, ctx);
+ } else {
+ page.lock();
+ // Serve the page.
+ final Document doc = page.buildDocument(sreq, sresp);
+
+ PresentationManager pm = Templating.getPresentationManager();
+ pm.servePage(doc, sreq, sresp);
+ }
+
} else {
// Fall back on the JSP application dispatcher.
// NOTE: The JSP must ensure the proper authentication and
@@ -223,7 +221,7 @@
if (s_log.isInfoEnabled()) {
s_log.info("NO page registered to serve the requst url.");
}
-
+
RequestDispatcher rd = m_resolver.resolve(m_templatePath,
sreq, sresp, app);
if (rd != null) {
@@ -231,21 +229,20 @@
s_log.debug("Got dispatcher " + rd);
}
sreq = DispatcherHelper.restoreOriginalRequest(sreq);
- rd.forward(sreq,sresp);
+ rd.forward(sreq, sresp);
} else {
sresp.sendError(404, requestUri + " not found on this server.");
}
}
-
+
DeveloperSupport.endStage("ContentCenterServlet.doService");
if (s_log.isDebugEnabled()) {
s_log.info("doService method completed");
}
} // END doService()
-
/**
* Adds one pair of Url - Page to the internal hash map, used as a cache.
*
@@ -264,7 +261,6 @@
m_pages.put(pathInfo, page);
}
-
/**
* Service Method returns the URL stub for the class name,
* can return null if not mapped
@@ -274,11 +270,10 @@
s_log.debug("Getting URL Stub for : " + classname);
Iterator itr = s_pageURLs.keySet().iterator();
while (itr.hasNext()) {
- String classname2 = (String)itr.next();
- s_log.debug("key: " + classname + " value: " +
- (String)s_pageURLs.get(classname2));
+ String classname2 = (String) itr.next();
+ s_log.debug("key: " + classname + " value: " + (String) s_pageURLs.get(classname2));
}
- String url = (String)s_pageURLs.get(classname);
+ String url = (String) s_pageURLs.get(classname);
return url;
}
@@ -293,7 +288,6 @@
s_pages.remove(url);
}
-
/**
* Verify that the user is logged in and is able to view the
* page. Subclasses can override this method if they need to, but
@@ -305,10 +299,10 @@
**/
protected void checkUserAccess(final HttpServletRequest request,
final HttpServletResponse response //,
-/// final RequestContext actx
- )
- throws ServletException {
-
+ /// final RequestContext actx
+ )
+ throws ServletException {
+
if (!Web.getUserContext().isLoggedIn()) {
throw new LoginSignal(request);
@@ -324,11 +318,11 @@
**/
protected void redirectToLoginPage(HttpServletRequest req,
HttpServletResponse resp)
- throws ServletException {
+ throws ServletException {
String url = Util.getSecurityHelper()
- .getLoginURL(req)
- +"?"+LoginHelper.RETURN_URL_PARAM_NAME
- +"="+UserContext.encodeReturnURL(req);
+ .getLoginURL(req)
+ + "?" + LoginHelper.RETURN_URL_PARAM_NAME
+ + "=" + UserContext.encodeReturnURL(req);
try {
LoginHelper.sendRedirect(req, resp, url);
} catch (IOException e) {
Modified: trunk/ccm-portalserver/pdl/com/arsdigita/portalserver/Workspace.pdl
===================================================================
--- trunk/ccm-portalserver/pdl/com/arsdigita/portalserver/Workspace.pdl 2013-02-03 22:23:49 UTC (rev 2491)
+++ trunk/ccm-portalserver/pdl/com/arsdigita/portalserver/Workspace.pdl 2013-02-03 22:27:36 UTC (rev 2492)
@@ -86,7 +86,7 @@
workspace.displayName = acs_objects.display_name;
workspace.defaultDomainClass = acs_objects.default_domain_class;
workspace.parentResource.id = applications.parent_application_id;
- workspace.packageInstance.id = applications.package_id;
+// workspace.packageInstance.id = applications.package_id; (Old stype app code removed in 6.6.5)
workspace.title = applications.title;
workspace.description = applications.description;
workspace.primaryURL = applications.primary_url;
@@ -106,7 +106,7 @@
acs_objects.display_name,
acs_objects.default_domain_class,
applications.parent_application_id,
- applications.package_id,
+// applications.package_id,
applications.title,
applications.description,
applications.primary_url,
@@ -129,7 +129,7 @@
workspace.displayName = acs_objects.display_name;
workspace.defaultDomainClass = acs_objects.default_domain_class;
workspace.parentResource.id = applications.parent_application_id;
- workspace.packageInstance.id = applications.package_id;
+// workspace.packageInstance.id = applications.package_id;
workspace.title = applications.title;
workspace.description = applications.description;
workspace.primaryURL = applications.primary_url;
@@ -139,50 +139,50 @@
}
}
-query workspaceForSiteNodeID {
- Workspace workspace;
+// (pb) query workspaceForSiteNodeID {
+// (pb) Workspace workspace;
+// (pb)
+// (pb) do {
+// (pb) select
+// (pb) acs_objects.object_id,
+// (pb) acs_objects.object_type,
+// (pb) acs_objects.display_name,
+// (pb) acs_objects.default_domain_class,
+// (pb) applications.parent_application_id,
+// (pb) applications.package_id,
+// (pb) applications.title,
+// (pb) applications.description,
+// (pb) applications.primary_url,
+// (pb) ps_workspaces.ready_p,
+// (pb) ps_workspaces.mission
+// (pb) from
+// (pb) site_nodes,
+// (pb) apm_packages,
+// (pb) applications,
+// (pb) acs_objects,
+// (pb) ps_workspaces
+// (pb) where
+// (pb) site_nodes.node_id = :siteNodeID
+// (pb) -- joins
+// (pb) and site_nodes.object_id = apm_packages.package_id
+// (pb) and apm_packages.package_id = applications.package_id
+// (pb) and applications.application_id = acs_objects.object_id
+// (pb) and applications.application_id = ps_workspaces.workspace_id
+// (pb) } map {
+// (pb) workspace.id = acs_objects.object_id;
+// (pb) workspace.objectType = acs_objects.object_type;
+// (pb) workspace.displayName = acs_objects.display_name;
+// (pb) workspace.defaultDomainClass = acs_objects.default_domain_class;
+// (pb) workspace.parentResource.id = applications.parent_application_id;
+// (pb) workspace.packageInstance.id = applications.package_id;
+// (pb) workspace.title = applications.title;
+// (pb) workspace.description = applications.description;
+// (pb) workspace.primaryURL = applications.primary_url;
+// (pb) workspace.isReady = ps_workspaces.ready_p;
+// (pb) workspace.mission = ps_workspaces.mission;
+// (pb) }
+// (pb) }
- do {
- select
- acs_objects.object_id,
- acs_objects.object_type,
- acs_objects.display_name,
- acs_objects.default_domain_class,
- applications.parent_application_id,
- applications.package_id,
- applications.title,
- applications.description,
- applications.primary_url,
- ps_workspaces.ready_p,
- ps_workspaces.mission
- from
- site_nodes,
- apm_packages,
- applications,
- acs_objects,
- ps_workspaces
- where
- site_nodes.node_id = :siteNodeID
- -- joins
- and site_nodes.object_id = apm_packages.package_id
- and apm_packages.package_id = applications.package_id
- and applications.application_id = acs_objects.object_id
- and applications.application_id = ps_workspaces.workspace_id
- } map {
- workspace.id = acs_objects.object_id;
- workspace.objectType = acs_objects.object_type;
- workspace.displayName = acs_objects.display_name;
- workspace.defaultDomainClass = acs_objects.default_domain_class;
- workspace.parentResource.id = applications.parent_application_id;
- workspace.packageInstance.id = applications.package_id;
- workspace.title = applications.title;
- workspace.description = applications.description;
- workspace.primaryURL = applications.primary_url;
- workspace.isReady = ps_workspaces.ready_p;
- workspace.mission = ps_workspaces.mission;
- }
-}
-
query RolesForUser {
BigDecimal groupID;
do {
Modified: trunk/ccm-portalworkspace/pdl/com/arsdigita/portalworkspace/Workspace.pdl
===================================================================
--- trunk/ccm-portalworkspace/pdl/com/arsdigita/portalworkspace/Workspace.pdl 2013-02-03 22:23:49 UTC (rev 2491)
+++ trunk/ccm-portalworkspace/pdl/com/arsdigita/portalworkspace/Workspace.pdl 2013-02-03 22:27:36 UTC (rev 2492)
@@ -74,7 +74,7 @@
workspace.displayName = acs_objects.display_name;
workspace.defaultDomainClass = acs_objects.default_domain_class;
workspace.parentResource.id = applications.parent_application_id;
- workspace.packageInstance.id = applications.package_id;
+// workspace.packageInstance.id = applications.package_id; (Old style app code removed)
workspace.title = applications.title;
workspace.primaryURL = applications.primary_url;
workspace.description = applications.description;
|
|
From: <pb...@fe...> - 2013-02-03 22:23:59
|
Author: pboy
Date: 2013-02-03 22:23:49 +0000 (Sun, 03 Feb 2013)
New Revision: 2491
Added:
trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java.temporyraOff
Removed:
trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java
Log:
Deactivated cms update script, because it uses old style application code. Has to be refactored!
Deleted: trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java 2013-02-03 19:15:20 UTC (rev 2490)
+++ trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java 2013-02-03 22:23:49 UTC (rev 2491)
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2011 Peter Boy <pb...@ze...>. 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.cms.upgrade;
-
-import com.arsdigita.cms.Loader;
-import com.arsdigita.kernel.Kernel;
-import com.arsdigita.kernel.KernelExcursion;
-import com.arsdigita.kernel.PackageInstance;
-import com.arsdigita.kernel.PackageInstanceCollection;
-import com.arsdigita.kernel.PackageType;
-import com.arsdigita.kernel.Resource;
-import com.arsdigita.kernel.ResourceType;
-import com.arsdigita.util.cmd.Program;
-import com.arsdigita.persistence.Session;
-import com.arsdigita.persistence.SessionManager;
-import com.arsdigita.persistence.TransactionContext;
-import com.arsdigita.util.StringUtils;
-import com.arsdigita.web.Application;
-import com.arsdigita.web.ApplicationType;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.log4j.Logger;
-
-/**
- * Update from CCM version 6.6.1 to 6.6.2 where loader has been refactored to
- * use (new style) applications in package com.arsdigita.web instead of old
- * style applications using com.arsdigita.kermel.[Package* & SiteNode].
- *
- * Affected are the packages CMS Workspace and Service. They are now loaded
- * using new style application classes Workspace and Service.
- *
- * The task at hand is to add the necessary table entries for CMS Workspace and
- * Service to the tables application_types and applications using the
- * information already existing (by old style initialization) in
- * apm_package_types, site_nodes, and apm_packages.
- *
- * @author pb
- */
-public class AddNewStyleApplicationEntries extends Program {
-
- private static Logger s_log = Logger.getLogger(CreateGenericContentTypes.class);
-
- /**
- /* Constructor constructs a program object which initializes the CCM
- * runtime system and enables concatenation, so a following SQL script
- * may be executed.
- */
- public AddNewStyleApplicationEntries() {
- super("AddNewStyleApplicationEntries", "1.0.0", "",true,true);
- }
-
-
- /**
- * The mandatory main method
- * @param args
- */
- public static void main(final String[] args) {
- new AddNewStyleApplicationEntries().run(args);
- }
-
-
- /**
- * Worker method. Adds new style application entries.
- *
- * @param cmdLine
- */
- public void doRun(CommandLine cmdLine) {
-
- new KernelExcursion() {
- public void excurse() {
- setEffectiveParty(Kernel.getSystemParty());
- final Session session = SessionManager.getSession();
- final TransactionContext tc = session.getTransactionContext();
- tc.beginTxn();
-
- // Update CMS Workspace
- ApplicationType appType = null;
- appType = Loader.loadContentCenterApplicationType();
- // get corresponding package type
- PackageType packageType = PackageType.findByKey("content-center");
- // get all installed instances
- PackageInstanceCollection allPackages = packageType
- .getInstances();
- PackageInstance aPackage = null ;
- Resource res = null;
- Application app = null;
- while ( allPackages.next() ) {
- aPackage = allPackages.getPackageInstance();
- res = Resource.createResource((ResourceType)appType,
- aPackage.getDisplayName(),
- null);
- res.setDescription("The default CMS workspace instance.");
- res.save();
- app = Application.retrieveApplication(res.getOID());
- app.setPath("/"+StringUtils.urlize(app.getTitle())+"/");
- // unfortunately there seems to be no way to set the
- // assoziation to PackageInstance. So we must do that by
- // SQL magic
- }
-
-
- // Update CMS Service
- appType = null;
- appType = Loader.loadServiceApplicationType();
- // get corresponding package type
- packageType = PackageType.findByKey("cms-service");
- // get all installed instances
- allPackages = packageType.getInstances();
- aPackage = null ;
- res = null;
- app = null;
- while ( allPackages.next() ) {
- aPackage = allPackages.getPackageInstance();
- res = Resource.createResource((ResourceType)appType,
- aPackage.getDisplayName(),
- null);
- res.setDescription("The default CMS service instance.");
- res.save();
- app = Application.retrieveApplication(res.getOID());
- app.setPath("/"+StringUtils.urlize(app.getTitle())+"/");
- // unfortunately there seems to be no way to set the
- // assoziation to PackageInstance. So we must do that by
- // SQL magic
- }
-
-
- tc.commitTxn();
- }
- }.run();
- }
-
-}
Added: trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java.temporyraOff
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java.temporyraOff (rev 0)
+++ trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java.temporyraOff 2013-02-03 22:23:49 UTC (rev 2491)
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2011 Peter Boy <pb...@ze...>. 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.cms.upgrade;
+
+import com.arsdigita.cms.Loader;
+import com.arsdigita.kernel.Kernel;
+import com.arsdigita.kernel.KernelExcursion;
+import com.arsdigita.kernel.PackageInstance;
+import com.arsdigita.kernel.PackageInstanceCollection;
+import com.arsdigita.kernel.PackageType;
+import com.arsdigita.kernel.Resource;
+import com.arsdigita.kernel.ResourceType;
+import com.arsdigita.util.cmd.Program;
+import com.arsdigita.persistence.Session;
+import com.arsdigita.persistence.SessionManager;
+import com.arsdigita.persistence.TransactionContext;
+import com.arsdigita.util.StringUtils;
+import com.arsdigita.web.Application;
+import com.arsdigita.web.ApplicationType;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.log4j.Logger;
+
+/**
+ * Update from CCM version 6.6.1 to 6.6.2 where loader has been refactored to
+ * use (new style) applications in package com.arsdigita.web instead of old
+ * style applications using com.arsdigita.kermel.[Package* & SiteNode].
+ *
+ * Affected are the packages CMS Workspace and Service. They are now loaded
+ * using new style application classes Workspace and Service.
+ *
+ * The task at hand is to add the necessary table entries for CMS Workspace and
+ * Service to the tables application_types and applications using the
+ * information already existing (by old style initialization) in
+ * apm_package_types, site_nodes, and apm_packages.
+ *
+ * @author pb
+ */
+public class AddNewStyleApplicationEntries extends Program {
+
+ private static Logger s_log = Logger.getLogger(CreateGenericContentTypes.class);
+
+ /**
+ /* Constructor constructs a program object which initializes the CCM
+ * runtime system and enables concatenation, so a following SQL script
+ * may be executed.
+ */
+ public AddNewStyleApplicationEntries() {
+ super("AddNewStyleApplicationEntries", "1.0.0", "",true,true);
+ }
+
+
+ /**
+ * The mandatory main method
+ * @param args
+ */
+ public static void main(final String[] args) {
+ new AddNewStyleApplicationEntries().run(args);
+ }
+
+
+ /**
+ * Worker method. Adds new style application entries.
+ *
+ * @param cmdLine
+ */
+ public void doRun(CommandLine cmdLine) {
+
+ new KernelExcursion() {
+ public void excurse() {
+ setEffectiveParty(Kernel.getSystemParty());
+ final Session session = SessionManager.getSession();
+ final TransactionContext tc = session.getTransactionContext();
+ tc.beginTxn();
+
+ // Update CMS Workspace
+ ApplicationType appType = null;
+ appType = Loader.loadContentCenterApplicationType();
+ // get corresponding package type
+ PackageType packageType = PackageType.findByKey("content-center");
+ // get all installed instances
+ PackageInstanceCollection allPackages = packageType
+ .getInstances();
+ PackageInstance aPackage = null ;
+ Resource res = null;
+ Application app = null;
+ while ( allPackages.next() ) {
+ aPackage = allPackages.getPackageInstance();
+ res = Resource.createResource((ResourceType)appType,
+ aPackage.getDisplayName(),
+ null);
+ res.setDescription("The default CMS workspace instance.");
+ res.save();
+ app = Application.retrieveApplication(res.getOID());
+ app.setPath("/"+StringUtils.urlize(app.getTitle())+"/");
+ // unfortunately there seems to be no way to set the
+ // assoziation to PackageInstance. So we must do that by
+ // SQL magic
+ }
+
+
+ // Update CMS Service
+ appType = null;
+ appType = Loader.loadServiceApplicationType();
+ // get corresponding package type
+ packageType = PackageType.findByKey("cms-service");
+ // get all installed instances
+ allPackages = packageType.getInstances();
+ aPackage = null ;
+ res = null;
+ app = null;
+ while ( allPackages.next() ) {
+ aPackage = allPackages.getPackageInstance();
+ res = Resource.createResource((ResourceType)appType,
+ aPackage.getDisplayName(),
+ null);
+ res.setDescription("The default CMS service instance.");
+ res.save();
+ app = Application.retrieveApplication(res.getOID());
+ app.setPath("/"+StringUtils.urlize(app.getTitle())+"/");
+ // unfortunately there seems to be no way to set the
+ // assoziation to PackageInstance. So we must do that by
+ // SQL magic
+ }
+
+
+ tc.commitTxn();
+ }
+ }.run();
+ }
+
+}
|
|
From: <pb...@fe...> - 2013-02-03 18:15:25
|
Author: pboy
Date: 2013-02-03 18:15:14 +0000 (Sun, 03 Feb 2013)
New Revision: 2489
Modified:
releases/2.0.0/tools-ng/common/xsl/build-template.xsl
releases/2.0.0/tools-ng/ecdc/scriptlib/build-ccm.xml
releases/2.0.0/tools-ng/netbeans/project.xml
Log:
Added Camden contributed packages to netbeans configuration, enhanced build-template.xsl to handle special dirs template/ROOT and template/ERROR for specific jsp templates respectivly, specifically needed by Camden packages.
Modified: releases/2.0.0/tools-ng/common/xsl/build-template.xsl
===================================================================
--- releases/2.0.0/tools-ng/common/xsl/build-template.xsl 2013-02-03 13:30:50 UTC (rev 2488)
+++ releases/2.0.0/tools-ng/common/xsl/build-template.xsl 2013-02-03 18:15:14 UTC (rev 2489)
@@ -1337,15 +1337,39 @@
</fileset>
</copy>
- <copy todir="${{this.deploy.dir}}" overwrite="yes">
+ <!-- Copy subdirectories templates and themes to web, but exclude
+ special directories ROOT and ERROR, which must be processed
+ separately. -->
+ <copy todir="${{this.deploy.dir}}" overwrite="yes" >
<fileset dir="${{resolved.bundle.source.dir}}" >
<include name="templates/" />
<include name="themes/" />
- <exclude name="**placeholder.info**" />
- <exclude name="**README**" />
+ <exclude name="themes/placeholder.info" />
+ <exclude name="templates/placeholder.info" />
+ <exclude name="templates/ROOT/" />
+ <exclude name="templates/ERROR/" />
</fileset>
</copy>
+
+ <!-- Process special directory templates/ERROR
+ copy files to [docroot]/error -->
+ <copy todir="${{this.deploy.dir}}/error" overwrite="yes" failonerror="false" >
+ <fileset dir="${{resolved.bundle.source.dir}}/templates/ERROR/" >
+ <include name="*" />
+ <exclude name="placeholder.info" />
+ </fileset>
+ </copy>
+
+ <!-- Process special directory templates/ROOT
+ copy files to document root (context root). -->
+ <copy todir="${{this.deploy.dir}}" overwrite="yes" failonerror="false" >
+ <fileset dir="${{resolved.bundle.source.dir}}/templates/ROOT/" >
+ <include name="*" />
+ <exclude name="placeholder.info" />
+ </fileset>
+ </copy>
+
<!-- Autogenerate from project.xml a file containing a space delimited
list of package keys included in this build. Used during
initialization of a *.war file distribution as simplification and
Modified: releases/2.0.0/tools-ng/ecdc/scriptlib/build-ccm.xml
===================================================================
--- releases/2.0.0/tools-ng/ecdc/scriptlib/build-ccm.xml 2013-02-03 13:30:50 UTC (rev 2488)
+++ releases/2.0.0/tools-ng/ecdc/scriptlib/build-ccm.xml 2013-02-03 18:15:14 UTC (rev 2489)
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Purpose:
+ ANT script to perform the various administration and maintenance tasks,
+ i.e.:
+ - Various LOAD steps to load the database
+ most prominent: load-bundle
+ - UPGRADE tasks to run SQL upgrade scripts
+ - RUN-CCM task to run various CLI utility classes
+-->
+
<!-- Already definded:
ccm.project.dir: base dir of the development project
app.server.bundles.zip name of the installation file
Modified: releases/2.0.0/tools-ng/netbeans/project.xml
===================================================================
--- releases/2.0.0/tools-ng/netbeans/project.xml 2013-02-03 13:30:50 UTC (rev 2488)
+++ releases/2.0.0/tools-ng/netbeans/project.xml 2013-02-03 18:15:14 UTC (rev 2489)
@@ -263,6 +263,18 @@
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-atoz (Source)</label>
+ <type>java</type>
+ <location>ccm-atoz/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-atoz-siteproxy (Source)</label>
+ <type>java</type>
+ <location>ccm-atoz-siteproxy/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>ccm-auth-http (Source)</label>
<type>java</type>
<location>ccm-auth-http/src</location>
@@ -353,6 +365,12 @@
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-portlet-collection (Source)</label>
+ <type>java</type>
+ <location>ccm-portlet-collection/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>ccm-portlet-latestnews (Source)</label>
<type>java</type>
<location>ccm-portlet-latestnews/src</location>
@@ -419,6 +437,12 @@
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-ldn-atoz-siteproxy (Source)</label>
+ <type>java</type>
+ <location>ccm-ldn-atoz-siteproxy/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>ccm-ldn-dublin (Source)</label>
<type>java</type>
<location>ccm-ldn-dublin/src</location>
@@ -478,19 +502,57 @@
<location>ccm-ldn-util/src</location>
<encoding>UTF-8</encoding>
</source-folder>
+
<source-folder>
- <label>ccm-gen-aplaws (Source)</label>
+ <label>ccm-lbc-aplaws (Source)</label>
<type>java</type>
- <location>ccm-gen-aplaws/src</location>
+ <location>ccm-lbc-aplaws/src</location>
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
- <label>ccm-gen-aplaws (Web)</label>
+ <label>ccm-lbc-consultation (Source)</label>
<type>java</type>
- <location>ccm-gen-aplaws/web</location>
+ <location>ccm-lbc-consultation/src</location>
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-lbc-contentcheck (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-contentcheck/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-decisiontree (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-decisiontree/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-eforms (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-eforms/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-foi (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-foi/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-retention (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-retention/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-wordxml (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-wordxml/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+
+ <source-folder>
<label>ccm-sci-bundle (Source)</label>
<type>java</type>
<location>ccm-sci-bundle/src</location>
@@ -742,6 +804,14 @@
<location>ccm-cms-types-xmlfeed/src</location>
</source-folder>
<source-folder style="packages">
+ <label>ccm-atoz (Source)</label>
+ <location>ccm-atoz/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-atoz-siteproxy (Source)</label>
+ <location>ccm-atoz-siteproxy/src</location>
+ </source-folder>
+ <source-folder style="packages">
<label>ccm-auth-http (Source)</label>
<location>ccm-auth-http/src</location>
</source-folder>
@@ -802,6 +872,10 @@
<location>ccm-portlet-bookmarks/src</location>
</source-folder>
<source-folder style="packages">
+ <label>ccm-portlet-collection (Source)</label>
+ <location>ccm-portlet-collection/src</location>
+ </source-folder>
+ <source-folder style="packages">
<label>ccm-portlet-latestnews (Source)</label>
<location>ccm-portlet-latestnews/src</location>
</source-folder>
@@ -885,7 +959,41 @@
<label>ccm-ldn-util (Source)</label>
<location>ccm-ldn-util/src</location>
</source-folder>
+
<source-folder style="packages">
+ <label>ccm-lbc-aplaws (Source)</label>
+ <location>ccm-lbc-aplaws/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-consultation (Source)</label>
+ <location>ccm-lbc-consultation/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-contentcheck (Source)</label>
+ <location>ccm-lbc-contentcheck/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-decisiontree (Source)</label>
+ <location>ccm-lbc-decisiontree/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-eforms (Source)</label>
+ <location>ccm-lbc-eforms/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-foi (Source)</label>
+ <location>ccm-lbc-foi/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-retention (Source)</label>
+ <location>ccm-lbc-retention/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-wordxml (Source)</label>
+ <location>ccm-lbc-wordxml/src</location>
+ </source-folder>
+
+ <source-folder style="packages">
<label>ccm-sci-bundle (Source)</label>
<location>ccm-sci-bundle/src</location>
</source-folder>
@@ -902,20 +1010,20 @@
<location>ccm-sci-publications/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-departement (Source)</label>
- <location>ccm-sci-type-departement/src</location>
+ <label>ccm-sci-types-department (Source)</label>
+ <location>ccm-sci-types-department/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-institute (Source)</label>
- <location>ccm-sci-type-institute/src</location>
+ <label>ccm-sci-types-institute (Source)</label>
+ <location>ccm-sci-types-institute/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-member (Source)</label>
- <location>ccm-sci-type-member/src</location>
+ <label>ccm-sci-types-member (Source)</label>
+ <location>ccm-sci-types-member/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-project (Source)</label>
- <location>ccm-sci-type-project/src</location>
+ <label>ccm-sci-types-project (Source)</label>
+ <location>ccm-sci-types-project/src</location>
</source-folder>
<source-file>
<location>build.xml</location>
@@ -975,6 +1083,8 @@
<package-root>ccm-cms-types-siteproxy/src</package-root>
<package-root>ccm-cms-types-survey/src</package-root>
<package-root>ccm-cms-types-xmlfeed/src</package-root>
+ <package-root>ccm-atoz/src</package-root>
+ <package-root>ccm-atoz-siteproxy/src</package-root>
<package-root>ccm-auth-http/src</package-root>
<package-root>ccm-bookmarks/src</package-root>
<package-root>ccm-bundle/src</package-root>
@@ -990,6 +1100,7 @@
<package-root>ccm-portalworkspace/src</package-root>
<package-root>ccm-portalworkspace-homepage/src</package-root>
<package-root>ccm-portlet-bookmarks/src</package-root>
+ <package-root>ccm-portlet-collection/src</package-root>
<package-root>ccm-portlet-latestnews/src</package-root>
<package-root>ccm-portlet-motd/src</package-root>
<package-root>ccm-rssfeed/src</package-root>
@@ -1011,15 +1122,24 @@
<package-root>ccm-ldn-types-esdservice/src</package-root>
<package-root>ccm-ldn-userpreferences/src</package-root>
<package-root>ccm-ldn-util/src</package-root>
+ <package-root>ccm-lbc-aplaws/src</package-root>
+ <package-root>ccm-lbc-consultation/src</package-root>
+ <package-root>ccm-lbc-contentcheck/src</package-root>
+ <package-root>ccm-lbc-decisiontree/src</package-root>
+ <package-root>ccm-lbc-eforms/src</package-root>
+ <package-root>ccm-lbc-foi/src</package-root>
+ <package-root>ccm-lbc-retention/src</package-root>
+ <package-root>ccm-lbc-wordxml/src</package-root>
<package-root>ccm-sci-bundle/src</package-root>
<package-root>ccm-sci-personalprojects/src</package-root>
<package-root>ccm-sci-personalpublications/src</package-root>
<package-root>ccm-sci-publications/src</package-root>
- <package-root>ccm-sci-type-department/src</package-root>
- <package-root>ccm-sci-type-institute/src</package-root>
- <package-root>ccm-sci-type-member/src</package-root>
- <package-root>ccm-sci-type-project/src</package-root>
- <classpath mode="compile">ccm-core/lib/log4j.jar:ccm-core/lib/mail.jar:ccm-core/lib/commons-beanutils.jar:ccm-core/lib/commons-cli-1.0.jar:ccm-core/lib/commons-collections-3.0.jar:ccm-core/lib/commons-codec-1.3.jar:ccm-core/lib/commons-fileupload-1.1.1.jar:ccm-core/lib/commons-lang-2.1.jar:ccm-core/lib/commons-primitives-1.0.jar:ccm-core/lib/xercesImpl.jar:ccm-core/lib/jakarta-oro-2.0.8.jar:ccm-core/lib/Tidy.jar:ccm-core/lib/jdom.jar:ccm-core/lib/jdxslt.jar:ccm-core/lib/lucene-core-2.4.0.jar:ccm-core/lib/saxon.jar:ccm-core/lib/poi-2.5-final-20040302.jar:ccm-core/lib/pdfbox-1.4.0.jar:ccm-core/lib/tm-extractors-0.4.jar:ccm-core/lib/bcprov-jdk16-144.jar:ccm-cms/lib/jai_codec.jar:ccm-cms/lib/jai_core.jar:ccm-cms/lib/mlibwrapper_jai.jar:ccm-ldn-search/lib/axis.jar:ccm-ldn-search/lib/jaxrpc.jar:ccm-ldn-search/lib/jobo.jar:ccm-ldn-terms/lib/commons-digester.jar:ccm-ldn-terms/lib/jena.jar:ccm-ldn-terms/lib/snowball.jar:ccm-ldn-terms/lib/weka-3.5.5.jar:ccm-ldn-terms/l
ib/xstream-1.3.1.jar:ccm-formbuilder-pdf/lib/fop.jar:tools-ng/devel/lib/ccm-servlet-2.3.jar:tools-ng/devel/lib/ojdbc14.jar:tools-ng/devel/lib/postgresql-jdbc.jar</classpath>
+ <package-root>ccm-sci-types-department/src</package-root>
+ <package-root>ccm-sci-types-institute/src</package-root>
+ <package-root>ccm-sci-types-member/src</package-root>
+ <package-root>ccm-sci-types-project/src</package-root>
+
+ <classpath mode="compile">ccm-core/lib/log4j.jar:ccm-core/lib/mail.jar:ccm-core/lib/commons-beanutils.jar:ccm-core/lib/commons-cli-1.0.jar:ccm-core/lib/commons-collections-3.0.jar:ccm-core/lib/commons-codec-1.3.jar:ccm-core/lib/commons-fileupload-1.1.1.jar:ccm-core/lib/commons-io-1.3.1.jar:ccm-core/lib/commons-lang-2.1.jar:ccm-core/lib/commons-primitives-1.0.jar:ccm-core/lib/xercesImpl.jar:ccm-core/lib/jakarta-oro-2.0.8.jar:ccm-core/lib/Tidy.jar:ccm-core/lib/imgscalr-lib-4.2.jar:ccm-core/lib/jdom.jar:ccm-core/lib/jdxslt.jar:ccm-core/lib/lucene-core-2.4.0.jar:ccm-core/lib/saxon.jar:ccm-core/lib/poi-2.5-final-20040302.jar:ccm-core/lib/pdfbox-1.4.0.jar:ccm-core/lib/tm-extractors-0.4.jar:ccm-core/lib/bcprov-jdk16-144.jar:ccm-cms/lib/jai_codec.jar:ccm-cms/lib/jai_core.jar:ccm-cms/lib/mlibwrapper_jai.jar:ccm-ldn-search/lib/axis.jar:ccm-ldn-search/lib/jaxrpc.jar:ccm-ldn-search/lib/jobo.jar:ccm-ldn-terms/lib/commons-digester.jar:ccm-ldn-terms/lib/jena.jar:ccm-ldn-ter
ms/lib/snowball.jar:ccm-ldn-terms/lib/weka-3.5.5.jar:ccm-ldn-terms/lib/xstream-1.3.1.jar:ccm-formbuilder-pdf/lib/fop.jar:tools-ng/devel/lib/ccm-servlet-2.3.jar:tools-ng/devel/lib/ojdbc14.jar:tools-ng/devel/lib/postgresql-jdbc.jar</classpath>
<source-level>1.5</source-level>
</compilation-unit>
</java-data>
|
|
From: <pb...@fe...> - 2013-02-03 13:30:58
|
Author: pboy
Date: 2013-02-03 13:30:50 +0000 (Sun, 03 Feb 2013)
New Revision: 2488
Added:
releases/2.0.0/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java
Log:
Supplementing a missing file.
Added: releases/2.0.0/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java
===================================================================
--- releases/2.0.0/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java (rev 0)
+++ releases/2.0.0/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java 2013-02-03 13:30:50 UTC (rev 2488)
@@ -0,0 +1,50 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.arsdigita.cms.contentassets.ui;
+
+import com.arsdigita.bebop.MapComponentSelectionModel;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.cms.ContentItem;
+import com.arsdigita.cms.ReusableImageAsset;
+import com.arsdigita.cms.contentassets.ItemImageAttachment;
+import com.arsdigita.cms.ui.ImageComponent;
+import com.arsdigita.cms.ui.ImageComponentAbstractListener;
+import org.apache.log4j.Logger;
+
+/**
+ * A listener to attach an image to a content item.
+ *
+ * This listerner is used by {@link ImageStepEdit}.
+ *
+ * @author Sören Bernstein (quasimodo) <sbe...@ze...>
+ */
+public class ImageComponentAttachListener extends ImageComponentAbstractListener {
+
+ private final ImageStep m_imageStep;
+ private static final Logger s_log = Logger.getLogger(ImageComponentAttachListener.class);
+
+ public ImageComponentAttachListener(MapComponentSelectionModel imageComponent, ImageStep imageStep) {
+ super(imageComponent);
+ m_imageStep = imageStep;
+ }
+
+ @Override
+ protected void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image) {
+ ContentItem item = m_imageStep.getItem(ps);
+ if (null == item) {
+ s_log.error("No item selected in ImageStepEdit",
+ new RuntimeException());
+ return;
+ }
+ ItemImageAttachment attachment = m_imageStep.getAttachment(ps);
+ if (null == attachment) {
+ attachment = new ItemImageAttachment(item, image);
+ }
+
+ attachment.setCaption(component.getCaption(event));
+
+ }
+}
|
|
From: <pb...@fe...> - 2013-02-03 13:29:28
|
Author: pboy
Date: 2013-02-03 13:29:16 +0000 (Sun, 03 Feb 2013)
New Revision: 2487
Modified:
trunk/ccm-auth-http/src/com/arsdigita/auth/http/Inet4AddressRange.java
trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java
trunk/ccm-auth-http/src/com/arsdigita/auth/http/ui/UserCSVEntry.java
trunk/ccm-auth-http/web/WEB-INF/web.ccm-auth-http.xml
Log:
Supplementing some files which were lost somehow.
Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/Inet4AddressRange.java
===================================================================
--- trunk/ccm-auth-http/src/com/arsdigita/auth/http/Inet4AddressRange.java 2013-02-03 12:37:55 UTC (rev 2486)
+++ trunk/ccm-auth-http/src/com/arsdigita/auth/http/Inet4AddressRange.java 2013-02-03 13:29:16 UTC (rev 2487)
@@ -248,32 +248,32 @@
String addrStr = inetAddressToString (addr);
String addr2Str = inetAddressToString (addr2);
System.out.println ("addr = " + addrStr + "; addr2 = " + addr2Str);
- Assert.truth (addrStr.equals (addr2Str));
+ Assert.isTrue (addrStr.equals (addr2Str));
// Test makeNetmask.
addr = makeNetmask (0);
System.out.println ("makeNetmask(0) = " + addr);
- Assert.truth (inetAddressToString (addr).equals ("0.0.0.0"));
+ Assert.isTrue (inetAddressToString (addr).equals ("0.0.0.0"));
addr = makeNetmask (8);
System.out.println ("makeNetmask(8) = " + addr);
- Assert.truth (inetAddressToString (addr).equals ("255.0.0.0"));
+ Assert.isTrue (inetAddressToString (addr).equals ("255.0.0.0"));
addr = makeNetmask (16);
System.out.println ("makeNetmask(16) = " + addr);
- Assert.truth (inetAddressToString (addr).equals ("255.255.0.0"));
+ Assert.isTrue (inetAddressToString (addr).equals ("255.255.0.0"));
addr = makeNetmask (24);
System.out.println ("makeNetmask(24) = " + addr);
- Assert.truth (inetAddressToString (addr).equals ("255.255.255.0"));
+ Assert.isTrue (inetAddressToString (addr).equals ("255.255.255.0"));
addr = makeNetmask (28);
System.out.println ("makeNetmask(28) = " + addr);
- Assert.truth (inetAddressToString (addr).equals ("255.255.255.240"));
+ Assert.isTrue (inetAddressToString (addr).equals ("255.255.255.240"));
addr = makeNetmask (32);
System.out.println ("makeNetmask(32) = " + addr);
- Assert.truth (inetAddressToString (addr).equals ("255.255.255.255"));
+ Assert.isTrue (inetAddressToString (addr).equals ("255.255.255.255"));
// Test getByName.
Inet4AddressRange range
@@ -284,7 +284,7 @@
= Inet4AddressRange.getByName ("192.168.0.0/255.255.0.0");
System.out.println ("range = " + range.toString ());
// Test equals.
- Assert.truth (range.equals (range2));
+ Assert.isTrue (range.equals (range2));
range = Inet4AddressRange.getByName ("192.168.0.99");
System.out.println ("range = " + range.toString ());
@@ -292,19 +292,19 @@
// Test inRange.
range = Inet4AddressRange.getByName ("192.168.0.0/16");
addr = InetAddress.getByName ("192.168.0.99");
- Assert.truth (range.inRange (addr));
+ Assert.isTrue (range.inRange (addr));
range = Inet4AddressRange.getByName ("192.168.0.0/24");
addr = InetAddress.getByName ("192.168.2.99");
- Assert.truth (! range.inRange (addr));
+ Assert.isTrue (! range.inRange (addr));
range = Inet4AddressRange.getByName ("192.168.0.99");
addr = InetAddress.getByName ("192.168.0.99");
- Assert.truth (range.inRange (addr));
+ Assert.isTrue (range.inRange (addr));
range = Inet4AddressRange.getByName ("192.168.0.99");
addr = InetAddress.getByName ("192.168.3.99");
- Assert.truth (! range.inRange (addr));
+ Assert.isTrue (! range.inRange (addr));
System.out.println ("All test completed OK.");
}
Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java
===================================================================
--- trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java 2013-02-03 12:37:55 UTC (rev 2486)
+++ trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java 2013-02-03 13:29:16 UTC (rev 2487)
@@ -82,12 +82,6 @@
* instantiates a (single) default instance.
*/
private void setupHTTPAuth() {
-/*
- ApplicationType type = ApplicationType
- .createApplicationType("auth-http",
- "CCM HTTP Authentication Admin",
- HTTPAuth.BASE_DATA_OBJECT_TYPE);
-*/
/* Create new type legacy free application type
* NOTE: The wording in the title parameter of ApplicationType
Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/ui/UserCSVEntry.java
===================================================================
--- trunk/ccm-auth-http/src/com/arsdigita/auth/http/ui/UserCSVEntry.java 2013-02-03 12:37:55 UTC (rev 2486)
+++ trunk/ccm-auth-http/src/com/arsdigita/auth/http/ui/UserCSVEntry.java 2013-02-03 13:29:16 UTC (rev 2487)
@@ -80,7 +80,7 @@
}
public static synchronized UserCSVEntry nextEntry() {
- Assert.truth(hasMore(), "has more entries");
+ Assert.isTrue(hasMore(), "has more entries");
UserCSVEntry entry = new UserCSVEntry();
s_log.debug("Starting entry");
Modified: trunk/ccm-auth-http/web/WEB-INF/web.ccm-auth-http.xml
===================================================================
--- trunk/ccm-auth-http/web/WEB-INF/web.ccm-auth-http.xml 2013-02-03 12:37:55 UTC (rev 2486)
+++ trunk/ccm-auth-http/web/WEB-INF/web.ccm-auth-http.xml 2013-02-03 13:29:16 UTC (rev 2487)
@@ -22,4 +22,4 @@
</servlet-mapping>
<!-- module ccm-auth-http - servlet mappings END -->
-</web-app>
\ No newline at end of file
+</web-app>
|
|
From: <pb...@fe...> - 2013-02-03 12:38:04
|
Author: pboy
Date: 2013-02-03 12:37:55 +0000 (Sun, 03 Feb 2013)
New Revision: 2486
Modified:
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java
Log:
Backport r2470: Various authoring steps now configurable. (on behalf of JensP)
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-03 12:31:30 UTC (rev 2485)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-03 12:37:55 UTC (rev 2486)
@@ -84,6 +84,7 @@
return s_config;
}
+
/**
* Storage (map) for method getAssetStepsToSkip(ContentType type) to store
* mapping of steps that are deemed irrelevant for the passid in type.
@@ -120,7 +121,7 @@
"/default/folder.jsp");
/**
* Path or the root folter for template folders. Path is relative to webapp
- * root.
+ * root. Modify with care! Usually modified by developers only!
*/
private final Parameter m_templateRootPath =
new StringParameter(
@@ -550,8 +551,7 @@
private final Parameter m_itemSearchFlatBrowsePanePageSize = new IntegerParameter(
"com.arsdigita.cms.item_search.flat_browse_pane.page_size",
Parameter.REQUIRED,
- 20);
-
+ 20);
/////////////////////////////////////////////
// FolderBrowse
/////////////////////////////////////////////
@@ -606,6 +606,10 @@
Parameter.REQUIRED,
50);
+ private final Parameter m_attachPersonOrgaUnitsStep = new BooleanParameter(
+ "com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step",
+ Parameter.REQUIRED,
+ Boolean.TRUE);
// ///////////////////////////////////////////
// publishToFile package related parameter
@@ -708,6 +712,8 @@
// register(m_itemSearchFlatBrowsePaneEnable);
register(m_itemSearchFlatBrowsePanePageSize);
+ register(m_attachPersonOrgaUnitsStep);
+
loadInfo();
}
@@ -1164,4 +1170,8 @@
return (Integer) get(m_itemSearchFlatBrowsePanePageSize);
}
+ public Boolean getAttachPersonOrgaUnitsStep() {
+ return (Boolean) get(m_attachPersonOrgaUnitsStep);
+ }
+
}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2013-02-03 12:31:30 UTC (rev 2485)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2013-02-03 12:37:55 UTC (rev 2486)
@@ -294,3 +294,8 @@
com.arsdigita.cms.image_browser.thumbnail_max_height.purpose=Set the maximum height of the thumbnail in ImageBrowserr
com.arsdigita.cms.image_browser.thumbnail_max_height.example=150
com.arsdigita.cms.image_browser.thumbnail_max_height.format=[integer]
+
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.title = Attach PersonOrgaUnits step
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.purpose = Attaches an authoring step to GenericPerson which displays all GenericOrganizationalUnits to which the person is assigned to
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.example = true
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.foramt = [boolean]
\ No newline at end of file
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-03 12:31:30 UTC (rev 2485)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-03 12:37:55 UTC (rev 2486)
@@ -234,13 +234,14 @@
FileAsset.BASE_DATA_OBJECT_TYPE,
new AssetMetadataProvider());
-
+ if (s_conf.getAttachPersonOrgaUnitsStep()) {
AuthoringKitWizard.registerAssetStep(
GenericPerson.BASE_DATA_OBJECT_TYPE,
GenericPersonOrgaUnitsStep.class,
ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
20);
+ }
s_log.debug("CMS.Initializer.init(DomainInitEvent) completed");
} // END init(DomainInitEvent e)
|
|
From: <pb...@fe...> - 2013-02-03 12:31:41
|
Author: pboy
Date: 2013-02-03 12:31:30 +0000 (Sun, 03 Feb 2013)
New Revision: 2485
Added:
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundleCollection.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsStep.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java
Modified:
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java
Log:
Backport of r2464 (Improved ItemSearchWidget, improved authoring step) (on behalf of JensP).
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-03 09:50:25 UTC (rev 2484)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-03 12:31:30 UTC (rev 2485)
@@ -18,7 +18,10 @@
*/
package com.arsdigita.cms;
+import com.arsdigita.cms.contenttypes.GenericPerson;
import com.arsdigita.cms.contenttypes.Link;
+import com.arsdigita.cms.contenttypes.ui.GenericPersonOrgaUnitsStep;
+import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
import com.arsdigita.cms.dispatcher.AssetURLFinder;
import com.arsdigita.cms.dispatcher.ItemDelegatedURLPatternGenerator;
import com.arsdigita.cms.dispatcher.ItemTemplatePatternGenerator;
@@ -36,6 +39,7 @@
import com.arsdigita.cms.search.LaunchDateFilterType;
import com.arsdigita.cms.search.LuceneQueryEngine;
import com.arsdigita.cms.search.VersionFilterType;
+import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.workflow.CMSEngine;
import com.arsdigita.cms.workflow.CMSTask;
import com.arsdigita.cms.workflow.CMSTaskType;
@@ -107,9 +111,7 @@
s_log.debug("CMS.Initializer.(Constructor) invoked");
- add(new PDLInitializer
- (new ManifestSource
- ("ccm-cms.pdl.mf",
+ add(new PDLInitializer(new ManifestSource("ccm-cms.pdl.mf",
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
add(new com.arsdigita.cms.contentsection.Initializer());
@@ -131,26 +133,26 @@
super.init(e);
/* Register object instantiator for Workspace (Content Center) */
- e.getFactory().registerInstantiator
- (Workspace.BASE_DATA_OBJECT_TYPE,
+ e.getFactory().registerInstantiator(Workspace.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dobj) {
return new Workspace(dobj);
}
+
} );
LanguageUtil.setSupportedLanguages(
Kernel.getConfig().getSupportedLanguages());
/* Register object instantiator for CMS Service */
- e.getFactory().registerInstantiator
- (Service.BASE_DATA_OBJECT_TYPE,
+ e.getFactory().registerInstantiator(Service.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dobj) {
return new Service(dobj);
}
+
} );
URLService.registerFinder(ContentPage.BASE_DATA_OBJECT_TYPE,
@@ -170,6 +172,7 @@
return find(oid);
}
+
public String find( OID oid )
throws NoValidURLException {
@@ -177,8 +180,7 @@
try {
link = (Link) DomainObjectFactory.newInstance( oid );
} catch( DataObjectNotFoundException ex ) {
- throw new NoValidURLException
- ( "Cannot find an object with oid: " + oid );
+ throw new NoValidURLException("Cannot find an object with oid: " + oid);
}
if (Link.EXTERNAL_LINK.equals(link.getTargetType())) {
@@ -193,9 +195,9 @@
}
}
}
- }
- );
+ });
+
ImageSizerFactory.initialize();
registerInstantiators(e.getFactory());
@@ -220,15 +222,12 @@
// Just set the class implementing methods run when for publishing
// or unpublishing to file. No initialisation of the class here.
try {
- QueueManager.setListener((PublishToFileListener)
- ContentSection.getConfig()
+ QueueManager.setListener((PublishToFileListener) ContentSection.getConfig()
.getPublishToFileClass().newInstance());
} catch (InstantiationException ex) {
- throw new UncheckedWrapperException
- ("Failed to instantiate the listener class", ex);
+ throw new UncheckedWrapperException("Failed to instantiate the listener class", ex);
} catch (IllegalAccessException ex) {
- throw new UncheckedWrapperException
- ("Couldn't access the listener class", ex);
+ throw new UncheckedWrapperException("Couldn't access the listener class", ex);
}
MetadataProviderRegistry.registerAdapter(
@@ -236,6 +235,13 @@
new AssetMetadataProvider());
+ AuthoringKitWizard.registerAssetStep(
+ GenericPerson.BASE_DATA_OBJECT_TYPE,
+ GenericPersonOrgaUnitsStep.class,
+ ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
+ ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
+ 20);
+
s_log.debug("CMS.Initializer.init(DomainInitEvent) completed");
} // END init(DomainInitEvent e)
@@ -246,13 +252,11 @@
private void registerPatternGenerators() {
PatternStylesheetResolver.registerPatternGenerator(
"item_template_oid",
- new ItemTemplatePatternGenerator()
- );
+ new ItemTemplatePatternGenerator());
PatternStylesheetResolver.registerPatternGenerator(
"item_delegated_url",
- new ItemDelegatedURLPatternGenerator()
- );
+ new ItemDelegatedURLPatternGenerator());
}
@@ -262,57 +266,57 @@
private void registerInstantiators(DomainObjectFactory f) {
// Register the CMSTaskInstaniator
- f.registerInstantiator
- (CMSTask.BASE_DATA_OBJECT_TYPE,
+ f.registerInstantiator(CMSTask.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dataObject) {
return new CMSTask(dataObject);
}
+
});
- f.registerInstantiator
- (CMSTaskType.BASE_DATA_OBJECT_TYPE,
+ f.registerInstantiator(CMSTaskType.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) {
return new CMSTaskType(dataObject);
}
+
});
- f.registerInstantiator
- (TaskEventURLGenerator.BASE_DATA_OBJECT_TYPE,
+ f.registerInstantiator(TaskEventURLGenerator.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) {
return new TaskEventURLGenerator(dataObject);
}
+
});
- f.registerInstantiator
- (Workflow.BASE_DATA_OBJECT_TYPE,
+ f.registerInstantiator(Workflow.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) {
return new Workflow(dataObject);
}
+
});
- f.registerInstantiator
- (WorkflowTemplate.BASE_DATA_OBJECT_TYPE,
+ f.registerInstantiator(WorkflowTemplate.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dataObject) {
return new WorkflowTemplate(dataObject);
}
+
});
- f.registerInstantiator
- (TemplateContext.BASE_DATA_OBJECT_TYPE,
+ f.registerInstantiator(TemplateContext.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) {
return new TemplateContext(dataObject);
}
+
@Override
- public DomainObjectInstantiator
- resolveInstantiator(DataObject obj) {
+ public DomainObjectInstantiator resolveInstantiator(DataObject obj) {
return this;
}
+
});
}
@@ -354,4 +358,5 @@
},
new IntermediaQueryEngine());
}
+
}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties 2013-02-03 09:50:25 UTC (rev 2484)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties 2013-02-03 12:31:30 UTC (rev 2485)
@@ -147,3 +147,8 @@
cms.contenttypes.ui.person.select_contact.already_added=The selected contact has already been added to current item.
cms.contenttypes.ui.person.alias.delete.label=Delete
cms.contenttypes.ui.person.alias.delete.confirm=Are you sure to remove the alias?
+person.ui.orgaunits.none=This person is not assigned to any organizational units.
+person.ui.orgaunits.columns.name=Title
+person.ui.orgaunits.columns.year=Year
+person.ui.orgaunits.columns.type=Type
+person.authoring.orgas.title=Organisational Units
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties 2013-02-03 09:50:25 UTC (rev 2484)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties 2013-02-03 12:31:30 UTC (rev 2485)
@@ -158,3 +158,8 @@
cms.contenttypes.ui.person.select_contact.already_added=Das ausgew\u00e4hlte Kontakt-Item wurde dem aktuellen Item bereits hinzugef\u00fcgt.
cms.contenttypes.ui.person.alias.delete.label=L\u00f6schen
cms.contenttypes.ui.person.alias.delete.confirm=Sind Sie sicher, dass Sie das Alias entfernen wollen?
+person.ui.orgaunits.none=Diese Person ist keiner Organisationseinheit zugewiesen.
+person.ui.orgaunits.columns.name=Titel
+person.ui.orgaunits.columns.year=Jahr
+person.ui.orgaunits.columns.type=Typ
+person.authoring.orgas.title=Organisationseinheiten
Added: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundleCollection.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundleCollection.java (rev 0)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundleCollection.java 2013-02-03 12:31:30 UTC (rev 2485)
@@ -0,0 +1,34 @@
+package com.arsdigita.cms.contenttypes;
+
+import com.arsdigita.cms.ContentBundle;
+import com.arsdigita.domain.DomainCollection;
+import com.arsdigita.domain.DomainObjectFactory;
+import com.arsdigita.persistence.DataCollection;
+
+/**
+ *
+ * @author Jens Pelzetter <je...@jp...>
+ * @version $Id$
+ */
+public class GenericOrganizationalUnitBundleCollection extends DomainCollection {
+
+ public GenericOrganizationalUnitBundleCollection(final DataCollection dataCollection) {
+ super(dataCollection);
+ m_dataCollection.addOrder("name asc");
+ }
+
+ public GenericOrganizationalUnitBundle getGenericOrganizationalUnitBundle() {
+ return new GenericOrganizationalUnitBundle(m_dataCollection.getDataObject());
+ }
+
+ public GenericOrganizationalUnit getGenericOrganizationalUnit() {
+ final ContentBundle bundle = (ContentBundle) DomainObjectFactory.newInstance(m_dataCollection.getDataObject());
+ return (GenericOrganizationalUnit) bundle.getPrimaryInstance();
+ }
+
+ public GenericOrganizationalUnit getGenericOrganizationalUnit(final String language) {
+ final ContentBundle bundle = (ContentBundle) DomainObjectFactory.newInstance(m_dataCollection.getDataObject());
+ return (GenericOrganizationalUnit) bundle.getInstance(language);
+ }
+
+}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java 2013-02-03 09:50:25 UTC (rev 2484)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java 2013-02-03 12:31:30 UTC (rev 2485)
@@ -78,7 +78,7 @@
"cms.contenttypes.ui.genericorgaunit.select_contact").localize()));
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
findByAssociatedObjectType(GenericContact.class.getName()));
- m_itemSearch.setDisableCreatePane(true);
+ m_itemSearch.setDisableCreatePane(false);
add(m_itemSearch);
selectedContactLabel = new Label("");
Added: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsStep.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsStep.java (rev 0)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsStep.java 2013-02-03 12:31:30 UTC (rev 2485)
@@ -0,0 +1,27 @@
+package com.arsdigita.cms.contenttypes.ui;
+
+import com.arsdigita.cms.ItemSelectionModel;
+import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
+import com.arsdigita.cms.ui.authoring.SimpleEditStep;
+
+/**
+ *
+ * @author Jens Pelzetter <je...@jp...>
+ * @version $Id$
+ */
+public class GenericPersonOrgaUnitsStep extends SimpleEditStep {
+
+ public GenericPersonOrgaUnitsStep(final ItemSelectionModel itemModel, final AuthoringKitWizard parent) {
+ this(itemModel, parent, null);
+ }
+
+ public GenericPersonOrgaUnitsStep(final ItemSelectionModel itemModel,
+ final AuthoringKitWizard parent,
+ final String prefix) {
+ super(itemModel, parent, prefix);
+
+ final GenericPersonOrgaUnitsTable table = new GenericPersonOrgaUnitsTable(itemModel);
+ setDisplayComponent(table);
+ }
+
+}
Added: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java (rev 0)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java 2013-02-03 12:31:30 UTC (rev 2485)
@@ -0,0 +1,151 @@
+package com.arsdigita.cms.contenttypes.ui;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.Link;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.Table;
+import com.arsdigita.bebop.table.TableCellRenderer;
+import com.arsdigita.bebop.table.TableColumn;
+import com.arsdigita.bebop.table.TableColumnModel;
+import com.arsdigita.bebop.table.TableModel;
+import com.arsdigita.bebop.table.TableModelBuilder;
+import com.arsdigita.cms.CMS;
+import com.arsdigita.cms.ContentSection;
+import com.arsdigita.cms.ItemSelectionModel;
+import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
+import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundleCollection;
+import com.arsdigita.cms.contenttypes.GenericPerson;
+import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
+import com.arsdigita.cms.dispatcher.ItemResolver;
+import com.arsdigita.domain.DomainObjectFactory;
+import com.arsdigita.persistence.DataCollection;
+import com.arsdigita.persistence.DataObject;
+import com.arsdigita.util.LockableImpl;
+import java.math.BigDecimal;
+
+/**
+ *
+ * @author Jens Pelzetter <je...@jp...>
+ * @version $Id$
+ */
+public class GenericPersonOrgaUnitsTable extends Table {
+
+ private final static String TABLE_COL_EDIT = "table_col_edit";
+ private final static String TABLE_COL_YEAR = "table_col_year";
+ private final static String TABLE_COL_TYPE = "table_col_type";
+ private ItemSelectionModel itemModel;
+
+ public GenericPersonOrgaUnitsTable(final ItemSelectionModel itemModel) {
+ super();
+
+ this.itemModel = itemModel;
+
+ setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.none")));
+
+ final TableColumnModel columnModel = getColumnModel();
+ columnModel.add(new TableColumn(
+ 0,
+ ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.columns.name").localize(),
+ TABLE_COL_EDIT));
+ columnModel.add(new TableColumn(
+ 2,
+ ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.columns.type").localize(),
+ TABLE_COL_TYPE));
+
+ setModelBuilder(new ModelBuilder(itemModel));
+
+ columnModel.get(0).setCellRenderer(new EditCellRenderer());
+ }
+
+ private class ModelBuilder extends LockableImpl implements TableModelBuilder {
+
+ private final ItemSelectionModel itemModel;
+
+ public ModelBuilder(final ItemSelectionModel itemModel) {
+ this.itemModel = itemModel;
+ }
+
+ public TableModel makeModel(final Table table, final PageState state) {
+ table.getRowSelectionModel().clearSelection(state);
+
+ final GenericPerson person = (GenericPerson) itemModel.getSelectedItem(state);
+
+ return new Model(table, state, person);
+ }
+
+ }
+
+ private class Model implements TableModel {
+
+ private final Table table;
+ private final GenericOrganizationalUnitBundleCollection orgaUnits;
+
+ public Model(final Table table, final PageState state, final GenericPerson person) {
+ this.table = table;
+ orgaUnits =
+ new GenericOrganizationalUnitBundleCollection((DataCollection) person.getGenericPersonBundle().get("organizationalunits"));
+ }
+
+ @Override
+ public int getColumnCount() {
+ return table.getColumnModel().size();
+ }
+
+ @Override
+ public boolean nextRow() {
+ boolean ret;
+
+ if ((orgaUnits != null) && orgaUnits.next()) {
+ ret = true;
+ } else {
+ ret = false;
+ }
+
+ return ret;
+ }
+
+ @Override
+ public Object getElementAt(final int columnIndex) {
+ switch (columnIndex) {
+ case 0:
+ return orgaUnits.getGenericOrganizationalUnit().getTitle();
+ case 1:
+ return ((DataObject) orgaUnits.getGenericOrganizationalUnit().get("type")).get("label");
+ default:
+ return null;
+ }
+ }
+
+ @Override
+ public Object getKeyAt(final int columnIndex) {
+ return orgaUnits.getGenericOrganizationalUnit().getID();
+ }
+
+ }
+
+ private class EditCellRenderer extends LockableImpl implements TableCellRenderer {
+
+ public Component getComponent(final Table table,
+ final PageState state,
+ final Object value,
+ final boolean isSelected,
+ final Object key,
+ final int row,
+ final int column) {
+ //final com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
+ final GenericOrganizationalUnit orgaUnit = new GenericOrganizationalUnit((BigDecimal) key);
+
+ final ContentSection section = CMS.getContext().getContentSection();
+ final ItemResolver resolver = section.getItemResolver();
+ final Link link = new Link(value.toString(),
+ resolver.generateItemURL(state,
+ orgaUnit,
+ section,
+ orgaUnit.getVersion()));
+ return link;
+
+ }
+
+ }
+}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java 2013-02-03 09:50:25 UTC (rev 2484)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java 2013-02-03 12:31:30 UTC (rev 2485)
@@ -69,6 +69,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.ArrayList;
+import java.util.Collections;
/**
* <p>This class represents a single authoring kit. The wizard
@@ -102,7 +103,8 @@
AuthoringKitWizard.class,
ContentType.class
};
- private static final ArrayList s_assets = new ArrayList();
+ //private static final ArrayList s_assets = new ArrayList();
+ private static final java.util.List<AssetStepEntry> s_assets = new ArrayList<AssetStepEntry>();
private final Object[] m_vals;
private final ContentType m_type;
private final AuthoringKit m_kit;
@@ -268,14 +270,19 @@
s_log.debug("skip step " + it.next());
}
}
- Iterator assets = s_assets.iterator();
+ //Iterator assets = s_assets.iterator();
+ Iterator<AssetStepEntry> assets = s_assets.iterator();
while (assets.hasNext()) {
- Object[] data = (Object[]) assets.next();
- String baseObjectType = (String) data[0];
- Class step = (Class) data[1];
+ //Object[] data = (Object[]) assets.next();
+ final AssetStepEntry data = assets.next();
+ //String baseObjectType = (String) data[0];
+ final String baseObjectType = data.getBaseDataObjectType();
+ //Class step = (Class) data[1];
+ Class step = data.getStep();
s_log.debug("possibly adding asset step " + step.getName());
if (!skipSteps.contains(step.getName())) {
- GlobalizedMessage label = (GlobalizedMessage) data[2];
+ //GlobalizedMessage label = (GlobalizedMessage) data[2];
+ GlobalizedMessage label = data.getLabel();
if (!thisType.isSubtypeOf(baseObjectType)) {
continue;
@@ -425,11 +432,17 @@
+ " step class: "
+ step.getName());
- Iterator assets = s_assets.iterator();
+ //Iterator assets = s_assets.iterator();
+ Iterator<AssetStepEntry> assets = s_assets.iterator();
while (assets.hasNext()) {
- Object[] data = (Object[]) assets.next();
- String thisObjectType = (String) data[0];
- GlobalizedMessage thisLabel = (GlobalizedMessage) data[2];
+ //Object[] data = (Object[]) assets.next();
+ //String thisObjectType = (String) data[0];
+ //GlobalizedMessage thisLabel = (GlobalizedMessage) data[2];
+
+ final AssetStepEntry data = assets.next();
+ String thisObjectType = data.getBaseDataObjectType();
+ GlobalizedMessage thisLabel = data.getLabel();
+
/**
* jensp 2011-11-14: The code above was only testing for the same
* label, but not for the same object type. I don't think that
@@ -447,9 +460,83 @@
break;
}
}
- s_assets.add(new Object[]{baseObjectType, step, label, description});
+ s_assets.add(new AssetStepEntry(baseObjectType, step, label, description, sortKey));
+ Collections.sort(s_assets);
+ //s_assets.add(new Object[]{baseObjectType, step, label, description});
}
+ private static class AssetStepEntry implements Comparable<AssetStepEntry> {
+ private String baseDataObjectType;
+ private Class step;
+ private GlobalizedMessage label;
+ private GlobalizedMessage description;
+ private Integer sortKey;
+
+ public AssetStepEntry() {
+ super();
+ }
+
+ public AssetStepEntry(final String baseDataObjectType,
+ final Class step,
+ final GlobalizedMessage label,
+ final GlobalizedMessage description,
+ final Integer sortKey) {
+ this.baseDataObjectType = baseDataObjectType;
+ this.step = step;
+ this.label = label;
+ this.description = description;
+ this.sortKey = sortKey;
+ }
+
+ public String getBaseDataObjectType() {
+ return baseDataObjectType;
+ }
+
+ public void setBaseDataObjectType(final String baseDataObjectType) {
+ this.baseDataObjectType = baseDataObjectType;
+ }
+
+ public Class getStep() {
+ return step;
+ }
+
+ public void setStep(final Class step) {
+ this.step = step;
+ }
+
+ public GlobalizedMessage getLabel() {
+ return label;
+ }
+
+ public void setLabel(final GlobalizedMessage label) {
+ this.label = label;
+ }
+
+ public GlobalizedMessage getDescription() {
+ return description;
+ }
+
+ public void setDescription(final GlobalizedMessage description) {
+ this.description = description;
+ }
+
+ public Integer getSortKey() {
+ return sortKey;
+ }
+
+ public void setSortKey(final Integer sortKey) {
+ this.sortKey = sortKey;
+ }
+
+ public int compareTo(final AssetStepEntry other) {
+ if (sortKey == other.getSortKey()) {
+ return step.getName().compareTo(other.getStep().getName());
+ } else {
+ return sortKey.compareTo(other.getSortKey());
+ }
+ }
+ }
+
/**
* @return The content type handled by this wizard
*/
|
|
From: <pb...@fe...> - 2013-02-03 09:50:33
|
Author: pboy
Date: 2013-02-03 09:50:25 +0000 (Sun, 03 Feb 2013)
New Revision: 2484
Modified:
releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java
Log:
Minor fixes portalworkspace (on behalt of JensP)
Modified: releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
===================================================================
--- releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2013-02-03 09:43:44 UTC (rev 2483)
+++ releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2013-02-03 09:50:25 UTC (rev 2484)
@@ -575,7 +575,7 @@
// .retrieve("com.arsdigita.kernel.Party");
Filter f = dc.addNotInSubqueryFilter(
"id",
- "com.arsdigita.london.portal.WorkspaceParticipantIDs");
+ "com.arsdigita.portalworkspace.WorkspaceParticipantIDs");
f.set("workspaceID", getID());
return new PartyCollection(dc);
}
@@ -594,7 +594,7 @@
**/
public Iterator getParticipantInitials() {
DataQuery query = SessionManager.getSession().retrieveQuery(
- "com.arsdigita.london.portal.WorkspaceParticipantInitials");
+ "com.arsdigita.portalworkspace.WorkspaceParticipantInitials");
query.setParameter("workspaceID", getID());
LinkedList result = new LinkedList();
@@ -750,7 +750,7 @@
public WorkspaceCollection getChildWorkspaces() {
DataQuery query = SessionManager.getSession().retrieveQuery(
- "com.arsdigita.london.portal.childWorkspacesForApplicationID");
+ "com.arsdigita.portalworkspace.childWorkspacesForApplicationID");
query.setParameter("applicationID", getID());
DataCollection collection =
Modified: releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java
===================================================================
--- releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java 2013-02-03 09:43:44 UTC (rev 2483)
+++ releases/2.0.0/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java 2013-02-03 09:50:25 UTC (rev 2484)
@@ -15,7 +15,6 @@
* 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.portalworkspace.ui.admin;
import java.util.HashMap;
@@ -42,15 +41,10 @@
public class ApplicationPane extends SimpleContainer {
private Map m_edit; // Map of application type -> edit config form
-
private Map m_create;
-
private NewApplicationForm m_newApp;
-
private ApplicationDetails m_appDetails;
-
private ActionLink m_editLink;
-
private ApplicationSelectionModel m_app;
/**
@@ -80,6 +74,7 @@
public Object initialValue(PageState state) {
return m_app.getSelectedObject(state);
}
+
};
ApplicationTypeCollection types = ApplicationType
@@ -119,6 +114,7 @@
}
private class ApplicationCreateListener implements ActionListener {
+
public void actionPerformed(ActionEvent e) {
PageState state = e.getPageState();
@@ -131,9 +127,11 @@
m_appDetails.setVisible(state, false);
m_editLink.setVisible(state, false);
}
+
}
private class ApplicationEditListener implements ActionListener {
+
public void actionPerformed(ActionEvent e) {
PageState state = e.getPageState();
@@ -147,9 +145,11 @@
m_appDetails.setVisible(state, false);
m_editLink.setVisible(state, false);
}
+
}
private class ApplicationCompleteCreateListener implements ActionListener {
+
private Component m_src;
public ApplicationCompleteCreateListener(Component src) {
@@ -161,12 +161,16 @@
ResourceConfigComponent c = (ResourceConfigComponent) m_src;
Resource newResource = c.createResource(state);
+ if (newResource != null) {
+
+
c.setVisible(state, false);
// Copy categorization from nav app instance
Resource parentResource = newResource.getParentResource();
Category.setRootForObject(newResource, Category
.getRootForObject(parentResource));
+ }
m_newApp.setVisible(state, true);
m_appDetails.setVisible(state, true);
@@ -174,9 +178,11 @@
m_app.clearSelection(state);
}
+
}
private class ApplicationCompleteEditListener implements ActionListener {
+
private Component m_src;
public ApplicationCompleteEditListener(Component src) {
@@ -196,6 +202,6 @@
m_app.clearSelection(state);
}
+
}
-
}
|
|
From: <pb...@fe...> - 2013-02-03 09:43:55
|
Author: pboy
Date: 2013-02-03 09:43:44 +0000 (Sun, 03 Feb 2013)
New Revision: 2483
Modified:
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java
Log:
Backport r2462 (Lenght of property Name restricted, minor bugfixes, fixed paginator) (on behalf of JensP)
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java 2013-02-03 09:12:51 UTC (rev 2482)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java 2013-02-03 09:43:44 UTC (rev 2483)
@@ -36,8 +36,7 @@
final int pageSize) {
final String pageNumberStr = request.getParameter(PAGE_NUMBER);
if (pageNumberStr == null) {
- logger.debug("No pageNumber parameter in request setting page number"
- + " to 1.");
+ logger.debug("No pageNumber parameter in request setting page number to 1.");
pageNumber = 1;
} else {
pageNumber = Integer.parseInt(pageNumberStr);
@@ -99,6 +98,18 @@
getEnd()));
query.setRange(getBegin(), getEnd() + 1);
}
+
+ public <T> List<T> applyListLimits(final List<T> list, final Class<T> type) {
+ int begin = getBegin() - 1;
+ if (begin < 0) {
+ begin = 0;
+ }
+ int end = getEnd();
+ if (end >= list.size()) {
+ end = list.size();
+ }
+ return list.subList(begin, end);
+ }
public int getPageCount() {
return (int) Math.ceil((double) objectCount / (double) pageSize);
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java 2013-02-03 09:12:51 UTC (rev 2482)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java 2013-02-03 09:43:44 UTC (rev 2483)
@@ -144,7 +144,7 @@
final Hidden id = new Hidden(CONTENT_ITEM_ID);
//final TextField id = new TextField(CONTENT_ITEM_ID);
add(id);
-
+
// JavaScript auto-name generation is off by default.
// It is turned on under the following circumstances
//
@@ -179,11 +179,13 @@
add(new Label(getNameLabel()));
TextField nameWidget = new TextField(new TrimmedStringParameter(NAME));
nameWidget.addValidationListener(new NameValidationListener());
+ nameWidget.setMaxLength(190);
nameWidget.setOnFocus("defaulting = false");
nameWidget.setOnBlur(
"if (this.value == '') "
+ "{ defaulting = true; this.value = urlize(this.form." + TITLE
+ ".value) } " + " else { this.value = urlize(this.value); }");
+ nameWidget.addValidationListener(new NotNullValidationListener());
add(nameWidget);
}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java 2013-02-03 09:12:51 UTC (rev 2482)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java 2013-02-03 09:43:44 UTC (rev 2483)
@@ -142,6 +142,8 @@
@Override
public void validate(final FormSectionEvent fse) throws FormProcessException {
+ super.validate(fse);
+
final ContentItem item = getItemSelectionModel().getSelectedItem(fse.getPageState());
ACSObject parent = item.getParent();
|
|
From: <pb...@fe...> - 2013-02-03 09:13:05
|
Author: pboy
Date: 2013-02-03 09:12:51 +0000 (Sun, 03 Feb 2013)
New Revision: 2482
Modified:
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ImageAsset.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/dispatcher/BaseImage.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageDisplay.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImagesPane.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFlatBrowsePane.java
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties
releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties
releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.html
releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.js
releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js
releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js
Log:
* Backport r2461 (Improved alias handling, fixed publication process, new CreatePane to add members of organisational units, on behalf of JensP)
* Backport new Image tab (on behalf of quasimodo)
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -1111,3 +1111,4 @@
cms.ui.clear=Clear
cms.ui.item_search.create.folder_missing=No folder selected
+cms.ui.images_links=
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -1104,3 +1104,4 @@
cms.ui.type.minimum_number_of_values_bigger_than_maximum_number_of_values=Maximaler Wert kleiner als minimaler Wert
cms.ui.type.minimummaximum_number_of_values_cannot_be_negative=Keine negativen Werte erlaubt
cms.ui.item_search.create.folder_missing=kein Ordner ausgew\u00e4hlt
+cms.ui.images_links=
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -50,3 +50,4 @@
cms.ui.clear=
cms.ui.item_search.create.folder_missing=
+cms.ui.images_links=
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -67,7 +67,7 @@
cms.contenttypes.ui.there_are_no_events=Il n'y a aucun \u00e9venement
cms.contenttypes.ui.title=Titre
cms.contenttypes.ui.view_image=voir l'image
-
+
# Package com.arsdigita.cms.dispatcher
# =====================================
cms.dispatcher.cannot_find_domain_object=Impossible de trouver le domaine objet
@@ -77,7 +77,7 @@
cms.dispatcher.not_implemented=Non impl\u00e9ment\u00e9
cms.dispatcher.unknown_context=Contexte inconnu
-
+
# Package com.arsdigita.cms.formbuilder
# =====================================
cms.formbuilder.cannot_create_acsobject=Impossible de cr\u00e9er l'ACSObject
@@ -86,13 +86,13 @@
cms.formbuilder.roll_me_back=TRANSLATE THIS: Roll me back (cms.formbuilder.roll_me_back)
cms.formbuilder.css=Cascading Style Sheet (CSS) Class Attribute
-
+
# Package com.arsdigita.cms.installer
# =====================================
cms.installer.approval=Approbation
cms.installer.article=Article
cms.installer.authoring=Ecriture
-cms.installer.cannot_find_cms_package_type=Impossible de trouver le type package CMS
+cms.installer.cannot_find_cms_package_type=Impossible de trouver le type package CMS
cms.installer.cannot_find_content_type=Impossible de trouver le type de contenu
cms.installer.cannot_find_file=Impossible de trouver le fichier
cms.installer.cannot_find_group_for_email=Impossible de trouver le groupe pour l'email
@@ -109,7 +109,7 @@
cms.installer.simple_publication=Publication simple
cms.installer.template=Gabarit
-
+
# Package com.arsdigita.cms.lifecycle
# ===================================
cms.lifecycle.could_not_fetch_lifecycle=Impossible de trouver le cycle de vie
@@ -135,10 +135,10 @@
cms.publishToFile.publish_to_file_setlocalrequestpassword_could_not_be_created=La publication du fichier pour la demande de mot de passe ne peut pas \u00eatre cr\u00e9\u00e9e
cms.publishToFile.publishsource_sourcebase_must_end_in_=L'\u00e9dition source doit se terminer par '/'
cms.publishToFile.server=Server
-cms.publishToFile.unable_to_find_closing_for_tag=Impossible de trouver '>' pour la fermeture du tag
+cms.publishToFile.unable_to_find_closing_for_tag=Impossible de trouver '>' pour la fermeture du tag
cms.publishToFile.unable_to_get_contentitem=Impossible de trouve le contenu de l'\u00e9l\u00e9ment
-
+
# Package com.arsdigita.cms.ui
# ============================
cms.ui.actions=actions
@@ -196,7 +196,7 @@
cms.ui.no_items_matched_the_search=Pas d'\u00e9l\u00e9ment trouv\u00e9 dans la recherche
-
+
# Package com.arsdigita.cms.ui.authoring
# ======================================
cms.ui.authoring.an_item_with_this_name_already_exists=Un \u00e9l\u00e9ment de ce nom existe d\u00e9j\u00e0
@@ -236,12 +236,12 @@
cms.ui.authoring.upload_image=T\u00e9l\u00e9charger l'image
cms.ui.authoring.workflow=TRANSLATE THIS: Select a Workflow (cms.ui.authoring.workflow)
-
+
# Package com.arsdigita.cms.ui.authoringkit
# =========================================
cms.ui.authoringkit.authoring_kit_for=Kit d'\u00e9criture pour
cms.ui.authoringkit.component=Composant
-cms.ui.authoringkit.content_type_id=Type de contenu ID#
+cms.ui.authoringkit.content_type_id=Type de contenu ID#
cms.ui.authoringkit.create_component=Cr\u00e9er le composant
cms.ui.authoringkit.createcomponent=Cr\u00e9er le composant
cms.ui.authoringkit.current_row_does_not_exists=La ligne en cours n'exsite pas
@@ -251,7 +251,7 @@
cms.ui.authoringkit.ordering=Commande
cms.ui.authoringkit.submission_cancelled=Soumission annul\u00e9e
-
+
# Package com.arsdigita.cms.ui.category
# =====================================
cms.ui.category.add_a_subcategory=Ajouter une sous-rubrique
@@ -294,7 +294,7 @@
cms.ui.category.url=URL
# cms.ui.category.use_custom_permissions=Utiliser les droits personnalis\u00e9s
-
+
# Package com.arsdigita.cms.ui.cse
# ================================
cms.ui.cse.authorName=Author
@@ -305,17 +305,17 @@
cms.ui.cse.editLink=edit
cms.ui.cse.endDateTime=Live Until
-
+
# Package com.arsdigita.cms.ui.folder
# ===================================
cms.ui.folder.cancelled=Annul\u00e9
cms.ui.folder.cannot_find_a_root_folder=Impossible de trouver le r\u00e9pertoire racine
-cms.ui.folder.na=N/A
+cms.ui.folder.na=N/A
cms.ui.folder.no_source_items_specified=Pas d'\u00e9l\u00e9ment source sp\u00e9cifi\u00e9
cms.ui.folder.parent=Parent Folder
cms.ui.folder.rename=Rename folder
-
+
# Package com.arsdigita.cms.ui.formbuilder
# ========================================
cms.ui.formbuilder.description=Description
@@ -323,7 +323,7 @@
cms.ui.formbuilder.oh_no_you_dont=non, vous ne pouvez pas
cms.ui.formbuilder.title=Titre
-
+
# Package com.arsdigita.cms.ui.item
# =================================
cms.ui.item.access_denied=Acc\u00e8s refus\u00e9
@@ -345,7 +345,7 @@
cms.ui.item.the_current_row_does_not_exists=La ligne en cours n'exsite pas
cms.ui.item.unpublish=D\u00e9publier
-
+
# Package com.arsdigita.cms.ui.lifecycle
# ======================================
cms.ui.lifecycle.add=Create new lifecycle
@@ -372,7 +372,7 @@
cms.ui.lifecycle.phases=Etapes
cms.ui.lifecycle.start_delay=D\u00e9lai de d\u00e9but
-
+
# Package com.arsdigita.cms.ui.permissions
# ========================================
cms.ui.permissions.add_administrator=Ajouter un administrateur
@@ -421,7 +421,7 @@
cms.ui.staff.no_usersgroups_were_selected=Pas d'utilisateur/groupe s\u00e9l\u00e9ctionn\u00e9
cms.ui.staff.not_a_role_adminstrator=Pas d'administrateur de r\u00f4le
cms.ui.staff.not_an_administrator_for_roles=pas un administrateur pour les r\u00f4les
-cms.ui.staff.not_an_administrator_for_this_role=pas un administrateur pour ce r\u00f4le
+cms.ui.staff.not_an_administrator_for_this_role=pas un administrateur pour ce r\u00f4le
cms.ui.staff.out_of_bounds=En dehors de la plage
cms.ui.staff.privileges=Droits accord\u00e9s
cms.ui.staff.privileges=Droits accord\u00e9s
@@ -581,3 +581,4 @@
cms.ui.clear=
cms.ui.item_search.create.folder_missing=
+cms.ui.images_links=
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ImageAsset.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ImageAsset.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ImageAsset.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -52,6 +52,7 @@
*
* @author Jack Chung
* @author Stanislav Freidin
+ * @author Sören Bernstein <sbe...@qu...>
*
* @version $Id$
*/
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -145,3 +145,5 @@
cms.contenttypes.ui.person.select_contact.no_contact_selected=No contact selected.
cms.contenttypes.ui.person.select_contact.no_suitable_language_variant=The selected contact item is not avilable in the language of the current item.
cms.contenttypes.ui.person.select_contact.already_added=The selected contact has already been added to current item.
+cms.contenttypes.ui.person.alias.delete.label=Delete
+cms.contenttypes.ui.person.alias.delete.confirm=Are you sure to remove the alias?
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -156,3 +156,5 @@
cms.contenttypes.ui.person.select_contact.no_contact_selected=Kein Kontakt ausgew\u00e4hlt.
cms.contenttypes.ui.person.select_contact.no_suitable_language_variant=Das ausgew\u00e4hlte Kontakt-Item ist nicht in der Sprache des aktuellen Items verf\u00fcgbar.
cms.contenttypes.ui.person.select_contact.already_added=Das ausgew\u00e4hlte Kontakt-Item wurde dem aktuellen Item bereits hinzugef\u00fcgt.
+cms.contenttypes.ui.person.alias.delete.label=L\u00f6schen
+cms.contenttypes.ui.person.alias.delete.confirm=Sind Sie sicher, dass Sie das Alias entfernen wollen?
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -65,6 +65,7 @@
s_config.load();
logger.debug("Static initializer finished");
}
+
/**
* Data object type for this domain object
*/
@@ -326,8 +327,7 @@
}
}
- StringTokenizer keys = s_config.getContactEntryKeys();
-
+ StringTokenizer keys = s_config.getContactEntryKeys();
Element contactKeysElem = element.newChildElement("contactEntryKeys");
while(keys.hasMoreElements()) {
contactKeysElem.newChildElement("entryKey").setText(keys.nextToken());
@@ -350,4 +350,5 @@
generators.add(this);
return generators;
}
+
}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -355,7 +355,7 @@
link.set(
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
subOrgaUnits.get(
- GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER));
+ GenericOrganizationalUnitSuperiorCollection.LINK_SUPERIOR_ORGAUNIT_ORDER));
link.save();
}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -81,7 +81,7 @@
findByAssociatedObjectType(getPersonType()));
/*m_itemSearch.getItemField().addValidationListener(
new NotNullValidationListener());*/
- m_itemSearch.setDisableCreatePane(true);
+ m_itemSearch.setDisableCreatePane(false);
add(this.m_itemSearch);
selectedPersonNameLabel = new Label("");
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -30,16 +30,18 @@
final GenericPersonAliasPropertiesStep step) {
super(ID, itemModel);
addSaveCancelSection();
+ addProcessListener(this);
}
@Override
public void addWidgets() {
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
- "cms.contenttypes.ui.person.alias.delete.label").localize()));
+ "cms.contenttypes.ui.person.alias.delete.confirm").localize()));
}
@Override
public void init(final FormSectionEvent fse) throws FormProcessException {
+ //Nothing
}
@Override
@@ -51,6 +53,11 @@
person.unsetAlias();
}
}
+
+ @Override
+ public void validate(final FormSectionEvent event) throws FormProcessException {
+ //Nothing
+ }
@Override
public void addSaveCancelSection() {
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/dispatcher/BaseImage.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/dispatcher/BaseImage.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/dispatcher/BaseImage.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -71,8 +71,6 @@
public BaseImage(boolean download) {
m_imageId = new BigDecimalParameter(IMAGE_ID);
m_oid = new OIDParameter(OID_PARAM);
-// m_transactionID = new BigDecimalParameter(TRANSACTION_ID);
-// m_objectID = new BigDecimalParameter(OBJECT_ID);
m_download = download;
if (m_download) {
@@ -154,15 +152,9 @@
// Fetch and validate the image ID
OID oid = null;
BigDecimal imageId = null;
-// BigDecimal transactionID = null;
-// BigDecimal objectID = null;
try {
oid = (OID) m_oid.transformValue(request);
imageId = (BigDecimal) m_imageId.transformValue(request);
-// transactionID =
-// (BigDecimal) m_transactionID.transformValue(request);
-// objectID =
-// (BigDecimal) m_objectID.transformValue(request);
} catch (Exception e) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST,
e.toString());
@@ -177,26 +169,9 @@
oid = new OID(ImageAsset.BASE_DATA_OBJECT_TYPE, imageId);
}
-// Transaction transaction = null;
-// GenericArticle article = null;
- // XXX: add back rollback
- /*if (transactionID != null) {
- try {
- transaction =
- new Transaction(transactionID);
- // we have a transaction so let's see if we have an article
- if (objectID != null) {
- article = new GenericArticle(objectID);
- article.rollBackTo(transaction);
- }
- } catch (DataObjectNotFoundException e) {
- s_log.warn("Unable to locate transaction " + transactionID);
- // this is non-critical so we just continue
- }
- }*/
ImageAsset image = null;
-// if (article == null) {
+
try {
Asset a = (Asset) DomainObjectFactory.newInstance(oid);
@@ -212,30 +187,7 @@
"no ImageAsset with oid " + oid);
return;
}
-// }
-// if (image.getMimeType() == null) {
-// response.sendError(HttpServletResponse.SC_NOT_FOUND,
-// "MIME type not found for ImageAsset " + imageId);
-// }
-
- // Not until permissions are properly assigned to assets
- //checkUserAccess(request, response, actx, image);
-
-// response.setContentType(image.getMimeType().getMimeType());
-
-/* Quasimodo: on demand resizing of images
- int width;
- int height;
-
- width = Integer.parseInt(request.getParameter("width"));
- height = Integer.parseInt(request.getParameter("height"));
-
- if(width || height) {
-
- }
-*/
-
setHeaders(response, image);
send(response, image);
}
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -133,7 +133,7 @@
private FolderAdminPane m_folderPane;
private BrowsePane m_browsePane;
private LayoutPanel m_searchPane;
- //private ImagesPane m_imagesPane;
+ private ImagesPane m_imagesPane;
private RoleAdminPane m_rolePane;
private WorkflowAdminPane m_workflowPane;
private LifecycleAdminPane m_lifecyclePane;
@@ -166,7 +166,7 @@
m_folderPane = getFolderAdminPane();
m_browsePane = getBrowsePane();
m_searchPane = getSearchPane();
- //m_imagesPane = getImagesPane();
+ m_imagesPane = getImagesPane();
m_rolePane = getRoleAdminPane();
m_workflowPane = getWorkflowAdminPane();
m_lifecyclePane = getLifecycleAdminPane();
@@ -249,12 +249,12 @@
return m_searchPane;
}
-// protected ImagesPane getImagesPane() {
-// if(m_imagesPane == null) {
-// m_imagesPane = new ImagesPane();
-// }
-// return m_imagesPane;
-// }
+ protected ImagesPane getImagesPane() {
+ if(m_imagesPane == null) {
+ m_imagesPane = new ImagesPane();
+ }
+ return m_imagesPane;
+ }
protected RoleAdminPane getRoleAdminPane() {
if (m_rolePane == null) {
@@ -375,7 +375,7 @@
//tab(pane, "cms.ui.folders", getFolderAdminPane());
tab(pane, "cms.ui.browse", getBrowsePane());
tab(pane, "cms.ui.search", getSearchPane());
- //tab(pane, "cms.ui.images", getImagesPane());
+ tab(pane, "cms.ui.images", getImagesPane());
tab(pane, "cms.ui.roles", getRoleAdminPane());
tab(pane, "cms.ui.workflows", getWorkflowAdminPane());
tab(pane, "cms.ui.lifecycles", getLifecycleAdminPane());
@@ -414,8 +414,8 @@
if (pane == m_searchPane) {
m_searchPane.reset(state);
-// } else if (pane == m_imagesPane) {
-// m_imagesPane.reset(state);
+ } else if (pane == m_imagesPane) {
+ m_imagesPane.reset(state);
} else if (pane == m_folderPane) {
m_folderPane.reset(state);
} else if (pane == m_browsePane) {
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -83,7 +83,7 @@
* Construct a new ImageBrowser with default mode.
*
* @param builder the {@link ImageBrowserModelBuilder} that will supply this
- * component with its {@link ImageBrowserModel} during each request
+ * component with its {@link ImageBrowserModel} during each request
*/
public ImageBrowser(ImageBrowserModelBuilder b) {
@@ -94,14 +94,14 @@
* Construct a new ImageBrowser with requested mode.
*
* @param builder the {@link ImageBrowserModelBuilder} that will supply this
- * component with its {@link ImageBrowserModel} during each request
- * @param mode the component mode (see {@link ImageComponent})
+ * component with its {@link ImageBrowserModel} during each request
+ * @param mode the component mode (see {@link ImageComponent})
*/
public ImageBrowser(ImageBrowserModelBuilder b, int mode) {
super(new BuilderAdapter(b), HEADERS);
m_mode = mode;
setThumbnailSize(CMS.getConfig().getImageBrowserThumbnailMaxWidth(),
- CMS.getConfig().getImageBrowserThumbnailMaxHeight());
+ CMS.getConfig().getImageBrowserThumbnailMaxHeight());
m_builder = b;
getHeader().setDefaultRenderer(new DefaultTableCellRenderer(false));
@@ -123,9 +123,9 @@
}
public int getNumColumns() {
- return m_numColumns;
+ return m_numColumns;
}
-
+
/**
* @return the size, in pixels, of the thumbnail images
*/
@@ -151,6 +151,7 @@
/**
* @param state The current page state
+ *
* @return the {@link ImageBrowserModel} used in the current request
*/
public ImageBrowserModel getImageBrowserModel(PageState state) {
@@ -187,29 +188,14 @@
boolean isSelected, Object key,
int row, int column) {
ImageAsset a = (ImageAsset) value;
- // String url = Utilities.getImageURL(a);
+
String url = Service.getImageURL(a);
+ // Sets url paramter to resize the images server-side
+ String resizeParam = "&maxWidth=" + new Double(m_thumbSize.getWidth()).intValue() + "&maxHeight=" + new Double(m_thumbSize.getHeight()).intValue();
- Image img = new Image(URL.getDispatcherPath() + url);
+ Image img = new Image(URL.getDispatcherPath() + url + resizeParam, a.getName());
img.setBorder("0");
- img.setAlt(a.getName());
- BigDecimal width = a.getWidth(), height = a.getHeight();
- int w, h;
-
- if (width == null || height == null) {
- w = (int) m_thumbSize.getWidth();
- h = (int) m_thumbSize.getHeight();
- } else {
- Dimension d = ImageSizer.getScaledSize(
- width.intValue(), height.intValue(), (int) m_thumbSize.getWidth(), (int) m_thumbSize.getHeight());
- w = (int) d.getWidth();
- h = (int) d.getHeight();
- }
-
- img.setWidth(Integer.toString(w));
- img.setHeight(Integer.toString(h));
-
return new Link(img, url);
}
}
@@ -265,7 +251,7 @@
}
}
-
+
// can delete image because it's not in use
if (canDelete) {
return super.getComponent(table, state, value, isSelected, key, row, column);
@@ -309,7 +295,7 @@
@Override
public int getColumnCount() {
- return ((ImageBrowser)m_model).getNumColumns();
+ return ((ImageBrowser) m_model).getNumColumns();
// return ImageBrowser.s_numColumns;
}
@@ -359,7 +345,7 @@
return m.getMimeType();
case ImageBrowser.LINK:
- return "select";
+ return "select";
case ImageBrowser.DELETE:
return "delete";
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageDisplay.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageDisplay.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImageDisplay.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -24,12 +24,10 @@
import com.arsdigita.cms.ImageAsset;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.Service;
-// import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.mimetypes.MimeType;
import com.arsdigita.util.Assert;
import com.arsdigita.web.URL;
import com.arsdigita.xml.Element;
-
import java.math.BigDecimal;
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImagesPane.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImagesPane.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ImagesPane.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -5,6 +5,7 @@
package com.arsdigita.cms.ui;
import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.FormModel;
import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.List;
import com.arsdigita.bebop.ListPanel;
@@ -16,16 +17,17 @@
import com.arsdigita.bebop.SegmentedPanel;
import com.arsdigita.bebop.SegmentedPanel.Segment;
import com.arsdigita.bebop.SimpleContainer;
-import com.arsdigita.bebop.SingleSelectionModel;
import com.arsdigita.bebop.event.ChangeEvent;
import com.arsdigita.bebop.event.ChangeListener;
import com.arsdigita.bebop.list.ListModel;
import com.arsdigita.bebop.list.ListModelBuilder;
+import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.toolbox.ui.ActionGroup;
import com.arsdigita.toolbox.ui.LayoutPanel;
import com.arsdigita.toolbox.ui.Section;
+import com.arsdigita.util.Assert;
import com.arsdigita.util.LockableImpl;
import java.util.ArrayList;
import java.util.HashMap;
@@ -47,14 +49,15 @@
private ListPanel m_listPanel;
final private SegmentedPanel m_body;
private HashMap<String, Segment> m_bodySegments = new HashMap();
- private final SingleSelectionModel m_model;
+ private final ResettableParameterSingleSelectionModel m_model;
private final List m_links;
+ private final LinksSection m_modes;
public ImagesPane() {
super();
- m_model = new ParameterSingleSelectionModel(new StringParameter(List.SELECTED));
-
+ m_model = new ResettableParameterSingleSelectionModel(new StringParameter(List.SELECTED));
+ m_model.setDefaultSelection(ImageComponent.LIBRARY);
m_model.addChangeListener(new ImageAdminSelectionListener());
m_links = new List(new ImageAdminListModelBuilder());
@@ -63,8 +66,8 @@
final SimpleContainer left = new SimpleContainer();
setLeft(left);
- final LinksSection staff = new LinksSection();
- left.add(staff);
+ m_modes = new LinksSection();
+ left.add(m_modes);
m_body = new SegmentedPanel();
setBody(m_body);
@@ -81,7 +84,6 @@
final ImageLibraryComponent library = new ImageLibraryComponent(ImageComponent.ADMIN_IMAGES);
library.getForm().addInitListener(m_adminListener);
library.getForm().addProcessListener(m_adminListener);
- library.addUploadLink(m_adminListener);
selectors.put(ImageComponent.LIBRARY, library);
m_bodySegments.put(ImageComponent.LIBRARY, m_body.addSegment(
new Label(GlobalizationUtil.globalize("cms.ui.image_library")),
@@ -107,69 +109,77 @@
while (keys.hasNext()) {
String key = keys.next();
- page.setVisibleDefault(m_bodySegments.get(key), ImageComponent.LIBRARY.equals(key));
-// for (int index = 0; index < m_bodySegments.get(key).size(); index++) {
-
-// Component component = m_bodySegments.get(key).get(index);
-// page.setVisibleDefault(component, ImageComponent.LIBRARY.equals(key));
-// }
+ page.setVisibleDefault(m_bodySegments.get(key), m_model.getDefaultSelection().equals(key));
}
- // final Map componentsMap = m_imageComponent.getComponentsMap();
- //
- // final Iterator keyIter = componentsMap.keySet().iterator();
- // while (keyIter.hasNext()) {
- // final Object key = keyIter.next();
- // final Component component = (Component) componentsMap.get(key);
- //
- // page.setVisibleDefault(component, ImageComponent.LIBRARY.equals(key));
- // }
- //
page.addComponentStateParam(this, m_imageComponentKey);
}
/**
* Resets this pane and all its resettable components.
- *
+ *
* @param state Page state
*/
@Override
public final void reset(final PageState state) {
super.reset(state);
+ m_model.reset(state);
+ this.setActiveImageComponent(state, m_model.getDefaultSelection());
+ }
+
+ public final void setActiveImageComponent(PageState state, String activeComp) {
+
Iterator<String> keys = m_bodySegments.keySet().iterator();
+ m_imageComponent.setSelectedKey(state, activeComp);
while (keys.hasNext()) {
+
String key = keys.next();
- state.setVisible(m_bodySegments.get(key), ImageComponent.LIBRARY.equals(key));
+ final boolean visibility = key.equals(activeComp);
+ state.setVisible(m_bodySegments.get(key), visibility);
for (int index = 0; index < m_bodySegments.get(key).size(); index++) {
Component component = m_bodySegments.get(key).get(index);
-// state.setVisible(component, ImageComponent.LIBRARY.equals(key));
+
// Reset all components if they are of type Resettable
-
if (component instanceof Resettable) {
((Resettable) component).reset(state);
}
+
+ // Set visibility
+ component.setVisible(state, visibility);
}
}
+ }
+ private class ResettableParameterSingleSelectionModel extends ParameterSingleSelectionModel
+ implements Resettable {
-// final Map componentsMap = m_imageComponent.getComponentsMap();
-// m_imageComponent.setSelectedKey(state, ImageComponent.LIBRARY);
-// final Iterator keyIter = componentsMap.keySet().iterator();
-// while (keyIter.hasNext()) {
-// final Object key = keyIter.next();
-// final Component component = (Component) componentsMap.get(key);
-//
-// state.setVisible(component, ImageComponent.LIBRARY.equals(key));
-//
-// // Reset all components if they are of type Resettable
-// if (component instanceof Resettable) {
-// ((Resettable) component).reset(state);
-// }
-// }
+ private String defaultKey;
+
+ public ResettableParameterSingleSelectionModel(ParameterModel m) {
+ super(m);
+ }
+
+ public void setDefaultSelection(String selKey) {
+ this.defaultKey = selKey;
+ }
+
+ public String getDefaultSelection() {
+ return defaultKey;
+ }
+
+ public void reset(PageState state) {
+
+ if (Assert.isEnabled()) {
+ final FormModel model = state.getPage().getStateModel();
+ Assert.isTrue(model.containsFormParam(getStateParameter()));
+ }
+
+ state.setValue(getStateParameter(), this.defaultKey);
+ }
}
private class ImageAdminListModel implements ListModel {
@@ -212,13 +222,11 @@
final PageState state = e.getPageState();
-// getBody().reset(state);
-
if (m_model.isSelected(state)) {
S_LOG.debug("The selection model is selected; displaying "
+ "the item pane");
-// getBody().push(state, getItemPane());
+ ImagesPane.this.setActiveImageComponent(state, state.getControlEventValue());
}
}
}
@@ -234,4 +242,4 @@
group.setSubject(m_links);
}
}
-}
+}
\ No newline at end of file
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFlatBrowsePane.java
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFlatBrowsePane.java 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFlatBrowsePane.java 2013-02-03 09:12:51 UTC (rev 2482)
@@ -182,6 +182,7 @@
collection.set(state, session.retrieve(type.getClassName()));
}
((DataCollection)collection.get(state)).addFilter("version = 'draft'");
+ ((DataCollection)collection.get(state)).addFilter("section is not null");
final String query = (String) state.getValue(queryParam);
if ((query != null) && !query.isEmpty()) {
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -70,5 +70,5 @@
cms.ui.folder.filter.all=All
cms.ui.folder.filter=Filter for work
cms.ui.folder.filter_do=Filter
-cms.ui.folder.languages=
+cms.ui.folder.languages=Languages
cms.ui.folder.delete_confirmation=Permanently delete this item?
Modified: releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties
===================================================================
--- releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties 2013-02-03 09:12:51 UTC (rev 2482)
@@ -66,5 +66,5 @@
cms.ui.folder.filter.all=Alle
cms.ui.folder.filter=Nach Begriff filtern
cms.ui.folder.filter_do=Filtern
-cms.ui.folder.languages=
+cms.ui.folder.languages=Sprachen
cms.ui.folder.delete_confirmation=Wollen Sie dieses Content-Item l\u00f6schen?
Modified: releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.html
===================================================================
--- releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.html 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.html 2013-02-03 09:12:51 UTC (rev 2482)
@@ -121,7 +121,7 @@
</label>
<div class="value">
<select size="1" name="[alignment]" id="[alignment]" title="_(Positioning of this image)">
- <option value="" ><l10n>Not set</l10n></option>
+ <option value="none" ><l10n>Not set</l10n></option>
<option value="left" ><l10n>Left</l10n></option>
<option value="center"><l10n>Center</l10n></option>
<option value="right" ><l10n>Right</l10n></option>
@@ -133,18 +133,16 @@
<div class="value">
<input type="checkbox" name="[caption]" id="[caption]" title="_(Show caption)" checked="checked"/>
</div>
- <label class="key" for="[zoom]">
- <l10n>Enable Zoom:</l10n>
+ <label class="key" for="[fancybox]">
+ <l10n>Fancybox:</l10n>
</label>
<div class="value">
- <input type="checkbox" name="[zoom]" id="[zoom]" title="_(Enable zoom)"/>
+ <select size="1" name="[fancybox]" id="[fancybox]" title="_()">
+ <option value="none" ><l10n>None</l10n></option>
+ <option value="imageZoom" ><l10n>Zoom</l10n></option>
+ <option value="imageGallery"><l10n>Gallery</l10n></option>
+ </select>
</div>
- <label class="key" for="[gallery]">
- <l10n>Enable Gallery:</l10n>
- </label>
- <div class="value">
- <input type="checkbox" name="[gallery]" id="[gallery]" title="_(Enable gallery)"/>
- </div>
</fieldset>
<fieldset id="[dimensions]">
Modified: releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.js
===================================================================
--- releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.js 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/images/images.js 2013-02-03 09:12:51 UTC (rev 2482)
@@ -17,8 +17,11 @@
width : "",
height : "",
caption : "",
- zoom : "",
- gallery : "",
+
+ alignment : "",
+ caption : "",
+ fancybox : "",
+
aspect : ""
};
@@ -33,7 +36,7 @@
this.image = image;
- if(image && image.tagName.toLowerCase() == "img")
+ if (image && image.tagName.toLowerCase() == "img")
{
data.src = this.editor.fixRelativeLinks(image.getAttribute("src"));
data.alt = image.getAttribute("alt");
@@ -42,35 +45,50 @@
data.width = image.getAttribute("width");
data.height = image.getAttribute("height");
- if(image.parentNode.tagName.toLowerCase() == "div")
+ if (image.parentNode.tagName.toLowerCase() == "div")
{
// Parent node is not a link, so there is not zoom or gallery function
- data.alignment = image.parentNode.getAttribute("class").substring(image.parentNode.getAttribute("class").indexOf(" "));
+ alignment = image.parentNode.getAttribute("class");
+ if (alignment != "image none")
+ {
+ data.alignment = alignment.substring(alignment.indexOf(" ") + 1);
+ }
+ else
+ {
+ data.alignment = "none";
+ }
data.caption = (image.nextSibling.tagName.toLowerCase() == "span" && image.nextSibling.firstChild) ? image.nextSibling.firstChild.nodeValue : "";
- data.zoom = "";
- data.gallery = "";
+
+ data.fancybox = "none";
// data.galleryName = "";
}
else
{
// Parent node is a link
- data.alignment = image.parentNode.parentNode.getAttribute("class").substring(image.parentNode.getAttribute("class").indexOf(" "));
- data.zoom = (image.parentNode.getAttribute("class") == "imageZoom") ? "on" : "";
- data.gallery = (image.parentNode.getAttribute("class") == "imageGallery") ? "on" : "";
+ alignment = image.parentNode.parentNode.getAttribute("class");
+ if (alignment != "image none")
+ {
+ data.alignment = alignment.substring(alignment.indexOf(" ") + 1);
+ }
+ else
+ {
+ data.alignment="none";
+ }
+
+ data.fancybox = image.parentNode.getAttribute("class");
// data.galleryName = (image.parentNode.getAttribute("class") == "imageGallery") ? image.parentNode.getAttribute("rel") : "";
data.caption = (image.parentNode.nextSibling.tagName.toLowerCase() == "span" && image.parentNode.nextSibling.firstChild) ? image.parentNode.nextSibling.firstChild.nodeValue : "";
}
-
+
// Calculate aspect ratio
data.aspect = data.width / data.height;
}
else
{
- data.alignment = "";
+ data.alignment = "none";
// data.caption = "";
- data.zoom = "";
- data.gallery = "";
+ data.fancybox = "none";
// data.galleryName = "";
}
@@ -151,7 +169,6 @@
href : "",
rel : "",
class : ""
-
};
var divAttr =
@@ -181,20 +198,18 @@
}
// Read form values for link
- if(values.zoom || values.gallery)
+ if(values.fancybox.value == "imageZoom")
{
linkAttr.href = values.src;
- if(values.zoom)
- {
- linkAttr.rel = "";
- linkAttr.class = "imageZoom";
- }
+ linkAttr.rel = "";
+ linkAttr.class = "imageZoom";
+ }
- else if(values.gallery)
- {
- linkAttr.rel = "imageGallery";
- linkAttr.class = "imageGallery";
- }
+ else if(values.fancybox.value == "imageGallery")
+ {
+ linkAttr.href = values.src;
+ linkAttr.rel = "imageGallery";
+ linkAttr.class = "imageGallery";
}
// Read form values for div
@@ -240,7 +255,7 @@
// the folling has to be done for both cases
// insert link, if fancybox features are activated
- if(values.zoom || values.gallery)
+ if(values.fancybox.value != "none")
{
link = document.createElement("a");
for(var attr in linkAttr)
@@ -256,7 +271,7 @@
{
img.setAttribute(attr, imgAttr[attr]);
}
- if(values.zoom || values.gallery)
+ if(values.fancybox.value != "none")
{
link.appendChild(img);
}
@@ -358,11 +373,15 @@
{
if(dialog.getElementById(dialog.id["preview"]).style.display == "block")
{
+
+
// Recalculate height of preview
dialog.getElementById(dialog.id["preview"]).style.height = Math.min(Math.max(0, dialog.height - this._getCombinedComponentHeight() - 20), Math.round((window.innerHeight * 0.8) - this._getCombinedComponentHeight())) + "px";
// Resize preview image
this.resizePreview(dialog);
}
+ dialog.width = Math.min(Math.max(10, dialog.width), Math.round((window.innerWidth * 0.8)));
+ dialog.height = Math.min(Math.max(10, dialog.height), Math.round((window.innerHeight * 0.8)));
};
OpenCCM.prototype.resizePreview = function(dialog)
@@ -374,16 +393,21 @@
var maxHeight = previewElem.offsetHeight && previewElem.offsetHeight - 15 < Math.round((window.innerHeight * 0.8) - this._getCombinedComponentHeight())
? previewElem.offsetHeight - 15
: Math.round((window.innerHeight * 0.8) - this._getCombinedComponentHeight());
-
+
dialog.getElementById(dialog.id["ipreview"]).style.width = "auto";
dialog.getElementById(dialog.id["ipreview"]).style.height = "auto";
var width = parseInt(dialog.getElementById(dialog.id["ipreview"]).width,10);
var height = parseInt(dialog.getElementById(dialog.id["ipreview"]).height,10);
- var zoom = Math.min(maxWidth / width,
- maxHeight / height);
-
+// alert("W: " + maxWidth +" "+ width + "H: " + maxHeight +" "+ height);
+
+ var zoom = height > 0
+ ? Math.min(maxWidth / width, maxHeight / height)
+ : maxWidth / width;
+
+// alert("Zoom: " + zoom);
+
var w = dialog.getElementById(dialog.id["ipreview"]).style.width = Math.round(width * zoom) + "px";
var h = dialog.getElementById(dialog.id["ipreview"]).style.height = Math.round(height * zoom) + "px";
};
Modified: releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js
===================================================================
--- releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js 2013-02-03 09:12:51 UTC (rev 2482)
@@ -3,4 +3,19 @@
{
"OpenCCMInsertLink" : "Link einfügen / bearbeiten",
"OpenCCMInsertImage" : "Bild einfügen / bearbeiten",
+ "Name:" : "Name:",
+ "Alternate:" : "Alt-Text",
+ "Title:" : "Titel:",
+ "Layout" : "Darstellung",
+ "Alignment:" : "Ausrichtung:",
+ "Center" : "zentriert",
+ "Show Caption:" : "Zeige Bildunterschrift:",
+ "Fancybox" : "Fancybox:",
+ "Disabled" : "Deaktiviert",
+ "Zoom" : "Zoom",
+ "Gallery" : "Gallerie",
+ "Dimension" : "Dimensionen",
+ "Width:" : "Breite:",
+ "Height:" : "Höhe:",
+ "Preview" : "Vorschau"
}
Modified: releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js
===================================================================
--- releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js 2013-02-03 08:56:16 UTC (rev 2481)
+++ releases/2.0.0/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js 2013-02-03 09:12:51 UTC (rev 2482)
@@ -3,4 +3,19 @@
{
"OpenCCMInsertLink" : "Create / modify link",
"OpenCCMInsertImage" : "Insert / modify image",
+ "Name:" : "Name:",
+ "Alternate:" : "Alternate",
+ "Title:" : "Title:",
+ "Layout" : "Layout",
+ "Alignment:" : "Alignment:",
+ "Center" : "zentriert",
+ "Show Caption:" : "Show Caption:",
+ "Fancybox" : "Fancybox:",
+ "Disabled" : "Disabled",
+ "Zoom" : "Zoom",
+ "Gallery" : "Gallery",
+ "Dimension" : "Dimension",
+ "Width:" : "Width:",
+ "Height:" : "Height:",
+ "Preview" : "Preview"
}
|
|
From: <pb...@fe...> - 2013-02-03 08:56:41
|
Author: pboy Date: 2013-02-03 08:56:16 +0000 (Sun, 03 Feb 2013) New Revision: 2481 Modified: releases/2.0.0/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_sitemap_legacy_entries.sql Log: Backport r2460 (update script fixed). (on behalf of JensP) Modified: releases/2.0.0/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_sitemap_legacy_entries.sql =================================================================== --- releases/2.0.0/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_sitemap_legacy_entries.sql 2013-02-03 08:28:27 UTC (rev 2480) +++ releases/2.0.0/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_sitemap_legacy_entries.sql 2013-02-03 08:56:16 UTC (rev 2481) @@ -135,3 +135,24 @@ -- functionality and is removed. -- New, legacy free application works without a (dummy) Application table drop table sitemap_app ; + +delete from applications + where application_type_id = + (select application_type_id from application_types + where object_type like '%sitemap.SiteMap%'); + +delete from object_container_map + where object_id = + (select object_id from acs_objects + where object_type like '%sitemap.SiteMap%'); + +delete from object_context + where object_id = + (select object_id from acs_objects + where object_type like '%sitemap.SiteMap%'); + +delete from acs_objects + where object_type like '%sitemap.SiteMap%'; + +delete from application_types + where object_type like '%sitemap.SiteMap%'; \ No newline at end of file |
|
From: <pb...@fe...> - 2013-02-03 08:28:39
|
Author: pboy
Date: 2013-02-03 08:28:27 +0000 (Sun, 03 Feb 2013)
New Revision: 2480
Modified:
trunk/ccm-cms/src/com/arsdigita/cms/Folder.java
Log:
API addition: Load a folder by Path. (on behalf of JensP)
Modified: trunk/ccm-cms/src/com/arsdigita/cms/Folder.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/Folder.java 2013-02-02 23:46:44 UTC (rev 2479)
+++ trunk/ccm-cms/src/com/arsdigita/cms/Folder.java 2013-02-03 08:28:27 UTC (rev 2480)
@@ -48,21 +48,15 @@
import java.util.Iterator;
/**
- * This class represents folders for which to organize items in a tree
- * hierarchy.
+ * This class represents folders for which to organize items in a tree hierarchy.
*
- * Folders will only ever exist as draft or live versions. There
- * should never be any folders that are pending. The pending versions
- * of ordinary content items are stored in the live version of
- * folders.
+ * Folders will only ever exist as draft or live versions. There should never be any folders that are pending. The
+ * pending versions of ordinary content items are stored in the live version of folders.
*
- * Folders cannot have their own lifecycles. The methods to get or set
- * lifecycles are no-ops.
+ * Folders cannot have their own lifecycles. The methods to get or set lifecycles are no-ops.
*
- * You should never call {@link #publish} or {@link #unpublish} on a
- * folder; at present, these methods only log a warning when they are
- * called. In the future, these warnings may be turned into actual
- * errors.
+ * You should never call {@link #publish} or {@link #unpublish} on a folder; at present, these methods only log a
+ * warning when they are called. In the future, these warnings may be turned into actual errors.
*
* @author Jack Chung
* @author Michael Pih
@@ -72,24 +66,20 @@
public class Folder extends ContentItem {
private static final Logger s_log = Logger.getLogger(Folder.class);
-
public static final String BASE_DATA_OBJECT_TYPE =
- "com.arsdigita.cms.Folder";
-
+ "com.arsdigita.cms.Folder";
public static final String INDEX = "index";
public static final String HOME_FOLDER = "homeFolder";
public static final String HOME_SECTION = "homeSection";
-
private static final String ITEMS_QUERY = "com.arsdigita.cms.ItemsInFolder";
private static final String PRIMARY_INSTANCES_QUERY =
- "com.arsdigita.cms.PrimaryInstancesInFolder";
+ "com.arsdigita.cms.PrimaryInstancesInFolder";
private static final String ITEM_QUERY = "com.arsdigita.cms.ItemInFolder";
private static final String FOLDER_QUERY = "com.arsdigita.cms.FolderInFolder";
private static final String LABEL = "label";
private static final String NAME = "name";
private final static String ITEM = "item";
private boolean m_wasNew;
-
protected static final String ITEMS = "items";
/**
@@ -100,25 +90,24 @@
}
/**
- * Constructor. The contained <code>DataObject</code> is retrieved
- * from the persistent storage mechanism with an <code>OID</code>
- * specified by <cod>oid</code>.
+ * Constructor. The contained
+ * <code>DataObject</code> is retrieved from the persistent storage mechanism with an
+ * <code>OID</code> specified by <cod>oid</code>.
*
- * @param oid The <code>OID</code> for the retrieved
- * <code>DataObject</code>.
+ * @param oid The <code>OID</code> for the retrieved <code>DataObject</code>.
*/
public Folder(final OID oid) throws DataObjectNotFoundException {
super(oid);
}
/**
- * Constructor. The contained <code>DataObject</code> is retrieved
- * from the persistent storage mechanism with an <code>OID</code>
- * specified by <code>id</code> and
+ * Constructor. The contained
+ * <code>DataObject</code> is retrieved from the persistent storage mechanism with an
+ * <code>OID</code> specified by
+ * <code>id</code> and
* <code>Folder.BASE_DATA_OBJECT_TYPE</code>.
*
- * @param id The <code>id</code> for the retrieved
- * <code>DataObject</code>
+ * @param id The <code>id</code> for the retrieved <code>DataObject</code>
*/
public Folder(final BigDecimal id) throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id));
@@ -145,9 +134,10 @@
item.copy(this, true);
}
}
+
/**
- * @return the base PDL object type for this item. Child classes
- * should override this method to return the correct value
+ * @return the base PDL object type for this item. Child classes should override this method to return the correct
+ * value
*/
public String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE;
@@ -162,18 +152,16 @@
s_log.debug("Deleting folder");
if (!isEmpty()) {
- throw new IllegalStateException
- ("Attempt to delete non-empty folder " + getOID() + "; " +
- "only empty folders can be deleted");
+ throw new IllegalStateException("Attempt to delete non-empty folder " + getOID() + "; "
+ + "only empty folders can be deleted");
}
super.delete();
}
protected void beforeDelete() {
- DataCollection maps = SessionManager.getSession().retrieve
- (UserHomeFolderMap.BASE_DATA_OBJECT_TYPE);
- maps.addEqualsFilter(HOME_FOLDER + "." + ID,getID());
+ DataCollection maps = SessionManager.getSession().retrieve(UserHomeFolderMap.BASE_DATA_OBJECT_TYPE);
+ maps.addEqualsFilter(HOME_FOLDER + "." + ID, getID());
while (maps.next()) {
maps.getDataObject().delete();
}
@@ -207,9 +195,8 @@
final ContentSection section = getContentSection();
- if (section != null &&
- (this.equals(section.getRootFolder()) ||
- this.equals(section.getTemplatesFolder()))) {
+ if (section != null && (this.equals(section.getRootFolder()) || this.
+ equals(section.getTemplatesFolder()))) {
PermissionService.setContext(this, section);
}
}
@@ -225,9 +212,8 @@
}
/**
- * Fetches the child items of this folder. The returned collection
- * provides methods to filter by various criteria, for example by
- * name or by whether items are folders or not.
+ * Fetches the child items of this folder. The returned collection provides methods to filter by various criteria,
+ * for example by name or by whether items are folders or not.
*
* @param bSort whether to sort the collection by isFolder and ID
* @return child items of this folder
@@ -243,10 +229,9 @@
}
/**
- * Fetches the child items of this folder. The returned collection
- * provides methods to filter by various criteria, for example by
- * name or by whether items are folders or not. The items returned
- * by this method are sorted by isFolder and ID
+ * Fetches the child items of this folder. The returned collection provides methods to filter by various criteria,
+ * for example by name or by whether items are folders or not. The items returned by this method are sorted by
+ * isFolder and ID
*
* @return child items of this folder, sorted by isFolder and ID
*/
@@ -254,14 +239,11 @@
return getItems(true);
}
-
/**
- * Returns collection of primary language instances for bundles in
- * this folder.
+ * Returns collection of primary language instances for bundles in this folder.
*/
public ItemCollection getPrimaryInstances() {
- final DataQuery query = SessionManager.getSession().retrieveQuery
- (PRIMARY_INSTANCES_QUERY);
+ final DataQuery query = SessionManager.getSession().retrieveQuery(PRIMARY_INSTANCES_QUERY);
query.setParameter(PARENT, getID());
Assert.isNotEqual(PENDING, getVersion());
@@ -272,14 +254,11 @@
}
/**
- * Returns a child content item in this folder (which could itself
- * be a folder) with the specified name.
+ * Returns a child content item in this folder (which could itself be a folder) with the specified name.
*
* @param name The name of the item
- * @param isFolder If true, only return a subfolder. Otherwise,
- * return any subitem
- * @return The item with the given name, or null if no such item
- * exists in the folder
+ * @param isFolder If true, only return a subfolder. Otherwise, return any subitem
+ * @return The item with the given name, or null if no such item exists in the folder
*/
public ContentItem getItem(final String name,
final boolean isFolder) {
@@ -299,14 +278,13 @@
if (items.next()) {
DataObject dataObj = items.getDataObject();
- ContentItem result = (ContentItem)DomainObjectFactory
- .newInstance(dataObj);
+ ContentItem result = (ContentItem) DomainObjectFactory
+ .newInstance(dataObj);
if (items.next()) {
- s_log.warn("Item in folder has a duplicate name; one " +
- "is " + result + " and one is " +
- (ContentItem)DomainObjectFactory
- .newInstance(items.getDataObject()));
+ s_log.warn("Item in folder has a duplicate name; one " + "is " + result + " and one is "
+ + (ContentItem) DomainObjectFactory
+ .newInstance(items.getDataObject()));
throw new IllegalStateException();
}
@@ -334,7 +312,6 @@
}
}
-
/**
* Fetches the label of the folder.
*/
@@ -354,12 +331,10 @@
}
/**
- * Set the version of the folder. An attempt to set the version to
- * pending will result in the folder's version being set to live. We will
- * never have any pending versions of folders, only live or draft.
+ * Set the version of the folder. An attempt to set the version to pending will result in the folder's version being
+ * set to live. We will never have any pending versions of folders, only live or draft.
*
- * Pending versions of items are stored in the live version of a
- * folder.
+ * Pending versions of items are stored in the live version of a folder.
*/
protected void setVersion(String version) {
if (ContentItem.PENDING.equals(version)) {
@@ -372,7 +347,6 @@
//
// Publish/unpublish stuff
//
-
public void unpublish() {
if (s_log.isInfoEnabled()) {
s_log.info("Unpublishing folder " + this);
@@ -393,9 +367,9 @@
//
// Lifecycle stuff
//
-
/**
- * Always returns <code>null</code>, as folders do not have lifecycles.
+ * Always returns
+ * <code>null</code>, as folders do not have lifecycles.
*
* @return a <code>Lifecycle</code> value
*/
@@ -435,16 +409,12 @@
//
// Index item
//
-
/**
- * Get the (special) index item for the folder. The index item is
- * what carries all the user-editable attributes of the
- * folder. The index item is what should be published when a index
- * page for a folder is desired.
+ * Get the (special) index item for the folder. The index item is what carries all the user-editable attributes of
+ * the folder. The index item is what should be published when a index page for a folder is desired.
*
- * The index item is an ordinary item in every respect, i.e., it
- * is part of the collection returned by <code>getItems()</code>,
- * you cannot delete a folder if it still has an index item etc.
+ * The index item is an ordinary item in every respect, i.e., it is part of the collection returned by
+ * <code>getItems()</code>, you cannot delete a folder if it still has an index item etc.
*/
public ContentBundle getIndexItem() {
// BECAUSE INDEX ITEM MIGHT NOT BE UPDATED FOR PUBLISHED
@@ -453,7 +423,7 @@
if (getVersion().compareTo(ContentItem.LIVE) == 0) {
final ContentItem indexItem =
- ((Folder) getWorkingVersion()).getIndexItem();
+ ((Folder) getWorkingVersion()).getIndexItem();
if (indexItem == null) {
return null;
@@ -478,8 +448,7 @@
/**
* Sets the index item. This also adds the item to the folder.
*
- * @param item The index item with the folder's user-editable
- * attributes
+ * @param item The index item with the folder's user-editable attributes
*/
public final void setIndexItem(final ContentBundle item) {
setAssociation(INDEX, item);
@@ -495,15 +464,15 @@
}
/**
- * Returns <code>true</code> if the folder is empty.
+ * Returns
+ * <code>true</code> if the folder is empty.
*
* @return <code>true</code> if the folder is empty
*/
public boolean isEmpty() {
final Session session = SessionManager.getSession();
- final DataQuery query = session.retrieveQuery
- ("com.arsdigita.cms.folderNotEmpty");
+ final DataQuery query = session.retrieveQuery("com.arsdigita.cms.folderNotEmpty");
query.setParameter("id", getID());
final boolean result = !query.next();
@@ -514,17 +483,17 @@
}
/**
- * Returns <code>true</code> if the folder contains at least one
- * folder, <code>false</code> if the folder does not contain any
- * folders, but is either empty or contains only ordinary items.
+ * Returns
+ * <code>true</code> if the folder contains at least one folder,
+ * <code>false</code> if the folder does not contain any folders, but is either empty or contains only ordinary
+ * items.
*
* @return <code>true</code> if the folder contains other folders.
*/
public boolean containsFolders() {
final Session session = SessionManager.getSession();
- final DataQuery query = session.retrieveQuery
- ("com.arsdigita.cms.folderHasNoSubFolders");
+ final DataQuery query = session.retrieveQuery("com.arsdigita.cms.folderHasNoSubFolders");
query.setParameter("id", getID());
final boolean result = !query.next();
@@ -535,25 +504,23 @@
}
/**
- * Copy the specified property (attribute or association) from the specified
- * source folder. This method almost completely overrides the
- * metadata-driven methods in <code>ObjectCopier</code>. If the property in
- * question is an association to <code>ContentItem</code>(s), this method
- * should <em>only</em> call <code>FooContentItem newChild =
- * copier.copyItem(originalChild)</code>. An attempt to call any other
- * method in order to copy the child will most likely have disastrous
- * consequences.
+ * Copy the specified property (attribute or association) from the specified source folder. This method almost
+ * completely overrides the metadata-driven methods in
+ * <code>ObjectCopier</code>. If the property in question is an association to
+ * <code>ContentItem</code>(s), this method should <em>only</em> call
+ * <code>FooContentItem newChild =
+ * copier.copyItem(originalChild)</code>. An attempt to call any other method in order to copy the child will most
+ * likely have disastrous consequences.
*
* If a child class overrides this method, it should return
- * <code>super.copyProperty</code> in order to indicate that it is
- * not interested in handling the property in any special way.
+ * <code>super.copyProperty</code> in order to indicate that it is not interested in handling the property in any
+ * special way.
*
* @param srcItem the source item
* @param property the property to copy
* @param copier the ItemCopier
- * @return true if the property was copied, false to indicate that
- * regular metadata-driven methods should be used to copy the
- * property
+ * @return true if the property was copied, false to indicate that regular metadata-driven methods should be used to
+ * copy the property
*/
public boolean copyProperty(final CustomCopy srcItem,
final Property property,
@@ -575,42 +542,41 @@
}
/**
- * A collection of items that can be filtered to return only folders or
- * only nonfolders.
+ * A collection of items that can be filtered to return only folders or only nonfolders.
*/
public static class ItemCollection
- extends com.arsdigita.cms.ItemCollection {
+ extends com.arsdigita.cms.ItemCollection {
+
private final static String IS_FOLDER = "isFolder";
private final static String HAS_CHILDREN = "hasChildren";
private final static String ITEM = "item";
private final static String HAS_LIVE_VERSION = "hasLiveVersion";
private final static String TYPE_LABEL = "type.label";
- private final static String AUDIT_TRAIL="item.auditing";
-
+ private final static String AUDIT_TRAIL = "item.auditing";
private DataQuery m_query;
-
/**
* Constructor
- * @param adapter an adapter constructed using the query name rather than a
- * DataQuery object. This constructor must be used if there is any
- * intention to permission filter the results as only a DataQueryDataCollectionAdapter
- * constructed using query name has the bug fix to allow permission filtering
*
+ * @param adapter an adapter constructed using the query name rather than a DataQuery object. This constructor
+ * must be used if there is any intention to permission filter the results as only a
+ * DataQueryDataCollectionAdapter constructed using query name has the bug fix to allow permission filtering
+ *
* @param bSort whether to sort the collection by isFolder and ID
*/
- public ItemCollection (DataQueryDataCollectionAdapter adapter, boolean bSort) {
+ public ItemCollection(DataQueryDataCollectionAdapter adapter, boolean bSort) {
super(adapter);
doAlias(adapter);
init(adapter, bSort);
}
- public ItemCollection (DataQueryDataCollectionAdapter adapter) {
+ public ItemCollection(DataQueryDataCollectionAdapter adapter) {
this(adapter, true);
}
/**
* Constructor
+ *
* @param query the Data Query to use to retrieve the collection
* @param bSort whether to sort the collection by isFolder and ID
*/
@@ -623,14 +589,12 @@
}
/**
- * Convenience Constructor that always sorts the collection
- * by isFolder and ID
- *
- * jensp 2011-06: I changed this because this silly sorting affects
- * the ItemSearchWidget and makes it pretty useless... I've not noticed
- * any negative effects, so it seams no problem. Sorting is now set by
- * the caller/user of the {@code ItemCollection}.
- *
+ * Convenience Constructor that always sorts the collection by isFolder and ID
+ *
+ * jensp 2011-06: I changed this because this silly sorting affects the ItemSearchWidget and makes it pretty
+ * useless... I've not noticed any negative effects, so it seams no problem. Sorting is now set by the
+ * caller/user of the {@code ItemCollection}.
+ *
* @param query the Data Query to use to retrieve the collection
*/
public ItemCollection(DataQuery query) {
@@ -656,8 +620,7 @@
}
/**
- * Sets the range of the dataquery. This is used by the
- * paginator.
+ * Sets the range of the dataquery. This is used by the paginator.
*
* @param beginIndex The start index
* @param endIndex The end index
@@ -672,14 +635,12 @@
}
/**
- * For performance reaons, override superclass methods and
- * try to get the audit info without instantiating a content item.
- * We know this can help because the getPrimaryInstances
- * query retrieves the audit info directly
+ * For performance reaons, override superclass methods and try to get the audit info without instantiating a
+ * content item. We know this can help because the getPrimaryInstances query retrieves the audit info directly
*/
public Date getCreationDate() {
DataObject dobj = (DataObject) get(AUDIT_TRAIL);
- if (dobj != null){
+ if (dobj != null) {
BasicAuditTrail audit = new BasicAuditTrail(dobj);
return audit.getCreationDate();
} else {
@@ -689,7 +650,7 @@
public Date getLastModifiedDate() {
DataObject dobj = (DataObject) get(AUDIT_TRAIL);
- if (dobj != null){
+ if (dobj != null) {
BasicAuditTrail audit = new BasicAuditTrail(dobj);
return audit.getLastModifiedDate();
} else {
@@ -698,9 +659,8 @@
}
/**
- * Return the pretty name of the content type of the current item. If
- * the current item is a folder, the string <tt>Folder</tt> is
- * returned, otherwise the label of the item's content type.
+ * Return the pretty name of the content type of the current item. If the current item is a folder, the string
+ * <tt>Folder</tt> is returned, otherwise the label of the item's content type.
*
* @return the pretty name of the content type of the current item.
*/
@@ -708,16 +668,15 @@
if (isFolder()) {
return "Folder";
} else {
- return (String) get(TYPE_LABEL);
+ return (String) get(TYPE_LABEL);
}
}
/**
* Filter the collection by whether items are folders or not.
*
- * @param v <code>true</code> if the data query should only list folders,
- * <code>false</code> if the data query should only list non-folder
- * items.
+ * @param v <code>true</code> if the data query should only list folders, <code>false</code> if the data query
+ * should only list non-folder items.
*
*/
public void addFolderFilter(final boolean v) {
@@ -725,11 +684,10 @@
}
/**
- * Return <code>true</code> if the current item in the collection is a
- * folder.
+ * Return
+ * <code>true</code> if the current item in the collection is a folder.
*
- * @return <code>true</code> if the current item in the collection is a
- * folder.
+ * @return <code>true</code> if the current item in the collection is a folder.
*/
public boolean isFolder() {
Boolean result = (Boolean) m_query.get(IS_FOLDER);
@@ -743,7 +701,7 @@
public boolean isLive() {
String version = (String) get(ContentItem.VERSION);
- if (ContentItem.LIVE.equals(version) ) {
+ if (ContentItem.LIVE.equals(version)) {
return true;
}
Boolean hasLive = (Boolean) m_query.get(HAS_LIVE_VERSION);
@@ -763,12 +721,11 @@
}
/**
- * Called by <code>VersionCopier</code> to determine whether to
- * publish associated items when an item goes live. This will only
- * have an effect for non-component associations where the item is
- * not yet published. Override default for <code>Folder</code>s
- * since they don't have their own lifecycles and a folder must be
- * published when an item in it goes live.
+ * Called by
+ * <code>VersionCopier</code> to determine whether to publish associated items when an item goes live. This will
+ * only have an effect for non-component associations where the item is not yet published. Override default for
+ * <code>Folder</code>s since they don't have their own lifecycles and a folder must be published when an item in it
+ * goes live.
*
* @return whether to publish this item
*/
@@ -776,18 +733,18 @@
return true;
}
- public static void setUserHomeFolder(User user,Folder folder) {
- UserHomeFolderMap map = UserHomeFolderMap.findOrCreateUserHomeFolderMap(user,folder.getContentSection());
+ public static void setUserHomeFolder(User user, Folder folder) {
+ UserHomeFolderMap map = UserHomeFolderMap.findOrCreateUserHomeFolderMap(user, folder.getContentSection());
map.setHomeFolder(folder);
map.save();
}
- public static Folder getUserHomeFolder(User user,ContentSection section) {
+ public static Folder getUserHomeFolder(User user, ContentSection section) {
Folder folder = null;
- UserHomeFolderMap map = UserHomeFolderMap.findUserHomeFolderMap(user,section);
- if ( map != null ) {
+ UserHomeFolderMap map = UserHomeFolderMap.findUserHomeFolderMap(user, section);
+ if (map != null) {
folder = map.getHomeFolder();
- if ( folder != null ) {
+ if (folder != null) {
CMSContext context = CMS.getContext();
SecurityManager sm;
if (context.hasSecurityManager()) {
@@ -795,11 +752,106 @@
} else {
sm = new SecurityManager(section);
}
- if ( !sm.canAccess(user,SecurityConstants.PREVIEW_PAGES,folder) ) {
+ if (!sm.canAccess(user, SecurityConstants.PREVIEW_PAGES, folder)) {
folder = null;
}
}
}
return folder;
}
+
+ /**
+ * Retrieves a folder by its path from a given content section.
+ *
+ * @param section The content section from which the folder should be retrieved.
+ * @param path The path of the folder, relative to the content section.
+ * @return The folder with the given path from the provided content section. If there is no such folder,
+ * {@code null} is returned. It is up to the caller to check the returned value for {@code null} and take
+ * appropriate actions.
+ */
+ public static Folder retrieveFolder(final ContentSection section, final String path) {
+ if (section == null) {
+ throw new IllegalArgumentException("No content section provided.");
+ }
+
+ if ((path == null) || path.isEmpty()) {
+ throw new IllegalArgumentException("No path provided.");
+ }
+
+ if (path.charAt(0) != '/') {
+ throw new IllegalArgumentException("Provided path is not an absolute path (starting with '/').");
+ }
+
+ final String[] pathTokens = path.split("/");
+
+ final Folder rootFolder = section.getRootFolder();
+
+ Folder folder = rootFolder;
+ for (String token : pathTokens) {
+ if ((token == null) || token.isEmpty() || "/".equals(token)) {
+ continue;
+ }
+
+ folder = getSubFolder(token, folder);
+
+ if (folder == null) {
+ break;
+ }
+ }
+
+ return folder;
+ }
+
+ private static Folder getSubFolder(final String name, final Folder fromFolder) {
+ final ItemCollection items = fromFolder.getItems();
+ items.addFolderFilter(true);
+ items.addNameFilter(name);
+
+ if (items.next()) {
+ return (Folder) items.getDomainObject();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Retrieves a folder of the current content section by its path. The path is given in a UNIX like synatax and must
+ * be an absolute path starting with '/'. The path may be precceded with the name of content section, separated by
+ * ':'. If a content section if given, the path is relative to this content section. If the no content section is
+ * given, the current content section returned by {@code CMS.getContext().getContentSection()}. Please note that
+ * {@code CMS.getContext().getContentSection()} may return null.
+ *
+ * Examples for valid paths:
+ *
+ * <pre>
+ * /persons/members
+ * content:/persons/members
+ * publications:/monographs
+ * </pre>
+ *
+ * @param path The path of the folder to retrieve relative to the current content section.
+ * @return The folder with the given path from the content section. If there is no such folder, {@code null} is
+ * returned. It is up to the caller to check the returned value for {@code null} and take appropriate actions.
+ */
+ public static Folder retrieveFolder(final String path) {
+ final String[] tokens = path.split(":");
+
+ if (tokens.length == 1) {
+ return retrieveFolder(CMS.getContext().getContentSection(), path);
+ } else if (tokens.length == 2) {
+ final ContentSectionCollection sections = ContentSection.getAllSections();
+ sections.addEqualsFilter("label", tokens[0]);
+
+ if (sections.isEmpty()) {
+ return null;
+ } else {
+ sections.next();
+ final ContentSection section = sections.getContentSection();
+ return retrieveFolder(section, tokens[1]);
+ }
+ } else {
+ throw new IllegalArgumentException("Invalid path syntax. Valid syntax: "
+ + "[contentsection:]/path/to/folder'");
+ }
+ }
}
|
Author: pboy Date: 2013-02-02 23:46:44 +0000 (Sat, 02 Feb 2013) New Revision: 2479 Added: trunk/ccm-bundle/bundles/base/ trunk/ccm-bundle/bundles/base/AUTHORS trunk/ccm-bundle/bundles/base/ChangeLog trunk/ccm-bundle/bundles/base/NEWS trunk/ccm-bundle/bundles/base/README trunk/ccm-bundle/bundles/base/bundle.in trunk/ccm-bundle/bundles/base/cfg/ trunk/ccm-bundle/bundles/base/cfg/integration.properties trunk/ccm-bundle/bundles/base/cfg/project.xml trunk/ccm-bundle/bundles/base/cfg/web-ccm.xml trunk/ccm-bundle/bundles/base/res/ trunk/ccm-bundle/bundles/base/res/bundle/ trunk/ccm-bundle/bundles/base/res/bundle/categories/ trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-domain-1.00.xml trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-hierarchy-1.00.xml trunk/ccm-bundle/bundles/base/res/bundle/categories/placeholder.info trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-domain.xml trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-hierarchy.xml trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-mapping-lgcl-anav.xml trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-mapping-lgcl-anav.xsl trunk/ccm-bundle/bundles/base/res/bundle/navigation/ trunk/ccm-bundle/bundles/base/res/bundle/navigation/gen-templates.txt trunk/ccm-bundle/bundles/base/res/placeholder.info trunk/ccm-bundle/bundles/base/templates/ trunk/ccm-bundle/bundles/base/templates/ccm-navigation/ trunk/ccm-bundle/bundles/base/templates/ccm-navigation/navigation/ trunk/ccm-bundle/bundles/base/templates/placeholder.info trunk/ccm-bundle/bundles/base/themes/ trunk/ccm-bundle/bundles/base/themes/README trunk/ccm-bundle/bundles/base/themes/master/ trunk/ccm-bundle/bundles/base/themes/master/dummy trunk/ccm-bundle/bundles/base/themes/placeholder.info trunk/ccm-bundle/bundles/demo/res/bundle/categories/gen-nav-domain-1.00.xml trunk/ccm-bundle/bundles/demo/res/bundle/categories/gen-nav-hierarchy-1.00.xml Removed: trunk/ccm-bundle/bundles/demo/res/bundle/categories/sci-nav-domain-1.00.xml trunk/ccm-bundle/bundles/demo/res/bundle/categories/sci-nav-hierarchy-1.00.xml Log: Added base bundes to ccm-bundle, fixed minor bugs. Added: trunk/ccm-bundle/bundles/base/AUTHORS =================================================================== Added: trunk/ccm-bundle/bundles/base/ChangeLog =================================================================== --- trunk/ccm-bundle/bundles/base/ChangeLog (rev 0) +++ trunk/ccm-bundle/bundles/base/ChangeLog 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,9 @@ +* Thu Sep 22 2005 Alan Pevec <ap...@re...> +- Build all APLAWS+ bundles from the common set of templates. + +* Mon Feb 21 2005 Alan Pevec <ap...@re...> +- Requires applications. + +* Mon Jan 26 2004 Daniel Berrange <ber...@re...> +- Initial build. + Added: trunk/ccm-bundle/bundles/base/NEWS =================================================================== Added: trunk/ccm-bundle/bundles/base/README =================================================================== Added: trunk/ccm-bundle/bundles/base/bundle.in =================================================================== --- trunk/ccm-bundle/bundles/base/bundle.in (rev 0) +++ trunk/ccm-bundle/bundles/base/bundle.in 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,4 @@ +BUNDLE_NAME=aplaws-plus-zes-devel +BUNDLE_PRETTY_NAME="APLAWS+ ZeS Devel Bundle" +VERSION=1.1.2devel +RELEASE=1 Added: trunk/ccm-bundle/bundles/base/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/base/cfg/integration.properties (rev 0) +++ trunk/ccm-bundle/bundles/base/cfg/integration.properties 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,243 @@ +# ############################################################################## +# Libre CMS BASE bundle integration.properties, version 2.0.x +# ############################################################################## +# +# +# CORE BEBOP configuration parameters +# ############################################################################## +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage +# +; dhtml editor to use (system wide) +; Xinha is default +; default: Xinha editor & src=/assets/xinha/XinhaLoader.js +; To use FCKeditor configure: +; waf.bebop.dhtml_editor=FCKeditor + +waf.categorization.show_internal_name=true + +waf.dispatcher.default_expiry=3600 + + +# CORE KERNEL configuration parameters +# ############################################################################## +waf.kernel.data_permission_check_enabled=false +waf.kernel.primary_user_identifier=email +; if you activate screen_name, forum loader does not work. +; waf.kernel.primary_user_identifier=screen_name +waf.kernel.supported_languages=de,en +waf.kernel.language_independent_items=true + +# CORE KERNEL.SECURITY configuration parameters +# ############################################################################## +; waf.login_config resembles DEFAULTS, but leaves off RegisterSSO, TODO CHECK!! +; config file is cad.kernel.security.SecurityConfig +; waf.login_config=Request\:com.arsdigita.kernel.security.AdminLoginModule\:sufficient,Request\:com.arsdigita.kernel.security.RecoveryLoginModule\:sufficient,Request\:com.arsdigita.kernel.security.CookieLoginModule\:requisite,Register\:com.arsdigita.kernel.security.LocalLoginModule\:requisite,Register\:com.arsdigita.kernel.security.UserIDLoginModule\:requisite,Register\:com.arsdigita.kernel.security.CookieLoginModule\:optional +waf.auto_registration_on=false + +# CORE MAIL configuration parameters +# ############################################################################## +waf...@li... + + +# CORE SEARCH.LUCENE configuration parameters +# ############################################################################## +waf.search.indexer=lucene +; Below parameter used in version 1.0.4, now outdated und not valid anymore +; May be useful to chech the lucene serach functionality. Has to be deleted +; after all QA testing +; waf.lucene.location=/var/ccm-devel/web/redhat/intratest/data/lucene + + +# CORE TEMPLATING configuration parameters +# ############################################################################## +; Searches for localized style sheet (among others) +waf.templating.stylesheet_resolver=com.arsdigita.templating.PatternStylesheetResolver +waf.templating.stylesheet_paths=/WEB-INF/resources/librecms-stylesheet-paths.txt + +# CORE UI configuration parameters +# ############################################################################## +core.ui.pagemap.root_page_url=/portal/ +#core.ui.pagemap.user_redirect_url=content-center/redirect.jsp +core.ui.pagemap.user_redirect_url=/content-center/ +core.ui.pagemap.workspace_url=/portal/ +# With version 2 moved from kernel/security to ui rsp ui.permissions and +# no longer intended to be user configurable. +# TODO CHECK what these URLS (esp. ../one) is used for. +# waf.pagemap.permission=permissions/ ; DEFAULT +# waf.pagemap.perm_single=permissions/one + + +# CORE WEB configuration parameters +# ############################################################################## +# TODO: Check what exactly happens with/without this parameter set +;waf.web.cache_policy=none +; Default value is FALSE +;waf.web.deactivate_cache_host_notifications=true +;waf.web.dynamic_host_provider=com.arsdigita.util.servlet.HttpHost.SubsiteDynamicHostProvider + + +# CORE WORKFLOW configuration parameters +# ############################################################################## +waf.workflow.simple.alerts_enabled=true +waf...@li... + +# CORE XML processing configuration parameters +# ############################################################################## +waf.xml.xsl_transformer=xalan +waf.xml.activate_full_date_formatter=true + + + +# CMS configuration parameters +# ############################################################################## +com.arsdigita.cms.allow_content_create_in_section_listing=false + +# In order to create several content-section uncomment the line below and +# list the desired content section names +#com.arsdigita.cms.loader.section_names=generic,openccm,homepages + +# Replace CMS category form with a terms specific widget +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.london.terms.ui.ItemCategoryPicker + +com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp +com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver + +; Configure dhtml editor for use in cms content-center +; Xinha is default and does work out of the box +; A CCM specific configuration file is used to prevent a mess with the standard +; configuration, default is: +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js + +; to use FCKeditor: +; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js +; com.arsdigita.cms.dhtml_editor_hidden_buttons= +; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS + +com.arsdigita.cms.disable_item_pfs=true + +com.arsdigita.cms.hide_admin_tabs=true +com.arsdigita.cms.hide_folder_index_checkbox=true +com.arsdigita.cms.hide_launch_date=true +com.arsdigita.cms.hide_templates_tab=true +com.arsdigita.cms.hide_timezone=true +com.arsdigita.cms.hide_udct_ui=true + +com.arsdigita.cms.image_browser.thumbnail_max_width=200 +com.arsdigita.cms.image_browser.thumbnail_max_height=150 + +com.arsdigita.cms.soon_expired_timespan_days=7 +com.arsdigita.cms.soon_expired_timespan_months=0 + +com.arsdigita.cms.unpublished_not_found=false +com.arsdigita.cms.use_section_categories=false +com.arsdigita.cms.use_streamlined_creation=true + + +# ccm-cms-types-event parameters +com.arsdigita.cms.contenttypes.event.hide_cost=true +com.arsdigita.cms.contenttypes.event.hide_date_description=false +com.arsdigita.cms.contenttypes.event.hide_event_type=true +com.arsdigita.cms.contenttypes.event.hide_link_to_map=true +com.arsdigita.cms.contenttypes.event.hide_main_contributor=true +com.arsdigita.cms.contenttypes.event.use_html_date_description=false +com.arsdigita.cms.contenttypes.event.start_year=2000 +com.arsdigita.cms.contenttypes.event.end_year_delta=5 + + +# ccm-cms-types-newsitem parameters +com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true +com.arsdigita.cms.contenttypes.newsitem.start_year=2000 +com.arsdigita.cms.contenttypes.newsitem.end_year_delta=5 + + +# Forum application +com.arsdigita.forum.show_new_tabs=true +com.arsdigita.forum.use_wysiwyg_editor=true +com.arsdigita.forum.allow_quick_finish=true +com.arsdigita.forum.disable_page_caching=true + +# AtoZ configuration parameters +# ############################################################################## +com.arsdigita.atoz.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker + +# FORUM application +# ############################################################################## +# com.arsdigita.forum.admin_can_edit_posts=true ; DEFAULT anyway +com.arsdigita.forum.allow_quick_finish=true +# com.arsdigita.forum.author_can_edit_posts=true ; DEFAULT anyway +com.arsdigita.forum.disable_page_caching=true +com.arsdigita.forum.show_new_tabs=true +com.arsdigita.forum.use_wysiwyg_editor=true + +# NAVIGATION application +# ############################################################################## +; com.arsdigita.navigation.category_menu_show_grand_children_min=1 +; com.arsdigita.navigation.category_menu_show_grand_children=adaptive +; com.arsdigita.navigation.category_menu_show_grand_children_limit=1 +; com.arsdigita.navigation.category_menu_show_grand_children_max=65536 +com.arsdigita.navigation.category_menu_show_grand_children=false +; com.arsdigita.navigation.category_menu_show_nephews=false +com.arsdigita.navigation.default_cat_root_path=/navigation/ +com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/gen-default.jsp +com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt + + +# SUBSITE configuration parameters +# ############################################################################## +com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker + + +# THEMEDIRECTOR configuration parameters +# ############################################################################## +# Required to point to the package containing the theme to copy from when creating +# a new theme! (In addition to default_theme_path. Otherwise no files are copied! +themedirector.default_theme_manifest=ccm-bundle.web.mf +# Required to denote the dir containing the default theme! +themedirector.default_theme_path=themes/static/aplaws-generic + +# LDN-SEARCH application +# ############################################################################## +com.arsdigita.london.search.show_sponsored_links=true +; Comment this out or increase the num_of_threads if you really use remote search +com.arsdigita.london.search.num_threads=0 + +# AUTH-HTTP application +# ############################################################################## +aut...@ap... +auth.http.admin_identifier=webmaster + +# LDN Dublin Core configuration parameters +# ############################################################################## +com.arsdigita.london.cms.dublin.audience_domain=LGAL + +# ccm-bundle integration package configuration parameter +# ############################################################################## +# ccm-sci-bundle (Loader only) +#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml +#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu +#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/ + + +# ============================================================================== +# runtime specific configurations +# ============================================================================== + +waf...@li... +waf.admin.name.given=LibreCMS +waf.admin.name.family=Administrator +waf.admin.password=lib2000 +waf.admin.password.question=12345 +waf.admin.password.answer=6 + +waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm?user\=ccm&password\=ccm42web +waf.runtime.jdbc_pool_size=30 + +waf.web.server=localhost\:8080 + + +# ============================================================================================= +# devel specific configurations +waf.debug=true +waf.bebop.fancy_xsl_errors=true + Added: trunk/ccm-bundle/bundles/base/cfg/project.xml =================================================================== --- trunk/ccm-bundle/bundles/base/cfg/project.xml (rev 0) +++ trunk/ccm-bundle/bundles/base/cfg/project.xml 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- ====================================================================== + project.xml - BASE - containing all modules of the current LibreCMS + repository. A set of core modules is active, others are commented out + and may be activated (uncomment) according to a sites requirements. + + The unmodified (as distributed) bundle may be used to create a custom + set of packages by a site administrator using ccm-hostinit command and + an appropriate set of add-on packages. + ======================================================================= --> + +<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ccm="http://ccm.redhat.com/ccm-project" + ccmVersion="6.1" + name="librecms-ccm" + prettyName="LibreCMS OpenCCM" + version="0-0-0" + release="trunk-base" + webxml="web-ccm.xml" + webapp="ROOT" + xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd"> + +<ccm:databases> + <ccm:database name="postgres"/> +</ccm:databases> + + +<ccm:build> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- LibreCMS set of CORE packages --> +<!-- NONE can be omitted for technical reasons / internal dependencies --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Main apps --> + <ccm:application name="ccm-core"/> + <ccm:application name="ccm-cms"/> + +<!-- Content Assets --> + +<!-- Content Types --> + <ccm:application name="ccm-cms-types-article"/> + +<!-- Applications --> + <ccm:application name="ccm-navigation"/> + <!-- ccm-portalworkspace depends on ccm-subsite --> + <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-shortcuts"/> + <ccm:application name="ccm-subsite"/> + <ccm:application name="ccm-themedirector"/> + +<!-- LDN extension --> + <ccm:application name="ccm-ldn-search"/> + <ccm:application name="ccm-ldn-terms"/> + <ccm:application name="ccm-ldn-util"/> + +<!-- SCI extension --> + <ccm:application name="ccm-bundle"/> + + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- Libre CMS OPTIONAL packages --> +<!-- Various combinations of these packages make up specific editions --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Content Assets --> + +<!-- Content Types --> + +<!-- Applications --> + +<!-- LDN extension --> + + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- Scientific CMS potential ADD-ONS packages --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Content Assets --> + <ccm:application name="ccm-cms-assets-fileattachment"/> + <ccm:application name="ccm-cms-assets-imagestep"/> + <ccm:application name="ccm-cms-assets-notes"/> + <ccm:application name="ccm-cms-assets-relatedlink"/> + +<!-- CMS Content Types --> +<!-- + <ccm:application name="ccm-cms-types-address"/> + <ccm:application name="ccm-cms-types-agenda"/> + <ccm:application name="ccm-cms-types-bookmark"/> + <ccm:application name="ccm-cms-types-contact"/> + <ccm:application name="ccm-cms-types-event"/> + <ccm:application name="ccm-cms-types-faqitem"/> + <ccm:application name="ccm-cms-types-filestorageitem"/> + <ccm:application name="ccm-cms-types-formitem"/> + <ccm:application name="ccm-cms-types-formsectionitem"/> + <ccm:application name="ccm-cms-types-glossaryitem"/> + <ccm:application name="ccm-cms-types-htmlform"/> + <ccm:application name="ccm-cms-types-image"/> + <ccm:application name="ccm-cms-types-inlinesite"/> + <ccm:application name="ccm-cms-types-job"/> + <ccm:application name="ccm-cms-types-legalnotice"/> + <ccm:application name="ccm-cms-types-minutes"/> + <ccm:application name="ccm-cms-types-mparticle"/> + <ccm:application name="ccm-cms-types-newsitem"/> + <ccm:application name="ccm-cms-types-organization"/> + <ccm:application name="ccm-cms-types-person"/> + <ccm:application name="ccm-cms-types-pressrelease"/> + <ccm:application name="ccm-cms-types-service"/> + <ccm:application name="ccm-cms-types-siteproxy"/> + <ccm:application name="ccm-cms-types-xmlfeed"/> +--> + +<!-- Applications --> +<!-- + <ccm:application name="ccm-auth-http"/> + <ccm:application name="ccm-bookmarks"/> + <ccm:application name="ccm-cms-publicpersonalprofile"/> + <ccm:application name="ccm-docmgr"/> + <ccm:application name="ccm-docrepo"/> + <ccm:application name="ccm-forum"/> + <ccm:application name="ccm-forum-categorised"/> +--> +<!-- + <ccm:application name="ccm-portalserver"/> + <ccm:application name="ccm-portalworkspace-homepage"/> + <ccm:application name="ccm-weblog"/> + <ccm:application name="ccm-webpage"/> +--> + +<!-- LDN extension --> +<!-- + <ccm:application name="ccm-ldn-exporter"/> + <ccm:application name="ccm-ldn-freeform"/> + <ccm:application name="ccm-ldn-importer"/> +--> + + + </ccm:build> + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- Libre CMS list of OBSOLETE modules --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Content Types --> +<!-- <ccm:application name="ccm-cms-types-motditem"/> + Current code does not include any xsl templates, conent type does not + appear in the list of types in content center. + For the moment no longer supported (2012-02-06) --> + +<!-- Applications --> +<!-- currently doesn't work for unknown reason + <ccm:application name="ccm-simplesurvey"/> --> +<!-- Without known funcionality + <ccm:application name="ccm-formbuilder-pdf"/> + <ccm:application name="ccm-user-preferences"/> --> + +<!-- LDN extension --> +<!-- Conflicts with ccm-sci-bundle (this package) --> +<!-- <ccm:application name="ccm-ldn-aplaws"/> --> +<!-- In it's current implementation very ldn / aplaws specific + <ccm:application name="ccm-ldn-atoz"/> + <ccm:application name="ccm-ldn-dublin"/> --> + + +<!-- tools will be downloaded from trunk, but does not + contain java code to be compiled! + <ccm:application name="tools"/> --> + +</ccm:project> Added: trunk/ccm-bundle/bundles/base/cfg/web-ccm.xml =================================================================== --- trunk/ccm-bundle/bundles/base/cfg/web-ccm.xml (rev 0) +++ trunk/ccm-bundle/bundles/base/cfg/web-ccm.xml 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,591 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <display-name>LibreCMS DEMO Site</display-name> + <description>Community and Content Management</description> + + <!-- path and filename of the log4j user accessible config file + WEB-INF/conf/log4j.properties is the built-in default value --> + <context-param> + <param-name>log4j-conf-file</param-name> + <param-value>WEB-INF/conf/log4j.properties</param-value> + </context-param> + + + <!-- Require secure connection by redirect to host-port part + of parameter waf.web.secure_server + <filter> + <filter-name>secured</filter-name> + <filter-class>com.arsdigita.web.SecureFilter</filter-class> + </filter> + --> + <!-- Initialize Profiler timers + NOT USED with standard / production + <filter> + <filter-name>profiler</filter-name> + <filter-class>com.arsdigita.profiler.ProfilerFilter</filter-class> + </filter> + --> + + <filter> + <filter-name>shortcuts</filter-name> + <filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class> + </filter> + + <filter> + <filter-name>subsite</filter-name> + <filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class> + </filter> + +<!-- NOT USED HERE + <filter-mapping> + <filter-name>secured</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <filter-mapping> + <filter-name>profiler</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> +--> + + + <filter-mapping> + <filter-name>subsite</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <filter-mapping> + <filter-name>shortcuts</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Context Listener + required and used to initialize the runtime environment before any other + task is performed or any servlet initialized. + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + <listener> + <listener-class>com.arsdigita.web.CCMApplicationContextListener</listener-class> + </listener> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + BASE SERVLET DECLARATIONS SECTION + basically requirred by ccm-core + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <servlet> + <servlet-name>reg</servlet-name> + <servlet-class>com.arsdigita.web.ContextRegistrationServlet</servlet-class> + <init-param> + <param-name>uri</param-name> + <param-value>/</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet> + <servlet-name>ccm-dispatcher</servlet-name> + <servlet-class>com.arsdigita.web.DispatcherServlet</servlet-class> + <load-on-startup>2</load-on-startup> + </servlet> + + <servlet> + <servlet-name>cache-manager</servlet-name> + <servlet-class>com.arsdigita.caching.CacheServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>db-test</servlet-name> + <servlet-class>com.arsdigita.web.monitoring.DBTestServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>versioning-log</servlet-name> + <servlet-class>com.arsdigita.versioning.VersioningServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>login</servlet-name> + <servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>webadmin</servlet-name> + <servlet-class>com.arsdigita.ui.admin.AdminServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>webadmin-permissions</servlet-name> + <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> + </servlet> + + <servlet> + <servlet-name>resource-resolver</servlet-name> + <servlet-class>com.arsdigita.web.ResourceServlet</servlet-class> + </servlet> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ADDITIONAL SERVLET DECLARATIONS SECTION + basically requirred by ccm-cms + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <servlet> + <servlet-name>content-center</servlet-name> + <servlet-class>com.arsdigita.cms.ContentCenterServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>content-section</servlet-name> + <servlet-class>com.arsdigita.cms.ContentSectionServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>cms-service</servlet-name> + <servlet-class>com.arsdigita.cms.ServiceServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>content-type-xsl</servlet-name> + <servlet-class>com.arsdigita.cms.dispatcher.ContentTypeXSLServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>content-item-xsl</servlet-name> + <servlet-class>com.arsdigita.cms.dispatcher.ContentItemXSLServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>template-xsl</servlet-name> + <servlet-class>com.arsdigita.cms.dispatcher.TemplateXSLServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>TextOnlyServlet</servlet-name> + <display-name>Text Only Servlet</display-name> + <servlet-class> + com.arsdigita.web.InternalPrefixerServlet + </servlet-class> + <init-param> + <param-name>prefix</param-name> + <param-value>/text</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>PrintFriendlyServlet</servlet-name> + <display-name>Printer Friendly Output Servlet</display-name> + <servlet-class> + com.arsdigita.web.InternalPrefixerServlet + </servlet-class> + <init-param> + <param-name>prefix</param-name> + <param-value>/print</param-value> + </init-param> + </servlet> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + MODULES SERVLET DECLARATIONS SECTION + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <!-- module ccm-atoz - servlet definitions BEGIN --> + <servlet> + <servlet-name>atoz-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-atoz</param-value> + </init-param> + </servlet> + <!-- module ccm-atoz - servlet definitions END --> + + <!-- module ccm-forum - servlet declarations BEGIN --> + <servlet> + <servlet-name>forum-main</servlet-name> + <servlet-class>com.arsdigita.forum.ForumServlet</servlet-class> + </servlet> + <!-- module ccm-forum - servlet declarations END --> + + <servlet> + <servlet-name>portalworkspace-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-portalworkspace</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>navigation-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-navigation</param-value> + </init-param> + <init-param> + <param-name>file-resolver</param-name> + <param-value>com.arsdigita.navigation.NavigationFileResolver</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>portlet-type-xsl</servlet-name> + <servlet-class>com.arsdigita.dispatcher.PortletTypeXSLServlet</servlet-class> + </servlet> + + <!-- module ccm-rssfeed - servlet declaration BEGIN --> + <servlet> + <servlet-name>rssfeed-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-rssfeed</param-value> + </init-param> + <init-param> + <param-name>file-resolver</param-name> + <param-value>com.arsdigita.rssfeed.RSSFileResolver</param-value> + </init-param> + </servlet> + <!-- module ccm-rssfeed - servlet declaration END --> + + <!-- module ccm-ldn-search - servlet declarations BEGIN --> + <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-shortcuts - servlet definitions --> + <servlet> + <servlet-name>shortcuts-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-shortcuts</param-value> + </init-param> + </servlet> + + <!-- module ccm-subsite - servlet declarations BEGIN --> + <servlet> + <servlet-name>subsite-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-subsite</param-value> + </init-param> + </servlet> + <!-- module ccm-subsite - servlet declarations END --> + + <!-- module ccm-ldn-terms - servlet declarations BEGIN --> + <servlet> + <servlet-name>terms-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-ldn-terms</param-value> + </init-param> + </servlet> + <!-- module ccm-ldn-terms - servlet declarations END --> + + <!-- module ccm-themedirector - servlet declarations BEGIN --> + <servlet> + <servlet-name>theme-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-themedirector</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>ThemeDownload</servlet-name> + <servlet-class>com.arsdigita.themedirector.dispatcher.ThemeDownloadServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>ThemePreviewServlet</servlet-name> + <display-name>Servlet to allow admins to preview look/feel</display-name> + <servlet-class> + com.arsdigita.themedirector.dispatcher.InternalThemePrefixerServlet + </servlet-class> + <init-param> + <param-name>prefix</param-name> + <param-value>/theme</param-value> + </init-param> + </servlet> + <!-- module ccm-themedirector - servlet declarations END --> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + MODULES SERVLET MAPPINGS SECTION + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <!-- module ccm-atoz - servlet mappings BEGIN --> + <servlet-mapping> + <servlet-name>atoz-files</servlet-name> + <url-pattern>/ccm-atoz/files/*</url-pattern> + </servlet-mapping> + <!-- module ccm-atoz - servlet mappings END --> + + <!-- module ccm-forum - servlet mappings BEGIN --> + <servlet-mapping> + <servlet-name>forum-main</servlet-name> + <url-pattern>/forum-main/main/*</url-pattern> + </servlet-mapping> + <!-- module ccm-forum - servlet mappings END --> + + <servlet-mapping> + <servlet-name>portlet-type-xsl</servlet-name> + <url-pattern>/themes/servlet/portlet-type/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>portalworkspace-files</servlet-name> + <url-pattern>/ccm-portalworkspace/files/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>navigation-files</servlet-name> + <url-pattern>/ccm-navigation/files/*</url-pattern> + </servlet-mapping> + + <!-- module ccm-rssfeed - servlet mappings BEGIN --> + <servlet-mapping> + <servlet-name>rssfeed-files</servlet-name> + <url-pattern>/ccm-rssfeed/files/*</url-pattern> + </servlet-mapping> + <!-- module ccm-rssfeed - servlet mappings 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 --> + + <!-- module ccm-shortcuts - servlet mappings --> + <servlet-mapping> + <servlet-name>shortcuts-files</servlet-name> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> + </servlet-mapping> + + <!-- module ccm-subsite - servlet mappings BEGIN --> + <servlet-mapping> + <servlet-name>subsite-files</servlet-name> + <url-pattern>/ccm-subsite/files/*</url-pattern> + </servlet-mapping> + <!-- module ccm-subsite - servlet mappings END --> + + <!-- module ccm-ldn-terms - servlet mappings BEGIN --> + <servlet-mapping> + <servlet-name>terms-files</servlet-name> + <url-pattern>/ccm-ldn-terms/files/*</url-pattern> + </servlet-mapping> + <!-- module ccm-ldn-terms - servlet mappings END --> + + <!-- module ccm-themedirector - servlet mappings BEGIN --> + <servlet-mapping> + <servlet-name>theme-files</servlet-name> + <url-pattern>/theme-files/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>ThemeDownload</servlet-name> + <url-pattern>/theme-files/download/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>ThemePreviewServlet</servlet-name> + <url-pattern>/theme/*</url-pattern> + </servlet-mapping> + <!-- module ccm-themedirector - servlet mappings END --> + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + BASE SERVLET MAPPINGS SECTION + basically requirred by ccm-core + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <servlet-mapping> + <servlet-name>reg</servlet-name> + <url-pattern>/themes/null/reg/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>ccm-dispatcher</servlet-name> + <url-pattern>/ccm/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>cache-manager</servlet-name> + <url-pattern>/expireCache/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>db-test</servlet-name> + <url-pattern>/dbtest</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>versioning-log</servlet-name> + <url-pattern>/versioning/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>login</servlet-name> + <url-pattern>/login/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>webadmin</servlet-name> + <url-pattern>/admin/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>webadmin-permissions</servlet-name> + <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> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>resource-resolver</servlet-name> + <url-pattern>/resource/*</url-pattern> + </servlet-mapping> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ADDITIONAL SERVLET MAPPINGS SECTION + basically requirred by ccm-cms + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <servlet-mapping> + <servlet-name>content-center</servlet-name> + <url-pattern>/templates/servlet/content-center/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>content-section</servlet-name> + <url-pattern>/templates/servlet/content-section/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>cms-service</servlet-name> + <url-pattern>/templates/servlet/cms-service/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>content-item-xsl</servlet-name> + <url-pattern>/templates/servlet/content-item/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>content-type-xsl</servlet-name> + <url-pattern>/themes/servlet/content-type/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>template-xsl</servlet-name> + <url-pattern>/themes/servlet/template/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>TextOnlyServlet</servlet-name> + <url-pattern>/text/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>PrintFriendlyServlet</servlet-name> + <url-pattern>/print/*</url-pattern> + </servlet-mapping> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ERROR PAGES + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <error-page> + <exception-type>com.arsdigita.dispatcher.AccessDeniedException</exception-type> + <location>/error/access-denied.jsp</location> + </error-page> + + <error-page> + <exception-type>com.arsdigita.dispatcher.ObjectNotFoundException</exception-type> + <location>/error/object-not-found.jsp</location> + </error-page> + + <error-page> + <exception-type>com.arsdigita.kernel.permissions.PermissionException</exception-type> + <location>/error/permission-denied.jsp</location> + </error-page> + + <error-page> + <exception-type>com.arsdigita.persistence.DbNotAvailableException</exception-type> + <location>/error/db-not-available.jsp</location> + </error-page> + + <error-page> + <exception-type>com.arsdigita.db.DbNotAvailableException</exception-type> + <location>/error/db-not-available.jsp</location> + </error-page> + + <error-page> + <exception-type>java.lang.Exception</exception-type> + <location>/error/general.jsp</location> + </error-page> + + <error-page> + <exception-type>java.lang.Error</exception-type> + <location>/error/general.jsp</location> + </error-page> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + TAG LIBS + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <taglib> + <taglib-uri>/WEB-INF/bebop-show.tld</taglib-uri> + <taglib-location>/WEB-INF/bebop-show.tld</taglib-location> + </taglib> + + <taglib> + <taglib-uri>/WEB-INF/bebop-define.tld</taglib-uri> + <taglib-location>/WEB-INF/bebop-define.tld</taglib-location> + </taglib> + +</web-app> Added: trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-domain-1.00.xml =================================================================== --- trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-domain-1.00.xml (rev 0) +++ trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-domain-1.00.xml 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Document : gen-nav-domain-1.00.xml + Created on : 2. Juni 2007, 10:00 + Author : pb + Description: + Definition of the example terms (categories) in the generic Navigation Menue. + In gen-nav-hierarchy the structure of the tree will be defined. +--> + +<terms:domain xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + about="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml" + key="STD-NAV" + title="Default Navigation" + version="1.00" released="2005-10-01"> + + <terms:term id="10000" name="Category 1" inAtoZ="false"/> + <terms:term id="12000" name="Category 1.1" inAtoZ="false"/> + <terms:term id="14000" name="Category 1.2" inAtoZ="false"/> + + <terms:term id="30000" name="Category 2" inAtoZ="false"/> + <terms:term id="32000" name="Category 2.1" inAtoZ="false"/> + <terms:term id="34000" name="Category 2.2" inAtoZ="false"/> + + <terms:term id="50000" name="Category 3" inAtoZ="false"/> + <terms:term id="52000" name="Category 3.1" inAtoZ="false"/> + <terms:term id="54000" name="Category 3.2" inAtoZ="false"/> + +</terms:domain> + Added: trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-hierarchy-1.00.xml =================================================================== --- trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-hierarchy-1.00.xml (rev 0) +++ trunk/ccm-bundle/bundles/base/res/bundle/categories/gen-nav-hierarchy-1.00.xml 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Document : gen-nav-hierarchy-1.00.xml + Created on : 2. Juni 2007, 10:30 + Author : pb + Description: + Purpose of the document follows. +--> + +<terms:hierarchy xmlns:terms="http://xmlns.redhat.com/london/terms/1.0"> + <terms:domain resource="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml"/> + <!-- set root terms --> + <terms:term id="10000"/> + <terms:term id="30000"/> + <terms:term id="50000"/> + + <terms:orderedPair> + <!-- narrower terms, first level --> + <terms:source> + <terms:term id="10000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="12000"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="10000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="14000"/> + </terms:destination> + </terms:orderedPair> + + + <terms:orderedPair> + <terms:source> + <terms:term id="30000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="32000"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="30000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="34000"/> + </terms:destination> + </terms:orderedPair> + + + <terms:orderedPair> + <terms:source> + <terms:term id="50000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="52000"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="50000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="54000"/> + </terms:destination> + </terms:orderedPair> + + </terms:hierarchy> Added: trunk/ccm-bundle/bundles/base/res/bundle/categories/placeholder.info =================================================================== --- trunk/ccm-bundle/bundles/base/res/bundle/categories/placeholder.info (rev 0) +++ trunk/ccm-bundle/bundles/base/res/bundle/categories/placeholder.info 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,3 @@ +Subdirectory <cat> may optionally contain one or more local site specific +import xml files for Terms domain categories. + Added: trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-domain.xml =================================================================== --- trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-domain.xml (rev 0) +++ trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-domain.xml 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,151 @@ +<?xml version="1.0"?> +<terms:domain xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + about="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml" + key="APLAWS-NAV" + title="APLAWS Navigation List" + version="1.03" released="2004-03-24"> + + <terms:term id="1" name="Business" inAtoZ="false"/> + <terms:term id="1007" name="Jobs and careers" inAtoZ="false"/> + <terms:term id="1021" name="Legal services" inAtoZ="false"/> + <terms:term id="1039" name="Leisure and culture" inAtoZ="false"/> + <terms:term id="1286" name="Policing and public safety" inAtoZ="false"/> + <terms:term id="1325" name="Social issues" inAtoZ="false"/> + <terms:term id="1337" name="Transport and streets" inAtoZ="false"/> + <terms:term id="204" name="Education and learning" inAtoZ="false"/> + <terms:term id="281" name="Environment" inAtoZ="false"/> + <terms:term id="3088" name="Council, government and democracy" inAtoZ="false"/> + <terms:term id="3168" name="Obsolete terms" inAtoZ="false"/> + <terms:term id="596" name="Health and social care" inAtoZ="false"/> + <terms:term id="93" name="Community and living" inAtoZ="false"/> + <terms:term id="946" name="Housing" inAtoZ="false"/> + <terms:term id="11" name="Business promotion" inAtoZ="false"/> + <terms:term id="15" name="Business property" inAtoZ="false"/> + <terms:term id="1523" name="Business procurement" inAtoZ="false"/> + <terms:term id="21" name="Business sectors and services" inAtoZ="false"/> + <terms:term id="3100" name="Workers' co-operatives" inAtoZ="false"/> + <terms:term id="3300" name="Business and street trading licences" inAtoZ="false"/> + <terms:term id="3323" name="Business support and advice" inAtoZ="false"/> + <terms:term id="3329" name="Imports and exports" inAtoZ="false"/> + <terms:term id="5" name="Business finance" inAtoZ="false"/> + <terms:term id="59" name="Economic development" inAtoZ="false"/> + <terms:term id="62" name="Employing people" inAtoZ="false"/> + <terms:term id="66" name="Health and safety" inAtoZ="false"/> + <terms:term id="70" name="Trading standards" inAtoZ="false"/> + <terms:term id="8" name="Business opportunities" inAtoZ="false"/> + <terms:term id="1008" name="Finding work" inAtoZ="false"/> + <terms:term id="1017" name="Retirement" inAtoZ="false"/> + <terms:term id="1026" name="Legal advice" inAtoZ="false"/> + <terms:term id="1029" name="Courts" inAtoZ="false"/> + <terms:term id="1037" name="Probation" inAtoZ="false"/> + <terms:term id="1308" name="Police" inAtoZ="false"/> + <terms:term id="1309" name="Prisons" inAtoZ="false"/> + <terms:term id="1326" name="Equal opportunities" inAtoZ="false"/> + <terms:term id="2083" name="Legislation" inAtoZ="false"/> + <terms:term id="3025" name="Civil and human rights" inAtoZ="false"/> + <terms:term id="3441" name="Legal professions" inAtoZ="false"/> + <terms:term id="3442" name="Young offending" inAtoZ="false"/> + <terms:term id="1041" name="Arts and entertainment" inAtoZ="false"/> + <terms:term id="1098" name="Children's activities" inAtoZ="false"/> + <terms:term id="1102" name="Libraries" inAtoZ="false"/> + <terms:term id="1106" name="Local history and heritage" inAtoZ="false"/> + <terms:term id="1113" name="Hobbies and interests" inAtoZ="false"/> + <terms:term id="1132" name="Parks and recreation" inAtoZ="false"/> + <terms:term id="1164" name="Social clubs" inAtoZ="false"/> + <terms:term id="1165" name="Sports" inAtoZ="false"/> + <terms:term id="1248" name="Tourism and travel" inAtoZ="false"/> + <terms:term id="1258" name="Uniformed groups" inAtoZ="false"/> + <terms:term id="1261" name="Young people's activities" inAtoZ="false"/> + <terms:term id="1482" name="Museums and galleries" inAtoZ="false"/> + <terms:term id="1287" name="Accidents, emergencies and safety" inAtoZ="false"/> + <terms:term id="1298" name="Coastguard" inAtoZ="false"/> + <terms:term id="1299" name="Crime and law enforcement" inAtoZ="false"/> + <terms:term id="1310" name="Victim support" inAtoZ="false"/> + <terms:term id="1311" name="Discrimination or harassment" inAtoZ="false"/> + <terms:term id="3454" name="Fire fighting and rescue services" inAtoZ="false"/> +<!-- bug: this appears twice (look up a bit) + <terms:term id="1326" name="Equal opportunities" inAtoZ="false"/> +--> + <terms:term id="1327" name="Identity cards" inAtoZ="false"/> + <terms:term id="1328" name="Immigration and nationality" inAtoZ="false"/> + <terms:term id="1329" name="Sexual orientation" inAtoZ="false"/> + <terms:term id="1331" name="Firearms" inAtoZ="false"/> + <terms:term id="1332" name="Population and migration" inAtoZ="false"/> + <terms:term id="1333" name="Privacy and data protection" inAtoZ="false"/> + <terms:term id="1335" name="Rural communities" inAtoZ="false"/> + <terms:term id="1336" name="Social inclusion" inAtoZ="false"/> + <terms:term id="697" name="Family planning" inAtoZ="false"/> + <terms:term id="1352" name="Public rights of way" inAtoZ="false"/> + <terms:term id="1353" name="Motor vehicles, roads and parking" inAtoZ="false"/> + <terms:term id="1388" name="Public transport" inAtoZ="false"/> + <terms:term id="1402" name="Road and pathway maintenance" inAtoZ="false"/> + <terms:term id="1424" name="Transport planning" inAtoZ="false"/> + <terms:term id="3457" name="Ports and harbours" inAtoZ="false"/> + <terms:term id="3459" name="Waterways" inAtoZ="false"/> + <terms:term id="3461" name="Reservoirs" inAtoZ="false"/> + <terms:term id="205" name="Educational institutions" inAtoZ="false"/> + <terms:term id="206" name="Distance learning" inAtoZ="false"/> + <terms:term id="212" name="Language tuition" inAtoZ="false"/> + <terms:term id="219" name="Adult and community education" inAtoZ="false"/> + <terms:term id="2237" name="Teaching" inAtoZ="false"/> + <terms:term id="238" name="Work based learning" inAtoZ="false"/> + <terms:term id="280" name="Youth service" inAtoZ="false"/> + <terms:term id="3008" name="Higher education" inAtoZ="false"/> + <terms:term id="3345" name="Home education" inAtoZ="false"/> + <terms:term id="3346" name="School library service" inAtoZ="false"/> + <terms:term id="3347" name="Schools and colleges" inAtoZ="false"/> + <terms:term id="3359" name="Education welfare services" inAtoZ="false"/> + <terms:term id="3366" name="Youth support" inAtoZ="false"/> + <terms:term id="3440" name="Job training and development" inAtoZ="false"/> + <terms:term id="284" name="Animal welfare" inAtoZ="false"/> + <terms:term id="3374" name="Land and premises" inAtoZ="false"/> + <terms:term id="3379" name="Pests and nuisance" inAtoZ="false"/> + <terms:term id="3391" name="Pollution" inAtoZ="false"/> + <terms:term id="3393" name="Street care and cleaning" inAtoZ="false"/> + <terms:term id="3400" name="Town centre management" inAtoZ="false"/> + <terms:term id="347" name="Food production and quality" inAtoZ="false"/> + <terms:term id="372" name="Planning" inAtoZ="false"/> + <terms:term id="409" name="Energy" inAtoZ="false"/> + <terms:term id="420" name="Rubbish, waste and recycling" inAtoZ="false"/> + <terms:term id="451" name="Weather" inAtoZ="false"/> + <terms:term id="13" name="Information management" inAtoZ="false"/> + <terms:term id="3116" name="Democratic processes and events" inAtoZ="false"/> + <terms:term id="3344" name="Data protection and freedom of information" inAtoZ="false"/> + <terms:term id="454" name="Central government" inAtoZ="false"/> + <terms:term id="459" name="Councils" inAtoZ="false"/> + <terms:term id="524" name="Elections" inAtoZ="false"/> + <terms:term id="552" name="European affairs" inAtoZ="false"/> + <terms:term id="566" name="International affairs" inAtoZ="false"/> + <terms:term id="569" name="Non-governmental organisations" inAtoZ="false"/> + <terms:term id="584" name="Political parties" inAtoZ="false"/> + <terms:term id="592" name="Public services" inAtoZ="false"/> + <terms:term id="593" name="Regional governments" inAtoZ="false"/> + <terms:term id="178" name="Village newsletters" inAtoZ="false"/> + <terms:term id="462" name="Council documents, facts and figures" inAtoZ="false"/> + <terms:term id="514" name="Petitions" inAtoZ="false"/> + <terms:term id="515" name="Surveys" inAtoZ="false"/> + <terms:term id="597" name="Health and medical care" inAtoZ="false"/> + <terms:term id="631" name="Disabilities" inAtoZ="false"/> + <terms:term id="856" name="Social policy" inAtoZ="false"/> + <terms:term id="860" name="Social services" inAtoZ="false"/> + <terms:term id="107" name="Ethnic communities" inAtoZ="false"/> + <terms:term id="1302" name="Community safety" inAtoZ="false"/> + <terms:term id="1527" name="Life events" inAtoZ="false"/> + <terms:term id="182" name="Twinning" inAtoZ="false"/> + <terms:term id="184" name="Voluntary organisations" inAtoZ="false"/> + <terms:term id="201" name="Volunteering" inAtoZ="false"/> + <terms:term id="3013" name="Neighbourhood and village" inAtoZ="false"/> + <terms:term id="3101" name="Interpreters' services" inAtoZ="false"/> + <terms:term id="3118" name="Charities and citizens' interest groups" inAtoZ="false"/> + <terms:term id="3330" name="Community grants" inAtoZ="false"/> + <terms:term id="3332" name="Faiths, beliefs and religions" inAtoZ="false"/> + <terms:term id="95" name="Consumer advice and protection" inAtoZ="false"/> + <terms:term id="1627" name="Supported and sheltered housing" inAtoZ="false"/> + <terms:term id="2639" name="Private housing" inAtoZ="false"/> + <terms:term id="3424" name="Housing associations and co-operatives" inAtoZ="false"/> + <terms:term id="3426" name="Housing finance" inAtoZ="false"/> + <terms:term id="3430" name="Housing improvement and repairs" inAtoZ="false"/> + <terms:term id="3438" name="Multiple occupancy homes" inAtoZ="false"/> + <terms:term id="952" name="Housing advice" inAtoZ="false"/> + <terms:term id="960" name="Council housing" inAtoZ="false"/> +</terms:domain> Added: trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-hierarchy.xml =================================================================== --- trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-hierarchy.xml (rev 0) +++ trunk/ccm-bundle/bundles/base/res/bundle/categories/xample-nav-hierarchy.xml 2013-02-02 23:46:44 UTC (rev 2479) @@ -0,0 +1,1034 @@ +<?xml version="1.0"?> +<terms:hierarchy xmlns:terms="http://xmlns.redhat.com/london/terms/1.0"> + <terms:domain resource="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml"/> + <terms:term id="1"/> + <terms:term id="1007"/> + <terms:term id="1021"/> + <terms:term id="1039"/> + <terms:term id="1286"/> + <terms:term id="1325"/> + <terms:term id="1337"/> + <terms:term id="204"/> + <terms:term id="281"/> + <terms:term id="3088"/> + <terms:term id="3168"/> + <terms:term id="596"/> + <terms:term id="93"/> + <terms:term id="946"/> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="11"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="15"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1523"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="21"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3100"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3300"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3323"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3329"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="1"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="5"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <... [truncated message content] |
Author: pboy
Date: 2013-02-02 23:43:41 +0000 (Sat, 02 Feb 2013)
New Revision: 2478
Added:
trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java.nolongerInUse
Removed:
trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java
Modified:
trunk/ccm-core/pdl/com/arsdigita/kernel/ACSObject.pdl
trunk/ccm-core/src/com/arsdigita/kernel/ACSObject.java
trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java
trunk/ccm-core/src/com/arsdigita/kernel/Kernel.java
trunk/ccm-core/src/com/arsdigita/kernel/MDUtil.java
trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectContext.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectPermissionCollection.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/Permission.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCache.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCollection.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionDescriptor.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionException.java
trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionManager.java
trunk/ccm-core/src/com/arsdigita/kernel/security/AccountNotFoundException.java
trunk/ccm-core/src/com/arsdigita/kernel/security/AdminLoginModule.java
trunk/ccm-core/src/com/arsdigita/kernel/security/CookieLoginModule.java
trunk/ccm-core/src/com/arsdigita/kernel/security/CookieManager.java
trunk/ccm-core/src/com/arsdigita/kernel/security/Credential.java
trunk/ccm-core/src/com/arsdigita/kernel/security/LocalLoginModule.java
trunk/ccm-core/src/com/arsdigita/kernel/security/LoginContext.java
trunk/ccm-core/src/com/arsdigita/kernel/security/PasswordLoginModule.java
trunk/ccm-core/src/com/arsdigita/kernel/security/SimpleSSOLoginModule.java
trunk/ccm-core/src/com/arsdigita/kernel/security/Store.java
trunk/ccm-core/src/com/arsdigita/kernel/security/UserContext.java
trunk/ccm-core/src/com/arsdigita/messaging/Message.java
trunk/ccm-core/src/com/arsdigita/messaging/MessageThread.java
trunk/ccm-core/src/com/arsdigita/ui/login/UserLoginForm.java
trunk/ccm-core/src/com/arsdigita/web/Application.java
trunk/ccm-core/src/com/arsdigita/web/ApplicationType.java
trunk/ccm-core/src/com/arsdigita/web/InternalRequestLocal.java
trunk/ccm-core/src/com/arsdigita/web/Web.java
trunk/ccm-core/src/com/arsdigita/web/WebConfig.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/SimpleSurveyUtil.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Survey.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/admin/AdminSurveyTable.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/admin/PropertiesForm.java
Log:
Code clean-up, removed references to old style / legacy application code
(kernel.SiteNode, kernel.Packages, kernel.PackageTypes, etc.)
specifically:
* kernel.GenericURLFincer removed (commented out in core Initializer)
* kernel.ACSObject, removed references to method kernel.MDUtil#hasPackageInstanceRole without replacement
* kernel.MDutil: removed method hasPackageInstanceRole...
Modified: trunk/ccm-core/pdl/com/arsdigita/kernel/ACSObject.pdl
===================================================================
--- trunk/ccm-core/pdl/com/arsdigita/kernel/ACSObject.pdl 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/pdl/com/arsdigita/kernel/ACSObject.pdl 2013-02-02 23:43:41 UTC (rev 2478)
@@ -43,20 +43,22 @@
// aggressive load (container.id);
}
-query PackageInstanceForObject {
- PackageInstance packageInstance;
+// Used by GenericURLFinder
+// query PackageInstanceForObject {
+// PackageInstance packageInstance;
+//
+// do {
+// SELECT ap.package_id, ap.pretty_name,
+// o.object_type, o.display_name, o.default_domain_class
+// FROM apm_packages ap, acs_objects o
+// WHERE ap.package_id = o.object_id
+// AND ap.package_id = package_id_for_object_id(:objectID)
+// } map {
+// packageInstance.id = ap.package_id;
+// packageInstance.prettyName = ap.pretty_name;
+// packageInstance.objectType = o.object_type;
+// packageInstance.displayName = o.display_name;
+// packageInstance.defaultDomainClass = o.default_domain_class;
+// }
- do {
- SELECT ap.package_id, ap.pretty_name,
- o.object_type, o.display_name, o.default_domain_class
- FROM apm_packages ap, acs_objects o
- WHERE ap.package_id = o.object_id
- AND ap.package_id = package_id_for_object_id(:objectID)
- } map {
- packageInstance.id = ap.package_id;
- packageInstance.prettyName = ap.pretty_name;
- packageInstance.objectType = o.object_type;
- packageInstance.displayName = o.display_name;
- packageInstance.defaultDomainClass = o.default_domain_class;
- }
-}
+// }
Modified: trunk/ccm-core/src/com/arsdigita/kernel/ACSObject.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/ACSObject.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/ACSObject.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -165,6 +165,7 @@
/**
* Called from base class (DomainObject) constructors.
*/
+ @Override
protected void initialize() {
super.initialize();
@@ -264,10 +265,12 @@
}
/**
- * Returns the container for this object, or null if there is
- * no container. The container is produced by domain-specific
- * logic based on any properties of the domain object. The resulting
- * container is denormalized internally by ACSObject.save().
+ * Returns the container for this object, or null if there is no
+ * container.
+ *
+ * The container is produced by domain-specific logic based on any
+ * properties of the domain object. The resulting container is
+ * denormalized internally by ACSObject.save().
* The denormalized container hierarchy is currently only used
* for generically determining what package instance an object
* belongs to. In the future, other generic services may be
@@ -291,6 +294,9 @@
* of one File Storage application instance).
*
* @return this object's container.
+ * @deprecated without direct replacement. Method uses old app style
+ * PackageInstance no longer in use. Involing code has to be refactored
+ * to use new style application code.
*/
protected ACSObject getContainer() {
ObjectType specificType = MDUtil.getType(getSpecificObjectType());
@@ -301,10 +307,12 @@
containerData = (DataObject) get(p.getName());
}
if (containerData == null) {
- if (MDUtil.hasPackageInstanceRole(specificType)) {
- specializeDataObject(specificType);
- containerData = (DataObject) get(MDUtil.PACKAGE_INSTANCE);
- }
+ throw new IllegalArgumentException(
+ "containerData is null, PackageInstance removed.");
+ // if (MDUtil.hasPackageInstanceRole(specificType)) {
+ // specializeDataObject(specificType);
+ // containerData = (DataObject) get(MDUtil.PACKAGE_INSTANCE);
+ // }
}
return (ACSObject) DomainObjectFactory.newInstance(containerData);
@@ -312,9 +320,10 @@
/**
* Returns true if this object has been moved to a new container,
- * or null if the container has not changed. This methods is
- * used by ACSObject.save() to determine when to denormalize
- * the result of getContainer().
+ * or null if the container has not changed.
+ *
+ * This methods is used by ACSObject.save() to determine when to
+ * denormalize the result of getContainer().
*
* While this method is not abstract, the default implementation
* "guesses" the container based on metadata about the object.
@@ -330,11 +339,14 @@
*
* @return this object's container.
*
+ * @deprecated
* @see #getContainer()
*/
protected boolean isContainerModified() {
+
ObjectType specificType = MDUtil.getType(getSpecificObjectType());
Property p = MDUtil.getCompositeRole(specificType);
+
if (p != null) {
specializeDataObject(specificType);
if (isPropertyModified(p.getName())) {
@@ -348,10 +360,16 @@
return false;
}
}
- if (MDUtil.hasPackageInstanceRole(specificType)) {
- specializeDataObject(specificType);
- return isPropertyModified(MDUtil.PACKAGE_INSTANCE);
- }
+
+ // Removed. EXPERIMENTAL! (pboy 2013-01-26, r2049 hb)
+ // Because package tyble is empty (there exist no old style nor new style
+ // compatible applications anymore, everything is new style legacy free)
+ // the argument in if should always return false.!
+ // if (MDUtil.hasPackageInstanceRole(specificType)) {
+ // specializeDataObject(specificType);
+ // return isPropertyModified(MDUtil.PACKAGE_INSTANCE);
+ // }
+
return false;
}
@@ -452,7 +470,8 @@
* container for everything in the system is immature
* and not consistent.
*/
- SecurityLogger.log(Priority.INFO, "No parent container for " + this.getOID() + ".");
+ SecurityLogger.log(Priority.INFO, "No parent container for "
+ + this.getOID() + ".");
return;
}
}
@@ -461,6 +480,7 @@
assertPrivilege(PrivilegeDescriptor.WRITE);
}
+ @Override
protected void beforeSave() {
// set the display name property if necessary
String displayName = getDisplayName();
Deleted: trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -1,275 +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.kernel;
-
-import com.arsdigita.persistence.OID;
-import com.arsdigita.persistence.DataObject;
-import com.arsdigita.persistence.SessionManager;
-import com.arsdigita.persistence.DataQuery;
-import com.arsdigita.persistence.metadata.ObjectType;
-import com.arsdigita.persistence.metadata.Property;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import javax.servlet.http.HttpUtils;
-import java.net.URLEncoder;
-
-/**
- * A URLFinder that can be registered for most object types. The
- * GenericURLFinder is constructed with a specified URL pattern such
- * as <code>one-ticket?ticket_id=:id</code>. For a given OID, the
- * URL path is determined as follows:
- *
- * <ol>
- * <li> Try to find the package instance to which the specified
- * object belongs. The current process involves
- * examining persistence metadata to try to navigate from the
- * given OID to its package instance. This process will eventually
- * be replaced with a call to some other kernel service (to be
- * developed) that deals with the scoping of objects to package
- * instances. Until then, the process is as follows:
- * <ul>
- * <li> Get the data object's "packageInstance" property (if it has
- * such a property and the property is of type PackageInstance).
- * <li> If no such property exists, use metadata to figure out
- * if this data object has a composite role property (a
- * required, visible property where
- * <code>com.arsdigita.persistence.metadata.Property.isComposite()==true
- * </code>).
- * <li>If a composite role exists,
- * fetch the composite role, and
- * then repeat the process with that object. See the example below.
- * </ul>
- * <li> Once the package instance is determined, get the package
- * instance's primary mount point (see
- * PackageInstance.getDefaultMountPoint()).
- * <li> Once the primary mount point is determined, get its URL path.
- * <li> Append the URL pattern (which was specified to the constructor
- * of GenericURLFinder).
- * <li> Substitute terms like <code>:id</code> with values from the given
- * OID.
- * </ol>
- *
- * For example, suppose we have the following PDL fragment:
- * <blockquote><pre>
- * model examples;
- * object type Forum extends ACSObject {
- * PackageInstance[1..1] packageInstance;
- * }
- * object type Message extends ACSObject {...}
- * association {
- * Forum[1..1] forum;
- * composite Message[0..n] messages;
- * // NOTE: composite means component in PDL
- * }
- * </pre></blockquote>
- *
- * We can register GenericURLFinder with the URLService for both of
- * these object types with the following code:
- * <blockquote><pre>
- * URLService.registerFinder("examples.Forum",
- * new GenericURLFinder("index?forum_id=:id"));
- * URLService.registerFinder("examples.Message",
- * new GenericURLFinder("message?message_id=:id"));
- * </pre></blockquote>
- *
- * The GenericURLFinder registered for <code>examples.Forum</code> will
- * work because <code>examples.Forum</code> has a <code>packageInstance</code>
- * property of type <code>PackageInstance</code>.
- * <p>
- *
- * The finder registered for <code>examples.Message</code> will work
- * because <code>examples.Message</code> has a composite role (in this
- * case it is the role called <code>forum</code>), and the composite
- * object has a <code>packageInstance</code> property of type
- * <code>PackageInstance</code>.
- *
- * @author Oumi Mehrotra
- * @version $Id$
- */
-public class GenericURLFinder implements URLFinder {
-
- private String m_base;
- private Map m_params;
-
- public GenericURLFinder(String urlEndingPattern) {
- m_params = new HashMap();
- m_base = parseQueryString(urlEndingPattern, m_params);
- // setFormat(urlEndingPattern);
- }
-
- public String find(OID oid, String context) throws NoValidURLException {
- return find(oid);
- }
-
- public String find(OID oid) throws NoValidURLException {
- DataObject dobj = SessionManager.getSession().retrieve(oid);
- if (dobj==null) {
- throw new NoValidURLException("No such data object " + oid);
- }
- DataObject packageInstanceData =
- getPackageInstanceData(dobj);
- if (packageInstanceData == null) {
- throw new NoValidURLException("Could not find package " +
- "instance for " + dobj);
- }
- PackageInstance pkg = new PackageInstance(packageInstanceData);
- SiteNode sn = pkg.getDefaultMountPoint();
- if (sn == null) {
- throw new NoValidURLException("Could not find site node for " +
- "package instance " + pkg);
- }
- return sn.getURL() + m_base + unparseQueryString(oid);
- }
-
- private DataObject getPackageInstanceData(DataObject dobj) {
-
- if (!isACSObject(dobj.getObjectType())) {
- // For compatibility, the GenericURLFinder still tries to support
- // domain objects that are not ACSObject, using some metadata
- // driven guesswork to find a package instance for the object.
- return guessPackageInstanceData(dobj);
- }
-
- final String queryName =
- "com.arsdigita.kernel.PackageInstanceForObject";
- DataQuery query = SessionManager.getSession().retrieveQuery(queryName);
- query.setParameter("objectID", dobj.get("id"));
- DataObject pkgInst = null;
- if (query.next()) {
- pkgInst = (DataObject) query.get(MDUtil.PACKAGE_INSTANCE);
- }
- query.close();
-
- return pkgInst;
- }
-
- // This is how URLFinder used to work, before the generic container
- // hierarchy was introduced for ACSObject. Now, this method is
- // never called for an ACSObject. But I've left in the logic that
- // deals with ACSObject so that I can switch back and forth between
- // the new algorithm and the old algorithm for debugging.
- private DataObject guessPackageInstanceData(DataObject dobj) {
- ObjectType o = dobj.getObjectType();
-
- if (isACSObject(o)) {
- o = getType( (String) dobj.get(ACSObject.OBJECT_TYPE) );
- dobj.specialize(o);
- }
-
- if (isPackageInstance(o)) {
- return dobj;
- }
- if (MDUtil.hasPackageInstanceRole(o)) {
- return (DataObject) dobj.get(MDUtil.PACKAGE_INSTANCE);
- }
- // recurse to composite.
- DataObject composite = getComposite(dobj);
- if (composite != null) {
- return guessPackageInstanceData(composite);
- }
-
- // The object is not a package instance, has no packageInstance role,
- // and has no visible required composite role. Therefore we can't
- // generically figure out what package instance the object belongs
- // to.
- return null;
- }
-
- private static DataObject getComposite(DataObject dobj) {
- Property compositeRole = MDUtil.getCompositeRole(dobj.getObjectType());
- if (compositeRole==null) {
- return null;
- } else {
- return (DataObject) dobj.get(compositeRole.getName());
- }
- }
-
- private static boolean isACSObject(ObjectType type) {
- return (type.isSubtypeOf(getType(ACSObject.BASE_DATA_OBJECT_TYPE)));
- }
-
- private static boolean isPackageInstance(ObjectType type) {
- return (type.isSubtypeOf(getType(PackageInstance.BASE_DATA_OBJECT_TYPE)));
- }
-
- private static ObjectType getType(String typeName) {
- return SessionManager.getMetadataRoot().getObjectType(typeName);
- }
-
-
- /**
- * Copied from com.arsdigita.util.URLRewriter and modified slightly.
- **/
- private String unparseQueryString(OID oid) {
- StringBuffer buf = new StringBuffer(128);
- char sep = '?';
- Iterator keys = m_params.keySet().iterator();
- while (keys.hasNext()) {
- String key = (String)keys.next();
- Object value = m_params.get(key);
- if (value instanceof String[]) {
- String[] values = (String[])value;
- for (int i = 0; i < values.length; i++) {
- if (values[i] != null) {
- appendParam(buf, sep, key, getValue(oid, values[i]));
- sep = '&';
- }
- }
- continue;
- } else if (value != null) {
- appendParam(buf, sep, key, getValue(oid, value.toString()));
- sep = '&';
- }
- }
- return buf.toString();
- }
-
- private String getValue(OID oid, String val) {
- if (val.charAt(0)==':') {
- return oid.get(val.substring(1)).toString();
- }
- return val;
- }
-
- //
- // COPIED FROM: com.arsdigita.util.URLRewriter
- //
-
- private static String parseQueryString(String url, Map params) {
- int qmark = url.indexOf('?');
- if (qmark < 0) {
- return url;
- }
- String base = url.substring(0, qmark);
- String query = url.substring(qmark+1);
- params.putAll(HttpUtils.parseQueryString(query));
- return base;
- }
-
- /**
- * Appends string representation of a parameter to the given
- * StringBuffer: sep + URLEncode(key) + '=' + URLEncode(value)
- **/
- private static void appendParam(StringBuffer buf, char sep,
- String key, String value) {
- buf.append(sep).append(URLEncoder.encode(key))
- .append('=').append(URLEncoder.encode(value));
- }
-}
Added: trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java.nolongerInUse (rev 0)
+++ trunk/ccm-core/src/com/arsdigita/kernel/GenericURLFinder.java.nolongerInUse 2013-02-02 23:43:41 UTC (rev 2478)
@@ -0,0 +1,278 @@
+/*
+ * 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.kernel;
+
+import com.arsdigita.persistence.OID;
+import com.arsdigita.persistence.DataObject;
+import com.arsdigita.persistence.SessionManager;
+import com.arsdigita.persistence.DataQuery;
+import com.arsdigita.persistence.metadata.ObjectType;
+import com.arsdigita.persistence.metadata.Property;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import javax.servlet.http.HttpUtils;
+import java.net.URLEncoder;
+
+/**
+ * A URLFinder that can be registered for most object types. The
+ * GenericURLFinder is constructed with a specified URL pattern such
+ * as <code>one-ticket?ticket_id=:id</code>. For a given OID, the
+ * URL path is determined as follows:
+ *
+ * <ol>
+ * <li> Try to find the package instance to which the specified
+ * object belongs. The current process involves
+ * examining persistence metadata to try to navigate from the
+ * given OID to its package instance. This process will eventually
+ * be replaced with a call to some other kernel service (to be
+ * developed) that deals with the scoping of objects to package
+ * instances. Until then, the process is as follows:
+ * <ul>
+ * <li> Get the data object's "packageInstance" property (if it has
+ * such a property and the property is of type PackageInstance).
+ * <li> If no such property exists, use metadata to figure out
+ * if this data object has a composite role property (a
+ * required, visible property where
+ * <code>com.arsdigita.persistence.metadata.Property.isComposite()==true
+ * </code>).
+ * <li>If a composite role exists,
+ * fetch the composite role, and
+ * then repeat the process with that object. See the example below.
+ * </ul>
+ * <li> Once the package instance is determined, get the package
+ * instance's primary mount point (see
+ * PackageInstance.getDefaultMountPoint()).
+ * <li> Once the primary mount point is determined, get its URL path.
+ * <li> Append the URL pattern (which was specified to the constructor
+ * of GenericURLFinder).
+ * <li> Substitute terms like <code>:id</code> with values from the given
+ * OID.
+ * </ol>
+ *
+ * For example, suppose we have the following PDL fragment:
+ * <blockquote><pre>
+ * model examples;
+ * object type Forum extends ACSObject {
+ * PackageInstance[1..1] packageInstance;
+ * }
+ * object type Message extends ACSObject {...}
+ * association {
+ * Forum[1..1] forum;
+ * composite Message[0..n] messages;
+ * // NOTE: composite means component in PDL
+ * }
+ * </pre></blockquote>
+ *
+ * We can register GenericURLFinder with the URLService for both of
+ * these object types with the following code:
+ * <blockquote><pre>
+ * URLService.registerFinder("examples.Forum",
+ * new GenericURLFinder("index?forum_id=:id"));
+ * URLService.registerFinder("examples.Message",
+ * new GenericURLFinder("message?message_id=:id"));
+ * </pre></blockquote>
+ *
+ * The GenericURLFinder registered for <code>examples.Forum</code> will
+ * work because <code>examples.Forum</code> has a <code>packageInstance</code>
+ * property of type <code>PackageInstance</code>.
+ * <p>
+ *
+ * The finder registered for <code>examples.Message</code> will work
+ * because <code>examples.Message</code> has a composite role (in this
+ * case it is the role called <code>forum</code>), and the composite
+ * object has a <code>packageInstance</code> property of type
+ * <code>PackageInstance</code>.
+ *
+ * @author Oumi Mehrotra
+ * @version $Id: GenericURLFinder.java 287 2005-02-22 00:29:02Z sskracic $
+ * @deprecated without replacement. Current code depends solely on old style
+ * applications using SiteNode and Package / PackageType. Both are no longer
+ * in use. This class can not provide any useful information anymore (pb 2013-01)
+ */
+public class GenericURLFinder implements URLFinder {
+
+ private String m_base;
+ private Map m_params;
+
+ public GenericURLFinder(String urlEndingPattern) {
+ m_params = new HashMap();
+ m_base = parseQueryString(urlEndingPattern, m_params);
+ // setFormat(urlEndingPattern);
+ }
+
+ public String find(OID oid, String context) throws NoValidURLException {
+ return find(oid);
+ }
+
+ public String find(OID oid) throws NoValidURLException {
+ DataObject dobj = SessionManager.getSession().retrieve(oid);
+ if (dobj==null) {
+ throw new NoValidURLException("No such data object " + oid);
+ }
+ DataObject packageInstanceData =
+ getPackageInstanceData(dobj);
+ if (packageInstanceData == null) {
+ throw new NoValidURLException("Could not find package " +
+ "instance for " + dobj);
+ }
+ PackageInstance pkg = new PackageInstance(packageInstanceData);
+ SiteNode sn = pkg.getDefaultMountPoint();
+ if (sn == null) {
+ throw new NoValidURLException("Could not find site node for " +
+ "package instance " + pkg);
+ }
+ return sn.getURL() + m_base + unparseQueryString(oid);
+ }
+
+ private DataObject getPackageInstanceData(DataObject dobj) {
+
+ if (!isACSObject(dobj.getObjectType())) {
+ // For compatibility, the GenericURLFinder still tries to support
+ // domain objects that are not ACSObject, using some metadata
+ // driven guesswork to find a package instance for the object.
+ return guessPackageInstanceData(dobj);
+ }
+
+ final String queryName =
+ "com.arsdigita.kernel.PackageInstanceForObject";
+ DataQuery query = SessionManager.getSession().retrieveQuery(queryName);
+ query.setParameter("objectID", dobj.get("id"));
+ DataObject pkgInst = null;
+ if (query.next()) {
+ pkgInst = (DataObject) query.get(MDUtil.PACKAGE_INSTANCE);
+ }
+ query.close();
+
+ return pkgInst;
+ }
+
+ // This is how URLFinder used to work, before the generic container
+ // hierarchy was introduced for ACSObject. Now, this method is
+ // never called for an ACSObject. But I've left in the logic that
+ // deals with ACSObject so that I can switch back and forth between
+ // the new algorithm and the old algorithm for debugging.
+ private DataObject guessPackageInstanceData(DataObject dobj) {
+ ObjectType o = dobj.getObjectType();
+
+ if (isACSObject(o)) {
+ o = getType( (String) dobj.get(ACSObject.OBJECT_TYPE) );
+ dobj.specialize(o);
+ }
+
+ if (isPackageInstance(o)) {
+ return dobj;
+ }
+ if (MDUtil.hasPackageInstanceRole(o)) {
+ return (DataObject) dobj.get(MDUtil.PACKAGE_INSTANCE);
+ }
+ // recurse to composite.
+ DataObject composite = getComposite(dobj);
+ if (composite != null) {
+ return guessPackageInstanceData(composite);
+ }
+
+ // The object is not a package instance, has no packageInstance role,
+ // and has no visible required composite role. Therefore we can't
+ // generically figure out what package instance the object belongs
+ // to.
+ return null;
+ }
+
+ private static DataObject getComposite(DataObject dobj) {
+ Property compositeRole = MDUtil.getCompositeRole(dobj.getObjectType());
+ if (compositeRole==null) {
+ return null;
+ } else {
+ return (DataObject) dobj.get(compositeRole.getName());
+ }
+ }
+
+ private static boolean isACSObject(ObjectType type) {
+ return (type.isSubtypeOf(getType(ACSObject.BASE_DATA_OBJECT_TYPE)));
+ }
+
+ private static boolean isPackageInstance(ObjectType type) {
+ return (type.isSubtypeOf(getType(PackageInstance.BASE_DATA_OBJECT_TYPE)));
+ }
+
+ private static ObjectType getType(String typeName) {
+ return SessionManager.getMetadataRoot().getObjectType(typeName);
+ }
+
+
+ /**
+ * Copied from com.arsdigita.util.URLRewriter and modified slightly.
+ **/
+ private String unparseQueryString(OID oid) {
+ StringBuffer buf = new StringBuffer(128);
+ char sep = '?';
+ Iterator keys = m_params.keySet().iterator();
+ while (keys.hasNext()) {
+ String key = (String)keys.next();
+ Object value = m_params.get(key);
+ if (value instanceof String[]) {
+ String[] values = (String[])value;
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] != null) {
+ appendParam(buf, sep, key, getValue(oid, values[i]));
+ sep = '&';
+ }
+ }
+ continue;
+ } else if (value != null) {
+ appendParam(buf, sep, key, getValue(oid, value.toString()));
+ sep = '&';
+ }
+ }
+ return buf.toString();
+ }
+
+ private String getValue(OID oid, String val) {
+ if (val.charAt(0)==':') {
+ return oid.get(val.substring(1)).toString();
+ }
+ return val;
+ }
+
+ //
+ // COPIED FROM: com.arsdigita.util.URLRewriter
+ //
+
+ private static String parseQueryString(String url, Map params) {
+ int qmark = url.indexOf('?');
+ if (qmark < 0) {
+ return url;
+ }
+ String base = url.substring(0, qmark);
+ String query = url.substring(qmark+1);
+ params.putAll(HttpUtils.parseQueryString(query));
+ return base;
+ }
+
+ /**
+ * Appends string representation of a parameter to the given
+ * StringBuffer: sep + URLEncode(key) + '=' + URLEncode(value)
+ **/
+ private static void appendParam(StringBuffer buf, char sep,
+ String key, String value) {
+ buf.append(sep).append(URLEncoder.encode(key))
+ .append('=').append(URLEncoder.encode(value));
+ }
+}
Modified: trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -127,8 +127,10 @@
// finders registered for them by other initializers (in UI packages).
// For PackageInstance, urls are determined from the mount points on
// the site map.
- URLService.registerFinder(PackageInstance.BASE_DATA_OBJECT_TYPE,
- new GenericURLFinder(""));
+ // EXPERIMENTAL. This class relies on SiteNode / Package / PackageTye
+ // and is not able to provide usefull information anymore.
+ // URLService.registerFinder(PackageInstance.BASE_DATA_OBJECT_TYPE,
+ // new GenericURLFinder(""));
if (Kernel.getSystemParty() == null) {
final DatabaseTransaction transaction = new DatabaseTransaction();
Modified: trunk/ccm-core/src/com/arsdigita/kernel/Kernel.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/Kernel.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/Kernel.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -48,19 +48,33 @@
private static final Logger s_log = Logger.getLogger(Kernel.class);
/** The ID of the user that represents "the public", i.e. a non-logged-in
- * user. Created by insert-users.sql (during load step) . */
+ * user. Created by insert-users.sql (during load step) */
private static final BigDecimal PUBLIC_USER_ID = new BigDecimal(-200);
- /** Public (i.e. a non-logged-in) User object (retrieved by PUBLIC_USER_ID) */
+
+ /** Public (i.e. a non-logged-in) User object (retrieved by PUBLIC_USER_ID)*/
private static User s_publicUser;
+ /* The Kernel Initial Context object */
private static KernelContext s_initialContext;
+
+ /* The /actual) Kernel Context object */
+ private static ThreadLocal s_context;
+
+ /* The Kernel Configuration object */
private static KernelConfig s_config;
+
+ /* The Kernel Security Configuration object */
private static SecurityConfig s_securityConfig;
- private static ThreadLocal s_context;
+ /** Status flag wether the class is initialized or not. */
private static boolean initialized = false;
+ /**
+ * Internal service routine used by varios methods to initialize the
+ * class.
+ */
private static void init() {
+
if (initialized) {
return;
}
@@ -73,6 +87,7 @@
s_config.load();
s_securityConfig.load();
s_context = new ThreadLocal() {
+ @Override
public Object initialValue() {
return s_initialContext;
}
@@ -81,12 +96,20 @@
initialized = true;
}
- public static final KernelConfig getConfig() {
+ /**
+ * Provides the Kernel Config object for client classes.
+ * @return ConfigObject
+ */
+ public static KernelConfig getConfig() {
init();
return s_config;
}
- public static final SecurityConfig getSecurityConfig() {
+ /**
+ * Provides the Kernel Security Config object for client classes.
+ * @return SecurityConfigObject
+ */
+ public static SecurityConfig getSecurityConfig() {
init();
return s_securityConfig;
}
@@ -103,12 +126,12 @@
*
* @post return != null
*/
- public static final KernelContext getContext() {
+ public static KernelContext getContext() {
init();
return (KernelContext) s_context.get();
}
- static final void setContext(KernelContext context) {
+ static void setContext(KernelContext context) {
init();
if (s_log.isDebugEnabled()) {
s_log.debug("Set context to " + context.getDebugInfo());
@@ -117,16 +140,17 @@
}
/**
- * Get the system party, the agent of any work the system
- * performs, as apart from what some user or group does. Returns
- * null if the system party is not defined.
+ * Get the system party, the agent of any work the system performs,
+ * as apart from what some user or group does.
+ *
+ * Returns null if the system party is not defined.
*/
- public static final Party getSystemParty() {
+ public static Party getSystemParty() {
init();
return s_systemParty;
}
- static final void setSystemParty(Party party) {
+ static void setSystemParty(Party party) {
init();
s_systemParty = party;
}
@@ -134,8 +158,8 @@
/**
* Get the User that represents "the public", i.e. non-logged-in
* users.
- **/
- public static final User getPublicUser() {
+ */
+ public static User getPublicUser() {
init();
if (s_publicUser == null) {
// We could synchronize this method, but we don't really care if the
Modified: trunk/ccm-core/src/com/arsdigita/kernel/MDUtil.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/MDUtil.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/MDUtil.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -26,10 +26,10 @@
import java.util.Iterator;
/**
- * Metadata Utilities:
+ * Metadata Utilities.
* Package-private class containing utility/convenience methods for
* accessing persistence metadata.
- **/
+ */
class MDUtil {
// map used to cache metadata lookups
@@ -38,6 +38,10 @@
// the ObjectType.
private static HashMap s_composites = new HashMap();
+ /**
+ * @deprecated without direct replacement. PACKAGE_INSTANCE is old style
+ * application no longer in use.
+ */
static final String PACKAGE_INSTANCE = "packageInstance";
static Property getCompositeRole(ObjectType type) {
@@ -68,16 +72,23 @@
}
- static boolean hasPackageInstanceRole(ObjectType o) {
+ /**
+ *
+ * @param o
+ * @return
+ * @ deprecated PACKAGE_INSTANCE is old style application no longer in use.
+ */
+/* static boolean hasPackageInstanceRole(ObjectType o) {
+
Property p = o.getProperty(PACKAGE_INSTANCE);
- return
- p != null &&
- p.isRole() &&
- ((ObjectType) p.getType()).isSubtypeOf(
- getType(PackageInstance.BASE_DATA_OBJECT_TYPE));
- }
+ return p != null &&
+ p.isRole() &&
+ ((ObjectType) p.getType()).isSubtypeOf(
+ getType(PackageInstance.BASE_DATA_OBJECT_TYPE));
+ } */
+
/**
* convenience wrapper around
* SessionManager.getMetadataRoot().getObjectType()
Modified: trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -40,15 +40,16 @@
* Provides user authentication methods on a contained
* User object.
*
+ * @see com.arsdigita.kernel.User
+ *
* @author Phong Nguyen
* @version 1.0
- *
- * @see com.arsdigita.kernel.User
- **/
+ * @version $Id$
+ */
public class UserAuthentication extends DomainObject {
private static final Logger s_log =
- Logger.getLogger(UserAuthentication.class.getName());
+ Logger.getLogger(UserAuthentication.class.getName());
private User m_user;
public static final String BASE_DATA_OBJECT_TYPE =
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectContext.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectContext.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectContext.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -28,9 +28,9 @@
/**
- * A class that represents a context heiracrchy of
- * <code>ACSObject</code>s to other <code>ACSObject</code>s where the
- * context is used for security inheritance.
+ * A class that represents a context hierarchy of <code>ACSObject</code>s
+ * to other <code>ACSObject</code>s where the context is used for
+ * security inheritance.
*
* <p>
* <font color="ff0000">
@@ -43,13 +43,17 @@
* @version 1.0
*
* @see com.arsdigita.kernel.ACSObject
- **/
+ * @version $Id$
+ */
final class ObjectContext extends DomainObject {
-
private static final String BASE_DATA_OBJECT_TYPE =
- "com.arsdigita.kernel.permissions.ObjectContext";
+ "com.arsdigita.kernel.permissions.ObjectContext";
+ /**
+ *
+ * @return
+ */
protected String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE;
}
@@ -62,7 +66,7 @@
* @see com.arsdigita.domain.DomainObject#DomainObject(String)
* @see com.arsdigita.persistence.DataObject
* @see com.arsdigita.persistence.metadata.ObjectType
- **/
+ */
protected ObjectContext() {
super(BASE_DATA_OBJECT_TYPE);
}
@@ -78,7 +82,7 @@
* @see com.arsdigita.domain.DomainObject#DomainObject(OID)
* @see com.arsdigita.persistence.DataObject
* @see com.arsdigita.persistence.OID
- **/
+ */
protected ObjectContext(OID oid) throws DataObjectNotFoundException {
super(oid);
}
@@ -86,7 +90,7 @@
/**
* Wrapper for {@link #ObjectContext(OID)} that uses the default
* object type for object context.
- **/
+ */
protected ObjectContext(Object id) throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id));
}
@@ -103,7 +107,7 @@
*
* @see com.arsdigita.kernel.ACSObject
* @see com.arsdigita.persistence.OID
- **/
+ */
protected DataObject getContext() {
DataObject dataObj = (DataObject) get("context");
return dataObj;
@@ -120,7 +124,7 @@
*
* @see com.arsdigita.kernel.ACSObject
* @see com.arsdigita.persistence.OID
- **/
+ */
protected OID getContextOID() {
DataObject dataObj = (DataObject) get("context");
if (dataObj != null) {
@@ -137,7 +141,7 @@
* @param contextObject The <code>ACSObject</code> to use as the context.
*
* @see com.arsdigita.kernel.ACSObject
- **/
+ */
protected void setContext(ACSObject contextObject) {
if (contextObject == null) {
// hack to fix a bug in persistence.
@@ -157,7 +161,7 @@
*
* @see com.arsdigita.kernel.ACSObject
* @see com.arsdigita.persistence.OID
- **/
+ */
protected void setContext(OID contextObjectOID) {
if (contextObjectOID == null) {
// hack to fix a bug in persistence.
@@ -179,7 +183,7 @@
* <code>ObjectContext</code>.
*
* @see com.arsdigita.kernel.ACSObject
- **/
+ */
protected void setObject(ACSObject acsObject) {
if (isNew()) {
set("objectId", acsObject.getID());
@@ -199,7 +203,7 @@
*
* @see com.arsdigita.kernel.ACSObject
* @see com.arsdigita.persistence.OID
- **/
+ */
protected void setObject(OID objectOID) {
if (isNew()) {
set("objectId", objectOID.get("id"));
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectPermissionCollection.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectPermissionCollection.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/ObjectPermissionCollection.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -45,15 +45,15 @@
*
* @author Oumi Mehrotra
* @version 1.0
- **/
+ * @version $Id$
+ */
public class ObjectPermissionCollection extends DomainQuery {
-
/**
* Constructor.
*
* @see com.arsdigita.domain.DomainCollection#DomainCollection(DataCollection)
- **/
+ */
protected ObjectPermissionCollection(DataQuery query) {
super(query);
}
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/Permission.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/Permission.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/Permission.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -49,9 +49,9 @@
*
* @author Phong Nguyen
* @version 1.0
+ * @version $Id$
*/
class Permission extends DomainObject {
-
// Get the category named the same as this class
private static final Logger s_log = Logger.getLogger(Permission.class);
@@ -63,8 +63,11 @@
static final String PRIVILEGE = "privilege";
static final String BASE_DATA_OBJECT_TYPE =
- "com.arsdigita.kernel.permissions.Permission";
+ "com.arsdigita.kernel.permissions.Permission";
+ /**
+ *
+ */
@Override
protected String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE;
@@ -273,6 +276,9 @@
super.beforeSave();
}
+ /**
+ *
+ */
private void setCreationInfo() {
User user = Web.getContext().getUser();
// The user may be null.
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCache.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCache.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCache.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -119,7 +119,10 @@
return s_instance;
}
- // Caching of permission lookups within the txn
+ /**
+ * Caching of permission lookups within the txn
+ * @return
+ */
private static CollectionTxnCache getPermissionsCache() {
return getInstance().m_prTxnCache;
}
@@ -135,7 +138,7 @@
*
* @return <code>true</code> if the PermissionDescriptor's base object has the
* specified permission; <code>false</code> otherwise.
- **/
+ */
public boolean checkPermission(PermissionDescriptor perm) {
OID party = perm.getPartyOID();
OID obj = perm.getACSObjectOID();
@@ -158,6 +161,12 @@
return lookupResult.booleanValue();
}
+ /**
+ *
+ * @param party
+ * @param obj
+ * @return
+ */
private static HashMap getPrivilegesFromDB(
OID party,
OID obj) {
@@ -207,21 +216,48 @@
+ /**
+ *
+ */
private class CollectionTxnCache {
+
private String m_prefix;
+ /**
+ *
+ * @param prefix
+ */
public CollectionTxnCache(String prefix) {
m_prefix = prefix;
}
+ /**
+ *
+ * @param party
+ * @param object
+ * @return
+ */
private String attributeName(OID party, OID object) {
return m_prefix + ":" + party.get("id") + ":" + object.get("id");
}
+ /**
+ *
+ * @param party
+ * @param object
+ * @param privilegeMap
+ */
public void cache(OID party, OID object, HashMap privilegeMap) {
getTxn().setAttribute(attributeName(party, object), privilegeMap);
}
+ /**
+ *
+ * @param party
+ * @param object
+ * @param privilege
+ * @return
+ */
public Boolean lookup(
OID party,
OID object,
@@ -243,6 +279,10 @@
}
}
+ /**
+ *
+ * @return
+ */
private TransactionContext getTxn() {
TransactionContext txn =
SessionManager.getSession().getTransactionContext();
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCollection.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCollection.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionCollection.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -29,15 +29,15 @@
*
* @author Michael Bryzek
* @version 1.0
+ * @version $Id$
**/
class PermissionCollection extends DomainCollection {
-
/**
* Constructor.
*
* @see com.arsdigita.domain.DomainCollection#DomainCollection(DataCollection)
- **/
+ */
PermissionCollection(DataCollection dataCollection) {
super(dataCollection);
}
@@ -47,7 +47,7 @@
* the collection.
*
* @see com.arsdigita.domain.DomainObject#getDomainObject()
- **/
+ */
public DomainObject getDomainObject() {
DataObject data = m_dataCollection.getDataObject();
return new Permission(data);
@@ -62,7 +62,7 @@
*
* @see #getDomainObject()
* @see ObjectPermission
- **/
+ */
public Permission getPermission() {
return (Permission) getDomainObject();
}
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionDescriptor.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionDescriptor.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionDescriptor.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -44,10 +44,10 @@
private PrivilegeDescriptor m_privilege; // not null
/**
- * Creates a new PermissionDescriptor object for the
- * specified party, granting the specified privilege on the
- * specified ACS object.
+ * Creates a new PermissionDescriptor object for the specified party,
+ * granting the specified privilege on the specified ACS object.
*
+ *
* @param privilege the privilege being granted
*
* @param acsObject the ACS object on which
@@ -77,8 +77,8 @@
}
/**
- * Creates a new PermissionDescriptor object for the party
- * with the given OID, that grants the specified privilege on the
+ * Creates a new PermissionDescriptor object for the party with the
+ * given OID, that grants the specified privilege on the
* ACS object with the given OID.
*
* @param privilege the privilege to be granted
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionException.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionException.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionException.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -30,12 +30,11 @@
*
* @author <a href="mailto:rh...@mi...">rh...@mi...</a>
* @version $Revision: #9 $ $Date: 2004/08/16 $
+ * @version $Id$
**/
public class PermissionException extends RuntimeException {
-
-
private PermissionDescriptor m_permission;
private String m_msg;
@@ -49,6 +48,10 @@
SecurityLogger.log(Priority.WARN, m_msg);
}
+ /**
+ *
+ * @param permission
+ */
public PermissionException(PermissionDescriptor permission) {
m_permission = permission;
@@ -73,6 +76,12 @@
SecurityLogger.log(Priority.WARN, m_msg);
}
+ /**
+ *
+ * @param priv
+ * @param obj
+ * @param message
+ */
public PermissionException(PrivilegeDescriptor priv,
ACSObject obj,
String message) {
@@ -82,10 +91,18 @@
SecurityLogger.log(Priority.WARN, m_msg);
}
+ /**
+ *
+ * @return
+ */
public PermissionDescriptor getPermission() {
return m_permission;
}
+ /**
+ *
+ * @return
+ */
public String getMessage() {
return m_msg;
}
Modified: trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionManager.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionManager.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/permissions/PermissionManager.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -44,7 +44,7 @@
import java.util.Iterator;
/**
- * default implementation of PermissionService.
+ * Default implementation of PermissionService.
*
* @author Oumi Mehrotra
* @author Michael Bryzek
@@ -62,8 +62,8 @@
public static final int SYSTEM_PARTY = -204;
/**
- * Checks the permission
- * represented by the passed in {@link PermissionDescriptor}.
+ * Checks the permission represented by the passed in
+ * {@link PermissionDescriptor}.
*
* @param permission the {@link PermissionDescriptor} to
* provide service to
@@ -73,7 +73,6 @@
**/
public boolean checkPermission(PermissionDescriptor permission) {
-
// For performance, we use different queries depending on whether
// the party (from the permission descriptor) is a user or a group.
// Start out assuming the party is a user
@@ -92,10 +91,21 @@
return doCheck(queryName, permission);
}
+ /**
+ *
+ * @param permission
+ * @return
+ */
boolean checkDirectPermission(PermissionDescriptor permission) {
return checkDirectPermission(permission, true);
}
+ /**
+ *
+ * @param permission
+ * @param useImpliedPrivs
+ * @return
+ */
boolean checkDirectPermission(
PermissionDescriptor permission,
boolean useImpliedPrivs) {
@@ -126,13 +136,17 @@
/**
* Check a universal permission. This will soon be optimized via
* some sort of caching of universal permissions.
- **/
- private boolean
- checkPermission(UniversalPermissionDescriptor permission)
- {
+ */
+ private boolean checkPermission(UniversalPermissionDescriptor permission) {
return doCheck("CheckUninheritedPermissionForParty",permission);
}
+ /**
+ *
+ * @param queryName
+ * @param permission
+ * @return
+ */
private boolean doCheck(String queryName,
PermissionDescriptor permission) {
DataQuery query = getQuery("PermissionCheckPlaceholder");
@@ -225,7 +239,7 @@
*
* @see com.arsdigita.kernel.ACSObject
* @see com.arsdigita.persistence.OID
- **/
+ */
public DataObject getContext(OID oid) {
ObjectContext objContext;
@@ -252,7 +266,7 @@
*
* @see com.arsdigita.kernel.ACSObject
* @see com.arsdigita.persistence.OID
- **/
+ */
public DataObject getContext(ACSObject acsObject) {
return getContext(acsObject.getOID());
}
@@ -387,7 +401,6 @@
}
/**
- *
* Returns the set of permissions that have been granted on
* the specified object, including those inherited from
* the object's permission context. In the result set,
@@ -570,7 +583,7 @@
* @param party the OID of the party that privileges are to be returned for
*
* @return an iterator of PrivilegeDescriptors.
- **/
+ */
public Iterator getPrivileges(OID object, OID party) {
return getPrivilegeSet(object, party, false).iterator();
@@ -588,7 +601,7 @@
* @return an iterator of PrivilegeDescriptors.
*
* @see #getPrivileges(OID, OID)
- **/
+ */
public Iterator getImpliedPrivileges(OID object, OID party) {
return getPrivilegeSet(object, party, true).iterator();
}
@@ -659,7 +672,7 @@
* @see com.arsdigita.kernel.permissions.PermissionDescriptor
* @see com.arsdigita.kernel.permissions.Permission
* @see com.arsdigita.persistence.OID
- **/
+ */
private OID createPermissionOID(PermissionDescriptor permission) {
OID oid = new OID(Permission.BASE_DATA_OBJECT_TYPE);
oid.set(Permission.OBJECT_ID,
Modified: trunk/ccm-core/src/com/arsdigita/kernel/security/AccountNotFoundException.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/security/AccountNotFoundException.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/security/AccountNotFoundException.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -22,21 +22,38 @@
* Thrown when an account is not found.
*
* @author Sameer Ajmani
- **/
+ * @version $Id$
+ */
public class AccountNotFoundException extends AccountException {
+ /**
+ *
+ */
public AccountNotFoundException() {
super();
}
+ /**
+ *
+ * @param message
+ */
public AccountNotFoundException(String message) {
super(message);
}
+ /**
+ *
+ * @param rootCause
+ */
public AccountNotFoundException(Throwable rootCause) {
super(rootCause);
}
+ /**
+ *
+ * @param message
+ * @param rootCause
+ */
public AccountNotFoundException(String message, Throwable rootCause) {
super(message, rootCause);
}
Modified: trunk/ccm-core/src/com/arsdigita/kernel/security/AdminLoginModule.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/security/AdminLoginModule.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigita/kernel/security/AdminLoginModule.java 2013-02-02 23:43:41 UTC (rev 2478)
@@ -28,8 +28,10 @@
/**
* Supports login as an aribtrary user by checking whether a user ID has
- * been set for the Subject. If so, <code>login</code> succeeds, so
- * <code>commit</code> is called on all login modules to log the user in.
+ * been set for the Subject.
+ *
+ * If so, <code>login</code> succeeds, so <code>commit</code> is called
+ * on all login modules to log the user in.
* If no user ID is set, <code>login</code> fails. This module should
* appear at the beginning of a login context with the "sufficient" control
* flag. Note that this module does not check the privileges of the current
@@ -42,11 +44,19 @@
*/
public class AdminLoginModule implements LoginModule {
+ /** Private logger instance for debugging purpose */
private static final Logger s_log =
- Logger.getLogger(AdminLoginModule.class.getName());
+ Logger.getLogger(AdminLoginModule.class.getName());
private Subject m_subject;
+ /**
+ *
+ * @param subject
+ * @param handler
+ * @param shared
+ * @param options
+ */
public void initialize(Subject subject,
CallbackHandler handler,
Map shared,
Modified: trunk/ccm-core/src/com/arsdigita/kernel/security/CookieLoginModule.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/security/CookieLoginModule.java 2013-02-02 23:34:47 UTC (rev 2477)
+++ trunk/ccm-core/src/com/arsdigit...
[truncated message content] |
|
From: <pb...@fe...> - 2013-02-02 23:34:56
|
Author: pboy
Date: 2013-02-02 23:34:47 +0000 (Sat, 02 Feb 2013)
New Revision: 2477
Added:
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java.nolongerInUse
Removed:
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java
Modified:
trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
Log:
Code clean-up after migration of ContentCenter to new style legacy free bebop pages served by a servlet.
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java 2013-02-02 23:31:41 UTC (rev 2476)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentCenterServlet.java 2013-02-02 23:34:47 UTC (rev 2477)
@@ -20,7 +20,7 @@
package com.arsdigita.cms;
import com.arsdigita.bebop.Page;
-import com.arsdigita.cms.dispatcher.ResourceHandler;
+import com.arsdigita.cms.SecurityManager;
import com.arsdigita.cms.dispatcher.SimpleCache;
import com.arsdigita.cms.ui.contentcenter.MainPage;
import com.arsdigita.developersupport.DeveloperSupport;
@@ -37,7 +37,6 @@
import com.arsdigita.xml.Document;
import java.io.IOException;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -69,7 +68,7 @@
"/WEB-INF/resources/content-center-old-map.xml";
/** Mapping between a relative URL and the class name of a ResourceHandler.*/
- private static HashMap s_pageClasses = ContentCenterSetup.getURLToClassMap();
+ // private static HashMap s_pageClasses = ContentCenterSetup.getURLToClassMap();
private static HashMap s_pageURLs = ContentCenterSetup.getClassToURLMap();
/** Instantiated ResourceHandlers cache. This allows for lazy loading. */
@@ -205,7 +204,6 @@
}
- // ResourceHandler page = getResource(url);
final Page page = (Page) m_pages.get(pathInfo);
if ( page != null ) {
@@ -271,6 +269,7 @@
* Service Method returns the URL stub for the class name,
* can return null if not mapped
*/
+ // Currently still in use by c.ad.cms.ui.ItemSearchWidget
public static String getURLStubForClass(String classname) {
s_log.debug("Getting URL Stub for : " + classname);
Iterator itr = s_pageURLs.keySet().iterator();
@@ -284,66 +283,12 @@
}
/**
- * Fetch a page based on the URL stub.
- *
- * @param url The URL stub following the site-node URL
- * @return A ResourceHandler or null if none exists.
- * @pre (url != null)
- */
- protected ResourceHandler getResource(String url) throws ServletException {
-
- // First check the pages cache for existing pages.
- ResourceHandler page = (ResourceHandler) s_pages.get(url);
- if ( page == null ) {
-
- // Next check if the URL maps to a page class.
- String pageClassName = (String) s_pageClasses.get(url);
- if ( pageClassName != null ) {
-
- Class pageClass;
- try {
- pageClass = Class.forName(pageClassName);
- } catch (ClassNotFoundException e) {
- s_log.error("error fetching class for ResourceHandler", e);
- throw new ServletException(e);
- }
-
- // Try and instantiate the page.
- try {
- page = (ResourceHandler) pageClass.newInstance();
- } catch (InstantiationException e) {
- s_log.error("error instantiating a ResourceHandler", e);
- throw new ServletException(e);
- } catch (IllegalAccessException e) {
- s_log.error("error instantiating a ResourceHandler", e);
- throw new ServletException(e);
- }
-
- page.init();
- s_pages.put(url, page);
- }
- }
- return page;
- }
-
- /**
- * Map a page to a URL.
- *
- * @param url The URL
- * @param className The name of the ResourceHandler class
- * @pre (url != null && className != null)
- */
- protected void addResource(String url, String className) {
- s_pageClasses.put(url, className);
- s_pageURLs.put(className, url);
- }
-
- /**
* Release the page at the specified URL.
*
* @param url The URL
* @pre (url != null)
*/
+ // Currently still in use by c.ad.cms.dispatcher.Utilities
public static void releaseResource(String url) {
s_pages.remove(url);
}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java 2013-02-02 23:31:41 UTC (rev 2476)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java 2013-02-02 23:34:47 UTC (rev 2477)
@@ -18,38 +18,18 @@
*/
package com.arsdigita.cms.ui;
-import com.arsdigita.cms.dispatcher.*;
-import com.arsdigita.bebop.Bebop;
-import com.arsdigita.bebop.Container;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.Page;
-import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.*;
import com.arsdigita.bebop.page.PageTransformer;
-import com.arsdigita.cms.CMSExcursion;
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentSection;
-import com.arsdigita.cms.ContentSectionServlet;
-import com.arsdigita.cms.SecurityManager;
-import com.arsdigita.developersupport.DeveloperSupport;
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.domain.DomainObjectFactory;
+import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.User;
-import com.arsdigita.kernel.permissions.PermissionDescriptor;
-import com.arsdigita.kernel.permissions.PermissionService;
-import com.arsdigita.persistence.OID;
import com.arsdigita.templating.PresentationManager;
-import com.arsdigita.util.Assert;
-import com.arsdigita.web.Application;
import com.arsdigita.xml.Document;
import com.arsdigita.xml.Element;
-import java.io.IOException;
-import java.math.BigDecimal;
import java.util.HashMap;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
@@ -57,19 +37,18 @@
// ////////////////////////////////////////////////////////////////////////////
//
// Currently under development as a replacement for CMSPage without the
-// dispatcher mechanism but a new application style "pure" bebop page
+// dispatcher mechanism but a new application style "pure" bebop pageElement
// served by an application servlet.
//
// ////////////////////////////////////////////////////////////////////////////
/**
- * <p>A <tt>CMSPage</tt> is a Bebop {@link com.arsdigita.bebop.Page}
- * implementation of the {@link com.arsdigita.cms.dispatcher.ResourceHandler}
- * interface.</p>
+ * <p>A <tt>CMSApplicationPage</tt> is a Bebop {@link com.arsdigita.bebop.Page}
+ * implementation serving as a base for any CMS pageElement served by a servlet. </p>
*
* <p>It stores the current {@link com.arsdigita.cms.ContentSection} and, if
- * applicable, the {@link com.arsdigita.cms.ContentItem} in the page state as
+ * applicable, the {@link com.arsdigita.cms.ContentItem} in the pageElement state as
* request local objects. Components that are part of the <tt>CMSPage</tt>
* may access these objects by calling:</p>
* <blockquote><code><pre>
@@ -87,7 +66,7 @@
/** The global assets URL stub XML parameter name. */
public final static String ASSETS = "ASSETS";
- /** The XML page class. */
+ /** The XML pageElement class. */
public final static String PAGE_CLASS = "CMS";
/** Map of XML parameters */
@@ -122,10 +101,11 @@
}
/**
- * Builds the page.
+ * Builds the pageElement.
*/
- protected void buildPage() {
- // Set the class attribute.
+ private void buildPage() {
+
+ // Set the class attribute value (down in SimpleComponent).
setClassAttr(PAGE_CLASS);
// Global XML params.
@@ -151,10 +131,10 @@
}
/**
- * Finishes and locks the page. If the page is already locked, does nothing.
+ * Finishes and locks the pageElement. If the pageElement is already locked, does nothing.
*
* This method is called by the {@link com.arsdigita.dispatcher.Dispatcher}
- * that initializes this page.
+ * that initializes this pageElement.
*/
public synchronized void init() {
s_log.debug("Initializing the page");
@@ -194,7 +174,7 @@
* @param request The HTTP request
* @return The current content section
*
- * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
+ * @ deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
* instead
* Despite of being deprecated it can not be removed because it
* is required by the interface Resourcehandler which is
@@ -202,27 +182,27 @@
* On the other hand, if deprecated, implementing ResourceHandler
* may not be required
*/
- public ContentSection getContentSection(HttpServletRequest request) {
- // Resets all content sections associations.
- // return ContentSectionDispatcher.getContentSection(request);
- return ContentSectionServlet.getContentSection(request);
- }
+// public ContentSection getContentSection(HttpServletRequest request) {
+// // Resets all content sections associations.
+// // return ContentSectionDispatcher.getContentSection(request);
+// return ContentSectionServlet.getContentSection(request);
+// }
/**
* Fetch the request-local content section.
*
- * @param state The page state
+ * @param state The pageElement state
* @return The current content section
*
- * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
+ * @ deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
* instead
* Despite of being deprecated it can not be removed because it
* is required by ContentItemPage which extends CMSPage and
* uses this method.
*/
- public ContentSection getContentSection(PageState state) {
- return getContentSection(state.getRequest());
- }
+// public ContentSection getContentSection(PageState state) {
+// return getContentSection(state.getRequest());
+// }
/**
* Fetch the request-local content item.
@@ -230,7 +210,7 @@
* @param request The HTTP request
* @return The current content item
*
- * @deprecated use com.arsdigita.cms.CMS.getContext().getContentItem()
+ * @ deprecated use com.arsdigita.cms.CMS.getContext().getContentItem()
* instead
* Despite of being deprecated it can not be removed because it
* is required by the interface Resourcehandler which is
@@ -238,41 +218,41 @@
* On the other hand, if deprecated, implementing ResourceHandler
* may not be required
*/
- public ContentItem getContentItem(HttpServletRequest request) {
- // resets all content item associations
- return ContentSectionDispatcher.getContentItem(request);
- }
+// public ContentItem getContentItem(HttpServletRequest request) {
+// // resets all content item associations
+// return ContentSectionDispatcher.getContentItem(request);
+// }
/**
* Fetch the request-local content item.
*
- * @param state The page state
+ * @param state The pageElement state
* @return The current content item
- * @deprecated use com.arsdigita.cms.CMS.getContext().getContentItem()
+ * @ deprecated use com.arsdigita.cms.CMS.getContext().getContentItem()
* instead.
* Despite of being deprecated it can not be removed because it
* is required by ContentItemPage which extends CMSPage and
* uses this method.
*/
- public ContentItem getContentItem(PageState state) {
- return getContentItem(state.getRequest());
- }
+ // public ContentItem getContentItem(PageState state) {
+ // return getContentItem(state.getRequest());
+ // }
/**
- * Services the Bebop page.
+ * Services the Bebop pageElement.
*
* @param request The servlet request object
* @param response the servlet response object
*
* @pre m_transformer != null
*/
- public void dispatch(final HttpServletRequest request,
+/* public void dispatch(final HttpServletRequest request,
final HttpServletResponse response // ,
// RequestContext actx
)
throws IOException, ServletException {
- DeveloperSupport.startStage("CMSPage.dispatch: serve page");
+ DeveloperSupport.startStage("CMSPage.dispatch: serve pageElement");
CMSExcursion excursion = new CMSExcursion() {
public void excurse() throws IOException, ServletException {
@@ -331,21 +311,35 @@
try {
excursion.run();
} finally {
- DeveloperSupport.endStage("CMSPage.dispatch: serve page");
+ DeveloperSupport.endStage("CMSPage.dispatch: serve pageElement");
}
- }
+ } */
+ /**
+ * Overwrites bebop.Page#generateXMLHelper to add the name of the user
+ * logged in to the pageElement (displayed as part of the header).
+ * @param ps
+ * @param parent
+ * @return pageElement for use in generateXML
+ */
@Override
protected Element generateXMLHelper(PageState ps, Document parent) {
- Element page = super.generateXMLHelper(ps,parent);
+ /* Retain elements already included. */
+ Element pageElement = super.generateXMLHelper(ps,parent);
+ /* Add name of user logged in. */
+ // Note: There are at least 2 ways in the API to determin the user
+ // TODO: Check for differences, determin the best / recommended way and
+ // document it in the classes. Probably remove one ore the other
+ // way from the API if possible.
User user = (User) Kernel.getContext().getParty();
+ // User user = Web.getContext().getUser();
if ( user != null ) {
- page.addAttribute("name",user.getDisplayName());
+ pageElement.addAttribute("name",user.getDisplayName());
}
- return page;
+ return pageElement;
}
}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java 2013-02-02 23:31:41 UTC (rev 2476)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSDHTMLEditor.java 2013-02-02 23:34:47 UTC (rev 2477)
@@ -18,12 +18,16 @@
*/
package com.arsdigita.cms.ui;
-import com.arsdigita.cms.ContentSection;
import com.arsdigita.bebop.form.DHTMLEditor;
+import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter;
-import com.arsdigita.bebop.parameters.ParameterModel;
+import com.arsdigita.cms.ContentSection;
+/**
+ *
+ *
+ */
public class CMSDHTMLEditor extends DHTMLEditor {
public CMSDHTMLEditor(String name) {
Deleted: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java 2013-02-02 23:31:41 UTC (rev 2476)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java 2013-02-02 23:34:47 UTC (rev 2477)
@@ -1,205 +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.cms.ui;
-
-import com.arsdigita.bebop.Component;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.PageState;
-import com.arsdigita.bebop.SimpleContainer;
-import com.arsdigita.bebop.TabbedPane;
-import com.arsdigita.bebop.event.ActionEvent;
-import com.arsdigita.bebop.event.ActionListener;
-import com.arsdigita.bebop.parameters.BigDecimalParameter;
-import com.arsdigita.cms.ContentItem;
-import com.arsdigita.cms.ContentSection;
-import com.arsdigita.cms.ContentType;
-import com.arsdigita.cms.dispatcher.CMSPage;
-import com.arsdigita.cms.ui.contentcenter.TasksPanel;
-import com.arsdigita.cms.util.GlobalizationUtil;
-import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
-import com.arsdigita.ui.DebugPanel;
-
-
-/**
- * <p>The Content Center main page (index page). </p>
- *
- * This class uses the dispatcher based page creation mechanism.
- *
- * @author Jack Chung (fl...@ar...)
- * @author Michael Pih (pi...@ar...)
- * @version $Id: CMSPageWorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $
- */
-public class CMSPageWorkspacePage extends CMSPage implements ActionListener {
-
- private final static String XSL_CLASS = "CMS Admin";
-
- private TabbedPane m_tabbedPane;
-
- private TasksPanel m_tasks;
- private ItemSearch m_search;
- private ACSObjectSelectionModel m_typeSel;
- private ACSObjectSelectionModel m_sectionSel;
-
- public static final String CONTENT_TYPE = "type_id";
- public static final String CONTENT_SECTION = "section_id";
-
- /**
- * Construct a new CMSPageWorkspacePage
- */
- public CMSPageWorkspacePage() { // Constructor Page
-
- /* specifically invokes PresentationManager / PageTransformer to create
- * a page instantiation. */
- super(new Label( GlobalizationUtil.globalize
- ("cms.ui.content_center")),
- new SimpleContainer());
-
- setClassAttr("cms-admin");
-
- BigDecimalParameter typeId = new BigDecimalParameter(CONTENT_TYPE);
- addGlobalStateParam(typeId);
- m_typeSel = new ACSObjectSelectionModel(ContentType.class.getName(),
- ContentType.BASE_DATA_OBJECT_TYPE,
- typeId);
-
- BigDecimalParameter sectionId = new BigDecimalParameter(CONTENT_SECTION);
- addGlobalStateParam(sectionId);
- m_sectionSel = new ACSObjectSelectionModel
- (ContentSection.class.getName(),
- ContentSection.BASE_DATA_OBJECT_TYPE,
- sectionId);
-
- add( new WorkspaceContextBar() );
- add( new GlobalNavigation() );
-
- m_tasks = getTasksPane(m_typeSel, m_sectionSel);
- m_search = getSearchPane();
-
- m_tabbedPane = createTabbedPane();
- m_tabbedPane.setIdAttr("page-body");
- add(m_tabbedPane);
-
- add(new DebugPanel());
- }
-
- /**
- * Creates, and then caches, the Tasks pane. Overriding this
- * method to return null will prevent this tab from appearing.
- */
- protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel,
- ACSObjectSelectionModel sectionModel) {
- if (m_tasks == null) {
- m_tasks = new TasksPanel(typeModel,sectionModel);
- }
- return m_tasks;
- }
-
- /**
- * Creates, and then caches, the Search pane. Overriding this
- * method to return null will prevent this tab from appearing.
- **/
- protected ItemSearch getSearchPane() {
- if (m_search == null) {
- m_search = new ItemSearch(ContentItem.DRAFT);
- }
-
- return m_search;
- }
-
-/*
- private SimpleContainer makeHeader() {
- PrintListener l = new PrintListener() {
- public void prepare(PrintEvent event) {
- PageState state = event.getPageState();
- Link link = (Link) event.getTarget();
-
- User user = KernelHelper.getCurrentUser(state.getRequest());
-
- link.setChild(new Label(user.getName()));
- link.setTarget("/pvt/");
- }
- };
-
- SimpleContainer sc = new SimpleContainer();
- Label welcomeLabel = new Label(GlobalizationUtil.globalize("cms.ui.welcome"));
- Link nameLink = new Link(l);
-
- sc.add(welcomeLabel);
- sc.add(nameLink);
- return sc;
-
- }
-*/
-
- /**
- * Created the TabbedPane to use for this page.
- *
- * This is the "index" page, displayed at the base address (content-center
- * by default).
- *
- * Sets the class attribute for this tabbed pane. The default implementation
- * uses a {@link com.arsdigita.bebop.TabbedPane} and sets the class
- * attribute to "CMS Admin." This implementation also adds tasks,
- * content sections, and search panes.
- *
- * Developers can override this method to add only the tabs they want,
- * or to add additional tabs after the default CMS tabs are added.
- */
- protected TabbedPane createTabbedPane() {
- TabbedPane pane = new TabbedPane();
- pane.setClassAttr(XSL_CLASS);
- addToPane(pane, "Tasks/Sections", getTasksPane(m_typeSel, m_sectionSel));
- addToPane(pane, "Search", getSearchPane());
- pane.addActionListener(this);
- return pane;
- }
-
-
- /**
- * Adds the specified component, with the specified tab name, to the
- * tabbed pane only if it is not null.
- *
- * @param pane The pane to which to add the tab
- * @param tabName The name of the tab if it's added
- * @param comp The component to add to the pane
- **/
- protected void addToPane(TabbedPane pane, String tabName, Component comp) {
- if (comp != null) {
- pane.addTab(tabName, comp);
- }
- }
-
-
- /**
- * When a new tab is selected, reset the state of the
- * formerly-selected pane.
- *
- * @param event The event fired by selecting a tab
- */
- public void actionPerformed(ActionEvent event) {
- PageState state = event.getPageState();
- Component pane = m_tabbedPane.getCurrentPane(state);
-
- if ( pane == m_tasks ) {
- m_tasks.reset(state);
- } else if ( pane == m_search ) {
- m_search.reset(state);
- }
- }
-}
Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java.nolongerInUse
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java.nolongerInUse (rev 0)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java.nolongerInUse 2013-02-02 23:34:47 UTC (rev 2477)
@@ -0,0 +1,205 @@
+/*
+ * 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.cms.ui;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.bebop.TabbedPane;
+import com.arsdigita.bebop.event.ActionEvent;
+import com.arsdigita.bebop.event.ActionListener;
+import com.arsdigita.bebop.parameters.BigDecimalParameter;
+import com.arsdigita.cms.ContentItem;
+import com.arsdigita.cms.ContentSection;
+import com.arsdigita.cms.ContentType;
+import com.arsdigita.cms.dispatcher.CMSPage;
+import com.arsdigita.cms.ui.contentcenter.TasksPanel;
+import com.arsdigita.cms.util.GlobalizationUtil;
+import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
+import com.arsdigita.ui.DebugPanel;
+
+
+/**
+ * <p>The Content Center main page (index page). </p>
+ *
+ * This class uses the dispatcher based page creation mechanism.
+ *
+ * @author Jack Chung (fl...@ar...)
+ * @author Michael Pih (pi...@ar...)
+ * @version $Id: CMSPageWorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $
+ */
+public class CMSPageWorkspacePage extends CMSPage implements ActionListener {
+
+ private final static String XSL_CLASS = "CMS Admin";
+
+ private TabbedPane m_tabbedPane;
+
+ private TasksPanel m_tasks;
+ private ItemSearch m_search;
+ private ACSObjectSelectionModel m_typeSel;
+ private ACSObjectSelectionModel m_sectionSel;
+
+ public static final String CONTENT_TYPE = "type_id";
+ public static final String CONTENT_SECTION = "section_id";
+
+ /**
+ * Construct a new CMSPageWorkspacePage
+ */
+ public CMSPageWorkspacePage() { // Constructor Page
+
+ /* specifically invokes PresentationManager / PageTransformer to create
+ * a page instantiation. */
+ super(new Label( GlobalizationUtil.globalize
+ ("cms.ui.content_center")),
+ new SimpleContainer());
+
+ setClassAttr("cms-admin");
+
+ BigDecimalParameter typeId = new BigDecimalParameter(CONTENT_TYPE);
+ addGlobalStateParam(typeId);
+ m_typeSel = new ACSObjectSelectionModel(ContentType.class.getName(),
+ ContentType.BASE_DATA_OBJECT_TYPE,
+ typeId);
+
+ BigDecimalParameter sectionId = new BigDecimalParameter(CONTENT_SECTION);
+ addGlobalStateParam(sectionId);
+ m_sectionSel = new ACSObjectSelectionModel
+ (ContentSection.class.getName(),
+ ContentSection.BASE_DATA_OBJECT_TYPE,
+ sectionId);
+
+ add( new WorkspaceContextBar() );
+ add( new GlobalNavigation() );
+
+ m_tasks = getTasksPane(m_typeSel, m_sectionSel);
+ m_search = getSearchPane();
+
+ m_tabbedPane = createTabbedPane();
+ m_tabbedPane.setIdAttr("page-body");
+ add(m_tabbedPane);
+
+ add(new DebugPanel());
+ }
+
+ /**
+ * Creates, and then caches, the Tasks pane. Overriding this
+ * method to return null will prevent this tab from appearing.
+ */
+ protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel,
+ ACSObjectSelectionModel sectionModel) {
+ if (m_tasks == null) {
+ m_tasks = new TasksPanel(typeModel,sectionModel);
+ }
+ return m_tasks;
+ }
+
+ /**
+ * Creates, and then caches, the Search pane. Overriding this
+ * method to return null will prevent this tab from appearing.
+ **/
+ protected ItemSearch getSearchPane() {
+ if (m_search == null) {
+ m_search = new ItemSearch(ContentItem.DRAFT);
+ }
+
+ return m_search;
+ }
+
+/*
+ private SimpleContainer makeHeader() {
+ PrintListener l = new PrintListener() {
+ public void prepare(PrintEvent event) {
+ PageState state = event.getPageState();
+ Link link = (Link) event.getTarget();
+
+ User user = KernelHelper.getCurrentUser(state.getRequest());
+
+ link.setChild(new Label(user.getName()));
+ link.setTarget("/pvt/");
+ }
+ };
+
+ SimpleContainer sc = new SimpleContainer();
+ Label welcomeLabel = new Label(GlobalizationUtil.globalize("cms.ui.welcome"));
+ Link nameLink = new Link(l);
+
+ sc.add(welcomeLabel);
+ sc.add(nameLink);
+ return sc;
+
+ }
+*/
+
+ /**
+ * Created the TabbedPane to use for this page.
+ *
+ * This is the "index" page, displayed at the base address (content-center
+ * by default).
+ *
+ * Sets the class attribute for this tabbed pane. The default implementation
+ * uses a {@link com.arsdigita.bebop.TabbedPane} and sets the class
+ * attribute to "CMS Admin." This implementation also adds tasks,
+ * content sections, and search panes.
+ *
+ * Developers can override this method to add only the tabs they want,
+ * or to add additional tabs after the default CMS tabs are added.
+ */
+ protected TabbedPane createTabbedPane() {
+ TabbedPane pane = new TabbedPane();
+ pane.setClassAttr(XSL_CLASS);
+ addToPane(pane, "Tasks/Sections", getTasksPane(m_typeSel, m_sectionSel));
+ addToPane(pane, "Search", getSearchPane());
+ pane.addActionListener(this);
+ return pane;
+ }
+
+
+ /**
+ * Adds the specified component, with the specified tab name, to the
+ * tabbed pane only if it is not null.
+ *
+ * @param pane The pane to which to add the tab
+ * @param tabName The name of the tab if it's added
+ * @param comp The component to add to the pane
+ **/
+ protected void addToPane(TabbedPane pane, String tabName, Component comp) {
+ if (comp != null) {
+ pane.addTab(tabName, comp);
+ }
+ }
+
+
+ /**
+ * When a new tab is selected, reset the state of the
+ * formerly-selected pane.
+ *
+ * @param event The event fired by selecting a tab
+ */
+ public void actionPerformed(ActionEvent event) {
+ PageState state = event.getPageState();
+ Component pane = m_tabbedPane.getCurrentPane(state);
+
+ if ( pane == m_tasks ) {
+ m_tasks.reset(state);
+ } else if ( pane == m_search ) {
+ m_search.reset(state);
+ }
+ }
+}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java 2013-02-02 23:31:41 UTC (rev 2476)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java 2013-02-02 23:34:47 UTC (rev 2477)
@@ -24,16 +24,14 @@
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.ContentType;
+import com.arsdigita.cms.ui.CMSApplicationPage;
import com.arsdigita.cms.ui.GlobalNavigation;
import com.arsdigita.cms.ui.ItemSearch;
import com.arsdigita.cms.ui.WorkspaceContextBar;
import com.arsdigita.cms.util.GlobalizationUtil;
-import com.arsdigita.kernel.User;
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
import com.arsdigita.ui.DebugPanel;
-import com.arsdigita.web.Web;
-import com.arsdigita.xml.Document;
-import com.arsdigita.xml.Element;
+
import org.apache.log4j.Logger;
@@ -49,7 +47,7 @@
* @author Peter Boy (pb...@ba...)
* @version $Id: MainPage.java pboy $
*/
-public class MainPage extends Page implements ActionListener {
+public class MainPage extends CMSApplicationPage implements ActionListener {
private static final Logger s_log = Logger.getLogger(MainPage.class);
@@ -109,7 +107,8 @@
add(new DebugPanel());
/* Page complete, locked now. */
- lock();
+ // lock();
+ init();
}
/**
@@ -168,11 +167,8 @@
* attribute to "CMS Admin." This implementation also adds tasks,
* content sections, and search panes.
*
- *<p>
- *
- * Developers can override this method to add only the tabs they
- * want, or to add additional tabs after the default CMS tabs are
- * added.
+ * Developers can override this method to add only the tabs they want,
+ * or to add additional tabs after the default CMS tabs are added.
**/
protected TabbedPane createTabbedPane() {
TabbedPane pane = new TabbedPane();
@@ -216,31 +212,4 @@
}
}
- /**
- * Overwrites bebop.Page#generateXMLHelper to add the name of the user
- * logged in to the page (displayed as part of the header).
- * @param ps
- * @param parent
- * @return
- */
- // ToDo: This code fragment is used by several pages of CMS package. It
- // should be factored out into a kind of CMSBasePage, as it had been in
- // the deprecated CMSPage.
- // Should be checked when refactoring the content section pages to work
- // as bebop pages without dispatcher mechanism and in new style application.
- @Override
- protected Element generateXMLHelper(PageState ps, Document parent) {
-
- /* Retain elements already included. */
- Element page = super.generateXMLHelper(ps,parent);
-
- /* Add name of user logged in. */
- User user = Web.getContext().getUser();
- if ( user != null ) {
- page.addAttribute("name",user.getDisplayName());
- }
-
- return page;
- }
-
}
|
|
From: <pb...@fe...> - 2013-02-02 23:31:58
|
Author: pboy
Date: 2013-02-02 23:31:41 +0000 (Sat, 02 Feb 2013)
New Revision: 2476
Modified:
trunk/ccm-bundle/bundles/demo/cfg/integration.properties
trunk/ccm-bundle/bundles/demo/cfg/web-ccm.xml
trunk/ccm-bundle/bundles/devel/cfg/integration.properties
trunk/ccm-bundle/bundles/devel/cfg/web-ccm.xml
trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/dispatcher/MultilingualDocumentResolver.java
trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java
trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/SearchPane.java
trunk/ccm-ldn-aplaws/bundles/base/cfg/integration.properties
trunk/ccm-ldn-aplaws/bundles/base/cfg/web.xml
trunk/ccm-ldn-aplaws/bundles/complete/cfg/integration.properties
trunk/ccm-ldn-aplaws/bundles/complete/cfg/web.xml
trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties
trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml
trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties
trunk/ccm-ldn-aplaws/bundles/standard/cfg/web.xml
Log:
Adaptation of various package to change in 2475.
Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties
===================================================================
--- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2013-02-02 23:31:41 UTC (rev 2476)
@@ -1,5 +1,10 @@
-# Libre CMS demo bundle integration.properties
+# ##############################################################################
+# Libre CMS demo bundle integration.properties, version 2.0.x
+# ##############################################################################
#
+#
+# CORE BEBOP configuration parameters
+# ##############################################################################
waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage
#
; dhtml editor to use (system wide)
@@ -11,7 +16,10 @@
waf.categorization.show_internal_name=true
waf.dispatcher.default_expiry=3600
-;
+
+
+# CORE KERNEL configuration parameters
+# ##############################################################################
waf.kernel.data_permission_check_enabled=false
waf.kernel.primary_user_identifier=email
; if you activate screen_name, forum loader does not work.
@@ -19,29 +27,78 @@
waf.kernel.supported_languages=de,en
waf.kernel.language_independent_items=true
-; security.properties:
+# CORE KERNEL.SECURITY configuration parameters
+# ##############################################################################
+; waf.login_config resembles DEFAULTS, but leaves off RegisterSSO, TODO CHECK!!
+; config file is cad.kernel.security.SecurityConfig
+; waf.login_config=Request\:com.arsdigita.kernel.security.AdminLoginModule\:sufficient,Request\:com.arsdigita.kernel.security.RecoveryLoginModule\:sufficient,Request\:com.arsdigita.kernel.security.CookieLoginModule\:requisite,Register\:com.arsdigita.kernel.security.LocalLoginModule\:requisite,Register\:com.arsdigita.kernel.security.UserIDLoginModule\:requisite,Register\:com.arsdigita.kernel.security.CookieLoginModule\:optional
waf.auto_registration_on=false
+# CORE MAIL configuration parameters
+# ##############################################################################
+waf...@li...
+
+
+# CORE SEARCH.LUCENE configuration parameters
+# ##############################################################################
+waf.search.indexer=lucene
+; Below parameter used in version 1.0.4, now outdated und not valid anymore
+; May be useful to chech the lucene serach functionality. Has to be deleted
+; after all QA testing
+; waf.lucene.location=/var/ccm-devel/web/redhat/intratest/data/lucene
+
+
+# CORE TEMPLATING configuration parameters
+# ##############################################################################
; Searches for localized style sheet (among others)
waf.templating.stylesheet_resolver=com.arsdigita.templating.PatternStylesheetResolver
waf.templating.stylesheet_paths=/WEB-INF/resources/librecms-stylesheet-paths.txt
-core.ui.pagemap.root_page_url=navigation/
-core.ui.pagemap.workspace_url=navigation/
-core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
+# CORE UI configuration parameters
+# ##############################################################################
+core.ui.pagemap.root_page_url=/portal/
+#core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
+core.ui.pagemap.user_redirect_url=/content-center/
+core.ui.pagemap.workspace_url=/portal/
+# With version 2 moved from kernel/security to ui rsp ui.permissions and
+# no longer intended to be user configurable.
+# TODO CHECK what these URLS (esp. ../one) is used for.
+# waf.pagemap.permission=permissions/ ; DEFAULT
+# waf.pagemap.perm_single=permissions/one
-; workflow configuration
+
+# CORE WEB configuration parameters
+# ##############################################################################
+# TODO: Check what exactly happens with/without this parameter set
+;waf.web.cache_policy=none
+; Default value is FALSE
+;waf.web.deactivate_cache_host_notifications=true
+;waf.web.dynamic_host_provider=com.arsdigita.util.servlet.HttpHost.SubsiteDynamicHostProvider
+
+
+# CORE WORKFLOW configuration parameters
+# ##############################################################################
waf.workflow.simple.alerts_enabled=true
waf...@li...
-; Configures the xml processing
+# CORE XML processing configuration parameters
+# ##############################################################################
waf.xml.xsl_transformer=xalan
waf.xml.activate_full_date_formatter=true
-# ccm-cms parameters
-com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker
+# CMS configuration parameters
+# ##############################################################################
+com.arsdigita.cms.allow_content_create_in_section_listing=false
+
+# In order to create several content-section uncomment the line below and
+# list the desired content section names
+#com.arsdigita.cms.loader.section_names=generic,openccm,homepages
+
+# Replace CMS category form with a terms specific widget
+com.arsdigita.cms.category_authoring_add_form=com.arsdigita.london.terms.ui.ItemCategoryPicker
+
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver
@@ -66,6 +123,13 @@
com.arsdigita.cms.hide_timezone=true
com.arsdigita.cms.hide_udct_ui=true
+com.arsdigita.cms.image_browser.thumbnail_max_width=200
+com.arsdigita.cms.image_browser.thumbnail_max_height=150
+
+com.arsdigita.cms.soon_expired_timespan_days=7
+com.arsdigita.cms.soon_expired_timespan_months=0
+
+com.arsdigita.cms.unpublished_not_found=false
com.arsdigita.cms.use_section_categories=false
com.arsdigita.cms.use_streamlined_creation=true
@@ -93,8 +157,21 @@
com.arsdigita.forum.allow_quick_finish=true
com.arsdigita.forum.disable_page_caching=true
+# AtoZ configuration parameters
+# ##############################################################################
+com.arsdigita.atoz.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
-# ccm-navigation application
+# FORUM application
+# ##############################################################################
+# com.arsdigita.forum.admin_can_edit_posts=true ; DEFAULT anyway
+com.arsdigita.forum.allow_quick_finish=true
+# com.arsdigita.forum.author_can_edit_posts=true ; DEFAULT anyway
+com.arsdigita.forum.disable_page_caching=true
+com.arsdigita.forum.show_new_tabs=true
+com.arsdigita.forum.use_wysiwyg_editor=true
+
+# NAVIGATION application
+# ##############################################################################
; com.arsdigita.navigation.category_menu_show_grand_children_min=1
; com.arsdigita.navigation.category_menu_show_grand_children=adaptive
; com.arsdigita.navigation.category_menu_show_grand_children_limit=1
@@ -106,13 +183,8 @@
com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt
-# ccm-search application
-com.arsdigita.london.search.show_sponsored_links=true
-; Comment this out or increase the num_of_threads iv you really use remote search
-com.arsdigita.london.search.num_threads=0
-
-
-# ccm-subsite application
+# SUBSITE configuration parameters
+# ##############################################################################
com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
@@ -123,16 +195,35 @@
# Required to denote the dir containing the default theme!
themedirector.default_theme_path=themes/static/aplaws-generic
+# LDN-SEARCH application
+# ##############################################################################
+com.arsdigita.london.search.show_sponsored_links=true
+; Comment this out or increase the num_of_threads if you really use remote search
+com.arsdigita.london.search.num_threads=0
-# ccm-bundle (Loader only)
+# AUTH-HTTP application
+# ##############################################################################
+aut...@ap...
+auth.http.admin_identifier=webmaster
+
+# LDN Dublin Core configuration parameters
+# ##############################################################################
+com.arsdigita.london.cms.dublin.audience_domain=LGAL
+
+# ccm-bundle integration package configuration parameter
+# ##############################################################################
+# ccm-sci-bundle (Loader only)
#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml
#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu
#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/
-# =============================================================================================
+
+
+# ==============================================================================
# runtime specific configurations
+# ==============================================================================
waf...@li...
-waf.admin.name.given=SCI
+waf.admin.name.given=LibreCMS
waf.admin.name.family=Administrator
waf.admin.password=lib2000
waf.admin.password.question=12345
Modified: trunk/ccm-bundle/bundles/demo/cfg/web-ccm.xml
===================================================================
--- trunk/ccm-bundle/bundles/demo/cfg/web-ccm.xml 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-bundle/bundles/demo/cfg/web-ccm.xml 2013-02-02 23:31:41 UTC (rev 2476)
@@ -92,6 +92,7 @@
<servlet-class>com.arsdigita.web.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
+
<servlet>
<servlet-name>cache-manager</servlet-name>
<servlet-class>com.arsdigita.caching.CacheServlet</servlet-class>
@@ -144,7 +145,7 @@
<servlet>
<servlet-name>content-center</servlet-name>
- <servlet-class>com.arsdigita.cms.WorkspaceServlet</servlet-class>
+ <servlet-class>com.arsdigita.cms.ContentCenterServlet</servlet-class>
</servlet>
<servlet>
@@ -200,6 +201,16 @@
MODULES SERVLET DECLARATIONS SECTION
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- module ccm-atoz - servlet definitions BEGIN -->
+ <servlet>
+ <servlet-name>atoz-files</servlet-name>
+ <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
+ <init-param>
+ <param-name>template-path</param-name>
+ <param-value>/templates/ccm-atoz</param-value>
+ </init-param>
+ </servlet>
+ <!-- module ccm-atoz - servlet definitions END -->
<!-- module ccm-forum - servlet declarations BEGIN -->
<servlet>
@@ -333,6 +344,12 @@
MODULES SERVLET MAPPINGS SECTION
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- module ccm-atoz - servlet mappings BEGIN -->
+ <servlet-mapping>
+ <servlet-name>atoz-files</servlet-name>
+ <url-pattern>/ccm-atoz/files/*</url-pattern>
+ </servlet-mapping>
+ <!-- module ccm-atoz - servlet mappings END -->
<!-- module ccm-forum - servlet mappings BEGIN -->
<servlet-mapping>
Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties
===================================================================
--- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2013-02-02 23:31:41 UTC (rev 2476)
@@ -1,5 +1,10 @@
-# Libre CMS based on OpenCCM devel bundle integration.properties
+# ##############################################################################
+# Libre CMS based on OpenCCM devel bundle integration.properties, version 2.0.x
+# ##############################################################################
#
+#
+# CORE BEBOP configuration parameters
+# ##############################################################################
waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage
#
; dhtml editor to use (system wide)
@@ -11,7 +16,10 @@
waf.categorization.show_internal_name=true
waf.dispatcher.default_expiry=3600
-;
+
+
+# CORE KERNEL configuration parameters
+# ##############################################################################
waf.kernel.data_permission_check_enabled=false
waf.kernel.primary_user_identifier=email
; if you activate screen_name, forum loader does not work.
@@ -19,29 +27,78 @@
waf.kernel.supported_languages=en,de
waf.kernel.language_independent_items=true
-; security.properties:
+# CORE KERNEL.SECURITY configuration parameters
+# ##############################################################################
+; waf.login_config resembles DEFAULTS, but leaves off RegisterSSO, TODO CHECK!!
+; config file is cad.kernel.security.SecurityConfig
+; waf.login_config=Request\:com.arsdigita.kernel.security.AdminLoginModule\:sufficient,Request\:com.arsdigita.kernel.security.RecoveryLoginModule\:sufficient,Request\:com.arsdigita.kernel.security.CookieLoginModule\:requisite,Register\:com.arsdigita.kernel.security.LocalLoginModule\:requisite,Register\:com.arsdigita.kernel.security.UserIDLoginModule\:requisite,Register\:com.arsdigita.kernel.security.CookieLoginModule\:optional
waf.auto_registration_on=false
+# CORE MAIL configuration parameters
+# ##############################################################################
+waf...@li...
+
+
+# CORE SEARCH.LUCENE configuration parameters
+# ##############################################################################
+waf.search.indexer=lucene
+; Below parameter used in version 1.0.4, now outdated und not valid anymore
+; May be useful to chech the lucene serach functionality. Has to be deleted
+; after all QA testing
+; waf.lucene.location=/var/ccm-devel/web/redhat/intratest/data/lucene
+
+
+# CORE TEMPLATING configuration parameters
+# ##############################################################################
; Searches for localized style sheet (among others)
waf.templating.stylesheet_resolver=com.arsdigita.templating.PatternStylesheetResolver
waf.templating.stylesheet_paths=/WEB-INF/resources/librecms-stylesheet-paths.txt
-core.ui.pagemap.root_page_url=navigation/
-core.ui.pagemap.workspace_url=navigation/
-core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
+# CORE UI configuration parameters
+# ##############################################################################
+core.ui.pagemap.root_page_url=/portal/
+#core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
+core.ui.pagemap.user_redirect_url=/content-center/
+core.ui.pagemap.workspace_url=/portal/
+# With version 2 moved from kernel/security to ui rsp ui.permissions and
+# no longer intended to be user configurable.
+# TODO CHECK what these URLS (esp. ../one) is used for.
+# waf.pagemap.permission=permissions/ ; DEFAULT
+# waf.pagemap.perm_single=permissions/one
-; workflow configuration
+
+# CORE WEB configuration parameters
+# ##############################################################################
+# TODO: Check what exactly happens with/without this parameter set
+;waf.web.cache_policy=none
+; Default value is FALSE
+;waf.web.deactivate_cache_host_notifications=true
+;waf.web.dynamic_host_provider=com.arsdigita.util.servlet.HttpHost.SubsiteDynamicHostProvider
+
+
+# CORE WORKFLOW configuration parameters
+# ##############################################################################
waf.workflow.simple.alerts_enabled=true
-waf...@lo...
+waf...@li...
-; Configures the xml processing
+# CORE XML processing configuration parameters
+# ##############################################################################
waf.xml.xsl_transformer=xalan
waf.xml.activate_full_date_formatter=true
-# ccm-cms parameters
-com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker
+# CMS configuration parameters
+# ##############################################################################
+com.arsdigita.cms.allow_content_create_in_section_listing=false
+
+# In order to create several content-section uncomment the line below and
+# list the desired content section names
+#com.arsdigita.cms.loader.section_names=generic,openccm,homepages
+
+# Replace CMS category form with a terms specific widget
+com.arsdigita.cms.category_authoring_add_form=com.arsdigita.london.terms.ui.ItemCategoryPicker
+
com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp
com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver
@@ -57,7 +114,6 @@
; com.arsdigita.cms.dhtml_editor_hidden_buttons=
; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS
-com.arsdigita.cms.allow_content_create_in_section_listing=false
com.arsdigita.cms.disable_item_pfs=true
com.arsdigita.cms.hide_admin_tabs=true
@@ -67,6 +123,13 @@
com.arsdigita.cms.hide_timezone=true
com.arsdigita.cms.hide_udct_ui=true
+com.arsdigita.cms.image_browser.thumbnail_max_width=200
+com.arsdigita.cms.image_browser.thumbnail_max_height=150
+
+com.arsdigita.cms.soon_expired_timespan_days=7
+com.arsdigita.cms.soon_expired_timespan_months=0
+
+com.arsdigita.cms.unpublished_not_found=false
com.arsdigita.cms.use_section_categories=false
com.arsdigita.cms.use_streamlined_creation=true
@@ -94,8 +157,21 @@
com.arsdigita.forum.allow_quick_finish=true
com.arsdigita.forum.disable_page_caching=true
+# AtoZ configuration parameters
+# ##############################################################################
+com.arsdigita.atoz.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
-# ccm-navigation application
+# FORUM application
+# ##############################################################################
+# com.arsdigita.forum.admin_can_edit_posts=true ; DEFAULT anyway
+com.arsdigita.forum.allow_quick_finish=true
+# com.arsdigita.forum.author_can_edit_posts=true ; DEFAULT anyway
+com.arsdigita.forum.disable_page_caching=true
+com.arsdigita.forum.show_new_tabs=true
+com.arsdigita.forum.use_wysiwyg_editor=true
+
+# NAVIGATION application
+# ##############################################################################
; com.arsdigita.navigation.category_menu_show_grand_children_min=1
; com.arsdigita.navigation.category_menu_show_grand_children=adaptive
; com.arsdigita.navigation.category_menu_show_grand_children_limit=1
@@ -107,13 +183,8 @@
com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt
-# ccm-search application
-com.arsdigita.london.search.show_sponsored_links=true
-; Comment this out or increase the num_of_threads iv you really use remote search
-com.arsdigita.london.search.num_threads=0
-
-
-# ccm-subsite application
+# SUBSITE configuration parameters
+# ##############################################################################
com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
@@ -124,16 +195,34 @@
# Required to denote the dir containing the default theme!
themedirector.default_theme_path=themes/static/aplaws-generic
+# LDN-SEARCH application
+# ##############################################################################
+com.arsdigita.london.search.show_sponsored_links=true
+; Comment this out or increase the num_of_threads if you really use remote search
+com.arsdigita.london.search.num_threads=0
-# ccm-bundle (Loader only)
+# AUTH-HTTP application
+# ##############################################################################
+aut...@ap...
+auth.http.admin_identifier=webmaster
+
+# LDN Dublin Core configuration parameters
+# ##############################################################################
+com.arsdigita.london.cms.dublin.audience_domain=LGAL
+
+# ccm-bundle integration package configuration parameter
+# ##############################################################################
+# ccm-sci-bundle (Loader only)
#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml
#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu
#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/
-# =============================================================================================
+
+
+# ==============================================================================
# runtime specific configurations
-waf...@op...
-waf.admin.name.given=OpenCCM
+waf...@li...
+waf.admin.name.given=LibreCMS
waf.admin.name.family=Administrator
waf.admin.password=lib2000
waf.admin.password.question=12345
Modified: trunk/ccm-bundle/bundles/devel/cfg/web-ccm.xml
===================================================================
--- trunk/ccm-bundle/bundles/devel/cfg/web-ccm.xml 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-bundle/bundles/devel/cfg/web-ccm.xml 2013-02-02 23:31:41 UTC (rev 2476)
@@ -92,6 +92,7 @@
<servlet-class>com.arsdigita.web.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
+
<servlet>
<servlet-name>cache-manager</servlet-name>
<servlet-class>com.arsdigita.caching.CacheServlet</servlet-class>
@@ -144,7 +145,7 @@
<servlet>
<servlet-name>content-center</servlet-name>
- <servlet-class>com.arsdigita.cms.WorkspaceServlet</servlet-class>
+ <servlet-class>com.arsdigita.cms.ContentCenterServlet</servlet-class>
</servlet>
<servlet>
@@ -200,6 +201,16 @@
MODULES SERVLET DECLARATIONS SECTION
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- module ccm-atoz - servlet definitions BEGIN -->
+ <servlet>
+ <servlet-name>atoz-files</servlet-name>
+ <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
+ <init-param>
+ <param-name>template-path</param-name>
+ <param-value>/templates/ccm-atoz</param-value>
+ </init-param>
+ </servlet>
+ <!-- module ccm-atoz - servlet definitions END -->
<!-- module ccm-forum - servlet declarations BEGIN -->
<servlet>
@@ -333,6 +344,12 @@
MODULES SERVLET MAPPINGS SECTION
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- module ccm-atoz - servlet mappings BEGIN -->
+ <servlet-mapping>
+ <servlet-name>atoz-files</servlet-name>
+ <url-pattern>/ccm-atoz/files/*</url-pattern>
+ </servlet-mapping>
+ <!-- module ccm-atoz - servlet mappings END -->
<!-- module ccm-forum - servlet mappings BEGIN -->
<servlet-mapping>
Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/dispatcher/MultilingualDocumentResolver.java
===================================================================
--- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/dispatcher/MultilingualDocumentResolver.java 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/dispatcher/MultilingualDocumentResolver.java 2013-02-02 23:31:41 UTC (rev 2476)
@@ -32,7 +32,7 @@
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.Folder;
-import com.arsdigita.cms.Workspace;
+import com.arsdigita.cms.ContentCenter;
import com.arsdigita.cms.dispatcher.AbstractItemResolver;
import com.arsdigita.cms.dispatcher.CMSDispatcher;
import com.arsdigita.cms.dispatcher.CMSPage;
@@ -68,7 +68,7 @@
private static MasterPage s_masterP = null;
private static final String ADMIN_PREFIX = "admin";
- private static final String WORKSPACE_PREFIX = Workspace.getURL();
+ private static final String WORKSPACE_PREFIX = ContentCenter.getURL();
/**
* The string identifying an item's ID in the query string of a
Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java
===================================================================
--- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java 2013-02-02 23:31:41 UTC (rev 2476)
@@ -14,32 +14,9 @@
* Created on Dec 18, 2003
*
*/
-
package com.arsdigita.cms.docmgr.ui;
-import java.math.BigDecimal;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.apache.log4j.Logger;
-import com.arsdigita.bebop.ColumnPanel;
-import com.arsdigita.bebop.Component;
-import com.arsdigita.bebop.Container;
-import com.arsdigita.bebop.Form;
-import com.arsdigita.bebop.FormData;
-import com.arsdigita.bebop.FormProcessException;
-import com.arsdigita.bebop.GridPanel;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.ModalContainer;
-import com.arsdigita.bebop.Page;
-import com.arsdigita.bebop.PageState;
-import com.arsdigita.bebop.PaginationModelBuilder;
-import com.arsdigita.bebop.Paginator;
-import com.arsdigita.bebop.RequestLocal;
-import com.arsdigita.bebop.SegmentedPanel;
-import com.arsdigita.bebop.SimpleContainer;
-import com.arsdigita.bebop.Tree;
+import com.arsdigita.bebop.*;
import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
@@ -59,9 +36,8 @@
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.ContentSectionCollection;
import com.arsdigita.cms.docmgr.DocFolder;
-import com.arsdigita.cms.docmgr.DocMgr;
import com.arsdigita.cms.docmgr.DocLink;
-import com.arsdigita.cms.docmgr.Initializer;
+import com.arsdigita.cms.docmgr.DocMgr;
import com.arsdigita.cms.docmgr.search.SearchResults;
import com.arsdigita.cms.docmgr.search.SearchUtils;
import com.arsdigita.dispatcher.ObjectNotFoundException;
@@ -69,403 +45,426 @@
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
-import com.arsdigita.kernel.KernelHelper;
import com.arsdigita.kernel.User;
import com.arsdigita.kernel.permissions.PermissionService;
import com.arsdigita.util.StringUtils;
import com.arsdigita.util.UncheckedWrapperException;
+import java.math.BigDecimal;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import org.apache.log4j.Logger;
/**
+ * A UI Container class used to create instances of <code>DocLink</code> object
+ * type.
*
- * A UI Container class used to create instances of <code>DocLink</code> object type.
- *
- * Contains a simple Search Form to search Documents by name.
- * A table to display the results the of the search.
- * ActionLinks in the action column of <code>CreateDocLinkSearchTable</code>
- * are responsible to actually create the Links to the Document represented
- * in the corresponding row of the table.
- *
+ * Contains a simple Search Form to search Documents by name. A table to display
+ * the results the of the search. ActionLinks in the action column of
+ * <code>CreateDocLinkSearchTable</code> are responsible to actually create the
+ * Links to the Document represented in the corresponding row of the table.
+ *
* @author <a href="mailto:ss...@re...">Shashin Shinde</a>
- *
- * $Id: //apps/docmgr-cms/dev/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java#2 $
*
+ * $Id:
+ * //apps/docmgr-cms/dev/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java#2
+ * $
+ *
*/
+public class CreateDocLinkPane extends SimpleContainer
+ implements DMConstants {
-public class CreateDocLinkPane extends SimpleContainer
- implements DMConstants {
+ private static final Logger s_log = Logger.getLogger(
+ CreateDocLinkPane.class.getName());
- private static final Logger s_log = Logger.getLogger(CreateDocLinkPane.class.getName());
-
- public static final String PARAM_EDIT_DOCLINK_ID = "editDoclinkID";
- private static final String SEARCH_DOCUMENT = "searchDocument";
- private static final String TITLE = "title";
- private static final String DESCRIPTION = "description";
- private static final String EXTERNAL_URL = "url";
- private static final String CATEGORIES = "file-edit-cats";
+ public static final String PARAM_EDIT_DOCLINK_ID = "editDoclinkID";
+ private static final String SEARCH_DOCUMENT = "searchDocument";
+ private static final String TITLE = "title";
+ private static final String DESCRIPTION = "description";
+ private static final String EXTERNAL_URL = "url";
+ private static final String CATEGORIES = "file-edit-cats";
+ private final BigDecimalParameter m_doclinkIDParam =
+ new BigDecimalParameter(PARAM_EDIT_DOCLINK_ID);
+ private final TrimmedStringParameter m_searchDocsParam =
+ new TrimmedStringParameter(SEARCH_DOCUMENT);
+ private Label m_emptyLabel;
+ private Label m_errorMessages;
+ private Tree m_tree;
+ private Paginator m_paginator;
- private final BigDecimalParameter m_doclinkIDParam = new BigDecimalParameter(PARAM_EDIT_DOCLINK_ID);
- private final TrimmedStringParameter m_searchDocsParam = new TrimmedStringParameter(SEARCH_DOCUMENT);
- private Label m_emptyLabel;
- private Label m_errorMessages;
- private Tree m_tree;
- private Paginator m_paginator;
+ /**
+ * Constructor.
+ *
+ * @param parent to which this Table is added.Used to return after creating
+ * the link and cleaning up the Table selection.
+ * @param tree.Tree object to get the currently selected parent Folder under
+ * which to create the link.
+ * @param form.Search Form to get the terms to search for.
+ */
+ public CreateDocLinkPane(Component parent, Tree tree) {
+ m_tree = tree;
+ //Main Container.
+ //ColumnPanel m_mainContainer = new ColumnPanel(ColumnPanel.VERTICAL, true);
+ ColumnPanel m_mainContainer = new ColumnPanel(1);
- /**
- * Constructor.
- * @param parent to which this Table is added.Used to return after creating
- * the link and cleaning up the Table selection.
- * @param tree.Tree object to get the currently selected parent Folder under
- * which to create the link.
- * @param form.Search Form to get the terms to search for.
- */
- public CreateDocLinkPane(Component parent,Tree tree){
- m_tree = tree;
- //Main Container.
- //ColumnPanel m_mainContainer = new ColumnPanel(ColumnPanel.VERTICAL, true);
- ColumnPanel m_mainContainer = new ColumnPanel(1);
+ add(new Label(" "));
+ add(new Label(" "));
- add(new Label(" "));
- add(new Label(" "));
+ add(new Label(new GlobalizedMessage("ui.link.create.explanation", BUNDLE_NAME)),
+ ColumnPanel.LEFT);
- add( new Label
- (new GlobalizedMessage("ui.link.create.explanation", BUNDLE_NAME)),
- ColumnPanel.LEFT);
+ URLEntryForm m_entryForm = new URLEntryForm(new GridPanel(2), parent);
- URLEntryForm m_entryForm = new URLEntryForm(new GridPanel(2), parent);
+ m_mainContainer.add(m_entryForm);
+ m_mainContainer.add(new Label(" "));
+ m_mainContainer.add(new Label(" "));
- m_mainContainer.add(m_entryForm);
- m_mainContainer.add(new Label(" "));
- m_mainContainer.add(new Label(" "));
-
- //Add form at the top.
- SearchForm topSearchForm = new DocumentSearchForm(new GridPanel(2));
- m_mainContainer.add(topSearchForm);
- m_mainContainer.add(new Label(" ",false));
+ //Add form at the top.
+ SearchForm topSearchForm = new DocumentSearchForm(new GridPanel(2));
+ m_mainContainer.add(topSearchForm);
+ m_mainContainer.add(new Label(" ", false));
- //Bottom SegmentedPanel
- SegmentedPanel bottom = new SegmentedPanel();
- bottom.setClassAttr("main");
+ //Bottom SegmentedPanel
+ SegmentedPanel bottom = new SegmentedPanel();
+ bottom.setClassAttr("main");
- //Header for the Bottom panel which displays the results.
- ModalContainer m_segmentHeader = new ModalContainer();
- m_emptyLabel = new Label("Search Results");
- m_segmentHeader.add(m_emptyLabel);
- m_segmentHeader.setDefaultComponent(m_emptyLabel);
+ //Header for the Bottom panel which displays the results.
+ ModalContainer m_segmentHeader = new ModalContainer();
+ m_emptyLabel = new Label("Search Results");
+ m_segmentHeader.add(m_emptyLabel);
+ m_segmentHeader.setDefaultComponent(m_emptyLabel);
- //Search Results Component.
- final CreateDocLinkSearchTable m_search = new CreateDocLinkSearchTable(this,parent,tree,topSearchForm);
+ //Search Results Component.
+ final CreateDocLinkSearchTable m_search =
+ new CreateDocLinkSearchTable(this, parent, tree, topSearchForm);
- m_entryForm.addInitListener( new FormInitListener() {
- public void init(FormSectionEvent e) throws FormProcessException {
- m_search.clearSelection(e.getPageState());
- e.getPageState().setValue(m_searchDocsParam, null);
- }
- } );
+ m_entryForm.addInitListener(new FormInitListener() {
- m_paginator = new Paginator(
- (PaginationModelBuilder)m_search.getModelBuilder(),
- CreateDocLinkSearchTable.PAGE_SIZE);
- bottom.addSegment(m_segmentHeader,m_paginator);
- m_paginator.setHiddenIfSinglePage(false);
- m_mainContainer.add(bottom);
- m_errorMessages = new Label("");
- m_errorMessages.setColor(Color.red);
- m_mainContainer.add(m_errorMessages);
+ public void init(FormSectionEvent e) throws FormProcessException {
+ m_search.clearSelection(e.getPageState());
+ e.getPageState().setValue(m_searchDocsParam, null);
+ }
+ });
- //Add Search Results table
- m_mainContainer.add(m_search);
- add(m_mainContainer);
- }
+ m_paginator = new Paginator(
+ (PaginationModelBuilder) m_search.getModelBuilder(),
+ CreateDocLinkSearchTable.PAGE_SIZE);
+ bottom.addSegment(m_segmentHeader, m_paginator);
+ m_paginator.setHiddenIfSinglePage(false);
+ m_mainContainer.add(bottom);
+ m_errorMessages = new Label("");
+ m_errorMessages.setColor(Color.red);
+ m_mainContainer.add(m_errorMessages);
- /* Register state parameters */
- public void register(Page p) {
- super.register(p);
- p.addGlobalStateParam(m_doclinkIDParam);
- p.addGlobalStateParam(m_searchDocsParam);
- }
-
- Label getErrorLable(){
- return m_errorMessages;
- }
+ //Add Search Results table
+ m_mainContainer.add(m_search);
+ add(m_mainContainer);
+ }
- public BigDecimalParameter getEditDoclinkIDParam() {
- return m_doclinkIDParam;
- }
-
+ /*
+ * Register state parameters
+ */
+ public void register(Page p) {
+ super.register(p);
+ p.addGlobalStateParam(m_doclinkIDParam);
+ p.addGlobalStateParam(m_searchDocsParam);
+ }
- private class URLEntryForm extends Form
- implements FormInitListener, FormValidationListener, FormProcessListener {
+ Label getErrorLable() {
+ return m_errorMessages;
+ }
-// public static final String PARAM_DOC_LINK_ID = "doclinkID";
- private Submit m_submit;
+ public BigDecimalParameter getEditDoclinkIDParam() {
+ return m_doclinkIDParam;
+ }
- TrimmedStringParameter m_title;
- TrimmedStringParameter m_description;
- URLParameter m_URL;
- ArrayParameter m_cats;
- Component m_parent;
+ private class URLEntryForm extends Form
+ implements FormInitListener,
+ FormValidationListener,
+ FormProcessListener {
+
+// public static final String PARAM_DOC_LINK_ID = "doclinkID";
+ private Submit m_submit;
+ TrimmedStringParameter m_title;
+ TrimmedStringParameter m_description;
+ URLParameter m_URL;
+ ArrayParameter m_cats;
+ Component m_parent;
// BigDecimalParameter m_doclinkID = new BigDecimalParameter(PARAM_DOC_LINK_ID);
-
- public URLEntryForm(Container panel, Component parent) {
- super("urlEntry",panel);
- setMethod(Form.POST);
- m_parent = parent;
- m_title = new TrimmedStringParameter(TITLE);
- m_description = new TrimmedStringParameter(DESCRIPTION);
- m_URL = new URLParameter(EXTERNAL_URL);
- add(new Label("Title:"));
- TextField title = new TextField(m_title);
+ public URLEntryForm(Container panel, Component parent) {
+ super("urlEntry", panel);
+ setMethod(Form.POST);
+ m_parent = parent;
+ m_title = new TrimmedStringParameter(TITLE);
+ m_description = new TrimmedStringParameter(DESCRIPTION);
+ m_URL = new URLParameter(EXTERNAL_URL);
+
+ add(new Label("Title:"));
+ TextField title = new TextField(m_title);
// title.addValidationListener(new NotEmptyValidationListener());
- add(title);
- add(new Label("Description (optional):"));
+ add(title);
+ add(new Label("Description (optional):"));
// TextField desc = new TextField(m_description);
// desc.setSize(70);
- TextArea desc = new TextArea(m_description);
- desc.setRows(10);
- desc.setCols(40);
- add(desc);
- add(new Label("URL (must begin with \"http://\" or \"https://\"):"));
- TextField url = new TextField(m_URL);
- url.setSize(70);
+ TextArea desc = new TextArea(m_description);
+ desc.setRows(10);
+ desc.setCols(40);
+ add(desc);
+ add(new Label("URL (must begin with \"http://\" or \"https://\"):"));
+ TextField url = new TextField(m_URL);
+ url.setSize(70);
// url.addValidationListener(new NotEmptyValidationListener());
// url.addValidationListener(new URLValidationListener());
- add(url);
- add(new Label(FILE_CATEGORIES));
- m_cats = new ArrayParameter(CATEGORIES);
- MultipleSelect catSelect = new MultipleSelect(CATEGORIES);
- catSelect.setSize(20);
- try {
- catSelect.addPrintListener(new CategoriesPrintListener(getContentSection(), getEditDoclinkIDParam()));
- }
- catch (java.util.TooManyListenersException tmex) {
- throw new UncheckedWrapperException(tmex.getMessage());
- }
- add(catSelect);
- m_submit = new Submit("submitButton", "Save Link");
- add(m_submit, GridPanel.RIGHT);
- add(new Submit("cancelButton", "Cancel"));
+ add(url);
+ add(new Label(FILE_CATEGORIES));
+ m_cats = new ArrayParameter(CATEGORIES);
+ MultipleSelect catSelect = new MultipleSelect(CATEGORIES);
+ catSelect.setSize(20);
+ try {
+ catSelect.addPrintListener(new CategoriesPrintListener(
+ getContentSection(),
+ getEditDoclinkIDParam()));
+ } catch (java.util.TooManyListenersException tmex) {
+ throw new UncheckedWrapperException(tmex.getMessage());
+ }
+ add(catSelect);
+ m_submit = new Submit("submitButton", "Save Link");
+ add(m_submit, GridPanel.RIGHT);
+ add(new Submit("cancelButton", "Cancel"));
// add(new Hidden(m_doclinkID));
- addInitListener(this);
- addValidationListener(this);
- addProcessListener(this);
- }
+ addInitListener(this);
+ addValidationListener(this);
+ addProcessListener(this);
+ }
- private ContentSection getContentSection() {
- ContentSectionCollection csc = ContentSection.getAllSections();
- csc.addEqualsFilter("label", DocMgr.getConfig().getContentSection());
- if (!csc.next()) {
- csc.close();
- return null;
- }
- ContentSection cs = csc.getContentSection();
- csc.close();
- return cs;
- }
+ private ContentSection getContentSection() {
+ ContentSectionCollection csc = ContentSection.getAllSections();
+ csc.addEqualsFilter("label", DocMgr.getConfig().getContentSection());
+ if (!csc.next()) {
+ csc.close();
+ return null;
+ }
+ ContentSection cs = csc.getContentSection();
+ csc.close();
+ return cs;
+ }
- public void init(FormSectionEvent e) {
- PageState state = e.getPageState();
- BigDecimal id = (BigDecimal) state.getValue(m_doclinkIDParam);
- if (id != null) {
- DocLink doclink = new DocLink(id);
- FormData fd = e.getFormData();
+ public void init(FormSectionEvent e) {
+ PageState state = e.getPageState();
+ BigDecimal id = (BigDecimal) state.getValue(m_doclinkIDParam);
+ if (id != null) {
+ DocLink doclink = new DocLink(id);
+ FormData fd = e.getFormData();
// fd.put(PARAM_DOC_LINK_ID, id);
- if (doclink.isExternal()) {
- fd.put(TITLE, doclink.getTitle());
- fd.put(DESCRIPTION, doclink.getDescription());
- fd.put(EXTERNAL_URL, doclink.getExternalURL());
+ if (doclink.isExternal()) {
+ fd.put(TITLE, doclink.getTitle());
+ fd.put(DESCRIPTION, doclink.getDescription());
+ fd.put(EXTERNAL_URL, doclink.getExternalURL());
- ArrayList assignedCats = new ArrayList();
+ ArrayList assignedCats = new ArrayList();
- CategoryCollection cats = doclink.getCategoryCollection();
- Category cat;
- if (cats.next()) {
- cat = cats.getCategory();
- String catID = cat.getID().toString();
- assignedCats.add(catID);
- }
- fd.put(CATEGORIES, assignedCats.toArray());
- }
- }
- }
+ CategoryCollection cats = doclink.getCategoryCollection();
+ Category cat;
+ if (cats.next()) {
+ cat = cats.getCategory();
+ String catID = cat.getID().toString();
+ assignedCats.add(catID);
+ }
+ fd.put(CATEGORIES, assignedCats.toArray());
+ }
+ }
+ }
- public void validate(FormSectionEvent e) throws FormProcessException {
- PageState state = e.getPageState();
- if(m_submit.isSelected(state)) {
- FormData fd = e.getFormData();
-
- String title = (String) fd.get(TITLE);
- if (title == null || title.trim().length() == 0) {
- fd.addError(TITLE, "This parameter is required");
- }
- //validate length of title
- if (title != null && title.length() > 1000) {
- fd.addError(TITLE, "This parameter is too long. It must be fewer than 1000 characters.");
- }
-
- String url = (String) fd.get(EXTERNAL_URL);
- if (url == null || url.trim().length() == 0) {
- fd.addError(EXTERNAL_URL, "This parameter is required");
- }
- if (url != null && url.length() > 4000) {
- fd.addError(EXTERNAL_URL, "This parameter is too long. It must be fewer than 4000 characters.");
- }
- try {
- new URL(url);
- } catch (MalformedURLException ex) {
- fd.addError(EXTERNAL_URL, "Please enter a URL");
- }
-
- //validate length of description
- String desc = (String) fd.get(DESCRIPTION);
- if (desc != null && desc.length() > 4000) {
- fd.addError(DESCRIPTION, "This parameter is too long. It must be fewer than 4000 characters.");
- }
- }
- }
-
- /**Just a dummy run to cache the results in RequestLocal object.*/
- public void process(FormSectionEvent e) {
- PageState state = e.getPageState();
- FormData fd = e.getFormData();
- if(m_submit.isSelected(state)) {
+ public void validate(FormSectionEvent e) throws FormProcessException {
+ PageState state = e.getPageState();
+ if (m_submit.isSelected(state)) {
+ FormData fd = e.getFormData();
- final DocFolder parent = getSelectedFolder(state);
+ String title = (String) fd.get(TITLE);
+ if (title == null || title.trim().length() == 0) {
+ fd.addError(TITLE, "This parameter is required");
+ }
+ //validate length of title
+ if (title != null && title.length() > 1000) {
+ fd.addError(TITLE, "This parameter is too long. It must be fewer than 1000 characters.");
+ }
- ContentBundle bundle;
+ String url = (String) fd.get(EXTERNAL_URL);
+ if (url == null || url.trim().length() == 0) {
+ fd.addError(EXTERNAL_URL, "This parameter is required");
+ }
+ if (url != null && url.length() > 4000) {
+ fd.addError(EXTERNAL_URL, "This parameter is too long. It must be fewer than 4000 characters.");
+ }
+ try {
+ new URL(url);
+ } catch (MalformedURLException ex) {
+ fd.addError(EXTERNAL_URL, "Please enter a URL");
+ }
- //Reached here indicates we can now proceed with Link Creation.
- DocLink link;
- BigDecimal id = (BigDecimal) state.getValue(m_doclinkIDParam);
- if (id != null) {
- link = new DocLink(id);
- bundle = link.getContentBundle();
+ //validate length of description
+ String desc = (String) fd.get(DESCRIPTION);
+ if (desc != null && desc.length() > 4000) {
+ fd.addError(DESCRIPTION, "This parameter is too long. It must be fewer than 4000 characters.");
+ }
}
- else {
- link = new DocLink();
- link.setName((String) fd.get(TITLE));
-
- //FIXME: when our client decides upon what permissions to adopt , change this one
- //and permissions code accordingly.
- link.setRepository(DocFolder.getRepository(parent));
- link.setLanguage("en");
+ }
- bundle = new ContentBundle(link);
- bundle.setParent(parent);
- bundle.setContentSection(parent.getContentSection());
- bundle.save();
+ /**
+ * Just a dummy run to cache the results in RequestLocal object.
+ */
+ public void process(FormSectionEvent e) {
+ PageState state = e.getPageState();
+ FormData fd = e.getFormData();
+ if (m_submit.isSelected(state)) {
- final ContentBundle bundleFinal = bundle;
-
- new KernelExcursion() {
- protected void excurse() {
- setParty(Kernel.getSystemParty());
- PermissionService.setContext(bundleFinal, parent);
+ final DocFolder parent = getSelectedFolder(state);
+
+ ContentBundle bundle;
+
+ //Reached here indicates we can now proceed with Link Creation.
+ DocLink link;
+ BigDecimal id = (BigDecimal) state.getValue(m_doclinkIDParam);
+ if (id != null) {
+ link = new DocLink(id);
+ bundle = link.getContentBundle();
+ } else {
+ link = new DocLink();
+ link.setName((String) fd.get(TITLE));
+
+ //FIXME: when our client decides upon what permissions
+ // to adopt , change this one
+ //and permissions code accordingly.
+ link.setRepository(DocFolder.getRepository(parent));
+ link.setLanguage("en");
+
+ bundle = new ContentBundle(link);
+ bundle.setParent(parent);
+ bundle.setContentSection(parent.getContentSection());
+ bundle.save();
+
+ final ContentBundle bundleFinal = bundle;
+
+ new KernelExcursion() {
+
+ protected void excurse() {
+ setParty(Kernel.getSystemParty());
+ PermissionService.setContext(bundleFinal, parent);
+ }
+ }.run();
}
- }.run();
+ link.setName((String) fd.get(TITLE));
+ link.setTitle((String) fd.get(TITLE));
+ link.setDescription((String) fd.get(DESCRIPTION));
+ link.setExternalURL((String) fd.get(EXTERNAL_URL));
+ link.setCategories((String[]) fd.get(CATEGORIES));
+ //((Table) e.getSource()).clearSelection(state);
}
- link.setName((String) fd.get(TITLE));
- link.setTitle((String) fd.get(TITLE));
- link.setDescription((String) fd.get(DESCRIPTION));
- link.setExternalURL((String) fd.get(EXTERNAL_URL));
- link.setCategories((String[]) fd.get(CATEGORIES));
- //((Table) e.getSource()).clearSelection(state);
- }
((BrowsePane) m_parent).displayFolderContentPanel(state);
- }
- }
+ }
+ }
+ /**
+ * A Form to Search Documents by name.Has one simple
+ * <code>TextField</code> and a submit button.
+ *
+ * It caches the SearchResults object in the m_coin RequestLocal object.
+ *
+ */
+ private class DocumentSearchForm extends Form
+ implements SearchForm,
+ FormValidationListener,
+ FormProcessListener,
+ FormInitListener {
+ private Submit m_submit;
+ private RequestLocal m_validated;
+ private RequestLocal m_coln;
- /**
- * A Form to Search Documents by name.Has one simple <code>TextField</code>
- * and a submit button.
- *
- * It caches the SearchResults object in the m_coin RequestLocal object.
- *
- */
- private class DocumentSearchForm extends Form implements SearchForm,
- FormValidationListener,FormProcessListener,FormInitListener {
+ public DocumentSearchForm(Container panel) {
+ super("docSearch", panel);
+ setMethod(Form.GET);
+ add(new Label("Search text:"));
+ TextField searchText = new TextField(SEARCH_DOCUMENT);
+ add(searchText);
+ m_submit = new Submit("search", "Search");
+ add(m_submit);
+ addValidationListener(this);
+ addProcessListener(this);
+ addInitListener(this);
- private Submit m_submit;
- private RequestLocal m_validated;
- private RequestLocal m_coln;
+ m_coln = new RequestLocal();
+ m_validated = new RequestLocal();
+ }
- public DocumentSearchForm(Container panel) {
- super("docSearch",panel);
- setMethod(Form.GET);
- add(new Label("Search text:"));
- TextField searchText = new TextField(SEARCH_DOCUMENT);
- add(searchText);
- m_submit = new Submit("search", "Search");
- add(m_submit);
- addValidationListener(this);
- addProcessListener(this);
- addInitListener(this);
+ public void init(FormSectionEvent e) throws FormProcessException {
+ e.getFormData().setParameter(SEARCH_DOCUMENT, null);
+ }
- m_coln = new RequestLocal();
- m_validated = new RequestLocal();
- }
+ public void validate(FormSectionEvent e) throws FormProcessException {
+ PageState ps = e.getPageState();
- public void init(FormSectionEvent e) throws FormProcessException {
- e.getFormData().setParameter(SEARCH_DOCUMENT, null);
- }
- public void validate(FormSectionEvent e) throws FormProcessException {
- PageState ps = e.getPageState();
-
- String docsSearch = (String) ps.getValue(m_searchDocsParam);
+ String docsSearch = (String) ps.getValue(m_searchDocsParam);
- if (StringUtils.emptyString(docsSearch)){
- m_emptyLabel.setVisible(ps,true);
- m_validated.set(ps, new Boolean(false));
- throw new FormProcessException("At least one search parameter must be specified");
- }
- m_validated.set(ps, new Boolean(true));
- //Reset the paginator for new search.
- m_paginator.reset(ps);
- }
+ if (StringUtils.emptyString(docsSearch)) {
+ m_emptyLabel.setVisible(ps, true);
+ m_validated.set(ps, new Boolean(false));
+ throw new FormProcessException(
+ "At least one search parameter must be specified");
+ }
+ m_validated.set(ps, new Boolean(true));
+ //Reset the paginator for new search.
+ m_paginator.reset(ps);
+ }
- /**Just a dummy run to cache the results in RequestLocal object.*/
- public void process(FormSectionEvent e) {
- PageState state = e.getPageState();
- if(m_submit.isSelected(state) &&
- ((Boolean) m_validated.get(state)).booleanValue()) {
- SearchResults results = getSearchHits(state);
- if(results != null &&
- results.getTotalSize() > 0) {
- s_log.debug("results");
- } else {
- s_log.debug("no results");
- }
- }
- }
+ /**
+ * Just a dummy run to cache the results in RequestLocal object.
+ */
+ public void process(FormSectionEvent e) {
+ PageState state = e.getPageState();
+ if (m_submit.isSelected(state)
+ && ((Boolean) m_validated.get(state)).booleanValue()) {
+ SearchResults results = getSearchHits(state);
+ if (results != null
+ && results.getTotalSize() > 0) {
+ s_log.debug("results");
+ } else {
+ s_log.debug("no results");
+ }
+ }
+ }
- /**Cache the results in the upper class's RequestLocal object.*/
- public SearchResults getSearchHits( PageState state ) {
- SearchResults searchResults = (SearchResults) m_coln.get(state);
- String terms = (String) state.getValue(m_searchDocsParam);
- s_log.debug("terms is "+terms);
- if (searchResults == null && ! StringUtils.emptyString(terms)){
- User user = KernelHelper.getCurrentUser(state.getRequest());
- searchResults = SearchUtils.getSimpleSearch(terms,user);
- m_coln.set(state, searchResults);
- }
- return searchResults;
- }
+ /**
+ * Cache the results in the upper class's RequestLocal object.
+ */
+ public SearchResults getSearchHits(PageState state) {
+ SearchResults searchResults = (SearchResults) m_coln.get(state);
+ String terms = (String) state.getValue(m_searchDocsParam);
+ s_log.debug("terms is " + terms);
+ if (searchResults == null && !StringUtils.emptyString(terms)) {
+ User user = (User) Kernel.getContext().getParty();
+ searchResults = SearchUtils.getSimpleSearch(terms, user);
+ m_coln.set(state, searchResults);
+ }
+ return searchResults;
+ }
- public boolean isVisible(PageState state) {
- return true;
- }
+ @Override
+ public boolean isVisible(PageState state) {
+ return true;
+ }
- public long getSearchResultCount(PageState state) {
- return m_coln.get(state) == null ? 0 :
- ((SearchResults)m_coln.get(state)).getTotalSize();
- }
+ public long getSearchResultCount(PageState state) {
+ return m_coln.get(state) == null ? 0
+ : ((SearchResults) m_coln.get(state)).getTotalSize();
+ }
+ }
- }
-
- /**Helper method to return the currently Selected Parent Folder in the tree */
- private DocFolder getSelectedFolder(PageState state){
+ /**
+ * Helper method to return the currently Selected Parent Folder in the tree
+ */
+ private DocFolder getSelectedFolder(PageState state) {
DocFolder p = null;
String selKey = (String) m_tree.getSelectedKey(state);
@@ -477,10 +476,10 @@
p = new DocFolder(folderID);
} catch (DataObjectNotFoundException nf) {
throw new ObjectNotFoundException(
- (String) FOLDER_PARENTNOTFOUND_ERROR.localize(state.getRequest()));
+ (String) FOLDER_PARENTNOTFOUND_ERROR.localize(state
+ .getRequest()));
}
}
return p;
}
-
}
Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/SearchPane.java
===================================================================
--- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/SearchPane.java 2013-02-02 23:17:14 UTC (rev 2475)
+++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/SearchPane.java 2013-02-02 23:31:41 UTC (rev 2476)
@@ -15,60 +15,18 @@
package com.arsdigita.cms.docmgr.ui;
-import com.arsdigita.bebop.BoxPanel;
-import com.arsdigita.bebop.Container;
-import com.arsdigita....
[truncated message content] |
Author: pboy
Date: 2013-02-02 22:58:25 +0000 (Sat, 02 Feb 2013)
New Revision: 2474
Added:
trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java.nolongerInUse
trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java.nolongerInUse
trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java.nolongerInUse
Removed:
trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java
Modified:
trunk/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminServlet.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalServlet.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/pslogin/PSSubsiteDispatcher.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalCreatePage.java
trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalTreeModelBuilder.java
trunk/ccm-portalserver/web/WEB-INF/web.ccm-portalserver.xml
trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/SimpleSurveyUtil.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ResultsPane.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/SurveyProcessListener.java
trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ViewPanel.java
Log:
Code clean-up, removed old application code.
Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java
===================================================================
--- trunk/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -17,18 +17,14 @@
package com.arsdigita.auth.http;
import com.arsdigita.db.Sequences;
-import com.arsdigita.kernel.KernelHelper;
-import com.arsdigita.kernel.security.HTTPRequestCallback;
-import com.arsdigita.kernel.security.HTTPResponseCallback;
-import com.arsdigita.kernel.security.MappingLoginModule;
-import com.arsdigita.kernel.security.PasswordLoginModule;
-import com.arsdigita.kernel.security.UserLoginModule;
-import com.arsdigita.kernel.security.Util;
+import com.arsdigita.kernel.security.*;
import com.arsdigita.persistence.DataOperation;
import com.arsdigita.persistence.DataQuery;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.web.RedirectSignal;
+import com.arsdigita.web.Web;
+
import java.math.BigDecimal;
import java.net.InetAddress;
import java.net.URLEncoder;
@@ -38,6 +34,7 @@
import java.util.Date;
import java.util.Enumeration;
import java.util.Map;
+
import javax.crypto.Cipher;
import javax.security.auth.Subject;
import javax.security.auth.callback.Callback;
@@ -46,7 +43,9 @@
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
import org.apache.log4j.Logger;
+
import sun.misc.BASE64Decoder;
/**
@@ -302,7 +301,8 @@
throw new UncheckedWrapperException( e );
}
- String returnURL = "http://" + KernelHelper.getHostName() + req.getRequestURI();
+ String returnURL = "http://" + Web.getConfig().getHost().getName()
+ + req.getRequestURI();
if( req.getQueryString () != null ) {
returnURL = returnURL + "?" + req.getQueryString ();
}
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -136,18 +136,6 @@
*/
private void loadPortalSiteApplicationType() {
- /* First try: create a new style, legacy compatible application */
-
- // ApplicationType type = ApplicationType.createApplicationType(
- // "portalsite",
- // "Portal Site",
- // PortalSite.BASE_DATA_OBJECT_TYPE);
- // Current code requires an apps specific dispatcher class. Has to be
- // modified to be able to create a legacy free app type.
- // type.setDispatcherClass
- // ("com.arsdigita.portalserver.ui.PortalDispatcher");
-
- // Try: new style legacy free application
ApplicationType type = new
ApplicationType("Portal Site", // title
PortalSite.BASE_DATA_OBJECT_TYPE );
@@ -251,7 +239,14 @@
// FORMERLY ui.admin.Initializer
/**
* Creates a PortalCreator, another of the domain classes of the portalserver
- * package, ApplicationType as a legacy-comp type of application type.
+ * package, ApplicationType as a legacy free type of application type.
+ *
+ * NOTE: The wording in the title parameter of ApplicationType determines
+ * the name of the subdirectory for the XSL stylesheets.
+ * It gets "urlized", i.e. trimming leading and trailing blanks and replacing
+ * blanks between words and illegal characters with an hyphen and converted
+ * to lower case.
+ * Example: "Portal Creator" will become "portal-creator".
*
*/
private void loadPortalCreatorApplicationType() {
Deleted: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2003-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.portalserver.admin;
-
-// import com.arsdigita.bebop.*;
-import com.arsdigita.portalserver.admin.PSAdminPage;
-import com.arsdigita.bebop.Page;
-import com.arsdigita.bebop.page.BebopMapDispatcher;
-import java.util.*;
-
-/**
- * Dispatcher
- *
- * @author <a href="mailto:rh...@mi...">rh...@mi...</a>
- * @version $Revision: #3 $ $Date: 2004/08/17 $
- **/
-
-public class Dispatcher extends BebopMapDispatcher {
-
- public final static String versionId = "$Id: //portalserver/dev/src/com/arsdigita/portalserver/admin/ui/Dispatcher.java#3 $ by $Author: dennis $, $DateTime: 2004/08/17 23:19:25 $";
-
- public Dispatcher() {
- Map m = new HashMap();
- Page index = new PSAdminPage();
- index.lock();
- m.put("", index);
- m.put("index.jsp", index);
- m.put("index.html", index);
- setMap(m);
- }
-
-}
Added: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java.nolongerInUse
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java.nolongerInUse (rev 0)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java.nolongerInUse 2013-02-02 22:58:25 UTC (rev 2474)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2003-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.portalserver.admin;
+
+// import com.arsdigita.bebop.*;
+import com.arsdigita.portalserver.admin.PSAdminPage;
+import com.arsdigita.bebop.Page;
+import com.arsdigita.bebop.page.BebopMapDispatcher;
+import java.util.*;
+
+/**
+ * Dispatcher
+ *
+ * @author <a href="mailto:rh...@mi...">rh...@mi...</a>
+ * @version $Revision: #3 $ $Date: 2004/08/17 $
+ **/
+
+public class Dispatcher extends BebopMapDispatcher {
+
+ public final static String versionId = "$Id: //portalserver/dev/src/com/arsdigita/portalserver/admin/ui/Dispatcher.java#3 $ by $Author: dennis $, $DateTime: 2004/08/17 23:19:25 $";
+
+ public Dispatcher() {
+ Map m = new HashMap();
+ Page index = new PSAdminPage();
+ index.lock();
+ m.put("", index);
+ m.put("index.jsp", index);
+ m.put("index.html", index);
+ setMap(m);
+ }
+
+}
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -18,18 +18,14 @@
*/
package com.arsdigita.portalserver.admin;
-import com.arsdigita.web.Application;
-import com.arsdigita.web.ApplicationCollection;
-import com.arsdigita.bebop.table.*;
import com.arsdigita.bebop.*;
-import com.arsdigita.dispatcher.*;
-import com.arsdigita.portalserver.*;
+import com.arsdigita.dispatcher.DispatcherHelper;
import com.arsdigita.portalserver.PortalPage;
-import com.arsdigita.toolbox.ui.*;
-import org.apache.log4j.Logger;
-
+import com.arsdigita.portalserver.PortalSite;
+import com.arsdigita.web.Application;
import com.arsdigita.xml.Document;
import com.arsdigita.xml.Element;
+import org.apache.log4j.Logger;
/**
* PSAdminPage
@@ -38,12 +34,9 @@
*
* @author <a href="mailto:rh...@mi...">rh...@mi...</a>
* @version $Revision: #8 $ $Date: 2004/08/17 $
+ * @version $ID:PSAdminPage.java, pboy $
*/
class PSAdminPage extends PortalPage {
- public static final String versionId =
- "$Id: //portalserver/dev/src/com/arsdigita/portalserver/admin/ui/AdminPage.java#8 $" +
- "$Author: dennis $" +
- "$DateTime: 2004/08/17 23:19:25 $";
BoxPanel m_bpanel;
@@ -51,6 +44,7 @@
(PSAdminPage.class.getName());
private RequestLocal m_children = new RequestLocal() {
+ @Override
public Object initialValue(PageState ps) {
Application app = Application.getCurrentApplication
(DispatcherHelper.getRequest());
@@ -62,6 +56,7 @@
getHeader().setIdAttr("admin");
}
+ @Override
protected void buildContextBar() {
DimensionalNavbar navbar = new DimensionalNavbar();
@@ -77,7 +72,7 @@
/**
* This method outputs a list of links to admin functionality.
*/
-
+ @Override
protected void buildBody(Container body) {
m_bpanel = new BoxPanel();
@@ -98,11 +93,11 @@
* This method is called by the generateXML() method of the parent
* class, and writes a CSS style block into the output.
*/
-
+ @Override
public void addStyleBlock(PageState state, Document parent) {
PortalSite psite = PortalSite.getCurrentPortalSite(state.getRequest());
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("<STYLE type=\"text/css\"> <!--");
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminServlet.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminServlet.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminServlet.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -50,7 +50,7 @@
/**
- * User extension point, initialize PortalCreator (index) page and add
+ * User extension point, initialize PortalAdmin (index) page and add
* authentication check.
*
* @throws ServletException
Deleted: trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2002-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.portalserver.personal;
-
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.Page;
-import com.arsdigita.bebop.page.PageDispatcher;
-import com.arsdigita.bebop.SimpleContainer;
-import com.arsdigita.web.Application;
-import com.arsdigita.kernel.ResourceTypeConfig;
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.dispatcher.Dispatcher;
-import com.arsdigita.dispatcher.DispatcherHelper;
-import com.arsdigita.dispatcher.RequestContext;
-import com.arsdigita.sitenode.SiteNodeRequestContext;
-import com.arsdigita.kernel.User;
-import com.arsdigita.kernel.Kernel;
-import com.arsdigita.kernel.KernelExcursion;
-import com.arsdigita.kernel.SiteNode;
-import com.arsdigita.util.Assert;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletException;
-import java.io.IOException;
-import java.math.BigDecimal;
-import org.apache.log4j.Category;
-
-/**
- * <p><strong>Experimental</strong></p>
- *
- * @author <a href="mailto:ju...@ar...">Justin Ross</a>
- * @version $Id: PersonalPortalCreatorDispatcher.java pboy $
- */
-public class PersonalPortalCreatorDispatcher implements Dispatcher {
-
- private static Category s_log = Category.getInstance
- (PersonalPortalCreatorDispatcher.class);
-
- private Dispatcher m_introDispatcher = null;
-
- private BigDecimal scanUserID(SiteNodeRequestContext snrc) {
- // We expect to get something like "23/"
- String url = snrc.getRemainingURLPart();
-
- int delimIndex = url.indexOf("/");
-
- try {
- if (delimIndex == -1) {
- return new BigDecimal(url);
- } else {
- return new BigDecimal(url.substring(0, delimIndex));
- }
- } catch (NumberFormatException nfe) {
- return null;
- } catch (IndexOutOfBoundsException iobe) {
- // BigDecimal(String) fails to validate its input. An
- // empty string makes it bomb, throwing this exception.
-
- return null;
- }
- }
-
- /**
- * Has to be replaced by a way not to use SiteNode / SiteNodeRequestContext
- * @param snrc
- * @return
- */
- private Application getApplication(SiteNodeRequestContext snrc) {
- SiteNode siteNode = snrc.getSiteNode();
-
- Application parent = Application.retrieveApplicationForSiteNode
- (siteNode);
-
- // Assert.assertNotNull(parent, "parent");
- Assert.exists(parent, "parent");
-
- return parent;
- }
-
- private User getUser(BigDecimal userID) {
- User user = null;
-
- try {
- user = User.retrieve(userID);
- } catch (DataObjectNotFoundException nfe) {
- s_log.error
- ("Failed to retrieve user " + userID + ".",
- new IllegalStateException());
- }
-
- // Assert.assertNotNull(user, "user");
- Assert.exists(user, "user");
-
- return user;
- }
-
- private void configurePortal(PersonalPortal portal) {
- ResourceTypeConfig config =
- portal.getApplicationType().getConfig();
-
- // Assert.assertNotNull(config, "config");
- Assert.exists(config, "config");
-
- config.configureResource(portal);
- }
-
- private Page buildIntroPage() {
- Page page = new Page("", new SimpleContainer());
-
- page.lock();
-
- return page;
- }
-
- public void dispatch(HttpServletRequest request,
- HttpServletResponse response,
- RequestContext context)
- throws IOException, ServletException {
-
- Assert.isTrue(context instanceof SiteNodeRequestContext);
-
- // XXX has to be replaced by a way NOT built upon SiteNode*
- SiteNodeRequestContext snrc = (SiteNodeRequestContext) context;
-
- final Application parent = getApplication(snrc);
-
- BigDecimal userID = scanUserID(snrc);
-
- if (userID == null) {
- s_log.warn
- ("Failed to read a user ID from a personal-portal link.");
- } else {
- final User user = getUser(userID);
-
- PersonalPortal portal =
- PersonalPortal.retrievePersonalPortal(user);
-
- if (portal == null) {
- // This is what we expect to happen.
- KernelExcursion rootExcursion = new KernelExcursion() {
- protected void excurse() {
- setParty(Kernel.getSystemParty());
- PersonalPortal ps =
- PersonalPortal.createPersonalPortal (user, parent);
-
- // Assert.assertNotNull(ps, "portal");
- Assert.exists(ps, "portal");
-
- configurePortal(ps);
-
- ps.save();
- }};
- rootExcursion.run();
- } else {
- // There's a problem. We should never get here if the
- // portal already exists, since the site node
- // dispatcher will go to an existing portal
- // directly, skipping this dispatcher.
-
- s_log.error
- ("PersonalPortalCreator invoked when the portalsite " +
- "exists already.", new IllegalStateException());
- }
-
- // Not synchronized, since it makes little difference.
-
- if (m_introDispatcher == null) {
- m_introDispatcher = new PageDispatcher(buildIntroPage());
- }
- Assert.exists(m_introDispatcher, "m_introDispatcher");
-
- // Don't understand: Above we create a new PageDisüpatcher but don't
- // call it's dispatch() method.
- // What does the sendRedirect here?
- DispatcherHelper.sendRedirect(request,
- response,
- snrc.getOriginalURL());
-
- // The following does not work because I need to be able to
- // reset the RequestContext before I invoke it. Otherwise,
- // the remainingURL is incorrect.
- //DispatcherHelper.forwardRequestByPath
- // (snrc.getOriginalURL(), request, response);
- }
- }
-}
Added: trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java.nolongerInUse
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java.nolongerInUse (rev 0)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java.nolongerInUse 2013-02-02 22:58:25 UTC (rev 2474)
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2002-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.portalserver.personal;
+
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.Page;
+import com.arsdigita.bebop.page.PageDispatcher;
+import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.web.Application;
+import com.arsdigita.kernel.ResourceTypeConfig;
+import com.arsdigita.domain.DataObjectNotFoundException;
+import com.arsdigita.dispatcher.Dispatcher;
+import com.arsdigita.dispatcher.DispatcherHelper;
+import com.arsdigita.dispatcher.RequestContext;
+import com.arsdigita.sitenode.SiteNodeRequestContext;
+import com.arsdigita.kernel.User;
+import com.arsdigita.kernel.Kernel;
+import com.arsdigita.kernel.KernelExcursion;
+import com.arsdigita.kernel.SiteNode;
+import com.arsdigita.util.Assert;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.math.BigDecimal;
+import org.apache.log4j.Category;
+
+/**
+ * <p><strong>Experimental</strong></p>
+ *
+ * @author <a href="mailto:ju...@ar...">Justin Ross</a>
+ * @version $Id: PersonalPortalCreatorDispatcher.java pboy $
+ */
+public class PersonalPortalCreatorDispatcher implements Dispatcher {
+
+ private static Category s_log = Category.getInstance
+ (PersonalPortalCreatorDispatcher.class);
+
+ private Dispatcher m_introDispatcher = null;
+
+ private BigDecimal scanUserID(SiteNodeRequestContext snrc) {
+ // We expect to get something like "23/"
+ String url = snrc.getRemainingURLPart();
+
+ int delimIndex = url.indexOf("/");
+
+ try {
+ if (delimIndex == -1) {
+ return new BigDecimal(url);
+ } else {
+ return new BigDecimal(url.substring(0, delimIndex));
+ }
+ } catch (NumberFormatException nfe) {
+ return null;
+ } catch (IndexOutOfBoundsException iobe) {
+ // BigDecimal(String) fails to validate its input. An
+ // empty string makes it bomb, throwing this exception.
+
+ return null;
+ }
+ }
+
+ /**
+ * Has to be replaced by a way not to use SiteNode / SiteNodeRequestContext
+ * @param snrc
+ * @return
+ */
+ private Application getApplication(SiteNodeRequestContext snrc) {
+ SiteNode siteNode = snrc.getSiteNode();
+
+ Application parent = Application.retrieveApplicationForSiteNode
+ (siteNode);
+
+ // Assert.assertNotNull(parent, "parent");
+ Assert.exists(parent, "parent");
+
+ return parent;
+ }
+
+ private User getUser(BigDecimal userID) {
+ User user = null;
+
+ try {
+ user = User.retrieve(userID);
+ } catch (DataObjectNotFoundException nfe) {
+ s_log.error
+ ("Failed to retrieve user " + userID + ".",
+ new IllegalStateException());
+ }
+
+ // Assert.assertNotNull(user, "user");
+ Assert.exists(user, "user");
+
+ return user;
+ }
+
+ private void configurePortal(PersonalPortal portal) {
+ ResourceTypeConfig config =
+ portal.getApplicationType().getConfig();
+
+ // Assert.assertNotNull(config, "config");
+ Assert.exists(config, "config");
+
+ config.configureResource(portal);
+ }
+
+ private Page buildIntroPage() {
+ Page page = new Page("", new SimpleContainer());
+
+ page.lock();
+
+ return page;
+ }
+
+ public void dispatch(HttpServletRequest request,
+ HttpServletResponse response,
+ RequestContext context)
+ throws IOException, ServletException {
+
+ Assert.isTrue(context instanceof SiteNodeRequestContext);
+
+ // XXX has to be replaced by a way NOT built upon SiteNode*
+ SiteNodeRequestContext snrc = (SiteNodeRequestContext) context;
+
+ final Application parent = getApplication(snrc);
+
+ BigDecimal userID = scanUserID(snrc);
+
+ if (userID == null) {
+ s_log.warn
+ ("Failed to read a user ID from a personal-portal link.");
+ } else {
+ final User user = getUser(userID);
+
+ PersonalPortal portal =
+ PersonalPortal.retrievePersonalPortal(user);
+
+ if (portal == null) {
+ // This is what we expect to happen.
+ KernelExcursion rootExcursion = new KernelExcursion() {
+ protected void excurse() {
+ setParty(Kernel.getSystemParty());
+ PersonalPortal ps =
+ PersonalPortal.createPersonalPortal (user, parent);
+
+ // Assert.assertNotNull(ps, "portal");
+ Assert.exists(ps, "portal");
+
+ configurePortal(ps);
+
+ ps.save();
+ }};
+ rootExcursion.run();
+ } else {
+ // There's a problem. We should never get here if the
+ // portal already exists, since the site node
+ // dispatcher will go to an existing portal
+ // directly, skipping this dispatcher.
+
+ s_log.error
+ ("PersonalPortalCreator invoked when the portalsite " +
+ "exists already.", new IllegalStateException());
+ }
+
+ // Not synchronized, since it makes little difference.
+
+ if (m_introDispatcher == null) {
+ m_introDispatcher = new PageDispatcher(buildIntroPage());
+ }
+ Assert.exists(m_introDispatcher, "m_introDispatcher");
+
+ // Don't understand: Above we create a new PageDisüpatcher but don't
+ // call it's dispatch() method.
+ // What does the sendRedirect here?
+ DispatcherHelper.sendRedirect(request,
+ response,
+ snrc.getOriginalURL());
+
+ // The following does not work because I need to be able to
+ // reset the RequestContext before I invoke it. Otherwise,
+ // the remainingURL is incorrect.
+ //DispatcherHelper.forwardRequestByPath
+ // (snrc.getOriginalURL(), request, response);
+ }
+ }
+}
Deleted: trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2002-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.portalserver.personal;
-
-
-import com.arsdigita.portalserver.util.GlobalizationUtil;
-
-import com.arsdigita.bebop.DimensionalNavbar;
-import com.arsdigita.bebop.Link;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.page.PageDispatcher;
-import com.arsdigita.dispatcher.Dispatcher;
-import com.arsdigita.dispatcher.RequestContext;
-
-import com.arsdigita.portalserver.ui.admin.PortalAdminPage;
-import com.arsdigita.portalserver.ui.PortalDispatcher;
-import com.arsdigita.portalserver.ui.PortalParticipants;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletException;
-
-/**
- * <p><strong>Experimental</strong></p>
- *
- * @author <a href="mailto:ju...@ar...">Justin Ross</a>
- * @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java#5 $
- */
-public class PersonalPortalDispatcher extends PortalDispatcher {
- public static final String versionId =
- "$Id: //portalserver/dev/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java#5 $" +
- "$Author: dennis $" +
- "$DateTime: 2004/08/17 23:19:25 $";
-
- private Dispatcher m_portalAdminDispatcher;
-
- public PersonalPortalDispatcher() {
- super();
-
- Map m = new HashMap();
-
- m.put("", new PersonalPortalHomePage());
- m.put(PORTAL_PARTICIPANT_PAGE, PortalParticipants.createPage());
-
- setMap(m);
- }
-
- @Override
- public void dispatch(HttpServletRequest request,
- HttpServletResponse response,
- RequestContext context)
- throws IOException, ServletException {
- String remainingURLPart = context.getRemainingURLPart();
-
- if (remainingURLPart.startsWith(PORTAL_ADMIN_PAGE)) {
- if (m_portalAdminDispatcher == null) {
-
- PortalAdminPage page = new PortalAdminPage() {
- @Override
- protected void buildContextBar() {
- DimensionalNavbar navbar = new DimensionalNavbar();
-
- navbar.setClassAttr("portalNavbar");
-
- navbar.add
- (new Link(new PersonalPortalLinkPrinter()));
- navbar.add(new Label(GlobalizationUtil.globalize("cw.workspace.personal.configure_workspace")));
-
- getHeader().add(navbar);
- }
- };
-
- m_portalAdminDispatcher = new PageDispatcher(page);
- }
-
- m_portalAdminDispatcher.dispatch(request, response, context);
- } else {
- super.dispatch(request, response, context);
- }
- }
-}
Added: trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java.nolongerInUse
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java.nolongerInUse (rev 0)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java.nolongerInUse 2013-02-02 22:58:25 UTC (rev 2474)
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2002-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.portalserver.personal;
+
+
+import com.arsdigita.portalserver.util.GlobalizationUtil;
+
+import com.arsdigita.bebop.DimensionalNavbar;
+import com.arsdigita.bebop.Link;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.page.PageDispatcher;
+import com.arsdigita.dispatcher.Dispatcher;
+import com.arsdigita.dispatcher.RequestContext;
+
+import com.arsdigita.portalserver.ui.admin.PortalAdminPage;
+import com.arsdigita.portalserver.ui.PortalDispatcher;
+import com.arsdigita.portalserver.ui.PortalParticipants;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+
+
+// ////////////////////////////////////////////////////////////////////////////
+//
+// Replaced by PersonalPortalServer and not used anymore
+//
+// ////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * <p><strong>Experimental</strong></p>
+ *
+ * @author <a href="mailto:ju...@ar...">Justin Ross</a>
+ * @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java#5 $
+ */
+public class PersonalPortalDispatcher extends PortalDispatcher {
+ public static final String versionId =
+ "$Id: //portalserver/dev/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java#5 $" +
+ "$Author: dennis $" +
+ "$DateTime: 2004/08/17 23:19:25 $";
+
+ private Dispatcher m_portalAdminDispatcher;
+
+ public PersonalPortalDispatcher() {
+ super();
+
+ Map m = new HashMap();
+
+ m.put("", new PersonalPortalHomePage());
+ m.put(PORTAL_PARTICIPANT_PAGE, PortalParticipants.createPage());
+
+ setMap(m);
+ }
+
+ @Override
+ public void dispatch(HttpServletRequest request,
+ HttpServletResponse response,
+ RequestContext context)
+ throws IOException, ServletException {
+ String remainingURLPart = context.getRemainingURLPart();
+
+ if (remainingURLPart.startsWith(PORTAL_ADMIN_PAGE)) {
+ if (m_portalAdminDispatcher == null) {
+
+ PortalAdminPage page = new PortalAdminPage() {
+ @Override
+ protected void buildContextBar() {
+ DimensionalNavbar navbar = new DimensionalNavbar();
+
+ navbar.setClassAttr("portalNavbar");
+
+ navbar.add
+ (new Link(new PersonalPortalLinkPrinter()));
+ navbar.add(new Label(GlobalizationUtil.globalize("cw.workspace.personal.configure_workspace")));
+
+ getHeader().add(navbar);
+ }
+ };
+
+ m_portalAdminDispatcher = new PageDispatcher(page);
+ }
+
+ m_portalAdminDispatcher.dispatch(request, response, context);
+ } else {
+ super.dispatch(request, response, context);
+ }
+ }
+}
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalServlet.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalServlet.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalServlet.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ * Copyright (C) 2012-2013 University of Bremen. 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
@@ -44,8 +44,11 @@
/**
- *
- * @author pb
+ * Provides the UI for the personal Portal for logged in users.
+ *
+ * It replaces the former PersonalPortalDispatcher.
+ *
+ * @author pb <pb...@ba...>
* @version $Id: PersonalPortalServlet.java pboy $
*/
public class PersonalPortalServlet extends BaseApplicationServlet {
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/pslogin/PSSubsiteDispatcher.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/pslogin/PSSubsiteDispatcher.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/pslogin/PSSubsiteDispatcher.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -19,7 +19,6 @@
package com.arsdigita.portalserver.pslogin;
// 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;
@@ -30,6 +29,8 @@
// Uses methods in c.ad.kernel.security.Initializer which have been modified
// and moved to ui
//
+// And used to use com.arsdigita.ui.login.SubsiteDispatcher which is deleted.
+//
// CURRENTLY NOT WORKING
//
// /////////////////////////////////////////////////////////////////////////////
@@ -39,7 +40,13 @@
* This class extends com.arsdigita.ui.login.SubsiteDispatcher
* It changes the subsite dispatcher behavior by
* directing logged-in users to a personal portal
- * rather than the default system portal
+ * rather than the default system portal.
+ *
+ * NOTE: Comment outdated! SubsiteDispatcher no longer exists. Logged in users
+ * are now redirected using a web.UI function. Class has to adjusted.
+ * Specifically it may not be needed anymore, because the current redirection
+ * mechanism works without it at all.
+ *
* @author <a href="mailto:bry...@ar...">Bryan Che</a>
**/
// public class PSSubsiteDispatcher extends SubsiteDispatcher {
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalCreatePage.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalCreatePage.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalCreatePage.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -29,36 +29,51 @@
import com.arsdigita.portalserver.ApplicationPage;
import com.arsdigita.portalserver.PortalSite;
+import java.io.IOException;
+/**
+ *
+ * @author pb
+ * @version $Id: PortalCreatePage.java#4 $
+ */
class PortalCreatePage extends ApplicationPage {
- public static final String versionId =
- "$Id: //portalserver/dev/src/com/arsdigita/portalserver/ui/admin/PortalCreatePage.java#4 $" +
- "$Author: dennis $" +
- "$DateTime: 2004/08/17 23:19:25 $";
+ /**
+ *
+ */
public PortalCreatePage() {
final RequestLocal portalsiteRL = new RequestLocal();
// TODO: parent portal selection after basic properties entered
final Component f = PortalCreateForm.
create(new RequestLocal(), portalsiteRL, new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- PageState ps = e.getPageState();
- try {
- com.arsdigita.dispatcher.DispatcherHelper.sendRedirect(
- ps.getRequest(), ps.getResponse(),
- ((PortalSite) portalsiteRL.get(ps)).getSiteNode().getURLNoContext() + "admin/");
- } catch (java.io.IOException ex) {
- throw
- new com.arsdigita.util.UncheckedWrapperException(ex);
- }
- }
- });
+ public void actionPerformed(ActionEvent e) {
+ PageState ps = e.getPageState();
+ try {
+ com.arsdigita.dispatcher.DispatcherHelper.sendRedirect(
+ ps.getRequest(),
+ ps.getResponse(),
+ // ((PortalSite) portalsiteRL.get(ps)).getPath()
+ // .getSiteNode()
+ // .getURLNoContext()
+ // TODO: Test whether replacement works !!
+ // Compare with version 2.0.x release
+ ((PortalSite) portalsiteRL.get(ps)).getPath()
+ + "admin/");
+ } catch (IOException ex) {
+ throw new com.arsdigita.util.UncheckedWrapperException(ex);
+ }
+ }
+ });
add(f);
}
+ /**
+ *
+ */
+ @Override
protected void buildContextBar() {
DimensionalNavbar navbar = new DimensionalNavbar();
navbar.setClassAttr("portalNavbar");
Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalTreeModelBuilder.java
===================================================================
--- trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalTreeModelBuilder.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalTreeModelBuilder.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -235,7 +235,10 @@
result.add(new ControlLink(l));
}
- String psURL = psite.getSiteNode().getURL();
+// String psURL = psite.getSiteNode().getURL();
+ // TODO: Does replacement work??
+ // Compare with version 2.0.x release
+ String psURL = psite.getPath();
result.add(new Label(GlobalizationUtil.globalize("cw.workspace.ui.admin.")));
Link viewLink = new Link( new Label(GlobalizationUtil.globalize("cw.workspace.ui.admin.view")), psURL);
viewLink.setTargetFrame(Link.NEW_FRAME);
Modified: trunk/ccm-portalserver/web/WEB-INF/web.ccm-portalserver.xml
===================================================================
--- trunk/ccm-portalserver/web/WEB-INF/web.ccm-portalserver.xml 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalserver/web/WEB-INF/web.ccm-portalserver.xml 2013-02-02 22:58:25 UTC (rev 2474)
@@ -31,7 +31,7 @@
</servlet>
<servlet>
- <servlet-name>portal-personalportal</servlet-name>
+ <servlet-name>portal-personalportalcreator</servlet-name>
<servlet-class>com.arsdigita.portalserver.personal.PersonalPortalCreatorServlet</servlet-class>
</servlet>
<!-- module ccm-portalserver - servlet declarations END -->
@@ -64,7 +64,7 @@
</servlet-mapping>
<servlet-mapping>
- <servlet-name>portal-personalportal</servlet-name>
+ <servlet-name>portal-personalportalcreator</servlet-name>
<url-pattern>/templates/servlet/personal-portal-creator/*</url-pattern>
</servlet-mapping>
<!-- module ccm-portalserver - servlet mappings END -->
Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
===================================================================
--- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -24,7 +24,7 @@
import com.arsdigita.kernel.Group;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
-import com.arsdigita.kernel.KernelHelper;
+import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.Party;
import com.arsdigita.kernel.PartyCollection;
import com.arsdigita.kernel.Role;
@@ -838,7 +838,7 @@
}
}.run();
// check that the user is no longer system user
- Party party = KernelHelper.getCurrentEffectiveParty();
+ Party party = Kernel.getContext().getEffectiveParty();
s_log.debug("party after excurse is " + party.getDisplayName());
Role admins = group.getRole("Administrators");
Modified: trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/SimpleSurveyUtil.java
===================================================================
--- trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/SimpleSurveyUtil.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/SimpleSurveyUtil.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -24,7 +24,7 @@
import com.arsdigita.kernel.PackageInstance;
import com.arsdigita.kernel.SiteNode;
-import com.arsdigita.kernel.KernelHelper;
+import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.User;
import com.arsdigita.kernel.permissions.PermissionDescriptor;
@@ -46,40 +46,63 @@
public class SimpleSurveyUtil {
+ /**
+ *
+ * @param request
+ * @return
+ */
public static SiteNode getSiteNode(HttpServletRequest request) {
- SiteNode siteNode;
- try {
- siteNode = SiteNode.getSiteNode(request.getRequestURI().toString(), true);
- } catch (com.arsdigita.domain.DataObjectNotFoundException e) {
- throw new com.arsdigita.util.UncheckedWrapperException(e);
- }
+ SiteNode siteNode;
+ try {
+ siteNode = SiteNode.getSiteNode(request.getRequestURI().toString(), true);
+ } catch (com.arsdigita.domain.DataObjectNotFoundException e) {
+ throw new com.arsdigita.util.UncheckedWrapperException(e);
+ }
- return siteNode;
+ return siteNode;
}
+ /**
+ *
+ * @param pageState
+ * @return
+ */
public static SiteNode getSiteNode(PageState pageState) {
- return getSiteNode(pageState.getRequest());
+ return getSiteNode(pageState.getRequest());
}
+
+ /**
+ *
+ * @param pageState
+ * @return
+ */
public static PackageInstance getPackageInstance(PageState pageState) {
-
- return getSiteNode(pageState).getPackageInstance();
+ return getSiteNode(pageState).getPackageInstance();
}
+ /**
+ *
+ * @param pageState
+ * @return
+ */
public static boolean isUserAdmin(PageState pageState) {
- boolean admin_p = false;
+ boolean admin_p = false;
- User user = KernelHelper.getCurrentUser(pageState.getRequest());
-
- SiteNode siteNode = SimpleSurveyUtil.getSiteNode(pageState);
-
- PermissionDescriptor admin = new PermissionDescriptor
- (PrivilegeDescriptor.ADMIN, siteNode, user);
+ User user = (User)Kernel.getContext().getParty();
- if (PermissionService.checkPermission(admin)) {
- admin_p = true;
- }
+ SiteNode siteNode = SimpleSurveyUtil.getSiteNode(pageState);
- return admin_p;
+ PermissionDescriptor admin = new PermissionDescriptor
+ (PrivilegeDescriptor.ADMIN,
+ siteNode,
+ user);
+
+ if (PermissionService.checkPermission(admin)) {
+ admin_p = true;
+ }
+
+ return admin_p;
}
+
}
Modified: trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ResultsPane.java
===================================================================
--- trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ResultsPane.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ResultsPane.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -43,7 +43,7 @@
import com.arsdigita.simplesurvey.Survey;
import com.arsdigita.simplesurvey.util.GlobalizationUtil;
-import com.arsdigita.kernel.KernelHelper;
+import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.User;
import java.math.BigDecimal;
@@ -94,8 +94,9 @@
};
m_user = new RequestLocal() {
+ @Override
public Object initialValue(PageState ps) {
- User user = KernelHelper.getCurrentUser(ps.getRequest());
+ User user = (User)Kernel.getContext().getParty();
return user;
}
};
Modified: trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/SurveyProcessListener.java
===================================================================
--- trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/SurveyProcessListener.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/SurveyProcessListener.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -19,40 +19,34 @@
package com.arsdigita.simplesurvey.ui;
+import com.arsdigita.bebop.FormData;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.RequestLocal;
import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
-
+import com.arsdigita.bebop.parameters.ParameterData;
+import com.arsdigita.domain.DataObjectNotFoundException;
+import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.formbuilder.PersistentComponent;
import com.arsdigita.formbuilder.PersistentForm;
import com.arsdigita.formbuilder.PersistentLabel;
import com.arsdigita.formbuilder.PersistentWidget;
-
-import com.arsdigita.kernel.KernelHelper;
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.domain.DomainObjectFactory;
-import com.arsdigita.persistence.OID;
-import java.util.Map;
-import java.util.HashMap;
-import com.arsdigita.bebop.FormData;
-import com.arsdigita.bebop.PageState;
-import com.arsdigita.bebop.RequestLocal;
-
-import com.arsdigita.simplesurvey.Survey;
-import com.arsdigita.simplesurvey.Response;
-import com.arsdigita.bebop.RequestLocal;
-import com.arsdigita.simplesurvey.ui.Question;
-import com.arsdigita.bebop.parameters.ParameterData;
+import com.arsdigita.formbuilder.util.FormBuilderUtil;
+import com.arsdigita.kernel.Kernel;
+import com.arsdigita.kernel.User;
import com.arsdigita.persistence.DataAssociationCursor;
import com.arsdigita.persistence.DataOperation;
+import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager;
-import java.util.Iterator;
+import com.arsdigita.simplesurvey.Response;
+import com.arsdigita.simplesurvey.Survey;
-import com.arsdigita.formbuilder.util.FormBuilderUtil;
-
-import com.arsdigita.kernel.User;
-
import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
import org.apache.log4j.Logger;
/**
@@ -108,7 +102,7 @@
m_persistentForm.set(ps, survey.getForm());
// Get the responding user
- User user = KernelHelper.getCurrentUser(ps.getRequest());
+ User user = (User)Kernel.getContext().getParty();
// Use the generic user "The Public" if the user is not registered
if ( user == null) {
Modified: trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ViewPanel.java
===================================================================
--- trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ViewPanel.java 2013-02-02 22:55:13 UTC (rev 2473)
+++ trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/ViewPanel.java 2013-02-02 22:58:25 UTC (rev 2474)
@@ -22,7 +22,7 @@
import com.arsdigita.simplesurvey.util.GlobalizationUtil ;
import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.kernel.KernelHelper;
+import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.User;
import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageState;
@@ -115,7 +115,7 @@
//s_log.warn("HEY responseID=" + responseID);
if ( responseID == null ) {
- User user = KernelHelper.getCurrentUser(ps.getRequest());
+ User user = (User)Kernel.getContext().getParty();
if ( user == null) {
try {
user = User.retrieve(THE_PUBLIC_USER);
|
Author: pboy
Date: 2013-02-02 22:55:13 +0000 (Sat, 02 Feb 2013)
New Revision: 2473
Added:
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ObjectTypeSchemaGenerator.java.probablyUnused
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ObjectTypeTraversal.java.probablyUnused
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ObjectTypeTraversalAdapter.java.probablyUnused
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/SimpleObjectTypeTraversalAdapter.java.probablyUnused
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/WebAppPatternGenerator.java.nolongerInUse
trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/ItemCategoryPicker.java
Removed:
trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeSchemaGenerator.java
trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversal.java
trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversalAdapter.java
trunk/ccm-bundle/src/com/arsdigita/bundle/SimpleObjectTypeTraversalAdapter.java
trunk/ccm-bundle/src/com/arsdigita/bundle/WebAppPatternGenerator.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ObjectTypeSchemaGenerator.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ObjectTypeTraversal.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ObjectTypeTraversalAdapter.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/SimpleObjectTypeTraversalAdapter.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/WebAppPatternGenerator.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/AssignedIndexItemTerms.java.probably.nolongerInUse
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/ItemCategoryPicker.java
Modified:
trunk/ccm-bundle/src/com/arsdigita/bundle/Initializer.java
trunk/ccm-cms/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java
trunk/ccm-core/src/WEB-INF/resources/stylesheet-paths.txt
trunk/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java
trunk/ccm-core/src/com/arsdigita/templating/PrefixPatternGenerator.java
trunk/ccm-core/src/com/arsdigita/templating/PresentationManager.java
trunk/ccm-core/src/com/arsdigita/templating/SimplePresentationManager.java
trunk/ccm-core/src/com/arsdigita/templating/WebAppPatternGenerator.java
trunk/ccm-forum-categorised/src/com/arsdigita/forum/categorised/ForumTermPicker.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/AutoCategorisation.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Initializer.java
trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/Initializer.java
trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/TermCategoryListener.java
trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/FlatCategoryPicker.java
trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/RootCategoryPicker.java
trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java
Log:
APLAWS Integration package clean up to avoid code duplication:
* Integrated WebAppPatternGenerator in Aplaws and in core into one. It is a core responsibility of templating and no APLAWS specific tasks involved anymore.
* Removed unused classes ObjectTypeTrav*
* Relocated ItemCategoryPicker to ldn-terms because it is a ldn-terms specific task to make terms available in cms in general, not an integration package task.
* Relocated initialisation of TermCategoryListener to sync terms and core categories to terms, because is is a core terms task.
* Various formatting and documentation.
Modified: trunk/ccm-bundle/src/com/arsdigita/bundle/Initializer.java
===================================================================
--- trunk/ccm-bundle/src/com/arsdigita/bundle/Initializer.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-bundle/src/com/arsdigita/bundle/Initializer.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -48,11 +48,17 @@
public void init(DomainInitEvent evt) {
super.init(evt);
- Categorization.addCategoryListener(new TermCategoryListener());
+ // Moved to terms initializer because it is a central responsibility of
+ // terms itself.
+ // /* Create new term in the proper terms domain whenever a new category
+ // * is created through CMS interface, keeping both insync */
+ // Categorization.addCategoryListener(new TermCategoryListener());
- PatternStylesheetResolver.registerPatternGenerator(
- "webapp",
- new WebAppPatternGenerator()
- );
+ // /* Register additional PatternStyleSheetResolver for Web app.
+ // * With all modules installing in one context no longer required. */
+ // PatternStylesheetResolver.registerPatternGenerator(
+ // "webapp",
+ // new WebAppPatternGenerator()
+ // );
}
}
Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeSchemaGenerator.java
===================================================================
--- trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeSchemaGenerator.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeSchemaGenerator.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -1,374 +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.bundle;
-
-import com.arsdigita.xml.Element;
-
-import com.arsdigita.persistence.metadata.ObjectType;
-import com.arsdigita.persistence.metadata.Property;
-
-import java.util.HashMap;
-import java.util.Stack;
-import java.math.BigDecimal;
-import org.apache.log4j.Logger;
-
-public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
-
- private static final Logger logger = Logger.getLogger(ObjectTypeSchemaGenerator.class);
- private boolean m_wrapRoot = false;
- private boolean m_wrapObjects = false;
- private boolean m_wrapAttributes = false;
- private Stack m_history = new Stack();
- private HashMap m_elements = new HashMap();
- // The xs:element
- private Element m_element;
- // The (optional) xs:complexType
- private Element m_type;
- // The (optional) xs:sequence
- private Element m_sequence;
- // The (optional property
- private Property m_property;
- private Stack m_properties = new Stack();
- private Element m_root;
- private String m_rootName;
- public static final String SCHEMA_PREFIX = "xs:";
- public static final String SCHEMA_NS =
- "http://www.w3.org/2001/XMLSchema";
- private static HashMap s_types = new HashMap();
-
- static {
- logger.debug("Static initalizer starting...");
- s_types.put(String.class, "xs:string");
- s_types.put(Boolean.class, "xs:boolean");
- s_types.put(Integer.class, "xs:integer");
- s_types.put(BigDecimal.class, "xs:double");
- logger.debug("Static initalizer finished.");
- }
-
- protected static String lookupType(Class klass) {
- if (s_types.containsKey(klass)) {
- return (String) s_types.get(klass);
- }
- return "xs:string";
- }
-
- public static void registerType(Class klass, String type) {
- s_types.put(klass, type);
- }
-
- public ObjectTypeSchemaGenerator(String rootName,
- String namespace) {
- m_root = new Element(SCHEMA_PREFIX + "schema",
- SCHEMA_NS);
- m_rootName = rootName;
-
- // Set the namespace for nodes defined by the schema
- m_root.addAttribute("targetNamespace", namespace);
- // Set the default namespace for unqualified nodes
- m_root.addAttribute("xmlns", namespace);
- // All nodes in an instance doc conforming to the schema
- // must be qualified
- m_root.addAttribute("elementFormDefault", "qualified");
- }
-
- public Element getRoot() {
- return m_root;
- }
-
- /**
- * Determines XML output for root object.
- * If set to true a separate element will
- * be output for the root object, if false,
- * then the element passed into the constructor
- * will be used.
- */
- public void setWrapRoot(boolean value) {
- m_wrapRoot = value;
- }
-
- /**
- * Determines XML output used for objects.
- * If set to true, then a wrapper XML element
- * will be generated for the association,
- * and then individual elements generated for
- * each object. If false then no wrapper
- * XML element will be produced.
- */
- public void setWrapObjects(boolean value) {
- m_wrapObjects = value;
- }
-
- /**
- * Determines XML output used for scalar
- * attributes. If set to true, then each
- * attribute is output as a separate element,
- * otherwise, attributes are output as simple
- * attributes.
- */
- public void setWrapAttributes(boolean value) {
- m_wrapAttributes = value;
- }
-
- /**
- * Method called when the processing of an object
- * starts
- */
- protected void beginObject(ObjectType obj,
- String path) {
- // XXX deal with revisited objects - xs:choice possibly
-
- if (m_type != null && m_sequence == null) {
- Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
- SCHEMA_NS);
- m_sequence = sequence;
- }
-
- Element parent;
- String name;
- if (m_element == null) {
- if (m_wrapRoot) {
- Element element = m_root.newChildElement(SCHEMA_PREFIX
- + "element",
- SCHEMA_NS);
- element.addAttribute("name", m_rootName);
-
- Element type = element.newChildElement(SCHEMA_PREFIX
- + "complexType",
- SCHEMA_NS);
- Element sequence = type.newChildElement(SCHEMA_PREFIX
- + "sequence",
- SCHEMA_NS);
-
- parent = sequence;
- name = nameFromPath(path);
- } else {
- parent = m_root;
- name = m_rootName;
- }
- } else {
- parent = m_sequence;
- if (m_wrapObjects) {
- name = "object";
- } else {
- name = nameFromPath(path);
- }
- }
- Element element = parent.newChildElement(SCHEMA_PREFIX + "element",
- SCHEMA_NS);
- element.addAttribute("name", name);
-
- if (m_property != null) {
- if (m_property.isNullable()) {
- element.addAttribute("minOccurs", "0");
- }
- if (m_property.isCollection()) {
- element.addAttribute("maxOccurs", "unbounded");
- }
- }
-
- Element type = element.newChildElement(SCHEMA_PREFIX + "complexType",
- SCHEMA_NS);
-
- Element oid = type.newChildElement(SCHEMA_PREFIX + "attribute",
- SCHEMA_NS);
- oid.addAttribute("name", "oid");
- oid.addAttribute("type", "xs:string");
-
- // Add to the path -> element map, not that we use this info yet
- m_elements.put(path, element);
-
- // Preserve context
- m_history.push(new Element[]{m_element, m_type, m_sequence});
-
- m_element = element;
- m_type = type;
- m_sequence = null;
- }
-
- /**
- * Method called when the procesing of an object
- * completes
- */
- protected void endObject(ObjectType obj,
- String path) {
- Element[] saved = (Element[]) m_history.pop();
- m_element = saved[0];
- m_type = saved[1];
- m_sequence = saved[2];
- }
-
- /**
- * Method called when an attribute is encountered
- */
- protected void handleAttribute(ObjectType obj,
- String path,
- Property property) {
- if (m_wrapAttributes) {
- if (m_sequence == null) {
- Element sequence = m_type.newChildElement(SCHEMA_PREFIX
- + "sequence",
- SCHEMA_NS);
- m_sequence = sequence;
- }
-
- Element element = new Element(SCHEMA_PREFIX + "element",
- SCHEMA_NS);
- element.addAttribute("name", property.getName());
- // XXX pdl type -> xs type mapping
- element.addAttribute("type", lookupType(property.getJavaClass()));
-
- if (property.isNullable()) {
- element.addAttribute("minOccurs", "0");
- }
-
- // Add to element
- m_sequence.addContent(element);
-
- // Add to the path -> element map
- m_elements.put(path, element);
- } else {
- Element element = new Element(SCHEMA_PREFIX + "attribute",
- SCHEMA_NS);
- element.addAttribute("name", property.getName());
- // XXX pdl type -> xs type mapping
- element.addAttribute("type", lookupType(property.getJavaClass()));
-
- if (property.isRequired()) {
- element.addAttribute("use", "required");
- }
-
- // Add to element
- m_type.addContent(element);
-
- // Add to the path -> element map
- m_elements.put(path, element);
- }
- }
-
- /**
- * Method called when the processing of a role
- * starts
- */
- protected void beginRole(ObjectType obj,
- String path,
- Property property) {
- if (m_wrapObjects) {
- if (m_sequence == null) {
- Element sequence = m_type.newChildElement(SCHEMA_PREFIX
- + "sequence",
- SCHEMA_NS);
- m_sequence = sequence;
- }
-
- Element element = m_sequence.newChildElement(SCHEMA_PREFIX
- + "element",
- SCHEMA_NS);
- element.addAttribute("name", property.getName());
- if (property.isNullable()) {
- element.addAttribute("minOccurs", "0");
- }
-
- Element type = element.newChildElement(SCHEMA_PREFIX + "complexType",
- SCHEMA_NS);
- Element sequence = type.newChildElement(SCHEMA_PREFIX + "sequence",
- SCHEMA_NS);
-
- // Preserve context
- m_history.push(new Element[]{m_element, m_type, m_sequence});
-
- m_element = element;
- m_type = type;
- m_sequence = sequence;
- }
- m_properties.push(m_property);
- m_property = property;
- }
-
- /**
- * Method called when the procesing of a role
- * completes
- */
- protected void endRole(ObjectType obj,
- String path,
- Property property) {
- if (m_wrapObjects) {
- Element[] saved = (Element[]) m_history.pop();
- m_element = saved[0];
- m_type = saved[1];
- m_sequence = saved[2];
- }
- m_property = (Property) m_properties.pop();
- }
-
- /**
- * Method called when the processing of an association
- * starts
- */
- protected void beginAssociation(ObjectType obj,
- String path,
- Property property) {
- if (m_wrapObjects) {
- if (m_sequence == null) {
- Element sequence = m_type.newChildElement(SCHEMA_PREFIX
- + "sequence",
- SCHEMA_NS);
- m_sequence = sequence;
- }
-
- Element element = m_sequence.newChildElement(SCHEMA_PREFIX
- + "element",
- SCHEMA_NS);
- element.addAttribute("name", property.getName());
- if (property.isNullable()) {
- element.addAttribute("minOccurs", "0");
- }
-
- Element type = element.newChildElement(SCHEMA_PREFIX + "complexType",
- SCHEMA_NS);
- Element sequence = type.newChildElement(SCHEMA_PREFIX + "sequence",
- SCHEMA_NS);
-
- // Preserve context
- m_history.push(new Element[]{m_element, m_type, m_sequence});
-
- m_element = element;
- m_type = type;
- m_sequence = sequence;
- }
- m_properties.push(m_property);
- m_property = property;
- }
-
- /**
- * Method called when the procesing of an association
- * completes
- */
- protected void endAssociation(ObjectType obj,
- String path,
- Property property) {
- if (m_wrapObjects) {
- Element[] saved = (Element[]) m_history.pop();
- m_element = saved[0];
- m_type = saved[1];
- m_sequence = saved[2];
- }
- m_property = (Property) m_properties.pop();
- }
-
-}
Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversal.java
===================================================================
--- trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversal.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversal.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -1,358 +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.bundle;
-
-import com.arsdigita.util.Assert;
-
-import com.arsdigita.persistence.metadata.ObjectType;
-import com.arsdigita.persistence.metadata.Property;
-import com.arsdigita.persistence.metadata.MetadataRoot;
-
-import java.util.Iterator;
-import java.util.HashMap;
-
-import org.apache.log4j.Logger;
-
-// XXX this class is pretty similar to DomainObjectTraversal
-// and it would be nice to figure out a way to let them share
-// some of their logic (provided it didn't cripple / obfuscate
-// the API).
-
-// At minimum the process for registering & looking up hierachical
-// adapters can be shared. Also the mangling of names / paths.
-
-
-/**
- * <p>This class provides a general purpose framework for iterating
- * over a domain object's properties, processing attributes and
- * traversing associations as required.</p>
- *
- * <p>Subclasses should implement the startXXX and endXXX methods to
- * provide whatever processing logic they require upon encountering
- * attributes, roles, associations and objects.</p>
- *
- * <p>The {@link com.arsdigita.domain.ObjectTypeTraversalAdapter}
- * provides a means to control which properties are processed and,
- * most importantly, which associations are traversed. When
- * registering an adapter, a 'use context' is supplied allowing
- * different adapters to be used according to the requirements of any
- * implementing subclass. It is recommended that the use context be
- * based on the fully qualified name of the class using
- * ObjectTypeTraversal, e.g.,
- * com.arsdigita.cms.ui.ObjectTypeRenderer.</p>
- *
- * <p>The path argument provided to the adapter and the startXXX ad
- * endXXX methods indicates which associations are currently being
- * traversed. The first element in the path is always '/object'. If it
- * then starts to traverse the 'rootCategory' association, the path
- * will become '/object/rootCategory'. For self-recursive
- * associations, rather than building up a long repeating string, the
- * path will be shortened by adding a '+' for each element that is
- * repeated. For example, '/object/container+' indicates that the
- * container association has been followed two or more times.</p>
- */
-public abstract class ObjectTypeTraversal {
-
- private static HashMap s_adapters = new HashMap();
-
- private static final Logger s_log = Logger.getLogger(ObjectTypeTraversal.class);
-
- /**
- * Registers a traversal adapter for an object type in a given
- * context.
- *
- * @param type the object type whose items will be traversed
- * @param adapter the adapter for controlling object traversal
- * @param context the context in which the adapter should be used
- */
- public static void registerAdapter(ObjectType type,
- ObjectTypeTraversalAdapter adapter,
- String context) {
- s_adapters.put(new AdapterKey(type, context), adapter);
- }
-
- /**
- * Unregisteres a traversal adapter for an object type in a
- * given context
- *
- * @param type the object type whose items will be traversed
- * @param context the context in which the adapter should be used
- */
- public static void unregisterAdapter(ObjectType type,
- String context) {
- s_adapters.remove(new AdapterKey(type, context));
- }
-
- /**
- * Registers a traversal adapter for an object type in a given
- * context.
- *
- * @param type the object type whose items will be traversed
- * @param adapter the adapter for controlling object traversal
- * @param context the context in which the adapter should be used
- */
- public static void registerAdapter(String type,
- ObjectTypeTraversalAdapter adapter,
- String context) {
- registerAdapter(MetadataRoot.getMetadataRoot().getObjectType(type),
- adapter,
- context);
- }
-
- /**
- * Unregisteres a traversal adapter for an object type in a
- * given context
- *
- * @param type the object type whose items will be traversed
- * @param context the context in which the adapter should be used
- */
- public static void unregisterAdapter(String type,
- String context) {
- unregisterAdapter(MetadataRoot.getMetadataRoot().getObjectType(type),
- context);
- }
-
- /**
- * Retrieves the traversal adapter for an object type in a given
- * context.
- *
- * @param type the object type to lookup
- * @param context the adapter context
- */
- public static ObjectTypeTraversalAdapter lookupAdapter(ObjectType type,
- String context) {
- return (ObjectTypeTraversalAdapter)s_adapters
- .get(new AdapterKey(type, context));
- }
-
- /**
- * Retrieves the closest matching traversal adapter for an object type
- * in a given context. The algorithm looks for an exact match, then
- * considers the supertype, and the supertype's supertype. If no match
- * could be found at all, returns null
- *
- * @param type the object type to search for
- * @param context the adapter context
- */
- public static ObjectTypeTraversalAdapter findAdapter(ObjectType type,
- String context) {
- ObjectTypeTraversalAdapter adapter = null;
- while (adapter == null && type != null) {
- adapter = lookupAdapter(type, context);
- type = type.getSupertype();
- }
- return adapter;
- }
-
- /**
- * Walks over properties of a domain object, invoking
- * methods to handle assoications, roles and attributes.
- *
- * @param obj the domain object to traverse
- * @param context the context for the traversal adapter
- */
- public void walk(String type,
- String context) {
- walk(MetadataRoot.getMetadataRoot().getObjectType(type),
- context);
- }
-
- /**
- * Walks over properties of a domain object, invoking
- * methods to handle assoications, roles and attributes.
- *
- * @param obj the domain object to traverse
- * @param context the context for the traversal adapter
- */
- public void walk(ObjectType type,
- String context) {
- Assert.exists(type, ObjectType.class);
-
- ObjectTypeTraversalAdapter adapter = findAdapter(type,
- context);
- Assert.exists(adapter, ObjectTypeTraversalAdapter.class);
- walk(adapter, type, "/object");
- }
-
- private void walk(ObjectTypeTraversalAdapter adapter,
- ObjectType type,
- String path) {
- beginObject(type, path);
-
- if (s_log.isInfoEnabled()) {
- s_log.info("Walking " + path + " type: " + type.getQualifiedName());
- }
-
- for (Iterator i = type.getProperties(); i.hasNext(); ) {
- Property prop = (Property) i.next();
- String propName = prop.getName();
-
- if (!adapter.processProperty(type,
- appendToPath(path, prop.getName()),
- prop)) {
- if (s_log.isDebugEnabled()) {
- s_log.debug("Skipping property " + propName);
- }
- continue;
- }
- if (s_log.isDebugEnabled()) {
- s_log.debug("Process property " + propName + " type " + prop.getType().getQualifiedName());
- }
-
- if (prop.isAttribute()) {
- handleAttribute(type, path, prop);
- } else {
- if (!prop.isCollection()) {
- beginRole(type, path, prop);
-
- walk(adapter,
- (ObjectType)prop.getType(),
- appendToPath(path, propName));
-
- endRole(type, path, prop);
- } else {
- beginAssociation(type, path, prop);
-
- Property roleProp = prop.getAssociatedProperty();
-
- walk(adapter,
- (ObjectType)prop.getType(),
- appendToPath(path, propName));
-
- endAssociation(type, path, prop);
- }
- }
- }
-
- endObject(type, path);
- }
-
-
- /**
- * Method called when the processing of an object
- * starts
- */
- protected abstract void beginObject(ObjectType obj,
- String path);
- /**
- * Method called when the procesing of an object
- * completes
- */
- protected abstract void endObject(ObjectType obj,
- String path);
-
- /**
- * Method called when an attribute is encountered
- */
- protected abstract void handleAttribute(ObjectType obj,
- String path,
- Property property);
-
- /**
- * Method called when the processing of a role
- * starts
- */
- protected abstract void beginRole(ObjectType obj,
- String path,
- Property property);
-
- /**
- * Method called when the procesing of a role
- * completes
- */
- protected abstract void endRole(ObjectType obj,
- String path,
- Property property);
-
- /**
- * Method called when the processing of an association
- * starts
- */
- protected abstract void beginAssociation(ObjectType obj,
- String path,
- Property property);
-
- /**
- * Method called when the procesing of an association
- * completes
- */
- protected abstract void endAssociation(ObjectType obj,
- String path,
- Property property);
-
-
- protected String appendToPath(String path,
- String name) {
- if (path.endsWith("/" + name)) {
- path = path + "+";
- } else if (!path.endsWith("/" + name + "+")) {
- path = path + "/" + name;
- }
-
- return path;
- }
-
- protected String nameFromPath(String path) {
- int index = path.lastIndexOf("/");
- Assert.isTrue(index >= 0, "Path starts with /");
-
- if (path.endsWith("+")) {
- return path.substring(index + 1, path.length() - 2);
- } else {
- return path.substring(index + 1);
- }
- }
-
- protected String parentFromPath(String path) {
- int index = path.lastIndexOf("/");
- Assert.isTrue(index >= 0, "Path starts with /");
-
- if (index == 0) {
- return null;
- } else {
- return path.substring(0, index - 1);
- }
- }
-
- private static class AdapterKey {
- private ObjectType m_type;
- private String m_context;
-
- public AdapterKey(ObjectType type,
- String context) {
- m_type = type;
- m_context = context;
- }
-
- public boolean equals(Object o) {
- if (o instanceof AdapterKey) {
- AdapterKey k = (AdapterKey)o;
- return k.m_type.equals(m_type) &&
- k.m_context.equals(m_context);
- } else {
- return false;
- }
- }
-
- public int hashCode() {
- return m_type.hashCode() + m_context.hashCode();
- }
- }
-
-}
Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversalAdapter.java
===================================================================
--- trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversalAdapter.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-bundle/src/com/arsdigita/bundle/ObjectTypeTraversalAdapter.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -1,60 +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.bundle;
-
-import com.arsdigita.persistence.metadata.Property;
-import com.arsdigita.persistence.metadata.ObjectType;
-
-// XXX this class is pretty similar to DomainObjectTraversal
-// and it would be nice to figure out a way to let them share
-// some of their logic (provided it didn't cripple / obfuscate
-// the API).
-
-/**
- * <p>This interface is used to control traversal of domain
- * objects. Whenever a property is encountered, the {@link
- * #processProperty} method will be called to determine whether or not
- * to continue processing the object. The most important use for this
- * is to prevent the needless (and potentially infinite) traversal of
- * associations between objects, but it can also be used to filter out
- * certain attributes.</p>
- *
- * <p>Instances of this class need to be registered using the
- * DomainObjectTraversal.registerAdapter method.</p>
- *
- * @see com.arsdigita.domain.DomainObjectTraversal
- * @see com.arsdigita.domain.SimpleDomainObjectTraversalAdapter
- * @version $Id: ObjectTypeTraversalAdapter.java 287 2005-02-22 00:29:02Z sskracic $
- */
-public interface ObjectTypeTraversalAdapter {
- /**
- * Invoked to determine whether to process a property.
- * Should return true to allow processing to commence,
- * false to prevent it.
- *
- * @param obj the object type currently being processed
- * @param path the path to the current domain object from
- * the root object being traversed
- * @param prop the property about to be processed
- * @return true if the property should be processed
- */
- public boolean processProperty(ObjectType obj,
- String path,
- Property prop);
-}
Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/SimpleObjectTypeTraversalAdapter.java
===================================================================
--- trunk/ccm-bundle/src/com/arsdigita/bundle/SimpleObjectTypeTraversalAdapter.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-bundle/src/com/arsdigita/bundle/SimpleObjectTypeTraversalAdapter.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -1,151 +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.bundle;
-
-import org.apache.log4j.Logger;
-import com.arsdigita.persistence.metadata.Property;
-import com.arsdigita.persistence.metadata.ObjectType;
-import java.util.HashSet;
-
-/**
- * This is a general purpose traversal adaptor
- * that allows/denies processing of a property
- * based on the path to the property, and its
- * presence in an inclusion/exclusion set.
- *
- * Instances of this class can be configured using
- * the ObjectTypeTraversalInitializer
- *
- * <p>See <code>com.arsdigita.cms.installer.ObjectTypeTraversalInitializer</code>.
- */
-public class SimpleObjectTypeTraversalAdapter
- implements ObjectTypeTraversalAdapter {
-
- private static final Logger s_log =
- Logger.getLogger(SimpleObjectTypeTraversalAdapter.class);
-
- /**
- * Rule that indicates the set of properties should be treated
- * as an inclusion list. ie, don't allow any properties except
- * those listed. This is the default for associations
- */
- public final static int RULE_INCLUDE = 0;
- /**
- * Rule that indicates the set of properties should be treated
- * as an exclusion list. ie, allow through all properties,
- * except those listed. This is the default for attributes.
- */
- public final static int RULE_EXCLUDE = 1;
-
- private HashSet m_attr = new HashSet();
- private HashSet m_assoc = new HashSet();
-
- private int m_attrRule = RULE_EXCLUDE;
- private int m_assocRule = RULE_INCLUDE;
-
- private SimpleObjectTypeTraversalAdapter m_parent;
-
- /**
- * Creates a new traversal adapter, with no parent
- * delegate. If no explicit rule is present it will
- * return false if RULE_INCLUDE is set, or true if
- * RULE_EXCLUDE is set.
- */
- public SimpleObjectTypeTraversalAdapter() {
- this(null);
- }
-
- /**
- * Creates a new traversal adapter, extending the rules
- * defined by a parent. If there is no explicit rule
- * for the property questioned, it will delegate the
- * query to the parent.
- * @param parent the parent adapter to delegate to
- */
- public SimpleObjectTypeTraversalAdapter(
- SimpleObjectTypeTraversalAdapter parent
- ) {
- m_parent = parent;
- }
-
- /**
- * Set the rule for processing attributes
- *
- * @param rule the new processing rule
- */
- public void setAttributeRule(int rule) {
- m_attrRule = rule;
- }
-
- /**
- * Set the rule for processing associations
- *
- * @param rule the new processing rule
- */
- public void setAssociationRule(int rule) {
- m_assocRule = rule;
- }
-
- /**
- * Add a property to the attribute property set.
- *
- * @param path the full path to the property
- */
- public void addAttributeProperty(String prop) {
- m_attr.add(prop);
- }
-
- /**
- * Add a property to the association property set.
- *
- * @param path the full path to the property
- */
- public void addAssociationProperty(String prop) {
- m_assoc.add(prop);
- }
-
- /**
- * Determines whether or not to allow processing
- * of a property, based on the property set and
- * the processing rule
- */
- public boolean processProperty(ObjectType obj,
- String path,
- Property prop) {
- if (prop.isAttribute()) {
- boolean result = m_attr.contains(path);
- s_log.debug("Check attr " + path + " contains " +
- result + " " + m_attrRule);
- if (!result && m_parent != null) {
- s_log.debug("No explicit rule, delegating to parent");
- return m_parent.processProperty(obj, path, prop);
- }
- return m_attrRule == RULE_INCLUDE ? result : !result;
- } else {
- boolean result = m_assoc.contains(path);
- s_log.debug("Check assoc " + path + " contains " +
- result + " " + m_attrRule);
- if (!result && m_parent != null) {
- s_log.debug("No explicit rule, delegating to parent");
- return m_parent.processProperty(obj, path, prop);
- }
- return m_assocRule == RULE_INCLUDE ? result : !result;
- }
- }
-}
Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/WebAppPatternGenerator.java
===================================================================
--- trunk/ccm-bundle/src/com/arsdigita/bundle/WebAppPatternGenerator.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-bundle/src/com/arsdigita/bundle/WebAppPatternGenerator.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -1,57 +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.bundle;
-
-
-import com.arsdigita.web.Application;
-import com.arsdigita.web.Web;
-import com.arsdigita.templating.PatternGenerator;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * Generates a set of patterns corresponding to the current
- * web application prefix
- */
-public class WebAppPatternGenerator implements PatternGenerator {
-
- private static final Logger s_log =
- Logger.getLogger(WebAppPatternGenerator.class);
-
- public String[] generateValues(String key,
- HttpServletRequest req) {
- Application app = Web.getContext().getApplication();
- String ctx = app == null ? null : app.getContextPath();
-
- if (app == null ||
- ctx == null ||
- "".equals(ctx)) {
- return new String[] { Web.ROOT_WEBAPP };
- }
-
- if (ctx.startsWith("/")) {
- ctx = ctx.substring(1);
- }
-
- return new String[] { ctx };
- }
-}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-cms/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -18,10 +18,10 @@
*/
package com.arsdigita.cms.lifecycle;
-import java.text.DateFormat;
-
-import org.apache.log4j.Logger;
-
+import java.text.DateFormat;
+
+import org.apache.log4j.Logger;
+
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentPage;
import com.arsdigita.cms.ContentSection;
@@ -51,7 +51,7 @@
* that the item is about to expire.
* Does nothing at the end of the phase.
*@author <a href="mailto:mha...@re...">Michael Hanisch</a>
- *@version $Id$
+ *@version $Id$
*/
public class NotifyLifecycleListener implements LifecycleListener {
@@ -81,11 +81,12 @@
final ContentSection section = item.getContentSection();
if (s_log.isDebugEnabled()) {
s_log.debug("item = " + (item == null ? "null" : item.toString()));
- s_log.debug("section = "+ (section == null ? "null" : section.toString()));
+ s_log.debug("section = "+ (section == null ? "null"
+ : section.toString()));
}
- Assert.exists(item);
- Assert.exists(section);
+ Assert.exists(item);
+ Assert.exists(section);
UserCollection spamVictims = getRecipients(item);
User user = null;
@@ -122,13 +123,13 @@
public void sendOneEmail(User user, Message message) {
Notification notif = new Notification(user, message);
- if (ContentSection.getConfig().deleteExpiryNotifications()) {
- notif.setIsPermanent(Boolean.FALSE);
- // true is set as default column value in DB for all
- // notifications, but set explicitly here in case that
- // changes
- notif.setMessageDelete(Boolean.TRUE);
- }
+ if (ContentSection.getConfig().deleteExpiryNotifications()) {
+ notif.setIsPermanent(Boolean.FALSE);
+ // true is set as default column value in DB for all
+ // notifications, but set explicitly here in case that
+ // changes
+ notif.setMessageDelete(Boolean.TRUE);
+ }
if (s_log.isDebugEnabled()) {
s_log.debug("notifying user " + user.getPrimaryEmail());
}
@@ -204,13 +205,14 @@
UserCollection usersToAlert = null;
if (alertRole != null) {
- usersToAlert = alertRole.getContainedUsers();
+ usersToAlert = alertRole.getContainedUsers();
Filter pFilter = PermissionService
- .getObjectFilterQuery(usersToAlert.getFilterFactory(),
- "id",
- PrivilegeDescriptor.
- get(SecurityManager.CMS_EDIT_ITEM),
- item.getDraftVersion().getParent().getOID()); // !! see above!!
+ .getObjectFilterQuery(
+ usersToAlert.getFilterFactory(),
+ "id",
+ PrivilegeDescriptor.
+ get(SecurityManager.CMS_EDIT_ITEM),
+ item.getDraftVersion().getParent().getOID()); // see above!!
usersToAlert.addFilter(pFilter);
}
return usersToAlert;
@@ -224,8 +226,8 @@
*@return a Message concerning <tt>item</tt
*/
protected Message createMessage(ContentItem item,
- LifecycleEvent lc) {
- Assert.exists(item);
+ LifecycleEvent lc) {
+ Assert.exists(item);
Message message = null;
Party sender = UserTask.getAlertsSender();
if (sender == null) {
@@ -244,21 +246,32 @@
String subject = "Content Item " + name + " is about to expire";
-
-
- String publicURL = URL.there(section.getSiteNode().getURL(DispatcherHelper.getWebappContext())
- + ((ContentItem)item.getParent()).getPath(),
- null).getURL();
+
+ // term section.getSiteNode below doesn't produce any meaningful
+ // value, because table sitenodes is empty since all apps are
+ // new style, legacy free apps. Term returns null.
+
+ // section.getSiteNode() get the sigenote object for the current
+ // contentsection in use, getURL is a sitenode method to provide
+ // the corresponding URL as String.
+ // Modification NOT test yet!
+ String publicURL = URL.there(
+ // section.getSiteNode().getURL(DispatcherHelper.getWebappContext())
+ section.getPath()
+ + ((ContentItem)item.getParent()).getPath()
+ ,null
+ ).getURL();
// link to the trunk version of the item, which can be edited.
// the live item cannot!
- //String adminURL = URL.there(ContentItemPage.getItemURL(item,ContentItemPage.AUTHORING_TAB), null).getURL();
+
ContentItem adminItem = item.getDraftVersion();
if (adminItem == null) {
adminItem = item;
}
- String adminURL = URL.there(ContentItemPage.getItemURL(adminItem,
- ContentItemPage.AUTHORING_TAB)
+ String adminURL = URL.there(ContentItemPage
+ .getItemURL(adminItem,
+ ContentItemPage.AUTHORING_TAB)
, null).getURL();
StringBuffer body = new StringBuffer(300);
Modified: trunk/ccm-core/src/WEB-INF/resources/stylesheet-paths.txt
===================================================================
--- trunk/ccm-core/src/WEB-INF/resources/stylesheet-paths.txt 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-core/src/WEB-INF/resources/stylesheet-paths.txt 2013-02-02 22:55:13 UTC (rev 2473)
@@ -3,8 +3,8 @@
# "PatternStylesheetResolver". Please read the Javadoc for that file for
# the full story.
-http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::-::locale::.xsl
-http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::.xsl
+http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::-::locale::.xsl
+http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::.xsl
-http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::-::locale::.xsl
-http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::.xsl
+http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::locale::.xsl
+http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::.xsl
Modified: trunk/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -78,9 +78,9 @@
* <table border="1">
* <tr> <th> Pattern </th> <th> Meaning </th> <th> Examples </th> </tr>
* <tr>
- * <td> <code>::locale::</code> </td>
- * <td> Current locale </td>
- * <td> <code>fr_FR</code> </td>
+ * <td> <code>::host::</code> </td>
+ * <td> Host name </td>
+ * <td> <code>www.aplaws.org</code> </td>
* </tr>
* <tr>
* <td> <code>::vhost::</code> </td>
@@ -88,10 +88,41 @@
* <td> <code>business.camden.gov.uk</code> </td>
* </tr>
* <tr>
+ * <td> <code>::webapp::</code> </td>
+ * <td> Current web application name (ie. context or document root) </td>
+ * <td> <code>ccm</code> </td>
+ * </tr>
+ * <tr>
+ * <td> <code>::application::</code> </td>
+ * <td> Current application name </td>
+ * <td> <code>navigation</code> </td>
+ * </tr>
+ * <tr>
+ * <td> <code>::url::</code> </td>
+ * <td> URL stub of the current applications name tree</td>
+ * <td> <code>admin</code> </td>
+ * </tr>
+ * <tr>
+ * <td> <code>::prefix::</code> </td>
+ * <td> ??</td>
+ * <td> <code>??</code> </td>
+ * </tr>
+ * <tr>
* <td> <code>::outputtype::</code> </td>
* <td> Output format. </td>
* <td> <code>text_html</code> </td>
* </tr>
+ * <tr>
+ * <td> <code>::locale::</code> </td>
+ * <td> Current locale </td>
+ * <td> <code>fr_FR</code> </td>
+ * </tr>
+ * <tr>clear
+ *
+ * <td> <code>::outputtype::</code> </td>
+ * <td> Output format. </td>
+ * <td> <code>text_html</code> </td>
+ * </tr>
* </table>
*
* <p>
@@ -109,6 +140,17 @@
* The resolver looks at each stylesheet in turn, and the first one which
* actually exists on disk is returned.
* </p>
+ *
+ * Developer may customize the process by writing a custom pattern generator
+ * and add it in a custom integration package Initializer (e.g. ccm-ldn-aplaws)
+ * by following code:
+ * // Register additional PatternStyleSheetResolver for Web app.
+ * // With all modules installing in one context no longer required.
+ * PatternStylesheetResolver.registerPatternGenerator(
+ * "[myKey]",
+ * new [My]PatternGenerator()
+ * );
+ *
*
* @author Richard W.M. Jones
*/
@@ -147,7 +189,7 @@
registerPatternGenerator
("prefix", new PrefixPatternGenerator());
registerPatternGenerator
- ("webapps", new WebAppPatternGenerator());
+ ("webapp", new WebAppPatternGenerator());
registerPatternGenerator
("host", new HostPatternGenerator());
s_log.debug("Static initalizer finished.");
Modified: trunk/ccm-core/src/com/arsdigita/templating/PrefixPatternGenerator.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/templating/PrefixPatternGenerator.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-core/src/com/arsdigita/templating/PrefixPatternGenerator.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -22,18 +22,27 @@
import javax.servlet.http.HttpServletRequest;
/**
- * Generates a pattern for based on the request prefix,
+ * Generates a pattern for based on the request dispatcher prefix,
* eg /print/content/myitem.jsp -> { 'print' }
* /text-only/content/myitem.jsp -> { 'text-only' }
*/
public class PrefixPatternGenerator implements PatternGenerator {
+
+ /**
+ *
+ * @param key
+ * @param req
+ * @return
+ */
public String[] generateValues(String key,
HttpServletRequest req) {
String value = DispatcherHelper.getDispatcherPrefix(req);
if (value != null) {
return new String[] { value.substring(1) };
}
-
- return new String[] { };
+ else {
+ return new String[] { };
+ }
}
+
}
Modified: trunk/ccm-core/src/com/arsdigita/templating/PresentationManager.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/templating/PresentationManager.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-core/src/com/arsdigita/templating/PresentationManager.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -23,18 +23,21 @@
import javax.servlet.http.HttpServletResponse;
/**
- * Interface for styling and serving XML documents to
- * the response output stream. The PresentationManager contains the
- * code that determines which XSLT transformer(s) are to be applied to
- * a given document. The default
- * BasePresentationManager should suffice for most cases. A custom
- * presentation manager is needed if an application needs to
+ * Interface for styling and serving XML documents to the response output
+ * stream.
+ *
+ * The PresentationManager contains the code that determines which
+ * XSLT transformer(s) are to be applied to a given document.
+ *
+ * The (default) SimplePresentationManager just links to the bebop
+ * implementation. It should suffice for most cases.
+ *
+ * A custom presentation manager is needed if an application needs to
* dynamically apply a set of templates to an XML document in a custom
* way. Typically, this occurs if the template selection
* depends on the outcome of some application-specific logic.
*
- * @see com.arsdigita.sitenode.SiteNodePresentationManager
- * @see com.arsdigita.sitenode.BasePresentationManager
+ * @see com.arsdigita.templating.SimplePresentationManager
*
* @author Bill Schneider
* @version ACS 4.6
Modified: trunk/ccm-core/src/com/arsdigita/templating/SimplePresentationManager.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/templating/SimplePresentationManager.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-core/src/com/arsdigita/templating/SimplePresentationManager.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -28,7 +28,7 @@
* configuration registry.
*/
/* NON Javadoc comment:
- * Used to be depracated in version 6.6.0. Reverted to non-deprecated in version
+ * Used to be deprecated in version 6.6.0. Reverted to non-deprecated in version
* 6.6.0 release 3. Package templating provides the basic mechanism for CCM
* templating system an should provide an implementation of the Presentation
* Manager interface to be complete.
Modified: trunk/ccm-core/src/com/arsdigita/templating/WebAppPatternGenerator.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/templating/WebAppPatternGenerator.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-core/src/com/arsdigita/templating/WebAppPatternGenerator.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -29,28 +29,48 @@
/**
* Generates a set of patterns corresponding to the current
- * web application prefix
+ * web application prefix.
*/
public class WebAppPatternGenerator implements PatternGenerator {
+ /** Private Logger instance for debugging purpose. */
private static final Logger s_log =
Logger.getLogger(WebAppPatternGenerator.class);
public String[] generateValues(String key,
HttpServletRequest req) {
+
Application app = Web.getContext().getApplication();
String ctx = app == null ? null : app.getContextPath();
- if (app == null ||
- ctx == null ||
- "".equals(ctx)) {
- return new String[] { Web.ROOT_WEBAPP };
+ if (s_log.isDebugEnabled()) {
+ s_log.debug("Generating Values key: " + key + " [" +
+ "Web.getContext(): " + Web.getContext() + "," +
+ "Application: " + Web.getContext().getApplication() + "," +
+ "ContextPath: " + ctx + "," + "]");
}
+
+ if (app == null || ctx == null || "".equals(ctx)) {
+ return new String[] { Web.ROOT_WEBAPP }; // Currently "ROOT"
+ }
if (ctx.startsWith("/")) {
ctx = ctx.substring(1);
}
- return new String[] { ctx + "," + Web.ROOT_WEBAPP };
+ /* "Older version: prior 6.6. Some modules used to be installed into
+ * its own web application context, but needed access to the main
+ * applications package files (e.g. bebop) which were installed into
+ * to ROOT web context. Therefore ROOT had to be added.
+ */
+ // return new String[] { ctx + "," + Web.ROOT_WEBAPP };
+
+ /* As of version 6.6 all packages are installed in one web application
+ * context, therefore the ROOT entry is no longer valid.
+ * This variation had first be introduced with the APLAWS integration
+ * package, which used to register an additional WebAppPatternGenerator,
+ * which simply cuts ","+ Web.ROOT_WEBAPP, under a different key
+ * "Webapp" (singular) */
+ return new String[] { ctx };
}
}
Modified: trunk/ccm-forum-categorised/src/com/arsdigita/forum/categorised/ForumTermPicker.java
===================================================================
--- trunk/ccm-forum-categorised/src/com/arsdigita/forum/categorised/ForumTermPicker.java 2013-02-02 18:43:41 UTC (rev 2472)
+++ trunk/ccm-forum-categorised/src/com/arsdigita/forum/categorised/ForumTermPicker.java 2013-02-02 22:55:13 UTC (rev 2473)
@@ -40,16 +40,20 @@
public ForumTermPicker(BigDecimalParameter root,
StringParameter mode) {
- super(root, mode);
- s_log.debug("instantiating ForumCategoryPicker");
+
+ super(root, mode);
+ s_log.debug("instantiating ForumCategoryPicker");
}
/* (non-Javadoc)
- * @see com.arsdigita.aplaws.ui.ACSObjectCategoryPicker#getForm(com.arsdigita.bebop.parameters.BigDecimalParameter, com.arsdigita.bebop.parameters.StringParameter)
+ * @see com.arsdigita.aplaws.ui.ACSObjectCa...
[truncated message content] |
Author: pboy
Date: 2013-02-02 18:43:41 +0000 (Sat, 02 Feb 2013)
New Revision: 2472
Modified:
trunk/
trunk/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaLoader.java
trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleLoader.java
trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java
trunk/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkLoader.java
trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventLoader.java
trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java
trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java
trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java
trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java
trunk/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemLoader.java
trunk/ccm-core/src/ccm-core.checklist
trunk/ccm-core/src/ccm-core.load
trunk/ccm-core/src/ccm-core.upgrade
trunk/ccm-core/src/com/arsdigita/toolbox/ui/DomainObjectPropertySheet.java
trunk/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ContactLoader.java
trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java
Log:
Enhanced various formatting, added various documentation.
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- conf
runtime
build-projects.xml
local.**.properties
build.xml
packages
nbproject
Project**
.ant-targets-build.xml
.local.ccm.properties.swp
.tmp.project.xml
.tmp.applications.list
.tmp.applications.list.swp
.local.runtime.properties.swp
.local.build.properties.swp
ccm-lbc-**
+ conf
runtime
build-projects.xml
local.**.properties
build.xml
packages
nbproject
Project**
.ant-targets-build.xml
.local.ccm.properties.swp
.tmp.project.xml
.tmp.applications.list
.tmp.applications.list.swp
.local.runtime.properties.swp
.local.build.properties.swp
ccm-lbc-**
.r2449.msg.swp
Modified: trunk/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaLoader.java
===================================================================
--- trunk/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaLoader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaLoader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,18 +21,33 @@
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
- * Loader. Just sets content type specific properties for use of the parent class.
+ * Loader executes nonrecurring once at install time and loads the Agenda
+ * contenttype package persistently into database.
*
+ * It uses the base class to create the database schema and the required
+ * table entries for the contenttype.
+ *
* @author Rafael H. Schloming <rh...@mi...>
* @version $Revision: #7 $ $Date: 2004/08/17 $
* @version $Id$
*/
public class AgendaLoader extends AbstractContentTypeLoader {
+ /** Defines the xml file containing the EForm content types property
+ * definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Agenda.xml"
};
+ /**
+ * Provides the of Agenda contenttype property definitions implementing
+ * the parent's class abstract method.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * @return String Array of fully qualified file names
+ */
public String[] getTypes() {
return TYPES;
}
Modified: trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleLoader.java
===================================================================
--- trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleLoader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleLoader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,17 +21,32 @@
// import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
- * Loader.
+ * Loader executes nonrecurring once at install time and loads the Article
+ * contenttype package persistently into database.
*
+ * It uses the base class to create the database schema and the required
+ * table entries for the contenttype.
+ *
* @author Justin Ross <jr...@re...>
* @version $Id$
*/
public class ArticleLoader extends AbstractContentTypeLoader {
+ /** Defines the xml file containing the Article content types property
+ * definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Article.xml"
};
+ /**
+ * Provides the of Article contenttype property definitions
+ * implementing the parent's class abstract method.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * @return String Atring Array of fully qualified file names
+ */
public String[] getTypes() {
return TYPES;
}
Modified: trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java
===================================================================
--- trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,11 +21,11 @@
import com.arsdigita.bebop.Component;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Article;
-import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil;
+import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/**
* Authoring step to edit the simple attributes of the Article content
Modified: trunk/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkLoader.java
===================================================================
--- trunk/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkLoader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkLoader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,17 +21,32 @@
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
- * Loader.
+ * Loader executes nonrecurring once at install time and loads the
+ * Bookmark contenttype package persistently into database.
*
+ * It uses the base class to create the database schema and the required
+ * table entries for the contenttype.
+ *
* @author Justin Ross <jr...@re...>
* @version $Id$
*/
public class BookmarkLoader extends AbstractContentTypeLoader {
- private static final String[] TYPES = {
+ /** Defines the xml file containing the Bookmark content types
+ * property definitions. */
+ private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Bookmark.xml"
};
+ /**
+ * Provides the of Bookmark contenttype property definitions implementing
+ * the parent's class abstract method.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * @return String Atring Array of fully qualified file names
+ */
public String[] getTypes() {
return TYPES;
}
Modified: trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventLoader.java
===================================================================
--- trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventLoader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventLoader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,19 +21,33 @@
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
- * Loader
+ * Loader executes nonrecurring once at install time and loads the
+ * Event contenttype package persistently into database.
*
+ * It uses the base class to create the database schema and the required
+ * table entries for the contenttype.
+ *
* @author Rafael H. Schloming <rh...@mi...>
* @version $Revision: #6 $ $Date: 2004/08/17 $
* @version $Id$
- **/
-
+ */
public class EventLoader extends AbstractContentTypeLoader {
- private static final String[] TYPES = {
+ /** Defines the xml file containing the EForm content types
+ * property definitions. */
+private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Event.xml"
};
+ /**
+ * Provides the of Event contenttype property definitions
+ * implementing the parent's class abstract method.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * @return String Atring Array of fully qualified file names
+ */
public String[] getTypes() {
return TYPES;
}
Modified: trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java
===================================================================
--- trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -24,14 +24,14 @@
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Event;
-import com.arsdigita.domain.DomainObject;
-import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
+import com.arsdigita.cms.contenttypes.util.EventGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
-import com.arsdigita.cms.contenttypes.util.EventGlobalizationUtil;
+import com.arsdigita.domain.DomainObject;
import com.arsdigita.globalization.GlobalizationHelper;
+import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import java.text.DateFormat;
import java.util.Calendar;
@@ -39,26 +39,36 @@
/**
* Authoring step to view/edit the simple attributes of the Event content type (and
- * its subclasses). The attributes edited are 'name', 'title', 'lead',
+ * its subclasses).
+ *
+ * The attributes edited are 'name', 'title', 'lead',
* 'start date', 'starttime', end date', 'end time','event date' (literal descr. of date),
* 'location', 'main contributor', 'event type', 'map link', and
- * 'cost'. This authoring step replaces the
+ * 'cost'.
+ *
+ * This authoring step replaces the
* <code>com.arsdigita.ui.authoring.PageEdit</code> step for this type.
- **/
+ */
public class EventPropertiesStep extends SimpleEditStep {
/** The name of the editing sheet added to this step */
public static String EDIT_SHEET_NAME = "edit";
+ /**
+ *
+ * @param itemModel
+ * @param parent
+ */
public EventPropertiesStep(ItemSelectionModel itemModel,
- AuthoringKitWizard parent) {
+ AuthoringKitWizard parent) {
super(itemModel, parent);
setDefaultEditKey(EDIT_SHEET_NAME);
BasicPageForm editSheet;
editSheet = new EventPropertyForm(itemModel, this);
- add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel),
+ add(EDIT_SHEET_NAME, "Edit",
+ new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());
setDisplayComponent(getEventPropertySheet(itemModel));
@@ -76,9 +86,14 @@
public static Component getEventPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name").localize(), Event.NAME);
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title").localize(), Event.TITLE);
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize(), Event.LEAD);
+
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name").localize(), Event.NAME);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title").localize(), Event.TITLE);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize(), Event.LEAD);
+
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name"), Event.NAME);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title"), Event.TITLE);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead"), Event.LEAD);
if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add(EventGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
ContentPage.LAUNCH_DATE,
@@ -96,8 +111,9 @@
}
});
}
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize(), Event.START_DATE,
- new DomainObjectPropertySheet.AttributeFormatter() {
+// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize(), Event.START_DATE,
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time"), Event.START_DATE,
+ new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
String attribute,
@@ -121,7 +137,8 @@
}
});
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time").localize(), Event.END_DATE,
+// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time").localize(), Event.END_DATE,
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time"), Event.END_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
@@ -145,21 +162,27 @@
}
});
if (!Event.getConfig().getHideDateDescription()) {
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize(), Event.EVENT_DATE);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize(), Event.EVENT_DATE);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description"), Event.EVENT_DATE);
}
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location").localize(), Event.LOCATION);
+// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location").localize(), Event.LOCATION);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location"), Event.LOCATION);
if (!Event.getConfig().getHideMainContributor()) {
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize(), Event.MAIN_CONTRIBUTOR);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize(), Event.MAIN_CONTRIBUTOR);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor"), Event.MAIN_CONTRIBUTOR);
}
if (!Event.getConfig().getHideEventType()) {
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize(), Event.EVENT_TYPE);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize(), Event.EVENT_TYPE);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type"), Event.EVENT_TYPE);
}
if (!Event.getConfig().getHideLinkToMap()) {
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize(), Event.MAP_LINK);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize(), Event.MAP_LINK);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map"), Event.MAP_LINK );
}
if (!Event.getConfig().getHideCost()) {
- sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize(), Event.COST);
+ // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize(), Event.COST);
+ sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost"), Event.COST );
}
return sheet;
}
Modified: trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java
===================================================================
--- trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -30,22 +30,24 @@
import com.arsdigita.bebop.form.Time;
import com.arsdigita.bebop.parameters.DateParameter;
import com.arsdigita.bebop.parameters.NotNullValidationListener;
+import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
-import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.parameters.TimeParameter;
import com.arsdigita.bebop.parameters.TrimmedStringParameter;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Event;
-import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.contenttypes.util.EventGlobalizationUtil;
import com.arsdigita.cms.ui.CMSDHTMLEditor;
+import com.arsdigita.cms.ui.authoring.BasicPageForm;
+
import java.util.Calendar;
import java.util.GregorianCalendar;
/**
- * Form to edit the basic properties of an <code>Event</code> object. Used by
- * <code>EventPropertiesStep</code> authoring kit step.
+ * Form to edit the basic properties of an <code>Event</code> object.
+ *
+ * Used by <code>EventPropertiesStep</code> authoring kit step.
* <br />
* This form can be extended to create forms for Event subclasses.
**/
@@ -113,7 +115,7 @@
super.addWidgets();
/* Summary (lead) */
- add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize()));
+ add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead")) );
ParameterModel leadParam = new StringParameter(LEAD);
if(Event.getConfig().isLeadTextOptional()) {
leadParam.addParameterListener(new NotNullValidationListener());
@@ -124,7 +126,7 @@
add(lead);
/* Start date and time */
ParameterModel eventStartDateParam = new DateParameter(START_DATE);
- add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_date").localize()));
+ add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_date")) );
eventStartDateParam.addParameterListener(new NotNullValidationListener());
// Use bebop date instead of java.util.date
m_startDate = new com.arsdigita.bebop.form.Date(eventStartDateParam);
@@ -134,7 +136,7 @@
add(m_startDate);
ParameterModel eventStartTimeParam = new TimeParameter(START_TIME);
- add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize()));
+ add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time")) );
if(Event.getConfig().isStartTimeOptional()) {
eventStartTimeParam.addParameterListener(new NotNullValidationListener());
}
Modified: trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java
===================================================================
--- trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.cms.contenttypes.util;
import com.arsdigita.globalization.GlobalizedMessage;
+
/**
* <p>
* Contains methods to simplify globalizing keys
@@ -28,9 +30,9 @@
* @author <a href="mailto:ra...@ar...">ra...@ar...</a>
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
public class EventGlobalizationUtil {
+ /** Name of the Java class to handle Event's globalisation. */
final public static String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.util.EventResourceBundle";
Modified: trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java
===================================================================
--- trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -18,17 +18,18 @@
*/
package com.arsdigita.cms.contenttypes.util;
-import java.util.PropertyResourceBundle;
+import com.arsdigita.cms.CMSGlobalized;
import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.CMSGlobalized;
+import java.util.PropertyResourceBundle;
+
/**
* Resource Bundle used in UI for Event ContentType.
*
- * @author Shashin Shinde <a href="mailto:ss...@re...">ss...@re...</a>
- *
+ * @author Shashin Shinde (ss...@re...)
*/
-public class EventResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
+public class EventResourceBundle extends ChainedResourceBundle
+ implements CMSGlobalized {
public final static String EVENT_BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.EventResources";
Modified: trunk/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemLoader.java
===================================================================
--- trunk/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemLoader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemLoader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,17 +21,32 @@
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
- * Loader.
+ * Loader executes nonrecurring once at install time and loads the
+ * FAQ contenttype package persistently into database.
*
+ * It uses the base class to create the database schema and the required
+ * table entries for the contenttype.
+ *
* @author Justin Ross <jr...@re...>
* @version $Id$
*/
public class FAQItemLoader extends AbstractContentTypeLoader {
+ /** Defines the xml file containing the FAQ content types
+ * property definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/FAQItem.xml"
};
+ /**
+ * Provides the of FAQ contenttype property definitions
+ * implementing the parent's class abstract method.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * @return String Atring Array of fully qualified file names
+ */
public String[] getTypes() {
return TYPES;
}
Modified: trunk/ccm-core/src/ccm-core.checklist
===================================================================
--- trunk/ccm-core/src/ccm-core.checklist 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-core/src/ccm-core.checklist 2013-02-02 18:43:41 UTC (rev 2472)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
<!-- Specification file for additional checks during the
installation process by the packaging tools
(see com/arsdigita/packaging/Check.java for details) -->
Modified: trunk/ccm-core/src/ccm-core.load
===================================================================
--- trunk/ccm-core/src/ccm-core.load 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-core/src/ccm-core.load 2013-02-02 18:43:41 UTC (rev 2472)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
<load>
<provides>
<table name="inits"/>
Modified: trunk/ccm-core/src/ccm-core.upgrade
===================================================================
--- trunk/ccm-core/src/ccm-core.upgrade 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-core/src/ccm-core.upgrade 2013-02-02 18:43:41 UTC (rev 2472)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
<upgrade>
<version from="6.0.0" to="6.0.1">
<script sql="ccm-core/upgrade/::database::-6.0.0-6.0.1.sql"/>
Modified: trunk/ccm-core/src/com/arsdigita/toolbox/ui/DomainObjectPropertySheet.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/toolbox/ui/DomainObjectPropertySheet.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-core/src/com/arsdigita/toolbox/ui/DomainObjectPropertySheet.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -22,29 +22,28 @@
import com.arsdigita.bebop.PropertySheet;
import com.arsdigita.bebop.PropertySheetModel;
import com.arsdigita.bebop.PropertySheetModelBuilder;
+import com.arsdigita.domain.DomainObject;
+import com.arsdigita.domain.DomainService;
+import com.arsdigita.globalization.GlobalizedMessage;
+import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
+import com.arsdigita.persistence.DataObject;
+import com.arsdigita.toolbox.util.GlobalizationUtil;
import com.arsdigita.util.LockableImpl;
-import java.util.List;
-import java.util.LinkedList;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.StringTokenizer;
-import com.arsdigita.domain.DomainService;
-import com.arsdigita.domain.DomainObject;
-import com.arsdigita.persistence.DataObject;
-import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
-import com.arsdigita.globalization.GlobalizedMessage;
-import com.arsdigita.toolbox.util.GlobalizationUtil;
-
-
/**
* Displays a list of label-value pairs, which represent the attributes
* of a domain object.
* <p>
* Typical usage is
* <blockquote><pre><code>
- * DomainObjectPropertySheet mySheet = new DomainObjectPropertySheet(myDomainObjectSelectionModel);
+ * DomainObjectPropertySheet mySheet =
+ * new DomainObjectPropertySheet(myDomainObjectSelectionModel);
* mySheet.add("Name:", ContentPage.NAME);
* mySheet.add("Title:", ContentPage.TITLE);
* </code></pre></blockquote>
@@ -65,9 +64,9 @@
* Note that, by default, <code>DomainObjectPropertySheet</code> retrieves
* the values for its properties directly from the underlying {@link DataObject}
* of the {@link DomainObject}. This means that the Java <code>getXXX</code>
- * methods of the <code>DomainObject</code> will never be called. Of course, it
- * is always possible to create a custom {@link AttributeFormatter} that will call the
- * appropriate methods.
+ * methods of the <code>DomainObject</code> will never be called. Of course,
+ * it is always possible to create a custom {@link AttributeFormatter} that
+ * will call the appropriate methods.
*
* @author Stanislav Freidin
* @version $Id$
@@ -75,8 +74,6 @@
*/
public class DomainObjectPropertySheet extends PropertySheet {
- public static final String versionId =
- "$Id$ by $Author$, $DateTime: 2004/08/16 18:10:38 $";
private List m_props;
private DomainObjectSelectionModel m_objModel;
private AttributeFormatter m_toStringFormatter;
@@ -157,7 +154,8 @@
* @param label The label for the attribute
* @param attribute The name for the attribute
* @param formatter An instance of AttributeFormatter
- * @deprecated Use add(GlobalizedMessage label, String attribute, AttributeFormatter f) instead
+ * @deprecated Use add(GlobalizedMessage label, String attribute,
+ * AttributeFormatter f) instead
*/
public void add(String label, String attribute, AttributeFormatter f) {
add(GlobalizationUtil.globalize(label), attribute, f);
@@ -252,7 +250,7 @@
private Iterator m_props;
private Property m_current;
private static String ERROR =
- "No current property. Make sure that nextRow() was called at least once.";
+ "No current property. Make sure that nextRow() was called at least once.";
public DomainObjectPropertiesModel(
DomainObject obj, Iterator props, PageState state) {
Modified: trunk/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ContactLoader.java
===================================================================
--- trunk/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ContactLoader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ContactLoader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -33,13 +33,21 @@
*/
public class ContactLoader extends AbstractContentTypeLoader {
- private static final String[] TYPES = {
- "/WEB-INF/content-types/com/arsdigita/london/contenttypes/Contact.xml"
- };
+ /** Defines the xml file containing the Contact content types property
+ * definitions. */
+ private static final String[] TYPES = {
+ "/WEB-INF/content-types/com/arsdigita/london/contenttypes/Contact.xml"
+ };
- /**
- * @see com.arsdigita.cms.contenttypes.AbstractContentTypeLoader#getTypes()
- */
+ /**
+ * Provides the of Contact contenttype property definitions implementing
+ * the parent's class abstract method.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * @return String Atring Array of fully qualified file names
+ */
public String[] getTypes() {
return TYPES;
}
Modified: trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java
===================================================================
--- trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java 2013-02-02 18:41:44 UTC (rev 2471)
+++ trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java 2013-02-02 18:43:41 UTC (rev 2472)
@@ -21,6 +21,10 @@
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.loader.PackageLoader;
+import com.arsdigita.navigation.portlet.ItemListPortlet;
+import com.arsdigita.navigation.portlet.NavigationTreePortlet;
+import com.arsdigita.navigation.portlet.ObjectListPortlet;
+import com.arsdigita.portal.PortletType;
import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.util.parameter.Parameter;
@@ -28,12 +32,6 @@
import com.arsdigita.web.Application;
import com.arsdigita.web.ApplicationType;
-import com.arsdigita.navigation.portlet.ObjectListPortlet;
-import com.arsdigita.navigation.portlet.ItemListPortlet;
-import com.arsdigita.navigation.portlet.NavigationTreePortlet;
-
-import com.arsdigita.portal.PortletType;
-
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -44,8 +42,13 @@
/**
- * Loader.
+ * Loader executes nonrecurring at install time and loads (installs and
+ * initializes) the Navigation module persistently into database.
*
+ * NOTE: Configuration parameters used at load time MUST be part of Loader
+ * class and can not delegated to a Config object (derived from AbstractConfig).
+ * They will (and can) not be persisted into an registry object (file).
+ *
* @author Justin Ross <jr...@re...>
* @version $Id: Loader.java 2070 2010-01-28 08:47:41Z pboy $
*/
@@ -60,7 +63,7 @@
"WEB-INF/navigation/templates.txt");
/**
- * Constructor
+ * Constructor, just registers parameters.
*/
public Loader() {
register( m_templatesFile );
@@ -83,8 +86,9 @@
loadObjectListPortlet();
NavigationTreePortlet.loadPortletType();
+ String templatesFile = (String)get(m_templatesFile);
try {
- setupTemplates();
+ setupTemplates(templatesFile);
} catch( IOException ex ) {
throw new UncheckedWrapperException( ex );
}
@@ -177,13 +181,20 @@
app.save();
}
- public void setupTemplates() throws IOException {
+ /**
+ * Processes a file with Navigation template specificatgions and
+ * registers JSP templates with Navigation.
+ *
+ * @param templatesFile file containing templates specification
+ * @throws IOException
+ */
+ public static void setupTemplates(String templatesFile) throws IOException {
- String templatesFile = (String)get(m_templatesFile);
InputStream file = Thread.currentThread().getContextClassLoader()
.getResourceAsStream(templatesFile);
if (file == null) {
- throw new UncheckedWrapperException(String.format("Failed to open templates files %s.", templatesFile));
+ throw new UncheckedWrapperException(String.format(
+ "Failed to open templates files %s.", templatesFile));
}
BufferedReader templates =
new BufferedReader( new InputStreamReader( file ) );
|
|
From: <pb...@fe...> - 2013-02-02 18:41:52
|
Author: pboy
Date: 2013-02-02 18:41:44 +0000 (Sat, 02 Feb 2013)
New Revision: 2471
Modified:
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/AplawsConfig.java
trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java
trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/aplaws-item.jsp
trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp
trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-services.jsp
Log:
Fixed various outdated class paths in JSP.
Modified: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/AplawsConfig.java
===================================================================
--- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/AplawsConfig.java 2013-02-02 18:40:36 UTC (rev 2470)
+++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/AplawsConfig.java 2013-02-02 18:41:44 UTC (rev 2471)
@@ -18,8 +18,8 @@
package com.arsdigita.aplaws;
import com.arsdigita.runtime.AbstractConfig;
+import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.Parameter;
-import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.StringParameter;
import org.apache.log4j.Logger;
Modified: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java
===================================================================
--- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java 2013-02-02 18:40:36 UTC (rev 2470)
+++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java 2013-02-02 18:41:44 UTC (rev 2471)
@@ -27,6 +27,11 @@
import com.arsdigita.kernel.RoleCollection;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
import com.arsdigita.loader.PackageLoader;
+import com.arsdigita.london.terms.Domain;
+import com.arsdigita.london.terms.importer.Parser;
+import com.arsdigita.navigation.Navigation;
+import com.arsdigita.navigation.Template;
+import com.arsdigita.navigation.TemplateMapping;
import com.arsdigita.persistence.DataQuery;
import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.util.Assert;
@@ -37,12 +42,6 @@
import com.arsdigita.util.parameter.URLParameter;
import com.arsdigita.web.Application;
-import com.arsdigita.navigation.Navigation;
-import com.arsdigita.navigation.Template;
-import com.arsdigita.navigation.TemplateMapping;
-import com.arsdigita.london.terms.Domain;
-import com.arsdigita.london.terms.importer.Parser;
-
import java.net.URL;
import java.net.MalformedURLException;
import java.util.Date;
Modified: trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/aplaws-item.jsp
===================================================================
--- trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/aplaws-item.jsp 2013-02-02 18:40:36 UTC (rev 2470)
+++ trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/aplaws-item.jsp 2013-02-02 18:41:44 UTC (rev 2471)
@@ -33,7 +33,7 @@
classname="com.arsdigita.navigation.ui.RelatedItems"/>
<define:component name="assignedTerms"
- classname="com.arsdigita.bundle.ui.AssignedItemTerms"/>
+ classname="com.arsdigita.aplaws.ui.AssignedItemTerms"/>
</define:page>
<show:all/>
Modified: trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp
===================================================================
--- trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp 2013-02-02 18:40:36 UTC (rev 2470)
+++ trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp 2013-02-02 18:41:44 UTC (rev 2471)
@@ -5,7 +5,7 @@
version="1.2">
<jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/>
- <jsp:directive.page import="com.arsdigita.london.navigation.Navigation"/>
+ <jsp:directive.page import="com.arsdigita.navigation.Navigation"/>
<jsp:directive.page import="com.arsdigita.bebop.parameters.BigDecimalParameter"/>
<jsp:directive.page import="com.arsdigita.portalworkspace.ui.CategoryPortalSelectionModel"/>
@@ -22,11 +22,11 @@
title="Navigation" cache="true">
<define:component name="categoryPath"
- classname="com.arsdigita.london.navigation.ui.category.Path"/>
+ classname="com.arsdigita.navigation.ui.category.Path"/>
<define:component name="categoryMenu"
- classname="com.arsdigita.london.navigation.ui.category.Menu"/>
+ classname="com.arsdigita.navigation.ui.category.Menu"/>
<define:component name="portalWorkspace"
- classname="com.arsdigita.london.portal.ui.WorkspaceViewer"/>
+ classname="com.arsdigita.portalworkspace.ui.WorkspaceViewer"/>
<jsp:scriptlet>
((com.arsdigita.portalworkspace.ui.WorkspaceViewer) portalWorkspace).setWorkspaceModel(new CategoryPortalSelectionModel());
</jsp:scriptlet>
Modified: trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-services.jsp
===================================================================
--- trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-services.jsp 2013-02-02 18:40:36 UTC (rev 2470)
+++ trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-services.jsp 2013-02-02 18:41:44 UTC (rev 2471)
@@ -6,9 +6,9 @@
<jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/>
<jsp:directive.page import="com.arsdigita.bebop.parameters.BigDecimalParameter"/>
- <jsp:directive.page import="com.arsdigita.london.navigation.Navigation"/>
- <jsp:directive.page import="com.arsdigita.london.navigation.cms.CMSDataCollectionDefinition"/>
- <jsp:directive.page import="com.arsdigita.london.navigation.cms.CMSDataCollectionRenderer"/>
+ <jsp:directive.page import="com.arsdigita.navigation.Navigation"/>
+ <jsp:directive.page import="com.arsdigita.navigation.cms.CMSDataCollectionDefinition"/>
+ <jsp:directive.page import="com.arsdigita.navigation.cms.CMSDataCollectionRenderer"/>
<jsp:scriptlet>
long age = Navigation.getConfig().getIndexPageCacheLifetime();
@@ -23,25 +23,25 @@
title="Navigation" cache="true">
<define:component name="greetingItem"
- classname="com.arsdigita.london.navigation.ui.GreetingItem"/>
+ classname="com.arsdigita.navigation.ui.GreetingItem"/>
<define:component name="categoryPath"
- classname="com.arsdigita.london.navigation.ui.category.Path"/>
+ classname="com.arsdigita.navigation.ui.category.Path"/>
<define:component name="categoryMenu"
- classname="com.arsdigita.london.navigation.ui.category.Menu"/>
+ classname="com.arsdigita.navigation.ui.category.Menu"/>
<define:component name="categoryTermDetails"
classname="com.arsdigita.aplaws.ui.CategoryTermDetails"/>
<define:component name="itemList"
- classname="com.arsdigita.london.navigation.ui.object.AtoZObjectList"/>
+ classname="com.arsdigita.navigation.ui.object.AtoZObjectList"/>
<jsp:scriptlet>
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).setDefinition(new CMSDataCollectionDefinition());
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).setRenderer(new CMSDataCollectionRenderer());
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).getDefinition().setObjectType("com.arsdigita.cms.ContentPage");
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).setDefinition(new CMSDataCollectionDefinition());
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).setRenderer(new CMSDataCollectionRenderer());
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).getDefinition().setObjectType("com.arsdigita.cms.ContentPage");
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).getDefinition().setDescendCategories(false);
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).getDefinition().setDescendCategories(false);
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).getRenderer().setPageSize(30);
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).getRenderer().addAttribute("objectType");
- ((com.arsdigita.london.navigation.ui.object.AtoZObjectList) itemList).getRenderer().addAttribute( "title");
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).getRenderer().setPageSize(30);
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).getRenderer().addAttribute("objectType");
+ ((com.arsdigita.london.ui.object.AtoZObjectList) itemList).getRenderer().addAttribute( "title");
</jsp:scriptlet>
</define:page>
|
Author: pboy
Date: 2013-02-02 18:40:36 +0000 (Sat, 02 Feb 2013)
New Revision: 2470
Modified:
trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java
trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java
trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java
trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties
trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java
trunk/ccm-cms/src/com/arsdigita/cms/Loader.java
trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java
Log:
Made various authoring steps configurable.
Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java
===================================================================
--- trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java 2013-02-02 18:40:36 UTC (rev 2470)
@@ -15,7 +15,6 @@
* 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.atoz.tools;
import com.arsdigita.atoz.AtoZ;
@@ -32,7 +31,6 @@
import org.apache.commons.cli.CommandLine;
import org.apache.log4j.Logger;
-
/**
* Command line utility to create an application instance of AtoZ.
*
@@ -53,14 +51,15 @@
private void addAtoZ(String atozURL, String atozTitle) {
- if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/"+atozURL+"/")) {
+ if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/" + atozURL + "/")) {
DomainObjectFactory.registerInstantiator(
AtoZ.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
- public DomainObject doNewInstance(DataObject dataObject) {
- return new AtoZ(dataObject);
- }
- });
+ public DomainObject doNewInstance(DataObject dataObject) {
+ return new AtoZ(dataObject);
+ }
+
+ });
Application app = Application.createApplication(
AtoZ.BASE_DATA_OBJECT_TYPE, atozURL, atozTitle, null);
app.save();
@@ -68,7 +67,7 @@
} else {
System.err.println(AtoZ.BASE_DATA_OBJECT_TYPE
- + " already installed at " + atozURL);
+ + " already installed at " + atozURL);
System.exit(1);
}
@@ -86,7 +85,7 @@
String atozURL = args[0];
String atozTitle = args[1];
if (atozURL != null && atozURL.length() != 0
- && atozTitle != null && atozTitle.length() != 0) {
+ && atozTitle != null && atozTitle.length() != 0) {
addAtoZ(atozURL, atozTitle);
} else {
help(System.err);
@@ -97,8 +96,10 @@
System.exit(1);
}
}
+
}.run();
}
+
}.run();
}
Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java
===================================================================
--- trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java 2013-02-02 18:40:36 UTC (rev 2470)
@@ -15,7 +15,6 @@
* 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.atoz.ui.admin;
import com.arsdigita.atoz.ItemProvider;
@@ -63,12 +62,12 @@
super.addWidgets();
m_loadPaths = new TextField(ItemProvider.LOAD_PATHS);
- ((SimpleComponent)m_loadPaths).setMetaDataAttribute("label", "Attributes to retrieve");
+ ((SimpleComponent) m_loadPaths).setMetaDataAttribute("label", "Attributes to retrieve");
add(m_loadPaths);
m_loadPaths.addValidationListener(new StringInRangeValidationListener(0, 200));
m_picker = new AllCategoryPicker("rootCategory");
- ((SimpleComponent)m_picker).setMetaDataAttribute("label", "Category filter");
- ((SingleSelect)m_picker).addValidationListener(new NotNullValidationListener());
+ ((SimpleComponent) m_picker).setMetaDataAttribute("label", "Category filter");
+ ((SingleSelect) m_picker).addValidationListener(new NotNullValidationListener());
add(m_picker);
}
@@ -77,10 +76,10 @@
AtoZProvider provider) {
super.processWidgets(state, provider);
- ItemProvider myprovider = (ItemProvider)provider;
+ ItemProvider myprovider = (ItemProvider) provider;
myprovider.setCategory(m_picker.getCategory(state));
- myprovider.setLoadPaths( (String) m_loadPaths.getValue(state));
+ myprovider.setLoadPaths((String) m_loadPaths.getValue(state));
}
@Override
@@ -88,7 +87,7 @@
AtoZProvider provider) {
super.initWidgets(state, provider);
- ItemProvider myprovider = (ItemProvider)provider;
+ ItemProvider myprovider = (ItemProvider) provider;
if (provider != null) {
//m_compound.setValue(state, new Boolean(myprovider.isCompound()));
@@ -107,26 +106,23 @@
SingleSelect target) {
target.addOption(new Option(null, "-- pick one --"));
- DataCollection domains = SessionManager.getSession()
- .retrieve("com.arsdigita.london.terms.Domain");
+ DataCollection domains = SessionManager.getSession().retrieve("com.arsdigita.london.terms.Domain");
domains.addPath("model.id");
domains.addPath("model.objectType");
domains.addOrder("title");
while (domains.next()) {
- Category rootCategory = (Category)
- DomainObjectFactory.newInstance( (DataObject) domains.get("model"));
+ Category rootCategory = (Category) DomainObjectFactory.newInstance((DataObject) domains.get("model"));
categorySubtreePath(target, rootCategory, " > ");
}
}
private void categorySubtreePath(SingleSelect target, Category root, String join) {
DomainCollection cats = new DomainCollection(
- SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE)
- );
+ SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE));
cats.addFilter("defaultAncestors like :ancestors")
- .set("ancestors",
- ((String)DomainServiceInterfaceExposer
- .get(root, "defaultAncestors")) + "%");
+ .set("ancestors",
+ ((String) DomainServiceInterfaceExposer
+ .get(root, "defaultAncestors")) + "%");
cats.addEqualsFilter("parents.link.isDefault", Boolean.TRUE);
cats.addOrder("defaultAncestors");
cats.addPath("parents.id");
@@ -137,27 +133,27 @@
path2cat.put(root.getName(), root);
cat2path.put(root.getID(), root.getName());
target.addOption(new Option(root.getOID().toString(),
- " +++++++++++++++++++++++++ "
- + root.getName()
- + " +++++++++++++++++++++++++ "));
+ " +++++++++++++++++++++++++ "
+ + root.getName()
+ + " +++++++++++++++++++++++++ "));
while (cats.next()) {
- Category cat = (Category)cats.getDomainObject();
- BigDecimal parent = (BigDecimal)cats.get("parents.id");
+ Category cat = (Category) cats.getDomainObject();
+ BigDecimal parent = (BigDecimal) cats.get("parents.id");
if (parent == null) {
path2cat.put(cat.getName(), cat);
cat2path.put(cat.getID(), cat.getName());
target.addOption(new Option(cat.getOID().toString(), cat.getName()));
} else {
- String parentPath = (String)cat2path.get(parent);
+ String parentPath = (String) cat2path.get(parent);
String path = parentPath + join + cat.getName();
path2cat.put(path, cat);
cat2path.put(cat.getID(), path);
//
int breakPos = 0;
String prefix = "---";
- while ((breakPos = 1+parentPath.indexOf(join, breakPos)) > 0) {
+ while ((breakPos = 1 + parentPath.indexOf(join, breakPos)) > 0) {
prefix += "---";
}
target.addOption(new Option(cat.getOID().toString(), prefix + " " + cat.getName()));
@@ -166,5 +162,4 @@
}
}
-
}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-02 18:40:36 UTC (rev 2470)
@@ -83,6 +83,7 @@
return s_config;
}
+
/**
* Storage (map) for method getAssetStepsToSkip(ContentType type) to store
* mapping of steps that are deemed irrelevant for the passid in type.
@@ -550,7 +551,6 @@
"com.arsdigita.cms.item_search.flat_browse_pane.page_size",
Parameter.REQUIRED,
20);
-
/////////////////////////////////////////////
// FolderBrowse
/////////////////////////////////////////////
@@ -592,7 +592,6 @@
"cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to",
Parameter.REQUIRED,
"");
-
/////////////////////////////////////////////////
// ImageBrowser Parameter
/////////////////////////////////////////////////
@@ -604,7 +603,6 @@
"com.arsdigita.cms.image_browser.thumbnail_max_height",
Parameter.REQUIRED,
50);
-
/////////////////////////////////////////////////
// ImageCache Parameter
/////////////////////////////////////////////////
@@ -624,15 +622,17 @@
"com.arsdigita.cms.image_cache.max_age",
Parameter.REQUIRED,
300);
+ private final Parameter m_attachPersonOrgaUnitsStep = new BooleanParameter(
+ "com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step",
+ Parameter.REQUIRED,
+ Boolean.TRUE);
-
// ///////////////////////////////////////////
// publishToFile package related parameter
// ///////////////////////////////////////////
// Moved to publishToFile.PublishToFileConfig as of version 6.0.2
// private final Parameter m_disableItemPfs;
// private final Parameter m_publishToFileClass;
-
/**
* Constructor, but do NOT instantiate this class directly.
*
@@ -733,6 +733,8 @@
// register(m_itemSearchFlatBrowsePaneEnable);
register(m_itemSearchFlatBrowsePanePageSize);
+ register(m_attachPersonOrgaUnitsStep);
+
loadInfo();
}
@@ -934,6 +936,7 @@
protected Object unmarshal(String value, ErrorList errors) {
return DHTMLEditor.Config.valueOf(value);
}
+
}
protected static HashMap extraXMLGenerators = new HashMap();
@@ -1200,9 +1203,12 @@
// public Boolean getItemSearchFlatBrowsePaneEnable() {
// return (Boolean) get(m_itemSearchFlatBrowsePaneEnable);
// }
-
public Integer getItemSearchFlatBrowsePanePageSize() {
- return (Integer) get(m_itemSearchFlatBrowsePanePageSize);
+ return (Integer) get(m_itemSearchFlatBrowsePanePageSize);
}
+ public Boolean getAttachPersonOrgaUnitsStep() {
+ return (Boolean) get(m_attachPersonOrgaUnitsStep);
+ }
+
}
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2013-02-02 18:40:36 UTC (rev 2470)
@@ -314,3 +314,8 @@
com.arsdigita.cms.image_cache.max_age.purpose=Max unused item age in seconds, keep this low to prevent filling you memory with unsused images
com.arsdigita.cms.image_cache.max_age.example=300
com.arsdigita.cms.image_cache.max_age.format=[integer]
+
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.title = Attach PersonOrgaUnits step
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.purpose = Attaches an authoring step to GenericPerson which displays all GenericOrganizationalUnits to which the person is assigned to
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.example = true
+com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.foramt = [boolean]
\ No newline at end of file
Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-02 18:40:36 UTC (rev 2470)
@@ -83,7 +83,6 @@
import org.apache.log4j.Logger;
-
/**
* The main CMS initializer, executed recurringly at each system startup.
*
@@ -96,7 +95,6 @@
/** Creates a s_logging category with name = to the full name of class */
private static Logger s_log = Logger.getLogger(Initializer.class);
/** Configuration object for the CMS module */
- /** Configuration object for the CMS module */
private static final CMSConfig s_conf = CMSConfig.getInstance();
/**
@@ -120,7 +118,6 @@
s_log.debug("CMS.Initializer.(Constructor) completed");
}
-
/**
* Initializes domain-coupling machinery, usually consisting of
* registering object instantiators and observers.
@@ -232,18 +229,18 @@
FileAsset.BASE_DATA_OBJECT_TYPE,
new AssetMetadataProvider());
+ if (s_conf.getAttachPersonOrgaUnitsStep()) {
+ AuthoringKitWizard.registerAssetStep(
+ GenericPerson.BASE_DATA_OBJECT_TYPE,
+ GenericPersonOrgaUnitsStep.class,
+ ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
+ ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
+ 20);
+ }
- AuthoringKitWizard.registerAssetStep(
- GenericPerson.BASE_DATA_OBJECT_TYPE,
- GenericPersonOrgaUnitsStep.class,
- ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
- ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
- 20);
-
s_log.debug("CMS.Initializer.init(DomainInitEvent) completed");
} // END init(DomainInitEvent e)
-
/**
* Helper Method, registers stylesheet pattern generators
*/
@@ -257,7 +254,6 @@
new ItemDelegatedURLPatternGenerator());
}
-
/**
* Registers object instantiators
*/
Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2013-02-02 18:40:36 UTC (rev 2470)
@@ -64,6 +64,10 @@
* processing, otherwise hardcoded default values take effect. After processing,
* the installation values can not be modified anymore without a fresh
* installation of the whole system.</p>
+ *
+ * NOTE: Configuration parameters used at load time MUST be part of Loader
+ * class and can not delegated to a Config object (derived from AbstractConfig).
+ * They will (and can) not be persisted into an registry object (file).
*
* @author Peter Boy <pb...@ba...>
* @since ccm-cms version 6.6.0
@@ -83,6 +87,7 @@
* time, the parameter must be relocated into this Loader class!
*/
private static final LoaderConfig s_conf = LoaderConfig.getInstance();
+
// ///////////////////////////////////////////////////////////////////
// Configurable parameters during load step.
// ///////////////////////////////////////////////////////////////////
@@ -96,6 +101,10 @@
"com.arsdigita.cms.loader.section_names",
Parameter.REQUIRED,
new String[]{"content"});
+ // ///////////////////////////////////////////////////////////////////
+ // Configurable parameters during load step END.
+ // ///////////////////////////////////////////////////////////////////
+
/**
* List of classnames of internal base content types (needed in every
* section created), generated while loading those content types in
Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java 2013-02-02 18:31:17 UTC (rev 2469)
+++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java 2013-02-02 18:40:36 UTC (rev 2470)
@@ -53,6 +53,12 @@
* This is the base loader that can be used by individual content types.
* Specifically, it provides type loading functionality in the "run" method
* that can be used by content types to reduce code duplication.
+ *
+ * NOTE: Implementing clases may need to define and use configuration parameters
+ * to adjust things at load time. These MUST be part of Loader class
+ * implementationand itself and can not be delegated to a Config object
+ * (derived from AbstractConfig). They will (and can) not be persisted into an
+ * registry object (file).
*
* @author Rafael H. Schloming <rh...@mi...>
* @authro Sören Bernstein (qu...@ba...)
@@ -134,6 +140,16 @@
ContentTypeWorkflowTemplate.updateWorkflowTemplate(section, type, wf);
}
+ /**
+ * Provides a list of contenttype property definitions.
+ *
+ * The file defines the types name as displayed in content center
+ * select box and the authoring steps. These are loaded into database.
+ *
+ * Must be implemented by each content type loader to provide its
+ * specific definition files.
+ * @return
+ */
protected abstract String[] getTypes();
/*
|
|
From: <pb...@fe...> - 2013-02-02 18:31:25
|
Author: pboy
Date: 2013-02-02 18:31:17 +0000 (Sat, 02 Feb 2013)
New Revision: 2469
Modified:
trunk/tools-ng/common/xsl/build-template.xsl
trunk/tools-ng/ecdc/scriptlib/build-ccm.xml
Log:
Enhanced build-template.xsl to handle special dirs template/ROOT and template/ERROR for specific jsp templates respectivly.
Modified: trunk/tools-ng/common/xsl/build-template.xsl
===================================================================
--- trunk/tools-ng/common/xsl/build-template.xsl 2013-02-02 18:23:47 UTC (rev 2468)
+++ trunk/tools-ng/common/xsl/build-template.xsl 2013-02-02 18:31:17 UTC (rev 2469)
@@ -1337,15 +1337,39 @@
</fileset>
</copy>
- <copy todir="${{this.deploy.dir}}" overwrite="yes">
+ <!-- Copy subdirectories templates and themes to web, but exclude
+ special directories ROOT and ERROR, which must be processed
+ separately. -->
+ <copy todir="${{this.deploy.dir}}" overwrite="yes" >
<fileset dir="${{resolved.bundle.source.dir}}" >
<include name="templates/" />
<include name="themes/" />
- <exclude name="**placeholder.info**" />
- <exclude name="**README**" />
+ <exclude name="themes/placeholder.info" />
+ <exclude name="templates/placeholder.info" />
+ <exclude name="templates/ROOT/" />
+ <exclude name="templates/ERROR/" />
</fileset>
</copy>
+
+ <!-- Process special directory templates/ERROR
+ copy files to [docroot]/error -->
+ <copy todir="${{this.deploy.dir}}/error" overwrite="yes" failonerror="false" >
+ <fileset dir="${{resolved.bundle.source.dir}}/templates/ERROR/" >
+ <include name="*" />
+ <exclude name="placeholder.info" />
+ </fileset>
+ </copy>
+
+ <!-- Process special directory templates/ROOT
+ copy files to document root (context root). -->
+ <copy todir="${{this.deploy.dir}}" overwrite="yes" failonerror="false" >
+ <fileset dir="${{resolved.bundle.source.dir}}/templates/ROOT/" >
+ <include name="*" />
+ <exclude name="placeholder.info" />
+ </fileset>
+ </copy>
+
<!-- Autogenerate from project.xml a file containing a space delimited
list of package keys included in this build. Used during
initialization of a *.war file distribution as simplification and
Modified: trunk/tools-ng/ecdc/scriptlib/build-ccm.xml
===================================================================
--- trunk/tools-ng/ecdc/scriptlib/build-ccm.xml 2013-02-02 18:23:47 UTC (rev 2468)
+++ trunk/tools-ng/ecdc/scriptlib/build-ccm.xml 2013-02-02 18:31:17 UTC (rev 2469)
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Purpose:
+ ANT script to perform the various administration and maintenance tasks,
+ i.e.:
+ - Various LOAD steps to load the database
+ most prominent: load-bundle
+ - UPGRADE tasks to run SQL upgrade scripts
+ - RUN-CCM task to run various CLI utility classes
+-->
+
<!-- Already definded:
ccm.project.dir: base dir of the development project
app.server.bundles.zip name of the installation file
|
|
From: <pb...@fe...> - 2013-02-02 18:23:59
|
Author: pboy
Date: 2013-02-02 18:23:47 +0000 (Sat, 02 Feb 2013)
New Revision: 2468
Removed:
trunk/ccm-core/src/com/arsdigita/dispatcher/ParameterProvider.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/initializer/
trunk/ccm-core/src/com/arsdigita/search/LegacyInitializer.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SearchDataQuery.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelp.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelpCustomize.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SearchSpecification.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/Searchable.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SearchableACSObject.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SearchableObserver.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/SimpleSearchSpecification.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/lucene/LegacyInitializer.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/search/lucene/enterprise.init.nolongerInUse
trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse
trunk/ccm-core/src/com/arsdigita/web/LegacyInitializerServlet.java.nolongerInUse
Modified:
trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java
trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java
trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java
trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java
trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java
trunk/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java
Log:
Code clean up, various formatting and documentation.
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-02 18:23:47 UTC (rev 2468)
@@ -73,8 +73,7 @@
* Returns the singleton configuration record for the content section
* environment.
*
- * @return The
- * <code>ContentSectionConfig</code> record; it cannot be null
+ * @return The <code>CMSConfig</code> record; it cannot be null
*/
public static synchronized CMSConfig getInstance() {
if (s_config == null) {
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2013-02-02 18:23:47 UTC (rev 2468)
@@ -124,6 +124,9 @@
protected static final String WF_TEMPLATES = "associatedWorkflowTemplates";
private final static String ITEM_QUERY = "com.arsdigita.cms.ItemsInSection";
private final static String SECTION_ID = "sectionId";
+
+ private static final CMSConfig s_config = CMSConfig.getInstance();
+/* DO NOT use CMSConfig constructor to instantiate !
private static final CMSConfig s_config = new CMSConfig();
static {
@@ -131,6 +134,7 @@
s_config.load();
s_log.debug("Static initializer finished...");
}
+*/
// Cached properties
PageResolver m_pageResolver = null;
ItemResolver m_itemResolver = null;
Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-02 18:23:47 UTC (rev 2468)
@@ -40,6 +40,7 @@
import com.arsdigita.cms.search.LuceneQueryEngine;
import com.arsdigita.cms.search.VersionFilterType;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
+import com.arsdigita.cms.util.LanguageUtil;
import com.arsdigita.cms.workflow.CMSEngine;
import com.arsdigita.cms.workflow.CMSTask;
import com.arsdigita.cms.workflow.CMSTaskType;
@@ -51,6 +52,7 @@
import com.arsdigita.domain.DomainObjectInstantiator;
import com.arsdigita.domain.xml.TraversalHandler;
import com.arsdigita.kernel.ACSObjectInstantiator;
+import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.NoValidURLException;
import com.arsdigita.kernel.URLFinder;
import com.arsdigita.kernel.URLFinderNotFoundException;
@@ -72,17 +74,13 @@
import com.arsdigita.search.filters.ContentSectionFilterType;
import com.arsdigita.search.filters.ObjectTypeFilterType;
import com.arsdigita.search.filters.PermissionFilterType;
+import com.arsdigita.templating.PatternStylesheetResolver;
import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.workflow.simple.Engine;
import com.arsdigita.workflow.simple.Workflow;
import com.arsdigita.workflow.simple.WorkflowTemplate;
-
import com.arsdigita.xml.XML;
-import com.arsdigita.templating.PatternStylesheetResolver;
-import com.arsdigita.cms.util.LanguageUtil;
-import com.arsdigita.kernel.Kernel;
-
import org.apache.log4j.Logger;
Modified: trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java 2013-02-02 18:23:47 UTC (rev 2468)
@@ -28,9 +28,9 @@
// IMPLEMENTATION NOTE
// Class is a result of migrating the old enterprise.init based
-// initialization process and not yet completed. Functionality is
-// basically OK so far, but code urgently needs cleaning up and a
-// check for useful bits.
+// initialization process. Functionality is basically OK so far, but
+// code urgently needs cleaning up and a check for useful bits.
+
/**
* Container for various configuration parameters for ccm-cms package loader.
*
Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java 2013-02-02 18:23:47 UTC (rev 2468)
@@ -36,7 +36,7 @@
import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.util.Assert;
import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.workflow.simple.TaskCollection;
+// import com.arsdigita.workflow.simple.TaskCollection;
import com.arsdigita.workflow.simple.WorkflowTemplate;
import com.arsdigita.xml.XML;
import java.io.BufferedReader;
Deleted: trunk/ccm-core/src/com/arsdigita/dispatcher/ParameterProvider.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/dispatcher/ParameterProvider.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/dispatcher/ParameterProvider.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,26 +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.dispatcher;
-/**
- * @deprecated use com.arsdigita.util.ParameterProvider instead
- * @see com.arsdigita.util.ParameterProvider
- */
-public interface ParameterProvider extends com.arsdigita.util.ParameterProvider
-{
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/LegacyInitializer.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/LegacyInitializer.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/LegacyInitializer.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,62 +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.search;
-
-import com.arsdigita.initializer.Configuration;
-import com.arsdigita.initializer.InitializationException;
-
-import com.arsdigita.domain.GlobalObserverManager;
-
-import org.apache.log4j.Logger;
-
-/**
- * This initializer (which will soon go away) activates
- * the appropriate search engine.
- * There are no APIs intended for public use in this class
- */
-@Deprecated
-public class LegacyInitializer
- implements com.arsdigita.initializer.Initializer {
-
- private Configuration m_conf = new Configuration();
-
- private static final Logger s_log =
- Logger.getLogger(LegacyInitializer.class);
-
- public LegacyInitializer() throws InitializationException {
- }
-
- public Configuration getConfiguration() {
- return m_conf;
- }
-
- public void startup() {
- if (Search.getConfig().getIndexerType().getObserver() != null) {
- s_log.info("registering observer for indexer: " + Search.getConfig().getIndexerType());
- GlobalObserverManager gom = GlobalObserverManager.getManager();
- gom.addObserver(new SearchObserver());
- } else {
- s_log.info("Not registering a search observer");
- }
-
- }
-
- public void shutdown() {}
-
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SearchDataQuery.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SearchDataQuery.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SearchDataQuery.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,35 +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.search;
-
-import com.arsdigita.persistence.Session;
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchDataQuery
- **/
-
-public class SearchDataQuery
- extends com.arsdigita.search.intermedia.SearchDataQuery {
-
- public SearchDataQuery(Session s, String sql, String[] columns) {
- super(s, sql, columns);
- }
-
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelp.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelp.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelp.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,28 +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.search;
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchIndexHelp
- **/
-
-public class SearchIndexHelp
- extends com.arsdigita.search.intermedia.SearchIndexHelp {
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelpCustomize.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelpCustomize.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SearchIndexHelpCustomize.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,29 +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.search;
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchIndexHelpCustomize
- **/
-
-public interface SearchIndexHelpCustomize
- extends com.arsdigita.search.intermedia.SearchIndexHelpCustomize {
-
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SearchSpecification.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SearchSpecification.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SearchSpecification.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,60 +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.search;
-
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchSpecification
- **/
-
-public class SearchSpecification
- extends com.arsdigita.search.intermedia.SearchSpecification{
-
-
- /**
- * Create a SearchSpecification object.
- * @param sql Sql select statement to perform the search. See
- * example above.
- * @param columns The names of columns returned by the
- * search.
- * @param maxRows The maximum number of result rows retrieved
- * by the search.
- * @param rowsPerPage The maximum number of rows per result
- * page returned by method getPage.
- **/
- public SearchSpecification(String sql, String[] columns,
- int maxRows, int rowsPerPage) {
-
- super(sql, columns, maxRows, rowsPerPage);
- }
-
- /**
- * Create a SearchSpecification object, using the default values
- * for maxRows and rowsPerPage.
- * @param sql Sql select statement to perform the search. See
- * example above.
- * @param columns The names of columns returned by the
- * search.
- **/
- public SearchSpecification(String sql, String[] columns) {
- super(sql, columns);
- }
-
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/Searchable.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/Searchable.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/Searchable.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,26 +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.search;
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchableACSObject
- **/
-
-public interface Searchable extends com.arsdigita.search.intermedia.Searchable {
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SearchableACSObject.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SearchableACSObject.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SearchableACSObject.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,49 +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.search;
-
-import com.arsdigita.domain.DataObjectNotFoundException;
-
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.persistence.DataObject;
-import com.arsdigita.persistence.OID;
-import com.arsdigita.persistence.metadata.ObjectType;
-
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchableACSObject
- **/
-
-public abstract class SearchableACSObject
- extends com.arsdigita.search.intermedia.SearchableACSObject {
-
- public SearchableACSObject(DataObject SearchableACSObjectData) {
- super(SearchableACSObjectData);
- }
- public SearchableACSObject(String typeName) {
- super(typeName);
- }
- public SearchableACSObject(ObjectType type) {
- super(type);
- }
- public SearchableACSObject(OID oid) throws DataObjectNotFoundException {
- super(oid);
- }
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SearchableObserver.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SearchableObserver.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SearchableObserver.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,38 +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.search;
-
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SearchableObserver
- **/
-public class SearchableObserver
- extends com.arsdigita.search.intermedia.SearchableObserver {
-
- /**
- * Constructor. Makes sure that only objects that implement Searchable
- * use this observer.
- **/
-
- public SearchableObserver(Searchable searchableObject) {
- super(searchableObject);
- }
-
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/SimpleSearchSpecification.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/SimpleSearchSpecification.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/SimpleSearchSpecification.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,33 +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.search;
-
-
-/**
- * @deprecated moved to com.arsdigita.search.intermedia package
- * @see com.arsdigita.search.intermedia.SimpleSearchSpecification
- **/
-public class SimpleSearchSpecification
- extends com.arsdigita.search.intermedia.SimpleSearchSpecification {
-
- public SimpleSearchSpecification(String object_type,
- String searchString) {
- super(object_type, searchString);
- }
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/lucene/LegacyInitializer.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/lucene/LegacyInitializer.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/lucene/LegacyInitializer.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2003-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.search.lucene;
-
-import com.arsdigita.initializer.Configuration;
-import com.arsdigita.initializer.InitializationException;
-import com.arsdigita.search.FilterType;
-import com.arsdigita.search.IndexerType;
-import com.arsdigita.search.QueryEngineRegistry;
-import com.arsdigita.search.Search;
-import com.arsdigita.search.filters.CategoryFilterType;
-import com.arsdigita.search.filters.ObjectTypeFilterType;
-import com.arsdigita.search.filters.PermissionFilterType;
-import java.io.File;
-import java.io.IOException;
-import java.util.Date;
-import org.apache.log4j.Logger;
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.search.BooleanQuery;
-
-/**
- * LegacyInitializer
- *
- * Initializes the Lucene package
- *
- * @author Richard Su (ric...@al...)
- * @version $Id: LegacyInitializer.java 1044 2005-12-09 13:21:16Z sskracic $
- *
- * @deprecated no longer in use, replaced by new Initializer. May be deleted.
- */
-public class LegacyInitializer implements com.arsdigita.initializer.Initializer {
-
- private static final Logger LOG = Logger.getLogger(LegacyInitializer.class);
-
- // public final static Loader LOADER = new IndexId.LoaderImpl();
-
- private Configuration m_conf = new Configuration();
-
- /**
- *
- */
- public LegacyInitializer() {}
-
- /**
- *
- * @return
- */
- public Configuration getConfiguration() {
- return m_conf;
- }
-
- /*
- * Called on startup.
- * @throws InitializationException
- */
- public void startup() {
- if (Search.getConfig().isLuceneEnabled()) {
- LuceneConfig conf = LuceneConfig.getConfig();
- String location = conf.getIndexLocation();
- int interval = conf.getIndexerInterval();
- Analyzer analyzer = conf.getAnalyzer();
- LOG.info("Lucene index location: " + location);
- LOG.info("Lucene Analyzer = " + analyzer.getClass().getName());
- BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE);
-
- try {
- if (!IndexReader.indexExists(location)) {
- File f = new File(location);
- f.mkdirs();
- IndexWriter iw = new IndexWriter
- (location, analyzer, true);
- iw.close();
- LOG.info("Lucene created index directory");
- }
- } catch (IOException ex) {
- throw new InitializationException
- ("lucene index id has not been initialized", ex);
- }
-
- Index.setLocation(location);
- // FIXME: This is a hack. Delay the start of the timer task by 5
- // seconds and keep your fingers crosses in hopes that
- // Index.getIndexerID() will be ready to return a valid value by
- // then. -- va...@re..., 2004-01-07
- Date delayedStart = new Date(System.currentTimeMillis() + 5000L);
- Index.getTimer().schedule
- (new Indexer(Index.getLocation()),
- delayedStart,
- ((long)interval * 1000l));
-
- QueryEngineRegistry.registerEngine
- (IndexerType.LUCENE, new FilterType[] {
- new CategoryFilterType(),
- new ObjectTypeFilterType(),
- new PermissionFilterType()
- },
- new BaseQueryEngine());
- }
- }
-
- /**
- * Called on shutdown. It's probably not a good idea to depend on this
- * being called.
- **/
- public void shutdown() {
- }
-
-// /**
-// * Only used by <code>CoreLoader</code>.
-// **/
-// public interface Loader {
-// void load();
-// }
-}
Deleted: trunk/ccm-core/src/com/arsdigita/search/lucene/enterprise.init.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/search/lucene/enterprise.init.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/search/lucene/enterprise.init.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,7 +0,0 @@
-// file: com.arsdigita.search.lucene.enterprise.init
-
-
-
-// As of version 6.5.x still in use!
-init com.arsdigita.search.lucene.LegacyInitializer {}
-
Deleted: trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,342 +0,0 @@
-/*
- * Copyright (C) 2002-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.web;
-
-import com.arsdigita.kernel.PackageType;
-import com.arsdigita.domain.DomainObjectInstantiator;
-import com.arsdigita.domain.DomainObjectFactory;
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.util.Assert;
-import java.util.List;
-import java.util.Iterator;
-import java.util.ArrayList;
-import org.apache.log4j.Category;
-
-/**
- * Automates the creation and setup of <code>ApplicationType</code>s.
- *
- * <pre><blockquote>
- * ApplicationSetup setup = new ApplicationSetup(s_log);
- * setup.setApplicationObjectType(SomeApp.BASE_DATA_OBJECT_TYPE);
- * setup.setKey("some-app");
- * setup.setTitle("Some App");
- * setup.setInstantiator(new ACSObjectInstantiator() {
- * protected DomainObject doNewInstance(DataObject dataObject) {
- * return new SomeApp(dataObject);
- * }
- * });
- * setup.run();
- * </blockquote></pre>
- *
- * <strong>Important note.</strong> When <code>Application</code>s are used
- * in the context of old-style apps that use <code>SiteNode</code>s and
- * <code>PackageType</code>s, it is important to use the
- * <code>setKey("some-string-key")</code> so that your new applications can
- * interoperate fluidly with the legacy applications.
- * Use of the <code>setKey</code> method ensures that your application will,
- * behind the scenes, use site nodes and package instances, in addition to the
- * <code>Application</code> object, to represent each new mountable application.
- * As a result, legacy code for managing and dispatching applications will work
- * with both your old and your new applications.
- *
- * @see com.arsdigita.web.ApplicationType
- * @author Justin Ross <<a href="mailto:jr...@re...">jr...@re...</a>>
- * @version $Id: ApplicationSetup.java 287 2005-02-22 00:29:02Z sskracic $
- * @deprecated without direct replacement.
- * Class requires ApplicationSetup.setInstantiator( ...) domain initialization
- * code which is only useful in old legacy initialization code. Initialization
- * now differentiates bitween one time loading step and recurring initialization
- * step.
- * Use ApplicationType apptype = new ApplicationType(...) and
- * Application app Application.createApplication(...) instead to create
- * new style legacy free applications.
- */
-public class ApplicationSetup {
-
- /** Appender to enable writing to the löog file. */
- protected Category m_category;
- protected String m_title = null;
- protected String m_description = null;
- protected String m_typeName = null;
- protected DomainObjectInstantiator m_instantiator = null;
-
- // Legacy fields.
-
- protected String m_key = null;
- protected PackageType m_packageType = null;
- protected boolean m_isWorkspaceApplication = true;
- protected boolean m_isSingleton = false;
- protected String m_dispatcherClass = null;
-
- /**
- * Constructor.
- *
- * @param category as appender to the log file.
- */
- public ApplicationSetup(Category category) {
- m_category = category;
- }
-
- /**
- * Sets a key for use in creating a package type and, later, site
- * node objects, as used by older applications, to match the new
- * application type.
- *
- * @param key the <code>String</code> key to use to generate a
- * package type corresponding to the new application type
- */
- public void setKey(String key) {
- m_key = key;
- }
-
- /**
- * Sets the package type to use to represent your application
- * under the older package instance and site node approach.
- *
- * @param packageType a <code>PackageType</code> to use behind the
- * new application type
- */
- public void setPackageType(PackageType packageType) {
- m_packageType = packageType;
- }
-
- /**
- * Sets the title of the installed application type.
- */
- public void setTitle(String title) {
- m_title = title;
- }
-
- /**
- * Sets the description of the installed application type.
- */
- public void setDescription(String description) {
- m_description = description;
- }
-
- /**
- * Sets the object type of the application instances this
- * application type represents.
- */
- public void setApplicationObjectType(String typeName) {
- m_typeName = typeName;
- }
-
- /**
- * Sets the instantiator used by {@link
- * com.arsdigita.domain.DomainObjectFactory} to resurrect specific
- * domain classes from data objects.
- */
- public void setInstantiator(DomainObjectInstantiator instantiator) {
- m_instantiator = instantiator;
- }
-
- /**
- * This method is an alternative to {@link
- * #setPortalApplication(boolean)}. It does the same thing.
- */
- public void setWorkspaceApplication(boolean isWorkspaceApplication) {
- m_isWorkspaceApplication = isWorkspaceApplication;
- }
-
- /**
- * Marks this applications of this type as ones that do or do not belong to
- * a "portal", a special application type that collects child applications
- * together for presentation and navigation purposes.
- *
- * By default, this value is true.
- */
- public void setPortalApplication(boolean isWorkspaceApplication) {
- m_isWorkspaceApplication = isWorkspaceApplication;
- }
-
- /**
- * Sets whether there can be more than one application of this
- * type in the system.
- *
- * The default is false.
- */
- public void setSingleton(boolean isSingleton) {
- m_isSingleton = isSingleton;
- }
-
- /**
- * Sets the dispatcher to use for appliactions of this type.
- */
- public void setDispatcherClass(String dispatcherClass) {
- m_dispatcherClass = dispatcherClass;
- }
-
- protected void notice(String message) {
- m_category.info("ApplicationType '" + m_title + "' - " + message);
- }
-
- /**
- * After all the properties are set, validates and installs the
- * specified application type.
- */
- public ApplicationType run() {
- notice("Validating setup...");
-
- List messages = validate();
-
- if (messages.size() > 0) {
- Iterator iter = messages.iterator();
- String errors = "Validation of ApplicationSetup data failed:\n";
-
- while (iter.hasNext()) {
- String msg = (String)iter.next();
- m_category.error(msg);
- errors += msg + "\n";
- }
-
- throw new RuntimeException(errors);
- }
-
- notice("Done validating.");
-
- ApplicationType applicationType = process();
- Assert.exists(applicationType, "applicationType is not null");
- applicationType.save();
-
- return applicationType;
- }
-
- protected List validate() {
- final ArrayList messages = new ArrayList();
-
- if (m_title == null) {
- messages.add("Title is not set.");
- }
-
- if (m_typeName == null) {
- messages.add("ApplicationObjectType is not set.");
- }
-
- if (m_instantiator == null) {
- messages.add("Instantiator is not set.");
- }
-
- return messages;
- }
-
- protected ApplicationType process() {
- notice("Starting setup...");
-
- ApplicationType applicationType = null;
-
- if (ApplicationType.isInstalled(m_typeName)) {
- // When migrating new code, sometimes an ApplicationType
- // exists but its corresponding PackageType does not.
- // This happens, for instance, when someone changes the
- // package key but not the object type in their app setup
- // script. To treat this case, we need to create the
- // PackageType if it isn't there, even if the
- // ApplicationType exists.
-
- if (m_key != null && !packageTypeIsInstalled(m_key)) {
- Assert.isTrue(m_packageType == null);
-
- m_category.warn
- ("ApplicationType " + m_typeName + " did not have " +
- "its corresponding PackageType " + m_key + ". Adding " +
- "one now.");
-
- PackageType packageType = new PackageType();
-
- packageType.setKey(m_key);
- packageType.setDisplayName(m_title);
- packageType.setURI("http://arsdigita.com/" + m_key);
-
- applicationType =
- ApplicationType.retrieveApplicationTypeForApplication
- (m_typeName);
-
- applicationType.setPackageType(packageType);
- applicationType.setDispatcherClass(m_dispatcherClass);
-
- packageType.save();
- applicationType.save();
- } else {
- applicationType =
- ApplicationType.retrieveApplicationTypeForApplication
- (m_typeName);
- }
- } else {
- // And, likewise, sometimes a package type is present, but
- // the application type does not yet exist.
- // ApplicationType's constructor knows how to handle this.
-
- notice("Not installed. Installing now...");
-
- notice("Using the following properties to perform install.");
- notice(" ApplicationObjectType: " + m_typeName);
- notice(" Title: " + m_title);
- notice(" Description: " + m_description);
- notice(" Instantiator: " + m_instantiator);
- notice(" IsWorkspaceApplication: " + m_isWorkspaceApplication);
- notice(" IsSingleton: " + m_isSingleton);
- notice(" Key: " + m_key);
- notice(" PackageType: " + m_packageType);
- notice(" DispatcherClass: " + m_dispatcherClass);
-
- if (m_key == null && m_packageType == null) {
- // This is a new style / legacy free application
- applicationType = new ApplicationType(m_title, m_typeName);
- } else {
- // This is a legacy application type.
-
- if (m_key == null) {
- applicationType = ApplicationType.createApplicationType
- (m_packageType, m_title, m_typeName);
- } else if (m_packageType == null) {
- applicationType = ApplicationType.createApplicationType
- (m_key, m_title, m_typeName);
-
- if (m_dispatcherClass != null) {
- applicationType.setDispatcherClass(m_dispatcherClass);
- }
- }
-
- applicationType.setWorkspaceApplication
- (m_isWorkspaceApplication);
- applicationType.setSingleton(m_isSingleton);
- }
-
- applicationType.setDescription(m_description);
-
- notice("Done installing.");
- }
-
- DomainObjectFactory.registerInstantiator(m_typeName, m_instantiator);
-
- notice("Done setting up.");
-
- return applicationType;
- }
-
- private boolean packageTypeIsInstalled(String key) {
- try {
- PackageType.findByKey(key);
- return true;
- } catch (DataObjectNotFoundException nfe) {
- return false;
- }
- }
-}
Deleted: trunk/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2002-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.web;
-
-import com.arsdigita.util.Assert;
-import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.web.Application;
-import com.arsdigita.kernel.PackageType;
-import com.arsdigita.dispatcher.RequestContext;
-import com.arsdigita.dispatcher.Dispatcher;
-import com.arsdigita.dispatcher.DispatcherHelper;
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-
-/**
- * <p>An application servlet that does what SiteNodeDispatcher does
- * but in the context of the newer CCM dispatcher. Gets the package
- * type associated with an application and uses its dispatcher.</p>
- *
- * <p>Use web.xml entries like the following to deploy this
- * servlet:</p>
- *
- * <blockquote><pre>
- * <servlet>
- * <servlet-name>legacy-adapter</servlet-name>
- * <servlet-class>com.arsdigita.web.LegacyAdapterServlet</servlet-class>
- * </servlet>
- *
- * <servlet-mapping>
- * <servlet-name>legacy-adapter</servlet-name>
- * <url-pattern>/themes/servlet/legacy-adapter/*</url-pattern>
- * </servlet-mapping>
- * </pre></blockquote>
- *
- * @see com.arsdigita.web.DispatcherServlet
- * @see com.arsdigita.sitenode.SiteNodeDispatcher
- *
- * @author Justin Ross <<a href="mailto:jr...@re...">jr...@re...</a>>
- * @version $Id: LegacyAdapterServlet.java 287 2005-02-22 00:29:02Z sskracic $
- */
-public class LegacyAdapterServlet extends BaseApplicationServlet {
-
- private static final Logger s_log = Logger.getLogger
- (LegacyAdapterServlet.class);
-
- /**
- * <p>Fetches the dispatcher for the package type of the current
- * application and dispatches to it with the {@link
- * RequestContext} constructed in {@link
- * com.arsdigita.web.BaseApplicationServlet}.</p>
- *
- * @param app The application which is being served.
- */
- public void doService(HttpServletRequest sreq,
- HttpServletResponse sresp,
- Application app)
- throws ServletException, IOException {
- s_log.debug("LegacyAdapterServlet.doService called for request " +
- sreq);
-
- PackageType type = app.getApplicationType().getPackageType();
-
- if (s_log.isDebugEnabled()) {
- s_log.debug("Using package type '" + type.getKey() + "'");
- }
-
- Assert.exists(type, "PackageType type");
-
- String jsp = "/packages/" + type.getKey() + "/www" + sreq.getPathInfo();
- File file = new File(getServletContext().getRealPath(jsp));
-
- if (file.exists() && !file.isDirectory()) {
- // XXX Need to handle welcome files.
-
- RequestDispatcher rd = sreq.getRequestDispatcher(jsp);
-
- Assert.exists(rd, "RequestDispatcher rd");
-
- rd.forward(sreq, sresp);
- } else {
- try {
- RequestContext rc = DispatcherHelper.getRequestContext();
-
- Assert.exists(rc, "RequestContext rc");
-
- Dispatcher dispatcher = type.getDispatcher();
-
- Assert.exists(dispatcher, "Dispatcher dispatcher");
-
- if (s_log.isDebugEnabled()) {
- s_log.debug
- ("Dispatching using dispatcher '" + dispatcher + "'");
- }
-
- dispatcher.dispatch(sreq, sresp, rc);
- } catch (ClassNotFoundException cnfe) {
- throw new UncheckedWrapperException(cnfe);
- } catch (InstantiationException ie) {
- throw new UncheckedWrapperException(ie);
- } catch (IllegalAccessException iae) {
- throw new UncheckedWrapperException(iae);
- } catch (InvocationTargetException ite) {
- throw new UncheckedWrapperException(ite);
- }
- }
- }
-}
Deleted: trunk/ccm-core/src/com/arsdigita/web/LegacyInitializerServlet.java.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/web/LegacyInitializerServlet.java.nolongerInUse 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-core/src/com/arsdigita/web/LegacyInitializerServlet.java.nolongerInUse 2013-02-02 18:23:47 UTC (rev 2468)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2003-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.web;
-
-
-// //////////////////////////////////////////////////////////////////////////
-//
-// Old initializer system based on enterprise.init scripts is no longer
-// available.
-//
-// //////////////////////////////////////////////////////////////////////////
-
-
-import com.arsdigita.developersupport.Debug;
-import com.arsdigita.initializer.Script;
-import com.arsdigita.util.ResourceManager;
-import java.io.InputStream;
-import javax.servlet.ServletException;
-
-/**
- * @author Justin Ross <jr...@re...>
- * @version $Id: LegacyInitializerServlet.java 287 2005-02-22 00:29:02Z sskracic $
- */
-public final class LegacyInitializerServlet extends BaseServlet {
-
- private Script m_initializer = null;
-
- /**
- * Starts up the web environment for the ACS by loading the specified
- * initializer script.
- */
- @Override
- protected final void doInit() throws ServletException {
- Debug.setLevel("com.arsdigita.initializer.Script", "info");
-
- final String script = getServletConfig().getInitParameter("init");
-
- final ResourceManager rm = ResourceManager.getInstance();
- rm.setServletContext(getServletContext());
-
- final InputStream is = rm.getResourceAsStream(script);
-
- if (is == null) {
- throw new ServletException("Couldn't find " + script);
- }
-
- m_initializer = new Script(is);
- m_initializer.startup();
- }
-
- @Override
- protected final void doDestroy() {
- m_initializer.shutdown();
- m_initializer = null;
- }
-}
Modified: trunk/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java
===================================================================
--- trunk/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java 2013-02-02 18:09:36 UTC (rev 2467)
+++ trunk/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java 2013-02-02 18:23:47 UTC (rev 2468)
@@ -23,8 +23,8 @@
import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.loader.PackageLoader;
import com.arsdigita.runtime.ScriptContext;
+import com.arsdigita.web.Application;
import com.arsdigita.web.ApplicationType;
-import com.arsdigita.web.Application;
import org.apache.log4j.Logger;
|
|
From: <pb...@fe...> - 2013-02-02 18:09:44
|
Author: pboy
Date: 2013-02-02 18:09:36 +0000 (Sat, 02 Feb 2013)
New Revision: 2467
Modified:
trunk/tools-ng/netbeans/project.xml
Log:
Added Camden packages to netbeans configuration.
Modified: trunk/tools-ng/netbeans/project.xml
===================================================================
--- trunk/tools-ng/netbeans/project.xml 2013-02-02 18:07:21 UTC (rev 2466)
+++ trunk/tools-ng/netbeans/project.xml 2013-02-02 18:09:36 UTC (rev 2467)
@@ -263,6 +263,18 @@
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-atoz (Source)</label>
+ <type>java</type>
+ <location>ccm-atoz/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-atoz-siteproxy (Source)</label>
+ <type>java</type>
+ <location>ccm-atoz-siteproxy/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>ccm-auth-http (Source)</label>
<type>java</type>
<location>ccm-auth-http/src</location>
@@ -353,6 +365,12 @@
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-portlet-collection (Source)</label>
+ <type>java</type>
+ <location>ccm-portlet-collection/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>ccm-portlet-latestnews (Source)</label>
<type>java</type>
<location>ccm-portlet-latestnews/src</location>
@@ -419,6 +437,12 @@
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-ldn-atoz-siteproxy (Source)</label>
+ <type>java</type>
+ <location>ccm-ldn-atoz-siteproxy/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
<label>ccm-ldn-dublin (Source)</label>
<type>java</type>
<location>ccm-ldn-dublin/src</location>
@@ -478,19 +502,57 @@
<location>ccm-ldn-util/src</location>
<encoding>UTF-8</encoding>
</source-folder>
+
<source-folder>
- <label>ccm-gen-aplaws (Source)</label>
+ <label>ccm-lbc-aplaws (Source)</label>
<type>java</type>
- <location>ccm-gen-aplaws/src</location>
+ <location>ccm-lbc-aplaws/src</location>
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
- <label>ccm-gen-aplaws (Web)</label>
+ <label>ccm-lbc-consultation (Source)</label>
<type>java</type>
- <location>ccm-gen-aplaws/web</location>
+ <location>ccm-lbc-consultation/src</location>
<encoding>UTF-8</encoding>
</source-folder>
<source-folder>
+ <label>ccm-lbc-contentcheck (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-contentcheck/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-decisiontree (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-decisiontree/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-eforms (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-eforms/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-foi (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-foi/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-retention (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-retention/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>ccm-lbc-wordxml (Source)</label>
+ <type>java</type>
+ <location>ccm-lbc-wordxml/src</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+
+ <source-folder>
<label>ccm-sci-bundle (Source)</label>
<type>java</type>
<location>ccm-sci-bundle/src</location>
@@ -742,6 +804,14 @@
<location>ccm-cms-types-xmlfeed/src</location>
</source-folder>
<source-folder style="packages">
+ <label>ccm-atoz (Source)</label>
+ <location>ccm-atoz/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-atoz-siteproxy (Source)</label>
+ <location>ccm-atoz-siteproxy/src</location>
+ </source-folder>
+ <source-folder style="packages">
<label>ccm-auth-http (Source)</label>
<location>ccm-auth-http/src</location>
</source-folder>
@@ -802,6 +872,10 @@
<location>ccm-portlet-bookmarks/src</location>
</source-folder>
<source-folder style="packages">
+ <label>ccm-portlet-collection (Source)</label>
+ <location>ccm-portlet-collection/src</location>
+ </source-folder>
+ <source-folder style="packages">
<label>ccm-portlet-latestnews (Source)</label>
<location>ccm-portlet-latestnews/src</location>
</source-folder>
@@ -885,7 +959,41 @@
<label>ccm-ldn-util (Source)</label>
<location>ccm-ldn-util/src</location>
</source-folder>
+
<source-folder style="packages">
+ <label>ccm-lbc-aplaws (Source)</label>
+ <location>ccm-lbc-aplaws/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-consultation (Source)</label>
+ <location>ccm-lbc-consultation/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-contentcheck (Source)</label>
+ <location>ccm-lbc-contentcheck/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-decisiontree (Source)</label>
+ <location>ccm-lbc-decisiontree/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-eforms (Source)</label>
+ <location>ccm-lbc-eforms/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-foi (Source)</label>
+ <location>ccm-lbc-foi/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-retention (Source)</label>
+ <location>ccm-lbc-retention/src</location>
+ </source-folder>
+ <source-folder style="packages">
+ <label>ccm-lbc-wordxml (Source)</label>
+ <location>ccm-lbc-wordxml/src</location>
+ </source-folder>
+
+ <source-folder style="packages">
<label>ccm-sci-bundle (Source)</label>
<location>ccm-sci-bundle/src</location>
</source-folder>
@@ -902,20 +1010,20 @@
<location>ccm-sci-publications/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-departement (Source)</label>
- <location>ccm-sci-type-departement/src</location>
+ <label>ccm-sci-types-department (Source)</label>
+ <location>ccm-sci-types-department/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-institute (Source)</label>
- <location>ccm-sci-type-institute/src</location>
+ <label>ccm-sci-types-institute (Source)</label>
+ <location>ccm-sci-types-institute/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-member (Source)</label>
- <location>ccm-sci-type-member/src</location>
+ <label>ccm-sci-types-member (Source)</label>
+ <location>ccm-sci-types-member/src</location>
</source-folder>
<source-folder style="packages">
- <label>ccm-sci-type-project (Source)</label>
- <location>ccm-sci-type-project/src</location>
+ <label>ccm-sci-types-project (Source)</label>
+ <location>ccm-sci-types-project/src</location>
</source-folder>
<source-file>
<location>build.xml</location>
@@ -975,6 +1083,8 @@
<package-root>ccm-cms-types-siteproxy/src</package-root>
<package-root>ccm-cms-types-survey/src</package-root>
<package-root>ccm-cms-types-xmlfeed/src</package-root>
+ <package-root>ccm-atoz/src</package-root>
+ <package-root>ccm-atoz-siteproxy/src</package-root>
<package-root>ccm-auth-http/src</package-root>
<package-root>ccm-bookmarks/src</package-root>
<package-root>ccm-bundle/src</package-root>
@@ -990,6 +1100,7 @@
<package-root>ccm-portalworkspace/src</package-root>
<package-root>ccm-portalworkspace-homepage/src</package-root>
<package-root>ccm-portlet-bookmarks/src</package-root>
+ <package-root>ccm-portlet-collection/src</package-root>
<package-root>ccm-portlet-latestnews/src</package-root>
<package-root>ccm-portlet-motd/src</package-root>
<package-root>ccm-rssfeed/src</package-root>
@@ -1011,15 +1122,24 @@
<package-root>ccm-ldn-types-esdservice/src</package-root>
<package-root>ccm-ldn-userpreferences/src</package-root>
<package-root>ccm-ldn-util/src</package-root>
+ <package-root>ccm-lbc-aplaws/src</package-root>
+ <package-root>ccm-lbc-consultation/src</package-root>
+ <package-root>ccm-lbc-contentcheck/src</package-root>
+ <package-root>ccm-lbc-decisiontree/src</package-root>
+ <package-root>ccm-lbc-eforms/src</package-root>
+ <package-root>ccm-lbc-foi/src</package-root>
+ <package-root>ccm-lbc-retention/src</package-root>
+ <package-root>ccm-lbc-wordxml/src</package-root>
<package-root>ccm-sci-bundle/src</package-root>
<package-root>ccm-sci-personalprojects/src</package-root>
<package-root>ccm-sci-personalpublications/src</package-root>
<package-root>ccm-sci-publications/src</package-root>
- <package-root>ccm-sci-type-department/src</package-root>
- <package-root>ccm-sci-type-institute/src</package-root>
- <package-root>ccm-sci-type-member/src</package-root>
- <package-root>ccm-sci-type-project/src</package-root>
- <classpath mode="compile">ccm-core/lib/log4j.jar:ccm-core/lib/mail.jar:ccm-core/lib/commons-beanutils.jar:ccm-core/lib/commons-cli-1.0.jar:ccm-core/lib/commons-collections-3.0.jar:ccm-core/lib/commons-codec-1.3.jar:ccm-core/lib/commons-fileupload-1.1.1.jar:ccm-core/lib/commons-lang-2.1.jar:ccm-core/lib/commons-primitives-1.0.jar:ccm-core/lib/xercesImpl.jar:ccm-core/lib/jakarta-oro-2.0.8.jar:ccm-core/lib/Tidy.jar:ccm-core/lib/jdom.jar:ccm-core/lib/jdxslt.jar:ccm-core/lib/lucene-core-2.4.0.jar:ccm-core/lib/saxon.jar:ccm-core/lib/poi-2.5-final-20040302.jar:ccm-core/lib/pdfbox-1.4.0.jar:ccm-core/lib/tm-extractors-0.4.jar:ccm-core/lib/bcprov-jdk16-144.jar:ccm-cms/lib/jai_codec.jar:ccm-cms/lib/jai_core.jar:ccm-cms/lib/mlibwrapper_jai.jar:ccm-ldn-search/lib/axis.jar:ccm-ldn-search/lib/jaxrpc.jar:ccm-ldn-search/lib/jobo.jar:ccm-ldn-terms/lib/commons-digester.jar:ccm-ldn-terms/lib/jena.jar:ccm-ldn-terms/lib/snowball.jar:ccm-ldn-terms/lib/weka-3.5.5.jar:ccm-ldn-terms/l
ib/xstream-1.3.1.jar:ccm-formbuilder-pdf/lib/fop.jar:tools-ng/devel/lib/ccm-servlet-2.3.jar:tools-ng/devel/lib/ojdbc14.jar:tools-ng/devel/lib/postgresql-jdbc.jar</classpath>
+ <package-root>ccm-sci-types-department/src</package-root>
+ <package-root>ccm-sci-types-institute/src</package-root>
+ <package-root>ccm-sci-types-member/src</package-root>
+ <package-root>ccm-sci-types-project/src</package-root>
+
+ <classpath mode="compile">ccm-core/lib/log4j.jar:ccm-core/lib/mail.jar:ccm-core/lib/commons-beanutils.jar:ccm-core/lib/commons-cli-1.0.jar:ccm-core/lib/commons-collections-3.0.jar:ccm-core/lib/commons-codec-1.3.jar:ccm-core/lib/commons-fileupload-1.1.1.jar:ccm-core/lib/commons-io-1.3.1.jar:ccm-core/lib/commons-lang-2.1.jar:ccm-core/lib/commons-primitives-1.0.jar:ccm-core/lib/xercesImpl.jar:ccm-core/lib/jakarta-oro-2.0.8.jar:ccm-core/lib/Tidy.jar:ccm-core/lib/imgscalr-lib-4.2.jar:ccm-core/lib/jdom.jar:ccm-core/lib/jdxslt.jar:ccm-core/lib/lucene-core-2.4.0.jar:ccm-core/lib/saxon.jar:ccm-core/lib/poi-2.5-final-20040302.jar:ccm-core/lib/pdfbox-1.4.0.jar:ccm-core/lib/tm-extractors-0.4.jar:ccm-core/lib/bcprov-jdk16-144.jar:ccm-cms/lib/jai_codec.jar:ccm-cms/lib/jai_core.jar:ccm-cms/lib/mlibwrapper_jai.jar:ccm-ldn-search/lib/axis.jar:ccm-ldn-search/lib/jaxrpc.jar:ccm-ldn-search/lib/jobo.jar:ccm-ldn-terms/lib/commons-digester.jar:ccm-ldn-terms/lib/jena.jar:ccm-ldn-ter
ms/lib/snowball.jar:ccm-ldn-terms/lib/weka-3.5.5.jar:ccm-ldn-terms/lib/xstream-1.3.1.jar:ccm-formbuilder-pdf/lib/fop.jar:tools-ng/devel/lib/ccm-servlet-2.3.jar:tools-ng/devel/lib/ojdbc14.jar:tools-ng/devel/lib/postgresql-jdbc.jar</classpath>
<source-level>1.5</source-level>
</compilation-unit>
</java-data>
|