mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Add metadata keys to org.dspace.content.Community, and use those instead of strings
This commit is contained in:
@@ -7,13 +7,6 @@
|
||||
*/
|
||||
package org.dspace.content;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.util.AuthorizeUtil;
|
||||
@@ -21,8 +14,8 @@ import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.authorize.ResourcePolicy;
|
||||
import org.dspace.browse.ItemCounter;
|
||||
import org.dspace.browse.ItemCountException;
|
||||
import org.dspace.browse.ItemCounter;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
@@ -34,6 +27,13 @@ import org.dspace.storage.rdbms.DatabaseManager;
|
||||
import org.dspace.storage.rdbms.TableRow;
|
||||
import org.dspace.storage.rdbms.TableRowIterator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
/**
|
||||
* Class representing a community
|
||||
* <P>
|
||||
@@ -70,6 +70,12 @@ public class Community extends DSpaceObject
|
||||
/** The default group of administrators */
|
||||
private Group admins;
|
||||
|
||||
// Keys for accessing Community metadata
|
||||
public static final String COPYRIGHT_TEXT = "copyright_text";
|
||||
public static final String INTRODUCTORY_TEXT = "introductory_text";
|
||||
public static final String SHORT_DESCRIPTION = "short_description";
|
||||
public static final String SIDEBAR_TEXT = "side_bar_text";
|
||||
|
||||
/**
|
||||
* Construct a community object from a database row.
|
||||
*
|
||||
|
@@ -81,9 +81,9 @@ public class Community {
|
||||
this.setCommunityID(community.getID());
|
||||
this.setName(community.getName());
|
||||
this.setHandle(community.getHandle());
|
||||
this.setCopyrightText(community.getMetadata("copyrightText"));
|
||||
this.setIntroductoryText(community.getMetadata("shortDescription"));
|
||||
this.setSidebarText(community.getMetadata("sidebarText"));
|
||||
this.setCopyrightText(community.getMetadata(org.dspace.content.Community.COPYRIGHT_TEXT));
|
||||
this.setIntroductoryText(community.getMetadata(org.dspace.content.Community.INTRODUCTORY_TEXT));
|
||||
this.setSidebarText(community.getMetadata(org.dspace.content.Community.SIDEBAR_TEXT));
|
||||
this.setCountItems(community.countItems());
|
||||
|
||||
if(expandFields.contains("parentCommunityID") || expandFields.contains("all")) {
|
||||
|
Reference in New Issue
Block a user