Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin committed Aug 16, 2012
2 parents d321d52 + 1ec9741 commit 06e2729
Show file tree
Hide file tree
Showing 161 changed files with 11,618 additions and 1,213 deletions.
7 changes: 6 additions & 1 deletion .gitignore
@@ -1,6 +1,11 @@
## Ignore the MVN compiled output directories from version tracking
target/

## Ignore project files created by Eclipse
.settings/
.project
.classpath

## Ignore project files created by IntelliJ IDEA
*.iml
*.ipr
Expand All @@ -15,4 +20,4 @@ dist/
nbdist/
nbactions.xml
nb-configuration.xml
META-INF/
META-INF/
137 changes: 137 additions & 0 deletions build.properties
@@ -0,0 +1,137 @@
# DSpace build.properties
# This file should be customised to suit your build environment.
# Note that not all configuration is handled here, only the most common properties that tend to differ between build environments.
# For adjusting global settings or more complex settings, edit the relevant config file.

##########################
# SERVER CONFIGURATION #
##########################

# DSpace installation directory. Data will be stored within this directory
dspace.dir=/dspace

# DSpace host name - should match base URL. Do not include port number
dspace.hostname = localhost

# DSpace base host URL. Include port number etc.
dspace.baseUrl = http://localhost:8080

# Name of the site
dspace.name = DSpace at My University

# Solr server
solr.server=http://localhost:8080/solr

# Default language for metadata values
default.language = en_US

##########################
# DATABASE CONFIGURATION #
##########################

# Database name ("oracle", or "postgres")
db.name=postgres

# Uncomment the appropriate block below for your database.
# postgres
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/dspace
db.username=dspace
db.password=dspace

# oracle
#db.driver= oracle.jdbc.OracleDriver
#db.url=jdbc:oracle:thin:@//localhost:1521/xe
#db.username=dspace
#db.password=dspace

# Schema name - if your database contains multiple schemas, you can avoid problems with
# retrieving the definitions of duplicate object names by specifying
# the schema name here that is used for DSpace by uncommenting the following entry
db.schema =

# Maximum number of DB connections in pool
db.maxconnections = 30

# Maximum time to wait before giving up if all connections in pool are busy (milliseconds)
db.maxwait = 5000

# Maximum number of idle connections in pool (-1 = unlimited)
db.maxidle = -1

# Determine if prepared statement should be cached. (default is true)
db.statementpool = true

# Specify a name for the connection pool (useful if you have multiple applications sharing Tomcat's dbcp)
# If not specified, defaults to 'dspacepool'
db.poolname = dspacepool

#######################
# EMAIL CONFIGURATION #
#######################

# SMTP mail server
mail.server = smtp.example.com

# SMTP mail server authentication username and password (if required)
# mail.server.username = myusername
# mail.server.password = mypassword
mail.server.username=
mail.server.password=

# SMTP mail server alternate port (defaults to 25)
mail.server.port = 25

# From address for mail
mail.from.address = dspace-noreply@myu.edu

# Currently limited to one recipient!
mail.feedback.recipient = dspace-help@myu.edu

# General site administration (Webmaster) e-mail
mail.admin = dspace-help@myu.edu

# Recipient for server errors and alerts
#mail.alert.recipient = email-address-here
mail.alert.recipient=

# Recipient for new user registration emails
#mail.registration.notify = email-address-here
mail.registration.notify=


########################
# HANDLE CONFIGURATION #
########################

# Canonical Handle URL prefix
#
# By default, DSpace is configured to use http://hdl.handle.net/
# as the canonical URL prefix when generating dc.identifier.uri
# during submission, and in the 'identifier' displayed in JSPUI
# item record pages.
#
# If you do not subscribe to CNRI's handle service, you can change this
# to match the persistent URL service you use, or you can force DSpace
# to use your site's URL, eg.
#handle.canonical.prefix = ${dspace.url}/handle/
#
# Note that this will not alter dc.identifer.uri metadata for existing
# items (only for subsequent submissions), but it will alter the URL
# in JSPUI's 'identifier' message on item record pages for existing items.
#
# If omitted, the canonical URL prefix will be http://hdl.handle.net/
handle.canonical.prefix = http://hdl.handle.net/

# CNRI Handle prefix
handle.prefix = 123456789

#######################
# PROXY CONFIGURATION #
#######################
# uncomment and specify both properties if proxy server required
# proxy server for external http requests - use regular hostname without port number
http.proxy.host =

# port number of proxy server
http.proxy.port =
2 changes: 1 addition & 1 deletion dspace-api/pom.xml
Expand Up @@ -91,7 +91,7 @@
</part>
</parts>
<properties>
<default.dspace.dir>${project.build.directory}/testing/dspace</default.dspace.dir>
<dspace.dir>${project.build.directory}/testing/dspace</dspace.dir>
</properties>
</output>
</outputs>
Expand Down
27 changes: 27 additions & 0 deletions dspace-api/src/main/java/org/dspace/app/util/DCInput.java
Expand Up @@ -7,6 +7,7 @@
*/
package org.dspace.app.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -65,6 +66,9 @@ public class DCInput
/** is the entry closed to vocabulary terms? */
private boolean closedVocabulary = false;

/** allowed document types */
private List<String> typeBind = null;

/**
* The scope of the input sets, this restricts hidden metadata fields from
* view during workflow processing.
Expand Down Expand Up @@ -118,6 +122,17 @@ public DCInput(Map<String, String> fieldMap, Map<String, List<String>> listMap)
String closedVocabularyStr = fieldMap.get("closedVocabulary");
closedVocabulary = "true".equalsIgnoreCase(closedVocabularyStr)
|| "yes".equalsIgnoreCase(closedVocabularyStr);

// parsing of the <type-bind> element (using the colon as split separator)
typeBind = new ArrayList<String>();
String typeBindDef = fieldMap.get("type-bind");
if(typeBindDef != null && typeBindDef.trim().length() > 0) {
String[] types = typeBindDef.split(",");
for(String type : types) {
typeBind.add( type.trim() );
}
}

}

/**
Expand Down Expand Up @@ -376,4 +391,16 @@ public boolean isClosedVocabulary() {
return closedVocabulary;
}

/**
* Decides if this field is valid for the document type
* @param typeName Document type name
* @return true when there is no type restriction or typeName is allowed
*/
public boolean isAllowedFor(String typeName) {
if(typeBind.size() == 0)
return true;

return typeBind.contains(typeName);
}

}
25 changes: 8 additions & 17 deletions dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java
Expand Up @@ -333,11 +333,10 @@ private void processDefinition(Node e)
Map<String, String> field = new HashMap<String, String>();
page.add(field);
processPageParts(formName, pgNum, nfld, field);
String error = checkForDups(formName, field, pages);
if (error != null)
{
throw new SAXException(error);
}

// we omit the duplicate validation, allowing multiple fields definition for
// the same metadata and different visibility/type-bind

}
}
} // ignore any child that is not a 'page'
Expand Down Expand Up @@ -605,18 +604,10 @@ private void checkValues()
throw new DCInputsReaderException(errString);
}
}
// if visibility restricted, make sure field is not required
String visibility = fld.get("visibility");
if (visibility != null && visibility.length() > 0 )
{
String required = fld.get("required");
if (required != null && required.length() > 0)
{
String errString = "Field '" + fld.get("label") +
"' is required but invisible";
throw new DCInputsReaderException(errString);
}
}

// we omit the "required" and "visibility" validation, provided this must be checked in the processing class
// only when it makes sense (if the field isn't visible means that it is not applicable, therefore it can't be required)

}
}
}
Expand Down
Expand Up @@ -7,6 +7,7 @@
*/
package org.dspace.app.util;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -30,7 +31,7 @@
* @author Robert Tansley
* @version $Revision$
*/
public class SubmissionInfo
public class SubmissionInfo extends HashMap
{
/** log4j logger */
private static Logger log = Logger.getLogger(SubmissionInfo.class);
Expand Down

0 comments on commit 06e2729

Please sign in to comment.