- Some bug fixes in sci-publications

- OrionDefaultServlet was not used, removed
- Formatting 


git-svn-id: https://svn.libreccm.org/ccm/trunk@695 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-01-19 07:44:38 +00:00
parent c9638bbb60
commit 12a8a41f85
8 changed files with 59 additions and 62 deletions

View File

@ -3035,7 +3035,11 @@ public class DaBInImporter extends Program {
getPlace()); getPlace());
publisherDe = new Publisher(); publisherDe = new Publisher();
publisherDe.setTitle(publisherData.getName()); publisherDe.setTitle(publisherData.getName());
publisherDe.setName(publisherData.getName().toLowerCase()); publisherDe.setName(publisherData.getName().
replace(",", "").
replace("/", "").
replaceAll("\\s\\s+", " ").
replace(' ', '-').toLowerCase());
publisherDe.setPlace(publisherData.getPlace()); publisherDe.setPlace(publisherData.getPlace());
publisherDe.setLanguage("de"); publisherDe.setLanguage("de");
publisherDe.setLifecycle(createLifecycle()); publisherDe.setLifecycle(createLifecycle());
@ -3047,7 +3051,11 @@ public class DaBInImporter extends Program {
getPlace()); getPlace());
publisherEn = new Publisher(); publisherEn = new Publisher();
publisherEn.setTitle(publisherData.getName()); publisherEn.setTitle(publisherData.getName());
publisherEn.setName(publisherData.getName().toLowerCase()); publisherEn.setName(publisherData.getName().
replace(",", "").
replace("/", "").
replaceAll("\\s\\s+", " ").
replace(' ', '-').toLowerCase());
publisherEn.setPlace(publisherData.getPlace()); publisherEn.setPlace(publisherData.getPlace());
publisherEn.setLanguage("en"); publisherEn.setLanguage("en");
publisherEn.setLifecycle(createLifecycle()); publisherEn.setLifecycle(createLifecycle());
@ -3151,7 +3159,11 @@ public class DaBInImporter extends Program {
int colonIndex = normalizedData.indexOf(':'); int colonIndex = normalizedData.indexOf(':');
if (colonIndex < 0) { if (colonIndex < 0) {
publisher.setName(normalizedData); publisher.setName(normalizedData.
replace(",", "").
replace("/", "").
replaceAll("\\s\\s+", " ").
replace(' ', '-').toLowerCase());
} else { } else {
String name; String name;
String place; String place;
@ -3188,7 +3200,11 @@ public class DaBInImporter extends Program {
System.out.printf("\tprevDelimIndex = %d\n", prevDelimIndex); System.out.printf("\tprevDelimIndex = %d\n", prevDelimIndex);
place = normalizedData.substring(prevDelimIndex, colonIndex); place = normalizedData.substring(prevDelimIndex, colonIndex);
publisher.setName(name.trim()); publisher.setName(name.trim().
replace(",", "").
replace("/", "").
replaceAll("\\s\\s+", " ").
replace(' ', '-').toLowerCase());
publisher.setPlace(place.trim()); publisher.setPlace(place.trim());
} }

View File

@ -67,9 +67,10 @@ public class PublicationData {
public void setLink(String link) { public void setLink(String link) {
if (link.length() < 200) { if (link.length() < 200) {
this.link = link; this.link = link;
} else { } else {
System.out.println("\n***WARNING: Link value too long. Truncating.\n"); System.out.println(
"\n***WARNING: Link value too long. Truncating.\n");
this.link = link.substring(0, 200); this.link = link.substring(0, 200);
} }
} }
@ -84,10 +85,18 @@ public class PublicationData {
public String getUrl() { public String getUrl() {
if (name.length() < 200) { if (name.length() < 200) {
return name; return name.replace(",", "").
replace("/", "").
replaceAll("\\s\\s+", " ").
replace(' ', '-').toLowerCase();
} else { } else {
System.out.println("\t***WARNING: Title of publication is too long for URL. Triming to title to a length of 200 characters for URL."); System.out.println(
return name.substring(0,200); "\t***WARNING: Title of publication is too long for URL. Triming to title to a length of 200 characters for URL.");
return name.substring(0, 200).
replace(",", "").
replace("/", "").
replaceAll("\\s\\s+", " ").
replace(' ', '-').toLowerCase();
} }
} }

View File

@ -250,6 +250,7 @@ public class FileAsset extends BinaryAsset {
} }
@Override
protected void beforeSave() { protected void beforeSave() {
if( null == getLanguage() ) { if( null == getLanguage() ) {
setLanguage( Locale.getDefault().getLanguage() ); setLanguage( Locale.getDefault().getLanguage() );

View File

@ -1,52 +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.dispatcher;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
/**
*
* @version $Id: OrionDefaultServlet.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class OrionDefaultServlet extends HttpServlet
implements DispatcherConstants {
private static final Logger s_log =
Logger.getLogger(OrionDefaultServlet.class);
public void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException {
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getNamedDispatcher("orion.filehandler");
try {
rd.include(req, resp);
} catch (Exception e) {
s_log.error("caught error", e);
throw new ServletException(e.getMessage());
}
}
}

View File

@ -28,6 +28,7 @@ import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream; import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
public class ServletRequestWrapper implements ServletRequest { public class ServletRequestWrapper implements ServletRequest {
private final ServletRequest m_req; private final ServletRequest m_req;

View File

@ -0,0 +1,14 @@
The ccm-sci-publications module
===============================
The ccm-sci-publications module provides several content types for
managing publications. The content types and forms have no special
characteristics, except that they are using many associations between
them. For displaying nice lists of publications, a special template is
necessary, together with support in the theme for the XML produced by
the template.
The key is the activate the specialize object feature in the item
lists. An example for a template for publication lists can be found in
the ccm-zes-aplaws module. The Mandalay theme supports publications
since revision 161.

View File

@ -11,6 +11,7 @@
<xrd:associations rule="include"> <xrd:associations rule="include">
<xrd:property name="/object/publisher"/> <xrd:property name="/object/publisher"/>
<xrd:property name="/object/authors"/>
</xrd:associations> </xrd:associations>
</xrd:adapter> </xrd:adapter>

View File

@ -40,7 +40,14 @@ import java.util.Set;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* Base class for all panels of the sci-types-organization module. * Base class for all panels of the sci-types-organization module. The panels
* are displaying the information of an organization type (
* <code>SciOrganization</code>, <code>SciDepartment</code>,
* <code>SciProject</code>) similar to the <code>MultiPartArticle</code>. For
* each information, e.g. members, there is a link, which replaces the
* information shown. To use this as an index item, a special template is
* necessary. An example of such a template can be found in the ccm-zes-aplaws
* module.
* *
* @see SciOrganizationPanel * @see SciOrganizationPanel
* @see SciDepartmentPanel * @see SciDepartmentPanel