mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
(Stuart Lewis/Claudia Juergen)
SF patch #1571494 for SF bug #1571490 - UTF-8 encoded characters in licence git-svn-id: http://scm.dspace.org/svn/repo/trunk@1636 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
- SF patch #1561292 for SF bug #1554064
|
||||
- SF patch #1563523 for SF bug #1548865 Browse errors on withdrawn item
|
||||
- SF patch #1556207 for SF bug #1554056 Community/collection handle URL with / redirects to homepage
|
||||
- SF patch #1571494 for SF bug #1571490 - UTF-8 encoded characters in licence
|
||||
|
||||
(Mark Diggory)
|
||||
- SF patch #1523824 robots.txt to limit bots navigating author and date pages
|
||||
|
@@ -302,6 +302,12 @@ jsp.dspace-admin.item-select.id = Internal ID:
|
||||
jsp.dspace-admin.item-select.text = <strong>The ID you entered isn't a valid item ID.</strong> If you're trying to edit a community or collection, you need to use the <a href="{0}">communities/collections admin page</a>.
|
||||
jsp.dspace-admin.item-select.title = Select Item
|
||||
|
||||
jsp.dspace-admin.license-edit.title = Edit Default License
|
||||
jsp.dspace-admin.license-edit.heading = Default License Editor
|
||||
jsp.dspace-admin.license-edit.description = Edit the default license by using the text box below. The license cannot be empty. <br />Please ensure the license meets the legal conditions of your country. <br />Changing this license will not affect those items already published and collections with their own licenses.
|
||||
jsp.dspace-admin.license-edit.edited = The Default License has been updated
|
||||
jsp.dspace-admin.license-edit.empty = You must enter a license!
|
||||
|
||||
jsp.dspace-admin.list-metadata-fields.schemas = Schemas
|
||||
jsp.dspace-admin.list-metadata-fields.schema = Schema
|
||||
jsp.dspace-admin.list-metadata-fields.element = Element
|
||||
@@ -553,6 +559,7 @@ jsp.layout.navbar-admin.metadataregistry = Metadata<br/>Registry
|
||||
jsp.layout.navbar-admin.formatregistry = Bitstream Format<br/>Registry
|
||||
jsp.layout.navbar-admin.workflow = Workflow
|
||||
jsp.layout.navbar-admin.authorization = Authorization
|
||||
jsp.layout.navbar-admin.editlicense = Edit Default<br />License
|
||||
jsp.layout.navbar-admin.editnews = Edit News
|
||||
jsp.layout.navbar-admin.supervisors = Supervisors
|
||||
jsp.layout.navbar-admin.statistics = Statistics
|
||||
|
@@ -209,7 +209,34 @@ property2.name = ${dspace.dir}/rest/of/path
|
||||
|
||||
<li><code>License</code></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2><a name="license" id="license">The Default Submission License</a></h2>
|
||||
<p>For each submitted item, a license must be granted. The license will be stored along with the item in the bundle LICENSE in order to keep the information under which terms an items has been published.</p>
|
||||
<p>You may define a license for each collection seperately, when creating/editing a collection. If no collection specific license is defined, the default license is used.</p>
|
||||
<p>The default license can be found in <code><i>[dspace]</i>/config/default.license</code> and can be edited via the dspace-admin interface.</p>
|
||||
<p>DSpace comes with a demo license, which you must adopt to your institutional needs and the legal regulations of your country.</p>
|
||||
<p>If in doubt, contact the law department of your institution.</p>
|
||||
<h3>Possible Points in a License </h3>
|
||||
<it>Note, that this is no legal advice, just some starting thoughts for creating you own license.</it>
|
||||
<ul>
|
||||
<li>Non-exclusive or exclusive right to</li>
|
||||
<ul>
|
||||
<li>capture and store</li>
|
||||
<li>distribute</li>
|
||||
<ul>
|
||||
<li>worldwide</li>
|
||||
<li>restricted (e.g. institutional wide</li>
|
||||
</ul>
|
||||
<li>translate</li>
|
||||
<li>transform to other formats or mediums</li>
|
||||
without changing the content
|
||||
</ul>
|
||||
<li>Make sure no rights (copyright or any other) are violated by this publication</li>
|
||||
<li>In case the type of submission (e.g. thesis) needs approval, make sure it is the final and approved version.</li>
|
||||
<li>Distinguish between the document itself and the metadata</li>
|
||||
<li>Point out that the license granted and the information who granted it will be stored.</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="crosswalks" id="crosswalks">Activating Additional OAI-PMH Crosswalks</a></h2>
|
||||
|
||||
<p>DSpace comes with an unqualified DC Crosswalk used in the default OAI-PMH data provider. There are also other Crosswalks bundled with the DSpace distribution which can be activated by editing one or more configuration files. How to do this for each available Crosswalk is described below.</p>
|
||||
|
@@ -72,6 +72,7 @@
|
||||
<LI><A HREF="configure.html#email">Wording of E-mail Messages</A></LI>
|
||||
<LI><A HREF="configure.html#admincontact">Local DSpace Administrator Contact Information</A></LI>
|
||||
<LI><A HREF="configure.html#registries">The Dublin Core and Bitstream Format Registries</A></LI>
|
||||
<LI><A HREF="configure.html#license">The Default Submission License</A></LI>
|
||||
<LI><A HREF="configure.html#crosswalks">Activating Additional OAI-PMH Crosswalks</A></LI>
|
||||
<LI><A HREF="configure.html#templates">Configuration Files for Other Applications</A></LI>
|
||||
<LI><A HREF="configure.html#customui">Customizing the Web User Interface</A></LI>
|
||||
|
@@ -225,6 +225,11 @@
|
||||
<servlet-class>org.dspace.app.webui.servlet.admin.NewsEditServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>edit-license</servlet-name>
|
||||
<servlet-class>org.dspace.app.webui.servlet.admin.LicenseEditServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>eperson-list</servlet-name>
|
||||
<servlet-class>org.dspace.app.webui.servlet.admin.EPersonListServlet</servlet-class>
|
||||
@@ -467,6 +472,11 @@
|
||||
<url-pattern>/dspace-admin/news-edit</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>edit-license</servlet-name>
|
||||
<url-pattern>/dspace-admin/license-edit</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>eperson-list</servlet-name>
|
||||
<url-pattern>/tools/eperson-list</url-pattern>
|
||||
|
110
dspace/jsp/dspace-admin/license-edit.jsp
Normal file
110
dspace/jsp/dspace-admin/license-edit.jsp
Normal file
@@ -0,0 +1,110 @@
|
||||
<%-- license-edit.jsp
|
||||
-
|
||||
- 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.
|
||||
--%>
|
||||
|
||||
<%--
|
||||
- License Edit Form JSP
|
||||
-
|
||||
- Attributes:
|
||||
- license - The license to edit
|
||||
--%>
|
||||
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
|
||||
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
|
||||
|
||||
<%
|
||||
// Get the existing license
|
||||
String license = (String)request.getAttribute("license");
|
||||
if (license == null)
|
||||
{
|
||||
license = "";
|
||||
}
|
||||
|
||||
// Are there any messages to show?
|
||||
String message = (String)request.getAttribute("edited");
|
||||
boolean edited = false;
|
||||
if ((message != null) && (message.equals("true")))
|
||||
{
|
||||
edited = true;
|
||||
}
|
||||
message = (String)request.getAttribute("empty");
|
||||
boolean empty = false;
|
||||
if ((message != null) && (message.equals("true")))
|
||||
{
|
||||
empty = true;
|
||||
}
|
||||
|
||||
%>
|
||||
|
||||
<dspace:layout titlekey="jsp.dspace-admin.license-edit.title"
|
||||
navbar="admin"
|
||||
locbar="link"
|
||||
parenttitlekey="jsp.administer"
|
||||
parentlink="/dspace-admin">
|
||||
|
||||
<h1><fmt:message key="jsp.dspace-admin.license-edit.heading"/></h1>
|
||||
|
||||
<form action="<%= request.getContextPath() %>/dspace-admin/license-edit" method="post">
|
||||
|
||||
<%
|
||||
if (edited)
|
||||
{
|
||||
%>
|
||||
<p>
|
||||
<strong><fmt:message key="jsp.dspace-admin.license-edit.edited"/></strong>
|
||||
</p>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if (empty)
|
||||
{
|
||||
%>
|
||||
<p>
|
||||
<strong><fmt:message key="jsp.dspace-admin.license-edit.empty"/></strong>
|
||||
</p>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<p><fmt:message key="jsp.dspace-admin.license-edit.description"/></p>
|
||||
<p><textarea name="license" rows="15" cols="70"><%= license %></textarea><br />
|
||||
<input type="submit" name="submit_save" value="<fmt:message key="jsp.dspace-admin.general.save"/>" />
|
||||
<input type="submit" name="submit_cancel" value="<fmt:message key="jsp.dspace-admin.general.cancel"/>" />
|
||||
</p>
|
||||
</form>
|
||||
</dspace:layout>
|
@@ -32,6 +32,7 @@
|
||||
<li><a href="#workflow">Workflow</a></li>
|
||||
<li><a href="#authorize">Authorization</a></li>
|
||||
<li><a href="#editnews">Edit News</a></li>
|
||||
<li><a href="#editlicense">Edit Default License</a></li>
|
||||
</ul>
|
||||
|
||||
<h3><a name="general"></a>General Information</h3>
|
||||
@@ -413,6 +414,11 @@
|
||||
or modified by typing directly in the box. You can use HTML tags to format the text, but note that the html won't
|
||||
be validated here.</p>
|
||||
<p> </p>
|
||||
|
||||
<h3><a name="editlicense"></a>Edit Default License</h3>
|
||||
<p>You can use this tool to edit the default license of DSpace</p>
|
||||
<p>The default license is used when no collection specific license is defined.</p>
|
||||
<p>Note that changing the default license has no effect on allready published items.</p>
|
||||
|
||||
|
||||
</body>
|
||||
|
@@ -146,6 +146,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="navigationBarItem">
|
||||
<td>
|
||||
<img alt="" src="<%= request.getContextPath() %>/image/<%= (currentPage.endsWith("/dspace-admin/license-edit") ? "arrow-highlight" : "arrow") %>.gif" width="16" height="16"/>
|
||||
</td>
|
||||
<td nowrap="nowrap" class="navigationBarItem">
|
||||
<a href="<%= request.getContextPath() %>/dspace-admin/license-edit"><fmt:message key="jsp.layout.navbar-admin.editlicense"/></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="navigationBarItem">
|
||||
<td>
|
||||
<img alt="" src="<%= request.getContextPath() %>/image/<%= (currentPage.endsWith("/dspace-admin/supervise") ? "arrow-highlight" : "arrow") %>.gif" width="16" height="16"/>
|
||||
|
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* LicenseEditServlet.java
|
||||
*
|
||||
* Version: $Revision$
|
||||
*
|
||||
* Date: $Date$
|
||||
*
|
||||
* Copyright (c) 2002-2005, 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.servlet.admin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.webui.servlet.DSpaceServlet;
|
||||
import org.dspace.app.webui.util.JSPManager;
|
||||
import org.dspace.app.webui.util.UIUtil;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
|
||||
/**
|
||||
* Servlet for editing the default license
|
||||
*
|
||||
* @author Stuart Lewis
|
||||
*/
|
||||
public class LicenseEditServlet extends DSpaceServlet
|
||||
{
|
||||
/** The logger */
|
||||
private static Logger log = Logger.getLogger(LicenseEditServlet.class);
|
||||
|
||||
/**
|
||||
* Handle GET requests. This does nothing but forwards
|
||||
* the request on to the POST handler.
|
||||
*/
|
||||
protected void doDSGet(Context c, HttpServletRequest request,
|
||||
HttpServletResponse response) throws ServletException, IOException,
|
||||
SQLException, AuthorizeException
|
||||
{
|
||||
// Forward on to the post handler
|
||||
this.doDSPost(c, request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the POST requests.
|
||||
*/
|
||||
protected void doDSPost(Context c, HttpServletRequest request,
|
||||
HttpServletResponse response) throws ServletException, IOException,
|
||||
SQLException, AuthorizeException
|
||||
{
|
||||
//Get submit button
|
||||
String button = UIUtil.getSubmitButton(request, "submit");
|
||||
|
||||
if (button.equals("submit_cancel"))
|
||||
{
|
||||
// Show main admin index
|
||||
JSPManager.showJSP(request, response, "/dspace-admin/index.jsp");
|
||||
}
|
||||
else if (!button.equals("submit_save"))
|
||||
{
|
||||
// Get the existing text from the ConfigurationManager
|
||||
String license = ConfigurationManager.getDefaultSubmissionLicense();
|
||||
|
||||
// Pass the existing license back to the JSP
|
||||
request.setAttribute("license", license);
|
||||
|
||||
// Show edit page
|
||||
JSPManager.showJSP(request, response, "/dspace-admin/license-edit.jsp");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get text string from form
|
||||
String license = (String)request.getParameter("license");
|
||||
|
||||
// Is the license empty?
|
||||
if (license.trim().equals(""))
|
||||
{
|
||||
// Get the existing text from the ConfigurationManager
|
||||
license = ConfigurationManager.getDefaultSubmissionLicense();
|
||||
|
||||
// Pass the existing license back to the JSP
|
||||
request.setAttribute("license", license);
|
||||
|
||||
// Pass the 'empty' message back
|
||||
request.setAttribute("empty", "true");
|
||||
|
||||
// Show edit page
|
||||
JSPManager.showJSP(request, response, "/dspace-admin/license-edit.jsp");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Write the string out to file
|
||||
ConfigurationManager.writeLicenseFile(license);
|
||||
|
||||
// Pass the existing license back to the JSP
|
||||
request.setAttribute("license", license);
|
||||
|
||||
// Pass the 'edited' message back
|
||||
request.setAttribute("edited", "true");
|
||||
|
||||
// Show edit page
|
||||
JSPManager.showJSP(request, response, "/dspace-admin/license-edit.jsp");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -389,8 +389,6 @@ public class ConfigurationManager
|
||||
// write the news out to the appropriate file
|
||||
FileOutputStream fos = new FileOutputStream(fileName);
|
||||
OutputStreamWriter osr = new OutputStreamWriter(fos, "UTF-8");
|
||||
|
||||
// BufferedWriter bw = new BufferedWriter( osr );
|
||||
PrintWriter out = new PrintWriter(osr);
|
||||
out.print(news);
|
||||
out.close();
|
||||
@@ -403,6 +401,34 @@ public class ConfigurationManager
|
||||
return news;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes license to a text file.
|
||||
*
|
||||
* @param news
|
||||
* the text to be written to the file.
|
||||
*/
|
||||
public static void writeLicenseFile(String newLicense)
|
||||
{
|
||||
String licenseFile = getProperty("dspace.dir") + File.separator
|
||||
+ "config" + File.separator + "default.license";
|
||||
|
||||
try
|
||||
{
|
||||
// write the news out to the appropriate file
|
||||
FileOutputStream fos = new FileOutputStream(licenseFile);
|
||||
OutputStreamWriter osr = new OutputStreamWriter(fos, "UTF-8");
|
||||
PrintWriter out = new PrintWriter(osr);
|
||||
out.print(newLicense);
|
||||
out.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
warn("license_write: " + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
license = newLicense;
|
||||
}
|
||||
|
||||
private static File loadedFile = null;
|
||||
|
||||
/**
|
||||
@@ -485,8 +511,10 @@ public class ConfigurationManager
|
||||
// Load in default license
|
||||
String licenseFile = getProperty("dspace.dir") + File.separator
|
||||
+ "config" + File.separator + "default.license";
|
||||
|
||||
BufferedReader br = new BufferedReader(new FileReader(licenseFile));
|
||||
|
||||
FileInputStream fir = new FileInputStream(licenseFile);
|
||||
InputStreamReader ir = new InputStreamReader(fir, "UTF-8");
|
||||
BufferedReader br = new BufferedReader(ir);
|
||||
String lineIn;
|
||||
license = "";
|
||||
|
||||
|
Reference in New Issue
Block a user