ItemSearch Widget funktionierte aufgrund der Änderungen in den Revision 2046 bis 2053 nicht mehr. Problem ist jetzt behoben.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2059 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
a6fda4180b
commit
5a86ae68e6
|
|
@ -27,7 +27,6 @@ import java.math.BigDecimal;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* Application domain class for the CMS module user entry page (content-center)
|
||||
*
|
||||
|
|
@ -38,11 +37,9 @@ public class ContentCenter extends Application {
|
|||
|
||||
/** 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";
|
||||
|
|
@ -95,15 +92,13 @@ public class ContentCenter extends Application {
|
|||
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,7 +110,7 @@ public class ContentCenter extends Application {
|
|||
*/
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -61,37 +61,27 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
/** Logger instance for debugging */
|
||||
private static Logger s_log = Logger
|
||||
.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.
|
||||
|
|
@ -111,7 +101,8 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
// Obviously not required.
|
||||
addPage("/", new MainPage()); // index page at address ~/ds
|
||||
// addPage("/index/", new MainPage());
|
||||
// addPage("/ItemSearchPage/", new CCItemSearchPage());
|
||||
//addPage("/ItemSearchPage/", new ItemSearchPage());
|
||||
addPage("/item-search", new ItemSearchPage());
|
||||
// addPage("/SearchResultRedirector/", new CCSearchResultRedirector());
|
||||
|
||||
|
||||
|
|
@ -130,7 +121,6 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
m_resolver = Web.getConfig().getApplicationFileResolver();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implements the (abstract) doService method of BaseApplicationServlet to
|
||||
* create the ContentCenter page.
|
||||
|
|
@ -209,12 +199,20 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
|
||||
// Check user access.
|
||||
checkUserAccess(sreq, sresp);
|
||||
//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);
|
||||
// page.init();
|
||||
// page.dispatch(sreq, sresp, ctx);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Fall back on the JSP application dispatcher.
|
||||
|
|
@ -245,7 +243,6 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
}
|
||||
} // END doService()
|
||||
|
||||
|
||||
/**
|
||||
* Adds one pair of Url - Page to the internal hash map, used as a cache.
|
||||
*
|
||||
|
|
@ -264,7 +261,6 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
m_pages.put(pathInfo, page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Service Method returns the URL stub for the class name,
|
||||
* can return null if not mapped
|
||||
|
|
@ -275,8 +271,7 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
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;
|
||||
|
|
@ -293,7 +288,6 @@ public class ContentCenterServlet extends BaseApplicationServlet {
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue