Only in ./app/mediafilter: MediaFilterManager.java.orig Only in ./app/mediafilter: MediaFilterManager.java.patch Only in ./app/mediafilter: MediaFilterManager.java.rej Only in ./app/mediafilter: PDFFilter.java.orig diff -aur --exclude=MediaFilterManager.java --exclude=PDFFilter.java --exclude=EPersonAdminServlet.java --exclude=GroupEditServlet.java --exclude=RegisterServlet.java --exclude=SimpleAuthenticator.java ../../../../dspace-1.2-source-devel/src/org/dspace/app/webui/jsptag/CollectionListTag.java ./app/webui/jsptag/CollectionListTag.java --- ../../../../dspace-1.2-source-devel/src/org/dspace/app/webui/jsptag/CollectionListTag.java 2002-11-01 15:59:10.000000000 -0200 +++ ./app/webui/jsptag/CollectionListTag.java 2005-04-19 17:34:57.000000000 -0200 @@ -51,6 +51,9 @@ import javax.servlet.jsp.JspWriter; import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.jstl.fmt.*; +import org.apache.taglibs.standard.tag.common.fmt.BundleSupport; + import org.dspace.content.Collection; /** @@ -69,7 +72,7 @@ { super(); } - + public int doStartTag() throws JspException @@ -82,7 +85,7 @@ // Write column headings out.print("
"); - out.print(fieldData[0]); - out.print(": | ");
- out.print(Utils.addEntities(values[0].value));
-
- for (int j = 1; j < values.length; j++)
- {
- out.print(" "); - out.print(Utils.addEntities(values[j].value)); - } - out.println(" |
Full metadata record
"); - - HttpServletRequest request = - (HttpServletRequest) pageContext.getRequest(); - - // Three column table - DC field, value, language - out.println("DC Field | Value | Language |
---|---|---|
"); - out.print(values[i].element); - if (values[i].qualifier != null) - { - out.print("." + values[i].qualifier); - } - out.print(" | "); - out.print(Utils.addEntities(values[i].value)); - out.print(" | "); - - if (values[i].language == null) - { - out.print("-"); - } - else - { - out.print(values[i].language); - } - - out.println(" |
Files in This Item: "); - - Bundle[] bundles = item.getBundles("ORIGINAL"); - - if (bundles.length == 0) - { - out.println("There are no files associated with this item. "); - } - else - { - boolean html = false; - String handle = item.getHandle(); - Bitstream primaryBitstream = null; - - Bundle[] bunds = item.getBundles("ORIGINAL"); - // if item contains multiple bitstreams, display bitstream description - boolean multiFile = bunds[0].getBitstreams().length > 1; - Bundle[] thumbs= item.getBundles("THUMBNAIL"); - - // check if primary bitstream is html - if (bunds[0] != null) - { - Bitstream[] bits = bunds[0].getBitstreams(); - for (int i = 0; i < bits.length && !html; i++) - { - if (bits[i].getID() == bunds[0].getPrimaryBitstreamID()) - { - html = bits[i].getFormat().getMIMEType().equals("text/html"); - primaryBitstream = bits[i]; - } - } - } - - out.println("
|
"); + out.print(fieldData[0]); + out.print(": | ");
+ out.print(Utils.addEntities(((DCValue) allValues.get(0)).value));
+
+ for (int j = 1; j < allValues.size(); j++)
+ {
+ out.print(" "); + out.print(Utils.addEntities(((DCValue) allValues.get(j)).value)); + } + out.println(" |
" + res.getString("ItemTag.full")+ "
"); + + HttpServletRequest request = + (HttpServletRequest) pageContext.getRequest(); + + // Three column table - DC field, value, language + out.println("" + res.getString("ItemTag.field") + " | " + res.getString("ItemTag.value") + " | " + res.getString("ItemTag.lang") + " |
---|---|---|
"); + out.print(values[i].element); + if (values[i].qualifier != null) + { + out.print("." + values[i].qualifier); + } + out.print(" | "); + out.print(Utils.addEntities(values[i].value)); + out.print(" | "); + + if (values[i].language == null) + { + out.print("-"); + } + else + { + out.print(values[i].language); + } + + out.println(" |
" + res.getString("ItemTag.filesIn") + " "); + + Bundle[] bundles = item.getBundles("ORIGINAL"); + + if (bundles.length == 0) + { + out.println("" + res.getString("ItemTag.nofiles") + " "); + } + else + { + boolean html = false; + String handle = item.getHandle(); + Bitstream primaryBitstream = null; + + Bundle[] bunds = item.getBundles("ORIGINAL"); + // if item contains multiple bitstreams, display bitstream description + boolean multiFile = bunds[0].getBitstreams().length > 1; + Bundle[] thumbs= item.getBundles("THUMBNAIL"); + + // check if primary bitstream is html + if (bunds[0] != null) + { + Bitstream[] bits = bunds[0].getBitstreams(); + for (int i = 0; i < bits.length && !html; i++) + { + if (bits[i].getID() == bunds[0].getPrimaryBitstreamID()) + { + html = bits[i].getFormat().getMIMEType().equals("text/html"); + primaryBitstream = bits[i]; + } + } + } + + out.println("
|
dspace.layout.parentlinks
- a List
of
* String
s corresponding with links to put in the location bar.
* Empty strings mean no link. Will only be set if
- * dspace.layout.locbar
is true.dspace.layout.locbar
is true.
* dspace.layout.navbar
- value will be "off", or the
* navigation bar to include, e.g. "/layout/navbar_default.jsp"dspace.layout.sidebar
- contents of the sidebar"); - + if (multiple) { out.print(" | ||
"); @@ -157,16 +160,25 @@ { out.print(" | "); } - - String p = (multiple ? "people" : "person"); - out.print(""); - + if (multiple) { out.print(" | "); - out.print(""); + out.print(""); } out.println(" |
null
if there is no location, i.e. "all of
- * DSpace" is the location.
- *
- * @param request current HTTP request
- *
- * @return the current community location, or null
- */
- public static Community getCommunityLocation(HttpServletRequest request)
- {
- return ((Community) request.getAttribute("dspace.community"));
- }
-
- /**
- * Get the current collection location, that is, where the user "is".
- * This returns null if there is no collection location, i.e. the
- * location is "all of DSpace" or a community.
- *
- * @param request current HTTP request
- *
- * @return the current collection location, or null
- */
- public static Collection getCollectionLocation(HttpServletRequest request)
- {
- return ((Collection) request.getAttribute("dspace.collection"));
- }
-
- /**
- * Put the original request URL into the request object as an attribute
- * for later use. This is necessary because forwarding a request removes
- * this information. The attribute is only written if it hasn't been
- * before; thus it can be called after a forward safely.
- *
- * @param request the HTTP request
- */
- public static void storeOriginalURL(HttpServletRequest request)
- {
- String orig = (String) request.getAttribute("dspace.original.url");
-
- if (orig == null)
- {
- String fullURL = request.getRequestURL().toString();
-
- if (request.getQueryString() != null)
- {
- fullURL = fullURL + "?" + request.getQueryString();
- }
-
- request.setAttribute("dspace.original.url", fullURL);
- }
- }
-
- /**
- * Get the original request URL.
- *
- * @param request the HTTP request
- *
- * @return the original request URL
- */
- public static String getOriginalURL(HttpServletRequest request)
- {
- // Make sure there's a URL in the attribute
- storeOriginalURL(request);
-
- return ((String) request.getAttribute("dspace.original.url"));
- }
-
- /**
- * Utility method to convert spaces in a string to HTML non-break space
- * elements.
- *
- * @param s string to change spaces in
- * @return the string passed in with spaces converted to HTML non-break
- * spaces
- */
- public static String nonBreakSpace(String s)
- {
- StringBuffer newString = new StringBuffer();
-
- for (int i = 0; i < s.length(); i++)
- {
- char ch = s.charAt(i);
-
- if (ch == ' ')
- {
- newString.append(" ");
- }
- else
- {
- newString.append(ch);
- }
- }
-
- return newString.toString();
- }
-
- /**
- * Write a human-readable version of a DCDate.
- *
- * @param d the date
- * @param time if true, display the time with the date
- * @param localTime if true, adjust for local timezone, otherwise GMT
- *
- * @return the date in a human-readable form.
- */
- public static String displayDate(DCDate d,
- boolean time,
- boolean localTime)
- {
- StringBuffer sb = new StringBuffer();
-
- if (d != null)
- {
- int year, month, day, hour, minute, second;
-
- if (localTime)
- {
- year = d.getYear();
- month = d.getMonth();
- day = d.getDay();
- hour = d.getHour();
- minute = d.getMinute();
- second = d.getSecond();
- }
- else
- {
- year = d.getYearGMT();
- month = d.getMonthGMT();
- day = d.getDayGMT();
- hour = d.getHourGMT();
- minute = d.getMinuteGMT();
- second = d.getSecondGMT();
- }
-
- if (year > -1)
- {
- if (month > -1)
- {
- if (day > -1)
- {
- sb.append(day + "-");
- }
- sb.append(DCDate.getMonthName(month).substring(0, 3) + "-");
- }
- sb.append(year + " ");
- }
-
- if (time && hour > -1)
- {
- String hr = String.valueOf(hour);
-
- while (hr.length() < 2)
- {
- hr = "0" + hr;
- }
- String mn = String.valueOf(minute);
-
- while (mn.length() < 2)
- {
- mn = "0" + mn;
- }
- String sc = String.valueOf(second);
-
- while (sc.length() < 2)
- {
- sc = "0" + sc;
- }
- sb.append(hr + ":" + mn + ":" + sc + " ");
- }
- }
- else
- {
- sb.append("Unset");
- }
-
- return (sb.toString());
- }
-
- /**
- * Return a string for logging, containing useful information about the
- * current request - the URL, the method and parameters.
- *
- * @param request the request object.
- * @return a multi-line string containing information about
- * the request.
- */
- public static String getRequestLogInfo(HttpServletRequest request)
- {
- String report;
-
- report = "-- URL Was: " + getOriginalURL(request) + "\n";
- report = report + "-- Method: " + request.getMethod() + "\n";
-
- // First write the parameters we had
- report = report + "-- Parameters were:\n";
- Enumeration e = request.getParameterNames();
-
- while (e.hasMoreElements())
- {
- String name = (String) e.nextElement();
-
- if (name.equals("login_password"))
- {
- // We don't want to write a clear text password
- // to the log, even if it's wrong!
- report = report + "-- " + name + ": *not logged*\n";
- }
- else
- {
- report = report + "-- " + name + ": \"" + request.getParameter(name) + "\"\n";
- }
- }
-
- return report;
- }
-
-
- /**
- * Obtain a parameter from the given request as an int. -1
- * is returned if the parameter is garbled or does not exist.
- *
- * @param request the HTTP request
- * @param param the name of the parameter
- *
- * @return the integer value of the parameter, or -1
- */
- public static int getIntParameter(HttpServletRequest request, String param)
- {
- String val = request.getParameter(param);
-
- try
- {
- return Integer.parseInt(val);
- }
- catch (Exception e)
- {
- // Problem with parameter
- return -1;
- }
- }
-
-
- /**
- * Obtain an array of int parameters from the given request as an int.
- * null is returned if parameter doesn't exist. -1
- * is returned in array locations if that particular value is garbled.
- *
- * @param request the HTTP request
- * @param param the name of the parameter
- *
- * @return array of integers or null
- */
- public static int [] getIntParameters(HttpServletRequest request, String param)
- {
- String [] request_values = request.getParameterValues(param);
-
- if( request_values == null ) return null;
-
- int [] return_values = new int[request_values.length];
-
- for( int x = 0; x < return_values.length; x++ )
- {
- try
- {
- return_values[x] = Integer.parseInt(request_values[x]);
- }
- catch (Exception e)
- {
- // Problem with parameter, stuff -1 in this slot
- return_values[x] = -1;
- }
- }
-
- return return_values;
- }
-
-
- /**
- * Obtain a parameter from the given request as a boolean.
- * false
is returned if the parameter is garbled or does not
- * exist.
- *
- * @param request the HTTP request
- * @param param the name of the parameter
- *
- * @return the integer value of the parameter, or -1
- */
- public static boolean getBoolParameter(HttpServletRequest request,
- String param)
- {
- return (request.getParameter(param) != null &&
- request.getParameter(param).equals("true"));
- }
-
-
- /**
- * Get the button the user pressed on a submitted form. All buttons
- * should start with the text submit
for this to work.
- * A default should be supplied, since often the browser will submit a form
- * with no submit button pressed if the user presses enter.
- *
- * @param request the HTTP request
- * @param def the default button
- *
- * @return the button pressed
- */
- public static String getSubmitButton(HttpServletRequest request, String def)
- {
- Enumeration e = request.getParameterNames();
-
- while (e.hasMoreElements())
- {
- String parameterName = (String) e.nextElement();
-
- if (parameterName.startsWith("submit"))
- {
- return parameterName;
- }
- }
-
- return def;
- }
-
-
- /**
- * Send an alert to the designated "alert recipient" - that is, when a
- * database error or internal error occurs, this person is sent an
- * e-mail with details.
- *
- * The recipient is configured via the "alert.recipient" property in
- * dspace.cfg
. If this property is omitted, no alerts
- * are sent.
- *
- * This method "swallows" any exception that might occur - it will just
- * be logged. This is because this method will usually be invoked as
- * part of an error handling routine anyway.
- *
- * @param request the HTTP request leading to the error
- * @param exception the exception causing the error, or null
- */
- public static void sendAlert(HttpServletRequest request,
- Exception exception)
- {
- String logInfo = UIUtil.getRequestLogInfo(request);
-
- try
- {
- String recipient =
- ConfigurationManager.getProperty("alert.recipient");
-
- if (recipient != null)
- {
- Email email = ConfigurationManager.getEmail("internal_error");
-
- email.addRecipient(recipient);
- email.addArgument(
- ConfigurationManager.getProperty("dspace.url"));
- email.addArgument(new Date());
- email.addArgument(request.getSession().getId());
- email.addArgument(logInfo);
-
- String stackTrace;
-
- if (exception != null)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- exception.printStackTrace(pw);
- pw.flush();
- stackTrace = sw.toString();
- }
- else
- {
- stackTrace = "No exception";
- }
-
- email.addArgument(stackTrace);
- email.send();
- }
- }
- catch (Exception e)
- {
- // Not much we can do here!
- log.warn("Unable to send email alert", e);
- }
- }
-
-}
+/*
+ * UIUtil.java
+ *
+ * Version: $Revision: 1.12 $
+ *
+ * Date: $Date: 2004/01/29 01:09:22 $
+ *
+ * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
+ * Institute of Technology. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Hewlett-Packard Company nor the name of the
+ * Massachusetts Institute of Technology nor the names of their
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+package org.dspace.app.webui.util;
+
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.Enumeration;
+
+import java.util.Locale;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.jstl.fmt.*;
+
+
+import org.apache.log4j.Logger;
+
+import org.dspace.app.webui.SiteAuthenticator;
+import org.dspace.content.Collection;
+import org.dspace.content.Community;
+import org.dspace.content.DCDate;
+import org.dspace.core.ConfigurationManager;
+import org.dspace.core.Context;
+import org.dspace.core.Email;
+import org.dspace.eperson.EPerson;
+import java.util.ResourceBundle;
+
+/**
+ * Miscellaneous UI utility methods
+ *
+ * @author Robert Tansley
+ * @version $Revision: 1.12 $
+ */
+public class UIUtil
+{
+
+ /** log4j category */
+ private static Logger log = Logger.getLogger(UIUtil.class);
+
+ /**
+ * Obtain a new context object. If a context object has already been
+ * created for this HTTP request, it is re-used, otherwise it is created.
+ * If a user has authenticated with the system, the current user of the
+ * context is set appropriately.
+ *
+ * @param request the HTTP request
+ *
+ * @return a context object
+ */
+ public static Context obtainContext(HttpServletRequest request)
+ throws SQLException
+ {
+ Context c = (Context) request.getAttribute("dspace.context");
+
+ if (c == null)
+ {
+ // No context for this request yet
+ c = new Context();
+
+ // See if a user has authentication
+ Integer userID = (Integer)
+ request.getSession().getAttribute("dspace.current.user.id");
+
+ if (userID != null)
+ {
+ EPerson e = EPerson.find(c, userID.intValue());
+
+ Authenticate.loggedIn(c, request, e);
+ }
+
+ // Set any special groups - invoke the site authenticator
+ SiteAuthenticator siteAuth = Authenticate.getSiteAuth();
+ int[] groupIDs = siteAuth.getSpecialGroups(c, request);
+ for (int i = 0; i < groupIDs.length; i++)
+ {
+ c.setSpecialGroup(groupIDs[i]);
+ }
+
+
+ // Set the session ID
+ c.setExtraLogInfo("session_id=" + request.getSession().getId());
+
+ // Store the context in the request
+ request.setAttribute("dspace.context", c);
+ }
+
+ return c;
+ }
+
+ /**
+ * Get the current community location, that is, where the user "is".
+ * This returns null
if there is no location, i.e. "all of
+ * DSpace" is the location.
+ *
+ * @param request current HTTP request
+ *
+ * @return the current community location, or null
+ */
+ public static Community getCommunityLocation(HttpServletRequest request)
+ {
+ return ((Community) request.getAttribute("dspace.community"));
+ }
+
+ /**
+ * Get the current collection location, that is, where the user "is".
+ * This returns null if there is no collection location, i.e. the
+ * location is "all of DSpace" or a community.
+ *
+ * @param request current HTTP request
+ *
+ * @return the current collection location, or null
+ */
+ public static Collection getCollectionLocation(HttpServletRequest request)
+ {
+ return ((Collection) request.getAttribute("dspace.collection"));
+ }
+
+ /**
+ * Put the original request URL into the request object as an attribute
+ * for later use. This is necessary because forwarding a request removes
+ * this information. The attribute is only written if it hasn't been
+ * before; thus it can be called after a forward safely.
+ *
+ * @param request the HTTP request
+ */
+ public static void storeOriginalURL(HttpServletRequest request)
+ {
+ String orig = (String) request.getAttribute("dspace.original.url");
+
+ if (orig == null)
+ {
+ String fullURL = request.getRequestURL().toString();
+
+ if (request.getQueryString() != null)
+ {
+ fullURL = fullURL + "?" + request.getQueryString();
+ }
+
+ request.setAttribute("dspace.original.url", fullURL);
+ }
+ }
+
+ /**
+ * Get the original request URL.
+ *
+ * @param request the HTTP request
+ *
+ * @return the original request URL
+ */
+ public static String getOriginalURL(HttpServletRequest request)
+ {
+ // Make sure there's a URL in the attribute
+ storeOriginalURL(request);
+
+ return ((String) request.getAttribute("dspace.original.url"));
+ }
+
+ /**
+ * Utility method to convert spaces in a string to HTML non-break space
+ * elements.
+ *
+ * @param s string to change spaces in
+ * @return the string passed in with spaces converted to HTML non-break
+ * spaces
+ */
+ public static String nonBreakSpace(String s)
+ {
+ StringBuffer newString = new StringBuffer();
+
+ for (int i = 0; i < s.length(); i++)
+ {
+ char ch = s.charAt(i);
+
+ if (ch == ' ')
+ {
+ newString.append(" ");
+ }
+ else
+ {
+ newString.append(ch);
+ }
+ }
+
+ return newString.toString();
+ }
+
+ /**
+ * Write a human-readable version of a DCDate.
+ *
+ * @param d the date
+ * @param time if true, display the time with the date
+ * @param localTime if true, adjust for local timezone, otherwise GMT
+ *
+ * @return the date in a human-readable form.
+ */
+ public static String displayDate(DCDate d,
+ boolean time,
+ boolean localTime, Locale loc)
+ {
+
+
+ ResourceBundle res = ResourceBundle.getBundle ("Messages", loc);
+ StringBuffer sb = new StringBuffer();
+
+ if (d != null)
+ {
+ int year, month, day, hour, minute, second;
+
+ if (localTime)
+ {
+ year = d.getYear();
+ month = d.getMonth();
+ day = d.getDay();
+ hour = d.getHour();
+ minute = d.getMinute();
+ second = d.getSecond();
+ }
+ else
+ {
+ year = d.getYearGMT();
+ month = d.getMonthGMT();
+ day = d.getDayGMT();
+ hour = d.getHourGMT();
+ minute = d.getMinuteGMT();
+ second = d.getSecondGMT();
+ }
+
+ if (year > -1)
+ {
+ if (month > -1)
+ {
+ if (day > -1)
+ {
+ sb.append(day + "-");
+ }
+ sb.append(DCDate.getMonthName(month, loc).substring(0, 3) + "-");
+ }
+ sb.append(year + " ");
+ }
+
+ if (time && hour > -1)
+ {
+ String hr = String.valueOf(hour);
+
+ while (hr.length() < 2)
+ {
+ hr = "0" + hr;
+ }
+ String mn = String.valueOf(minute);
+
+ while (mn.length() < 2)
+ {
+ mn = "0" + mn;
+ }
+ String sc = String.valueOf(second);
+
+ while (sc.length() < 2)
+ {
+ sc = "0" + sc;
+ }
+ sb.append(hr + ":" + mn + ":" + sc + " ");
+ }
+ }
+ else
+ {
+ sb.append(res.getString("remove-item.itemDate.unset"));
+ }
+
+ return (sb.toString());
+ }
+
+ /**
+ * Return a string for logging, containing useful information about the
+ * current request - the URL, the method and parameters.
+ *
+ * @param request the request object.
+ * @return a multi-line string containing information about
+ * the request.
+ */
+ public static String getRequestLogInfo(HttpServletRequest request)
+ {
+ String report;
+
+ report = "-- URL Was: " + getOriginalURL(request) + "\n";
+ report = report + "-- Method: " + request.getMethod() + "\n";
+
+ // First write the parameters we had
+ report = report + "-- Parameters were:\n";
+ Enumeration e = request.getParameterNames();
+
+ while (e.hasMoreElements())
+ {
+ String name = (String) e.nextElement();
+
+ if (name.equals("login_password"))
+ {
+ // We don't want to write a clear text password
+ // to the log, even if it's wrong!
+ report = report + "-- " + name + ": *not logged*\n";
+ }
+ else
+ {
+ report = report + "-- " + name + ": \"" + request.getParameter(name) + "\"\n";
+ }
+ }
+
+ return report;
+ }
+
+
+ /**
+ * Obtain a parameter from the given request as an int. -1
+ * is returned if the parameter is garbled or does not exist.
+ *
+ * @param request the HTTP request
+ * @param param the name of the parameter
+ *
+ * @return the integer value of the parameter, or -1
+ */
+ public static int getIntParameter(HttpServletRequest request, String param)
+ {
+ String val = request.getParameter(param);
+
+ try
+ {
+ return Integer.parseInt(val);
+ }
+ catch (Exception e)
+ {
+ // Problem with parameter
+ return -1;
+ }
+ }
+
+
+ /**
+ * Obtain an array of int parameters from the given request as an int.
+ * null is returned if parameter doesn't exist. -1
+ * is returned in array locations if that particular value is garbled.
+ *
+ * @param request the HTTP request
+ * @param param the name of the parameter
+ *
+ * @return array of integers or null
+ */
+ public static int [] getIntParameters(HttpServletRequest request, String param)
+ {
+ String [] request_values = request.getParameterValues(param);
+
+ if( request_values == null ) return null;
+
+ int [] return_values = new int[request_values.length];
+
+ for( int x = 0; x < return_values.length; x++ )
+ {
+ try
+ {
+ return_values[x] = Integer.parseInt(request_values[x]);
+ }
+ catch (Exception e)
+ {
+ // Problem with parameter, stuff -1 in this slot
+ return_values[x] = -1;
+ }
+ }
+
+ return return_values;
+ }
+
+
+ /**
+ * Obtain a parameter from the given request as a boolean.
+ * false
is returned if the parameter is garbled or does not
+ * exist.
+ *
+ * @param request the HTTP request
+ * @param param the name of the parameter
+ *
+ * @return the integer value of the parameter, or -1
+ */
+ public static boolean getBoolParameter(HttpServletRequest request,
+ String param)
+ {
+ return (request.getParameter(param) != null &&
+ request.getParameter(param).equals("true"));
+ }
+
+
+ /**
+ * Get the button the user pressed on a submitted form. All buttons
+ * should start with the text submit
for this to work.
+ * A default should be supplied, since often the browser will submit a form
+ * with no submit button pressed if the user presses enter.
+ *
+ * @param request the HTTP request
+ * @param def the default button
+ *
+ * @return the button pressed
+ */
+ public static String getSubmitButton(HttpServletRequest request, String def)
+ {
+ Enumeration e = request.getParameterNames();
+
+ while (e.hasMoreElements())
+ {
+ String parameterName = (String) e.nextElement();
+
+ if (parameterName.startsWith("submit"))
+ {
+ return parameterName;
+ }
+ }
+
+ return def;
+ }
+
+
+ /**
+ * Send an alert to the designated "alert recipient" - that is, when a
+ * database error or internal error occurs, this person is sent an
+ * e-mail with details.
+ *
+ * The recipient is configured via the "alert.recipient" property in
+ * dspace.cfg
. If this property is omitted, no alerts
+ * are sent.
+ *
+ * This method "swallows" any exception that might occur - it will just
+ * be logged. This is because this method will usually be invoked as
+ * part of an error handling routine anyway.
+ *
+ * @param request the HTTP request leading to the error
+ * @param exception the exception causing the error, or null
+ */
+ public static void sendAlert(HttpServletRequest request,
+ Exception exception)
+ {
+ String logInfo = UIUtil.getRequestLogInfo(request);
+
+ try
+ {
+ String recipient =
+ ConfigurationManager.getProperty("alert.recipient");
+
+ if (recipient != null)
+ {
+ Email email = ConfigurationManager.getEmail("internal_error");
+
+ email.addRecipient(recipient);
+ email.addArgument(
+ ConfigurationManager.getProperty("dspace.url"));
+ email.addArgument(new Date());
+ email.addArgument(request.getSession().getId());
+ email.addArgument(logInfo);
+
+ String stackTrace;
+
+ if (exception != null)
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ exception.printStackTrace(pw);
+ pw.flush();
+ stackTrace = sw.toString();
+ }
+ else
+ {
+ stackTrace = "No exception";
+ }
+
+ email.addArgument(stackTrace);
+ email.send();
+ }
+ }
+ catch (Exception e)
+ {
+ // Not much we can do here!
+ log.warn("Unable to send email alert", e);
+ }
+ }
+
+}
Only in ./content: Collection.bak
Only in ./content: Community.bak
diff -aur --exclude=MediaFilterManager.java --exclude=PDFFilter.java --exclude=EPersonAdminServlet.java --exclude=GroupEditServlet.java --exclude=RegisterServlet.java --exclude=SimpleAuthenticator.java ../../../../dspace-1.2-source-devel/src/org/dspace/content/DCDate.java ./content/DCDate.java
--- ../../../../dspace-1.2-source-devel/src/org/dspace/content/DCDate.java 2003-04-11 14:49:06.000000000 -0200
+++ ./content/DCDate.java 2005-04-19 17:34:59.000000000 -0200
@@ -46,6 +46,12 @@
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
+import java.util.ResourceBundle;
+import java.util.Locale;
+import javax.servlet.jsp.jstl.fmt.*;
+//import javax.servlet.jsp.PageContext;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.taglibs.standard.tag.common.fmt.BundleSupport;
// FIXME: No tests
@@ -273,7 +279,7 @@
return utcGC.getTime();
}
-
+
/**
* Set the date. The date passed in is assumed to be in the current
* time zone, and is adjusting to fit the current time zone.
@@ -559,11 +565,20 @@
*
* @return the month name.
*/
- public static String getMonthName(int m)
+ //ResourceBundle added by kotsomit
+
+ public static String getMonthName(int m, Locale loc)
{
+
+
+ ResourceBundle mon =
+ ResourceBundle.getBundle("months", loc);
+ String[] monthnames = (String[])mon.getObject("Months");
+
+
if (m > 0 && m < 13)
{
- return MONTHNAMES[m - 1];
+ return monthnames[m - 1];
}
else
{
diff -aur --exclude=MediaFilterManager.java --exclude=PDFFilter.java --exclude=EPersonAdminServlet.java --exclude=GroupEditServlet.java --exclude=RegisterServlet.java --exclude=SimpleAuthenticator.java ../../../../dspace-1.2-source-devel/src/org/dspace/content/DCLanguage.java ./content/DCLanguage.java
--- ../../../../dspace-1.2-source-devel/src/org/dspace/content/DCLanguage.java 2002-11-01 15:59:12.000000000 -0200
+++ ./content/DCLanguage.java 2005-04-19 17:34:59.000000000 -0200
@@ -57,7 +57,7 @@
/** The language code. Special values: "" and "other". */
private String language;
-
+
/**
* Construct a language object from a database entry
*
@@ -67,7 +67,7 @@
{
setLanguage(l);
}
-
+
/**
* Write the language out to the database
*
@@ -88,14 +88,14 @@
return country + "_" + language;
}
}
-
+
/**
* Set the language and country
*
* @param l The language and country code, e.g. "en_US" or "fr"
*/
public void setLanguage(String l)
- {
+ {
if (l.equals("other"))
{
language = "other";
@@ -123,7 +123,7 @@
*
* @return the displayable name
*/
- public String getDisplayName()
+ public String getDisplayName(Locale inLocale)
{
Locale locale;
@@ -137,9 +137,9 @@
}
else
{
- locale = new Locale(language, country);
- return locale.getDisplayName();
+ locale = new Locale(language,country);
+ return locale.getDisplayName(inLocale);
}
}
-
+
}
diff -aur --exclude=MediaFilterManager.java --exclude=PDFFilter.java --exclude=EPersonAdminServlet.java --exclude=GroupEditServlet.java --exclude=RegisterServlet.java --exclude=SimpleAuthenticator.java ../../../../dspace-1.2-source-devel/src/org/dspace/content/Item.java ./content/Item.java
--- ../../../../dspace-1.2-source-devel/src/org/dspace/content/Item.java 2004-06-08 12:14:12.000000000 -0200
+++ ./content/Item.java 2005-04-19 17:34:59.000000000 -0200
@@ -220,7 +220,7 @@
{
// First check the cache
Item fromCache = (Item) context.fromCache(Item.class, id);
-
+
if (fromCache != null)
{
return fromCache;
@@ -269,13 +269,13 @@
{
TableRow row = DatabaseManager.create(context, "item");
Item i = new Item(context, row);
-
+
// Call update to give the item a last modified date. OK this isn't
// amazingly efficient but creates don't happen that often.
context.setIgnoreAuthorization(true);
i.update();
context.setIgnoreAuthorization(false);
-
+
HistoryManager.saveHistory(context,
i,
HistoryManager.CREATE,
@@ -330,7 +330,7 @@
return new ItemIterator(context, rows);
}
-
+
/**
* Get the internal ID of this item. In general, this shouldn't be
* exposed to users
@@ -370,7 +370,7 @@
return itemRow.getBooleanColumn("withdrawn");
}
-
+
/**
* Get the date the item was last modified, or the current date
* if last_modified is null
@@ -381,13 +381,13 @@
public Date getLastModified()
{
Date myDate = itemRow.getDateColumn("last_modified");
-
- if( myDate == null ) { myDate = new Date(); }
+
+ if( myDate == null ) { myDate = new Date(); }
return myDate;
}
-
+
/**
* Set the "is_archived" flag. This is public and only
* WorkflowItem.archive()
should set this.
@@ -415,7 +415,7 @@
* Get the owning Collection for the item
*
* @returns Collection that is the owner of the item
- */
+ */
public Collection getOwningCollection()
throws java.sql.SQLException
{
@@ -423,7 +423,7 @@
// get the collection ID
int cid = itemRow.getIntColumn("owning_collection");
-
+
myCollection = Collection.find(ourContext, cid);
return myCollection;
@@ -820,23 +820,23 @@
public Bundle[] getBundles(String name)
{
List matchingBundles = new ArrayList();
-
+
Iterator i = bundles.iterator();
-
+
// now only keep bundles with matching names
while(i.hasNext())
{
Bundle b = (Bundle)i.next();
-
+
if(name.equals(b.getName() ))
{
matchingBundles.add(b);
}
}
-
+
Bundle [] bundleArray = new Bundle[matchingBundles.size()];
bundleArray = (Bundle[])matchingBundles.toArray(bundleArray);
-
+
return bundleArray;
}
@@ -858,7 +858,7 @@
Bundle b = Bundle.create(ourContext);
b.setName(name);
b.update();
-
+
addBundle(b);
return b;
}
@@ -976,7 +976,7 @@
return bitstream;
}
-
+
/**
* Just for backwards compatibility - bitstream stored
* in bundle "ORIGINAL"
@@ -1050,7 +1050,7 @@
BitstreamFormat bf = BitstreamFormat.findByShortDescription(
ourContext, "License");
b.setFormat(bf);
-
+
b.update();
}
@@ -1068,13 +1068,13 @@
// search through bundles, looking for bitstream type license
Bundle[] buns = getBundles();
-
+
for(int i = 0; i < buns.length; i++)
{
boolean removethisbundle = false;
-
+
Bitstream [] bits = buns[i].getBitstreams();
-
+
for(int j=0; j
*
*/
public static EPerson[] findAll(Context context, int sortField)
- throws SQLException
+ throws SQLException
{
String s;
-
+
switch (sortField)
{
case ID:
@@ -189,25 +227,28 @@
s = "email";
break;
+ case NETID:
+ s = "netid";
+ break;
+
default:
s = "lastname";
}
-
+
TableRowIterator rows = DatabaseManager.query(context,
- "SELECT * FROM eperson ORDER BY " + s);
+ "SELECT * FROM eperson ORDER BY " + s);
List epeopleRows = rows.toList();
-
+
EPerson[] epeople = new EPerson[epeopleRows.size()];
-
+
for (int i = 0; i < epeopleRows.size(); i++)
{
TableRow row = (TableRow) epeopleRows.get(i);
// First check the cache
- EPerson fromCache = (EPerson) context.fromCache(
- EPerson.class,
- row.getIntColumn("eperson_id"));
+ EPerson fromCache = (EPerson) context.fromCache(EPerson.class, row
+ .getIntColumn("eperson_id"));
if (fromCache != null)
{
@@ -220,101 +261,87 @@
}
return epeople;
- }
-
+ }
/**
* Create a new eperson
- *
- * @param context DSpace context object
+ *
+ * @param context
+ * DSpace context object
*/
- public static EPerson create(Context context)
- throws SQLException, AuthorizeException
+ public static EPerson create(Context context) throws SQLException,
+ AuthorizeException
{
// authorized?
- if( !AuthorizeManager.isAdmin(context) )
+ if (!AuthorizeManager.isAdmin(context))
{
throw new AuthorizeException(
- "You must be an admin to create an EPerson");
+ "You must be an admin to create an EPerson");
}
-
+
// Create a table row
TableRow row = DatabaseManager.create(context, "eperson");
EPerson e = new EPerson(context, row);
- log.info(
- LogManager.getHeader(context,
- "create_eperson",
- "eperson_id=" + e.getID() )
- );
-
- HistoryManager.saveHistory(context,
- e,
- HistoryManager.REMOVE,
- context.getCurrentUser(),
- context.getExtraLogInfo());
+ log.info(LogManager.getHeader(context, "create_eperson", "eperson_id="
+ + e.getID()));
+
+ HistoryManager.saveHistory(context, e, HistoryManager.REMOVE, context
+ .getCurrentUser(), context.getExtraLogInfo());
return e;
}
-
/**
* Delete an eperson
- *
+ *
*/
- public void delete()
- throws SQLException, AuthorizeException, EPersonDeletionException
+ public void delete() throws SQLException, AuthorizeException,
+ EPersonDeletionException
{
// authorized?
- if( !AuthorizeManager.isAdmin(myContext) )
+ if (!AuthorizeManager.isAdmin(myContext))
{
throw new AuthorizeException(
- "You must be an admin to delete an EPerson");
+ "You must be an admin to delete an EPerson");
}
- HistoryManager.saveHistory(myContext,
- this,
- HistoryManager.REMOVE,
- myContext.getCurrentUser(),
- myContext.getExtraLogInfo());
+ HistoryManager.saveHistory(myContext, this, HistoryManager.REMOVE,
+ myContext.getCurrentUser(), myContext.getExtraLogInfo());
//check for presence of eperson in tables that
//have constraints on eperson_id
Vector constraintList = getDeleteConstraints();
-
+
//if eperson exists in tables that have constraints
//on eperson, throw an exception
- if(constraintList.size() > 0)
+ if (constraintList.size() > 0)
+ {
throw new EPersonDeletionException(constraintList);
-
+ }
+
// Remove from cache
myContext.removeCached(this, getID());
- // Remove any group memberships first
- DatabaseManager.updateQuery(myContext,
- "DELETE FROM EPersonGroup2EPerson WHERE eperson_id=" +
- getID() );
-
+ // Remove any group memberships first
+ DatabaseManager.updateQuery(myContext,
+ "DELETE FROM EPersonGroup2EPerson WHERE eperson_id=" + getID());
+
// Remove any subscriptions
- DatabaseManager.updateQuery(myContext,
- "DELETE FROM subscription WHERE eperson_id=" +
- getID() );
+ DatabaseManager.updateQuery(myContext,
+ "DELETE FROM subscription WHERE eperson_id=" + getID());
// Remove ourself
DatabaseManager.delete(myContext, myRow);
- log.info(
- LogManager.getHeader(myContext,
- "delete_eperson",
- "eperson_id=" + getID() )
- );
+ log.info(LogManager.getHeader(myContext, "delete_eperson",
+ "eperson_id=" + getID()));
}
-
/**
* Get the e-person's internal identifier
- *
+ *
* @return the internal identifier
*/
public int getID()
@@ -322,29 +349,27 @@
return myRow.getIntColumn("eperson_id");
}
-
public String getHandle()
{
// No Handles for e-people
return null;
}
-
/**
* Get the e-person's email address
- *
- * @return their email address
+ *
+ * @return their email address
*/
public String getEmail()
{
return myRow.getStringColumn("email");
}
-
/**
* Set the EPerson's email
- *
- * @param s the new email
+ *
+ * @param s
+ * the new email
*/
public void setEmail(String s)
{
@@ -352,23 +377,48 @@
{
s = s.toLowerCase();
}
-
+
myRow.setColumn("email", s);
}
+ /**
+ * Get the e-person's netid
+ *
+ * @return their netid
+ */
+ public String getNetid()
+ {
+ return myRow.getStringColumn("netid");
+ }
+
/**
- * Get the e-person's full name, combining first and last name
- * in a displayable string.
+ * Set the EPerson's netid
*
- * @return their full name
+ * @param s the new netid
+ */
+ public void setNetid(String s)
+ {
+ if (s != null)
+ {
+ s = s.toLowerCase();
+ }
+
+ myRow.setColumn("netid", s);
+ }
+
+ /**
+ * Get the e-person's full name, combining first and last name in a
+ * displayable string.
+ *
+ * @return their full name
*/
public String getFullName()
{
String f = myRow.getStringColumn("firstname");
String l = myRow.getStringColumn("lastname");
-
- if (l == null && f == null)
+
+ if ((l == null) && (f == null))
{
return getEmail();
}
@@ -382,10 +432,9 @@
}
}
-
/**
* Get the eperson's first name.
- *
+ *
* @return their first name
*/
public String getFirstName()
@@ -393,21 +442,20 @@
return myRow.getStringColumn("firstname");
}
-
/**
* Set the eperson's first name
- *
- * @param firstname the person's first name
+ *
+ * @param firstname
+ * the person's first name
*/
public void setFirstName(String firstname)
{
myRow.setColumn("firstname", firstname);
}
-
/**
* Get the eperson's last name.
- *
+ *
* @return their last name
*/
public String getLastName()
@@ -415,22 +463,22 @@
return myRow.getStringColumn("lastname");
}
-
/**
* Set the eperson's last name
- *
- * @param lastname the person's last name
+ *
+ * @param lastname
+ * the person's last name
*/
public void setLastName(String lastname)
{
myRow.setColumn("lastname", lastname);
}
-
/**
* Indicate whether the user can log in
- *
- * @param login boolean yes/no
+ *
+ * @param login
+ * boolean yes/no
*/
public void setCanLogIn(boolean login)
{
@@ -439,7 +487,7 @@
/**
* Can the user log in?
- *
+ *
* @return boolean, yes/no
*/
public boolean canLogIn()
@@ -447,21 +495,20 @@
return myRow.getBooleanColumn("can_log_in");
}
-
/**
* Set require cert yes/no
- *
- * @param isrequired boolean yes/no
+ *
+ * @param isrequired
+ * boolean yes/no
*/
public void setRequireCertificate(boolean isrequired)
{
myRow.setColumn("require_certificate", isrequired);
}
-
/**
* Get require certificate or not
- *
+ *
* @return boolean, yes/no
*/
public boolean getRequireCertificate()
@@ -469,11 +516,11 @@
return myRow.getBooleanColumn("require_certificate");
}
-
/**
* Indicate whether the user self-registered
- *
- * @param sr boolean yes/no
+ *
+ * @param sr
+ * boolean yes/no
*/
public void setSelfRegistered(boolean sr)
{
@@ -482,7 +529,7 @@
/**
* Can the user log in?
- *
+ *
* @return boolean, yes/no
*/
public boolean getSelfRegistered()
@@ -490,56 +537,57 @@
return myRow.getBooleanColumn("self_registered");
}
-
/**
* Get the value of a metadata field
- *
- * @param field the name of the metadata field to get
- *
- * @return the value of the metadata field
- *
- * @exception IllegalArgumentException if the requested metadata
- * field doesn't exist
+ *
+ * @param field
+ * the name of the metadata field to get
+ *
+ * @return the value of the metadata field
+ *
+ * @exception IllegalArgumentException
+ * if the requested metadata field doesn't exist
*/
public String getMetadata(String field)
{
- return myRow.getStringColumn(field);
+ return myRow.getStringColumn(field);
}
-
/**
* Set a metadata value
- *
- * @param field the name of the metadata field to get
- * @param value value to set the field to
- *
- * @exception IllegalArgumentException if the requested metadata
- * field doesn't exist
+ *
+ * @param field
+ * the name of the metadata field to get
+ * @param value
+ * value to set the field to
+ *
+ * @exception IllegalArgumentException
+ * if the requested metadata field doesn't exist
*/
public void setMetadata(String field, String value)
{
- myRow.setColumn(field, value);
+ myRow.setColumn(field, value);
}
-
/**
* Set the EPerson's password
- *
- * @param s the new email
+ *
+ * @param s
+ * the new email
*/
public void setPassword(String s)
{
- // FIXME: encoding
+ // FIXME: encoding
String encoded = Utils.getMD5(s);
myRow.setColumn("password", encoded);
}
-
/**
* Check EPerson's password
- *
- * @param attempt the password attempt
+ *
+ * @param attempt
+ * the password attempt
* @return boolean successful/unsuccessful
*/
public boolean checkPassword(String attempt)
@@ -549,45 +597,38 @@
return (encoded.equals(myRow.getStringColumn("password")));
}
-
/**
* Update the EPerson
*/
- public void update()
- throws SQLException, AuthorizeException
+ public void update() throws SQLException, AuthorizeException
{
// Check authorisation - if you're not the eperson
// see if the authorization system says you can
- if(!myContext.ignoreAuthorization() &&
- (myContext.getCurrentUser() == null ||
- getID() != myContext.getCurrentUser().getID()))
+ if (!myContext.ignoreAuthorization()
+ && ((myContext.getCurrentUser() == null) || (getID() != myContext
+ .getCurrentUser().getID())))
{
AuthorizeManager.authorizeAction(myContext, this, Constants.WRITE);
}
-
+
DatabaseManager.update(myContext, myRow);
- log.info(
- LogManager.getHeader(myContext,
- "update_eperson",
- "eperson_id=" + getID() )
- );
-
- HistoryManager.saveHistory(myContext,
- this,
- HistoryManager.MODIFY,
- myContext.getCurrentUser(),
- myContext.getExtraLogInfo());
+ log.info(LogManager.getHeader(myContext, "update_eperson",
+ "eperson_id=" + getID()));
+
+ HistoryManager.saveHistory(myContext, this, HistoryManager.MODIFY,
+ myContext.getCurrentUser(), myContext.getExtraLogInfo());
}
/**
* Return ID
LASTNAME
EMAIL
NETID
true
if other
is the same EPerson as
* this object, false
otherwise
- *
- * @param other object to compare to
- *
- * @return true
if object passed in represents the same
- * eperson as this object
+ *
+ * @param other
+ * object to compare to
+ *
+ * @return true
if object passed in represents the same
+ * eperson as this object
*/
public boolean obsolete_equals(Object other)
{
@@ -599,7 +640,6 @@
return (getID() == ((EPerson) other).getID());
}
-
/**
* return type found in Constants
*/
@@ -607,53 +647,50 @@
{
return Constants.EPERSON;
}
-
-
+
/**
- * Check for presence of EPerson in tables that have constraints
- * on EPersons. Called by delete() to determine whether the
- * eperson can actually be deleted.
- *
- * An EPerson cannot be deleted if it exists in the item,
- * workflowitem, or tasklistitem tables.
- *
- * @return Vector of tables that contain a reference to the
- * eperson.
+ * Check for presence of EPerson in tables that have constraints on
+ * EPersons. Called by delete() to determine whether the eperson can
+ * actually be deleted.
+ *
+ * An EPerson cannot be deleted if it exists in the item, workflowitem, or
+ * tasklistitem tables.
+ *
+ * @return Vector of tables that contain a reference to the eperson.
*/
- public Vector getDeleteConstraints()
- throws SQLException
+ public Vector getDeleteConstraints() throws SQLException
{
Vector tableList = new Vector();
-
+
//check for eperson in item table
TableRowIterator tri = DatabaseManager.query(myContext,
- "SELECT * from item where submitter_id=" + getID());
-
- if(tri.hasNext())
+ "SELECT * from item where submitter_id=" + getID());
+
+ if (tri.hasNext())
{
tableList.add("item");
}
-
+
//check for eperson in workflowitem table
tri = DatabaseManager.query(myContext,
- "SELECT * from workflowitem where owner=" + getID());
-
- if(tri.hasNext())
+ "SELECT * from workflowitem where owner=" + getID());
+
+ if (tri.hasNext())
{
tableList.add("workflowitem");
}
-
- //check for eperson in tasklistitem table
+
+ //check for eperson in tasklistitem table
tri = DatabaseManager.query(myContext,
"SELECT * from tasklistitem where eperson_id=" + getID());
- if(tri.hasNext())
+ if (tri.hasNext())
{
- tableList.add("tasklistitem");
+ tableList.add("tasklistitem");
}
-
- //the list of tables can be used to construct an error message
+
+ //the list of tables can be used to construct an error message
//explaining to the user why the eperson cannot be deleted.
- return tableList;
+ return tableList;
}
-}
+}
\ No newline at end of file
Only in ./eperson: EPerson.old
diff -aur --exclude=MediaFilterManager.java --exclude=PDFFilter.java --exclude=EPersonAdminServlet.java --exclude=GroupEditServlet.java --exclude=RegisterServlet.java --exclude=SimpleAuthenticator.java ../../../../dspace-1.2-source-devel/src/org/dspace/search/DSIndexer.java ./search/DSIndexer.java
--- ../../../../dspace-1.2-source-devel/src/org/dspace/search/DSIndexer.java 2004-07-23 12:34:36.000000000 -0200
+++ ./search/DSIndexer.java 2005-04-19 17:34:59.000000000 -0200
@@ -132,7 +132,7 @@
else
{
// FIXME: no handle, fail quietly - should log failure
- //System.out.println("Error in unIndexContent: Object had no handle!");
+ //System.out.println("Error in unIndexContent: Object had no handle!");
}
}
@@ -145,7 +145,7 @@
throws SQLException, IOException
{
unIndexContent(c, dso);
- indexContent(c, dso);
+ indexContent(c, dso);
}
@@ -165,7 +165,7 @@
// optimize the index - important to do regularly to reduce filehandle usage
// and keep performance fast!
writer.optimize();
-
+
closeIndex(c, writer);
}
@@ -185,7 +185,7 @@
unIndexContent(c, args[1]);
}
else
- {
+ {
c.setIgnoreAuthorization(true);
createIndex(c);
@@ -386,6 +386,8 @@
DCValue [] mimetypes = myitem.getDC( "format", "mimetype", Item.ANY );
DCValue [] sponsors = myitem.getDC( "description", "sponsorship", Item.ANY );
DCValue [] identifiers = myitem.getDC( "identifier", Item.ANY, Item.ANY );
+ DCValue [] languages = myitem.getDC( "language", Item.ANY, Item.ANY );
+
// put them all from an array of strings to one string for writing out
@@ -400,6 +402,7 @@
String mime_text = "";
String sponsor_text = "";
String id_text = "";
+ String lang_text = "";
// pack all of the arrays of DCValues into plain text strings for the indexer
@@ -407,7 +410,7 @@
{
author_text = new String(author_text + authors[j].value + " ");
}
-
+
for(j=0; j