mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DS-3154] Stash more fixes.
This commit is contained in:
@@ -32,115 +32,121 @@ import org.dspace.authorize.AuthorizeException;
|
||||
|
||||
/**
|
||||
* Generates the Administrative Curate Form, from which any DSpace object can
|
||||
* be curated.
|
||||
* be curated.
|
||||
*
|
||||
* @author tdonohue
|
||||
*/
|
||||
public class CurateForm extends AbstractDSpaceTransformer
|
||||
{
|
||||
private static final Message T_dspace_home = message("xmlui.general.dspace_home");
|
||||
private static final Message T_submit_perform = message("xmlui.general.perform");
|
||||
private static final Message T_submit_queue = message("xmlui.general.queue");
|
||||
private static final Message T_title = message("xmlui.administrative.CurateForm.title");
|
||||
private static final Message T_trail = message("xmlui.administrative.CurateForm.trail");
|
||||
private static final Message T_task_label_name = message("xmlui.administrative.CurateForm.task_label_name");
|
||||
private static final Message T_taskgroup_label_name = message("xmlui.administrative.CurateForm.taskgroup_label_name");
|
||||
private static final Message T_object_label_name = message("xmlui.administrative.CurateForm.object_label_name");
|
||||
private static final Message T_object_hint = message("xmlui.administrative.CurateForm.object_hint");
|
||||
|
||||
public void setup(SourceResolver resolver, Map objectModel, String src,
|
||||
Parameters parameters) throws ProcessingException, SAXException, IOException
|
||||
{
|
||||
super.setup(resolver, objectModel, src, parameters);
|
||||
FlowCurationUtils.setupCurationTasks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the page metadata & breadcrumb trail
|
||||
*
|
||||
* @param pageMeta
|
||||
* @throws WingException
|
||||
*/
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws WingException
|
||||
private static final Message T_dspace_home = message("xmlui.general.dspace_home");
|
||||
private static final Message T_submit_perform = message("xmlui.general.perform");
|
||||
private static final Message T_submit_queue = message("xmlui.general.queue");
|
||||
private static final Message T_title = message("xmlui.administrative.CurateForm.title");
|
||||
private static final Message T_trail = message("xmlui.administrative.CurateForm.trail");
|
||||
private static final Message T_task_label_name = message("xmlui.administrative.CurateForm.task_label_name");
|
||||
private static final Message T_taskgroup_label_name = message("xmlui.administrative.CurateForm.taskgroup_label_name");
|
||||
private static final Message T_object_label_name = message("xmlui.administrative.CurateForm.object_label_name");
|
||||
private static final Message T_object_hint = message("xmlui.administrative.CurateForm.object_hint");
|
||||
|
||||
@Override
|
||||
public void setup(SourceResolver resolver, Map objectModel, String src,
|
||||
Parameters parameters) throws ProcessingException, SAXException, IOException
|
||||
{
|
||||
super.setup(resolver, objectModel, src, parameters);
|
||||
FlowCurationUtils.setupCurationTasks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the page metadata and breadcrumb trail
|
||||
*
|
||||
* @param pageMeta
|
||||
* @throws WingException
|
||||
*/
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws WingException
|
||||
{
|
||||
pageMeta.addMetadata("title").addContent(T_title);
|
||||
pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
|
||||
pageMeta.addTrail().addContent(T_trail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add object curation form
|
||||
*
|
||||
* @param body body of the form.
|
||||
* @throws WingException passed through.
|
||||
* @throws SQLException passed through.
|
||||
* @throws AuthorizeException passed through.
|
||||
* @throws java.io.UnsupportedEncodingException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addBody(Body body)
|
||||
throws WingException, SQLException,
|
||||
AuthorizeException, UnsupportedEncodingException
|
||||
{
|
||||
// Get our parameters and state;
|
||||
String objectID = parameters.getParameter("identifier", null);
|
||||
String taskSelected = parameters.getParameter("curate_task", null);
|
||||
|
||||
// DIVISION: curate
|
||||
Division div = body.addInteractiveDivision("curate",
|
||||
contextPath + "/admin/curate",
|
||||
Division.METHOD_MULTIPART,
|
||||
"primary administrative curate");
|
||||
div.setHead(T_title);
|
||||
|
||||
// Curate Form
|
||||
List form = div.addList("curate-form", List.TYPE_FORM);
|
||||
|
||||
// Object ID Textbox (required)
|
||||
Text id = form.addItem().addText("identifier");
|
||||
id.setAutofocus("autofocus");
|
||||
id.setLabel(T_object_label_name);
|
||||
if (objectID != null)
|
||||
{
|
||||
pageMeta.addMetadata("title").addContent(T_title);
|
||||
pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
|
||||
pageMeta.addTrail().addContent(T_trail);
|
||||
id.setValue(objectID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add object curation form
|
||||
*
|
||||
* @param body
|
||||
* @throws WingException
|
||||
* @throws SQLException
|
||||
* @throws AuthorizeException
|
||||
*/
|
||||
@Override
|
||||
public void addBody(Body body)
|
||||
throws WingException, SQLException,
|
||||
AuthorizeException, UnsupportedEncodingException
|
||||
id.setRequired();
|
||||
id.setHelp(T_object_hint);
|
||||
|
||||
// Selectbox of Curation Task options (required)
|
||||
String curateGroup = "";
|
||||
try
|
||||
{
|
||||
// Get our parameters and state;
|
||||
String objectID = parameters.getParameter("identifier", null);
|
||||
String taskSelected = parameters.getParameter("curate_task", null);
|
||||
|
||||
// DIVISION: curate
|
||||
Division div = body.addInteractiveDivision("curate", contextPath + "/admin/curate", Division.METHOD_MULTIPART,"primary administrative curate");
|
||||
div.setHead(T_title);
|
||||
|
||||
// Curate Form
|
||||
List form = div.addList("curate-form", List.TYPE_FORM);
|
||||
|
||||
// Object ID Textbox (required)
|
||||
Text id = form.addItem().addText("identifier");
|
||||
id.setAutofocus("autofocus");
|
||||
id.setLabel(T_object_label_name);
|
||||
if (objectID != null)
|
||||
{
|
||||
id.setValue(objectID);
|
||||
}
|
||||
id.setRequired();
|
||||
id.setHelp(T_object_hint);
|
||||
|
||||
// Selectbox of Curation Task options (required)
|
||||
String curateGroup = "";
|
||||
try
|
||||
{
|
||||
curateGroup = (parameters.getParameter("select_curate_group") != null) ? parameters.getParameter("select_curate_group") : FlowCurationUtils.UNGROUPED_TASKS;
|
||||
}
|
||||
catch (Exception pe)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
if (!FlowCurationUtils.groups.isEmpty())
|
||||
{
|
||||
Select groupSelect = form.addItem().addSelect("select_curate_group");
|
||||
groupSelect = FlowCurationUtils.getGroupSelectOptions(groupSelect);
|
||||
groupSelect.setLabel(T_taskgroup_label_name);
|
||||
groupSelect.setSize(1);
|
||||
groupSelect.setRequired();
|
||||
groupSelect.setEvtBehavior("submitOnChange");
|
||||
if (curateGroup.equals(""))
|
||||
{
|
||||
curateGroup = (String) (FlowCurationUtils.groups.keySet().iterator().next());
|
||||
}
|
||||
groupSelect.setOptionSelected(curateGroup);
|
||||
}
|
||||
Select taskSelect = form.addItem().addSelect("curate_task");
|
||||
taskSelect = FlowCurationUtils.getTaskSelectOptions(taskSelect, curateGroup);
|
||||
taskSelect.setLabel(T_task_label_name);
|
||||
taskSelect.setSize(1);
|
||||
taskSelect.setRequired();
|
||||
if(taskSelected!=null)
|
||||
{
|
||||
taskSelect.setOptionSelected(taskSelected);
|
||||
}
|
||||
|
||||
// Buttons: 'curate' and 'queue'
|
||||
Para buttonList = div.addPara();
|
||||
buttonList.addButton("submit_curate_task").setValue(T_submit_perform);
|
||||
buttonList.addButton("submit_queue_task").setValue(T_submit_queue);
|
||||
div.addHidden("administrative-continue").setValue(knot.getId());
|
||||
curateGroup = (parameters.getParameter("select_curate_group") != null) ? parameters.getParameter("select_curate_group") : FlowCurationUtils.UNGROUPED_TASKS;
|
||||
}
|
||||
catch (Exception pe)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
if (!FlowCurationUtils.groups.isEmpty())
|
||||
{
|
||||
Select groupSelect = form.addItem().addSelect("select_curate_group");
|
||||
groupSelect = FlowCurationUtils.getGroupSelectOptions(groupSelect);
|
||||
groupSelect.setLabel(T_taskgroup_label_name);
|
||||
groupSelect.setSize(1);
|
||||
groupSelect.setRequired();
|
||||
groupSelect.setEvtBehavior("submitOnChange");
|
||||
if (curateGroup.equals(""))
|
||||
{
|
||||
curateGroup = (String) (FlowCurationUtils.groups.keySet().iterator().next());
|
||||
}
|
||||
groupSelect.setOptionSelected(curateGroup);
|
||||
}
|
||||
Select taskSelect = form.addItem().addSelect("curate_task");
|
||||
taskSelect = FlowCurationUtils.getTaskSelectOptions(taskSelect, curateGroup);
|
||||
taskSelect.setLabel(T_task_label_name);
|
||||
taskSelect.setSize(1);
|
||||
taskSelect.setRequired();
|
||||
if(taskSelected!=null)
|
||||
{
|
||||
taskSelect.setOptionSelected(taskSelected);
|
||||
}
|
||||
|
||||
// Buttons: 'curate' and 'queue'
|
||||
Para buttonList = div.addPara();
|
||||
buttonList.addButton("submit_curate_task").setValue(T_submit_perform);
|
||||
buttonList.addButton("submit_queue_task").setValue(T_submit_queue);
|
||||
div.addHidden("administrative-continue").setValue(knot.getId());
|
||||
}
|
||||
}
|
||||
|
@@ -20,22 +20,22 @@ import org.dspace.app.xmlui.wing.Message;
|
||||
* and returns an object of type FlowResult, then the flow script can inspect
|
||||
* the results object to determine what the next course of action is.
|
||||
*
|
||||
* Basically, this results object stores all the errors and continuation states
|
||||
* <p>Basically, this results object stores all the errors and continuation states
|
||||
* that need to be represented. There are four types of information stored:
|
||||
*
|
||||
* 1) Continuation, this is a simple boolean variable that indicates whether
|
||||
* <p>1) Continuation, this is a simple boolean variable that indicates whether
|
||||
* the required operation is complete and the user may continue on to the next step.
|
||||
*
|
||||
* 2) Notice information, this is a simple encoding of a notice message to be displayed
|
||||
* <p>2) Notice information, this is a simple encoding of a notice message to be displayed
|
||||
* to the user on their next step. There are four parts: outcome, header, message, and
|
||||
* characters. See each field for more description on each part. Note: either a message
|
||||
* or characters are required.
|
||||
*
|
||||
* 3) Errors, this is a list of errors that were encountered during processing.
|
||||
* <p>3) Errors, this is a list of errors that were encountered during processing.
|
||||
* Typically, it just consists of a list of errored fields. However occasionally there
|
||||
* may be other specialized errors listed.
|
||||
*
|
||||
* 4) Parameters, this is a map of attached parameters that may be relevant to the
|
||||
* <p>4) Parameters, this is a map of attached parameters that may be relevant to the
|
||||
* result. This should be used for things such as generated id's when objects are newly
|
||||
* created.
|
||||
*
|
||||
@@ -45,7 +45,7 @@ public class FlowResult {
|
||||
|
||||
/**
|
||||
* Determine whether the operation has been completed enough that the user
|
||||
* may successufully continue on to the next step.
|
||||
* may successfully continue on to the next step.
|
||||
*/
|
||||
private boolean continuep;
|
||||
|
||||
@@ -73,7 +73,6 @@ public class FlowResult {
|
||||
*/
|
||||
private List<String> errors;
|
||||
|
||||
|
||||
/**
|
||||
* Any parameters that may be attached to this result.
|
||||
*/
|
||||
@@ -82,6 +81,7 @@ public class FlowResult {
|
||||
/**
|
||||
* Set the continuation parameter determining if the
|
||||
* user should progress to the next step in the flow.
|
||||
* @param continuep true if should continue.
|
||||
*/
|
||||
public void setContinue(boolean continuep)
|
||||
{
|
||||
@@ -123,6 +123,7 @@ public class FlowResult {
|
||||
/**
|
||||
* Get the notice outcome in string form, either success
|
||||
* or failure. If the outcome is neutral then null is returned.
|
||||
* @return the outcome.
|
||||
*/
|
||||
public String getOutcome()
|
||||
{
|
||||
@@ -141,6 +142,7 @@ public class FlowResult {
|
||||
* Set the notice header.
|
||||
*
|
||||
* This must be an i18n dictionary key
|
||||
* @param header the header.
|
||||
*/
|
||||
public void setHeader(Message header)
|
||||
{
|
||||
@@ -148,7 +150,8 @@ public class FlowResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the notice header
|
||||
* Return the notice header.
|
||||
* @return the header.
|
||||
*/
|
||||
public String getHeader()
|
||||
{
|
||||
@@ -160,9 +163,10 @@ public class FlowResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the notice message
|
||||
* Set the notice message.
|
||||
*
|
||||
* This must be an i18n dictionary key
|
||||
* This must be an i18n dictionary key.
|
||||
* @param message the message.
|
||||
*/
|
||||
public void setMessage(Message message)
|
||||
{
|
||||
@@ -170,7 +174,8 @@ public class FlowResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* return the notice message
|
||||
* return the notice message.
|
||||
* @return the notice.
|
||||
*/
|
||||
public String getMessage()
|
||||
{
|
||||
@@ -182,7 +187,8 @@ public class FlowResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the notice characters
|
||||
* Set the notice characters.
|
||||
* @param characters the notice.
|
||||
*/
|
||||
public void setCharacters(String characters)
|
||||
{
|
||||
@@ -191,6 +197,7 @@ public class FlowResult {
|
||||
|
||||
/**
|
||||
* Return the notice characters
|
||||
* @return the notice.
|
||||
*/
|
||||
public String getCharacters()
|
||||
{
|
||||
@@ -216,7 +223,7 @@ public class FlowResult {
|
||||
{
|
||||
if (this.errors == null)
|
||||
{
|
||||
this.errors = new ArrayList<String>();
|
||||
this.errors = new ArrayList<>();
|
||||
}
|
||||
|
||||
this.errors.add(newError);
|
||||
@@ -224,6 +231,7 @@ public class FlowResult {
|
||||
|
||||
/**
|
||||
* Return the current list of errors.
|
||||
* @return a list of errors.
|
||||
*/
|
||||
public List<String> getErrors()
|
||||
{
|
||||
@@ -233,10 +241,11 @@ public class FlowResult {
|
||||
/**
|
||||
* Return the list of errors in string form, i.e. a comma-separated list
|
||||
* of errors. If there are no errors then null is returned.
|
||||
* @return a list of errors.
|
||||
*/
|
||||
public String getErrorString()
|
||||
{
|
||||
if (errors == null || errors.size() == 0)
|
||||
if (errors == null || errors.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -259,8 +268,8 @@ public class FlowResult {
|
||||
|
||||
/**
|
||||
* Attach a new parameter to this result object with the specified
|
||||
* name & value.
|
||||
*
|
||||
* name and value.
|
||||
*
|
||||
* @param name The parameter's name
|
||||
* @param value The parameter's value.
|
||||
*/
|
||||
@@ -268,7 +277,7 @@ public class FlowResult {
|
||||
{
|
||||
if (this.parameters == null)
|
||||
{
|
||||
this.parameters = new HashMap<String, Object>();
|
||||
this.parameters = new HashMap<>();
|
||||
}
|
||||
|
||||
this.parameters.put(name, value);
|
||||
|
@@ -36,8 +36,9 @@ import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
*
|
||||
* Show a form allowing the user to edit a bitstream's metadata, the description & format.
|
||||
*
|
||||
* Show a form allowing the user to edit a bitstream's metadata, the description
|
||||
* and format.
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
public class EditBitstreamForm extends AbstractDSpaceTransformer
|
||||
@@ -73,6 +74,7 @@ public class EditBitstreamForm extends AbstractDSpaceTransformer
|
||||
protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
|
||||
protected BitstreamFormatService bitstreamFormatService = ContentServiceFactory.getInstance().getBitstreamFormatService();
|
||||
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws WingException
|
||||
{
|
||||
pageMeta.addMetadata("title").addContent(T_title);
|
||||
@@ -83,6 +85,7 @@ public class EditBitstreamForm extends AbstractDSpaceTransformer
|
||||
pageMeta.addMetadata("javascript", "static").addContent("static/js/editItemUtil.js");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBody(Body body) throws SAXException, WingException,
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
|
@@ -52,13 +52,17 @@ import org.xml.sax.SAXException;
|
||||
* This item may be configured so that it will only display up to a specific depth,
|
||||
* and may include or exclude collections from the tree.
|
||||
*
|
||||
* The configuration option available: <depth exclude-collections="true">999</depth>
|
||||
*
|
||||
* <p>The configuration option available:
|
||||
*
|
||||
* <pre>
|
||||
* {@code <depth exclude-collections="true">999</depth>}
|
||||
* </pre>
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
public class CommunityBrowser extends AbstractDSpaceTransformer implements CacheableProcessingComponent
|
||||
{
|
||||
private static Logger log = Logger.getLogger(CommunityBrowser.class);
|
||||
private static final Logger log = Logger.getLogger(CommunityBrowser.class);
|
||||
|
||||
/** Language Strings */
|
||||
public static final Message T_dspace_home =
|
||||
@@ -96,10 +100,19 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
/**
|
||||
* Set the component up, pulling any configuration values from the sitemap
|
||||
* parameters.
|
||||
*
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel object model.
|
||||
* @param src source.
|
||||
* @param parameters sitemap parameters.
|
||||
* @throws org.apache.cocoon.ProcessingException passed through.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void setup(SourceResolver resolver, Map objectModel, String src,
|
||||
Parameters parameters) throws ProcessingException, SAXException,
|
||||
IOException
|
||||
Parameters parameters)
|
||||
throws ProcessingException, SAXException, IOException
|
||||
{
|
||||
super.setup(resolver, objectModel, src, parameters);
|
||||
|
||||
@@ -111,7 +124,9 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
/**
|
||||
* Generate the unique caching key.
|
||||
* This key must be unique within the space of this component.
|
||||
* @return the key.
|
||||
*/
|
||||
@Override
|
||||
public Serializable getKey()
|
||||
{
|
||||
boolean full = DSpaceServicesFactory.getInstance().getConfigurationService().getBooleanProperty("xmlui.community-list.render.full", true);
|
||||
@@ -123,24 +138,26 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
*
|
||||
* The validity object will include a list of all communities
|
||||
* and collections being browsed along with their logo bitstreams.
|
||||
* @return validity.
|
||||
*/
|
||||
@Override
|
||||
public SourceValidity getValidity()
|
||||
{
|
||||
if (validity == null)
|
||||
{
|
||||
try {
|
||||
DSpaceValidity validity = new DSpaceValidity();
|
||||
DSpaceValidity theValidity = new DSpaceValidity();
|
||||
|
||||
TreeNode root = buildTree(communityService.findAllTop(context));
|
||||
TreeNode treeRoot = buildTree(communityService.findAllTop(context));
|
||||
|
||||
Stack<TreeNode> stack = new Stack<TreeNode>();
|
||||
stack.push(root);
|
||||
Stack<TreeNode> stack = new Stack<>();
|
||||
stack.push(treeRoot);
|
||||
|
||||
while (!stack.empty())
|
||||
{
|
||||
TreeNode node = stack.pop();
|
||||
|
||||
validity.add(context, node.getDSO());
|
||||
theValidity.add(context, node.getDSO());
|
||||
|
||||
// If we are configured to use collection strengths (i.e. item counts) then include that number in the validity.
|
||||
boolean showCount = DSpaceServicesFactory.getInstance().getConfigurationService().getBooleanProperty("webui.strengths.show");
|
||||
@@ -150,7 +167,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
{ //try to determine Collection size (i.e. # of items)
|
||||
|
||||
int size = new ItemCounter(context).getCount(node.getDSO());
|
||||
validity.add("size:"+size);
|
||||
theValidity.add("size:"+size);
|
||||
}
|
||||
catch(ItemCountException e) { /* ignore */ }
|
||||
}
|
||||
@@ -166,10 +183,10 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
String assumeCacheValidity = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("xmlui.community-list.cache");
|
||||
if (assumeCacheValidity != null)
|
||||
{
|
||||
validity.setAssumedValidityDelay(assumeCacheValidity);
|
||||
theValidity.setAssumedValidityDelay(assumeCacheValidity);
|
||||
}
|
||||
|
||||
this.validity = validity.complete();
|
||||
this.validity = theValidity.complete();
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -182,7 +199,14 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
|
||||
/**
|
||||
* Add a page title and trail links.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws SAXException,
|
||||
WingException, UIException, SQLException, IOException,
|
||||
AuthorizeException
|
||||
@@ -197,7 +221,14 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
/**
|
||||
* Add a community-browser division that includes references to community and
|
||||
* collection metadata.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addBody(Body body) throws SAXException, WingException,
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
@@ -205,16 +236,16 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
division.setHead(T_head);
|
||||
division.addPara(T_select);
|
||||
|
||||
TreeNode root = buildTree(communityService.findAllTop(context));
|
||||
|
||||
TreeNode treeRoot = buildTree(communityService.findAllTop(context));
|
||||
|
||||
boolean full = DSpaceServicesFactory.getInstance().getConfigurationService().getBooleanProperty("xmlui.community-list.render.full", true);
|
||||
|
||||
|
||||
if (full)
|
||||
{
|
||||
ReferenceSet referenceSet = division.addReferenceSet("community-browser",
|
||||
ReferenceSet.TYPE_SUMMARY_LIST,null,"hierarchy");
|
||||
|
||||
java.util.List<TreeNode> rootNodes = root.getChildrenOfType(Constants.COMMUNITY);
|
||||
java.util.List<TreeNode> rootNodes = treeRoot.getChildrenOfType(Constants.COMMUNITY);
|
||||
|
||||
for (TreeNode node : rootNodes)
|
||||
{
|
||||
@@ -225,7 +256,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
{
|
||||
List list = division.addList("comunity-browser");
|
||||
|
||||
java.util.List<TreeNode> rootNodes = root.getChildrenOfType(Constants.COMMUNITY);
|
||||
java.util.List<TreeNode> rootNodes = treeRoot.getChildrenOfType(Constants.COMMUNITY);
|
||||
|
||||
for (TreeNode node : rootNodes)
|
||||
{
|
||||
@@ -241,6 +272,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
*
|
||||
* @param referenceSet The include set
|
||||
* @param node The current node of the hierarchy.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void buildReferenceSet(ReferenceSet referenceSet, TreeNode node) throws WingException
|
||||
{
|
||||
@@ -279,6 +311,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
*
|
||||
* @param list The parent list
|
||||
* @param node The current node of the hierarchy.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void buildList(List list, TreeNode node) throws WingException
|
||||
{
|
||||
@@ -294,8 +327,8 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
name = ((Collection) dso).getName();
|
||||
}
|
||||
|
||||
String url = contextPath + "/handle/"+dso.getHandle();
|
||||
list.addItem().addHighlight("bold").addXref(url, name);
|
||||
String aURL = contextPath + "/handle/"+dso.getHandle();
|
||||
list.addItem().addHighlight("bold").addXref(aURL, name);
|
||||
|
||||
List subList = null;
|
||||
|
||||
@@ -312,8 +345,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
subList.addItemXref(collectionUrl, collectionName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Add all the sub-communities
|
||||
java.util.List<TreeNode> communityNodes = node.getChildrenOfType(Constants.COMMUNITY);
|
||||
if (communityNodes != null && communityNodes.size() > 0)
|
||||
@@ -330,9 +362,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* recycle
|
||||
*/
|
||||
@Override
|
||||
public void recycle()
|
||||
{
|
||||
this.root = null;
|
||||
@@ -357,7 +387,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
TreeNode newRoot = new TreeNode();
|
||||
|
||||
// Setup for breadth-first traversal
|
||||
Stack<TreeNode> stack = new Stack<TreeNode>();
|
||||
Stack<TreeNode> stack = new Stack<>();
|
||||
|
||||
for (Community community : communities)
|
||||
{
|
||||
@@ -397,7 +427,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
}
|
||||
|
||||
/**
|
||||
* Private class to represent the tree structure of communities & collections.
|
||||
* Private class to represent the tree structure of communities and collections.
|
||||
*/
|
||||
protected static class TreeNode
|
||||
{
|
||||
@@ -408,7 +438,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
private int level;
|
||||
|
||||
/** All children of this node */
|
||||
private java.util.List<TreeNode> children = new ArrayList<TreeNode>();
|
||||
private final java.util.List<TreeNode> children = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new root level node
|
||||
@@ -459,11 +489,12 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type interesting type.
|
||||
* @return All children of the given @type.
|
||||
*/
|
||||
public java.util.List<TreeNode> getChildrenOfType(int type)
|
||||
{
|
||||
java.util.List<TreeNode> results = new ArrayList<TreeNode>();
|
||||
java.util.List<TreeNode> results = new ArrayList<>();
|
||||
for (TreeNode node : children)
|
||||
{
|
||||
if (node.dso.getType() == type)
|
||||
|
@@ -100,6 +100,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
/**
|
||||
* Generate the unique caching key.
|
||||
* This key must be unique inside the space of this component.
|
||||
* @return the key.
|
||||
*/
|
||||
@Override
|
||||
public Serializable getKey() {
|
||||
@@ -124,7 +125,8 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
* Generate the cache validity object.
|
||||
*
|
||||
* The validity object will include the item being viewed,
|
||||
* along with all bundles & bitstreams.
|
||||
* along with all bundles and bitstreams.
|
||||
* @return validity.
|
||||
*/
|
||||
@Override
|
||||
public SourceValidity getValidity()
|
||||
@@ -136,9 +138,9 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
try {
|
||||
dso = HandleUtil.obtainHandle(objectModel);
|
||||
|
||||
DSpaceValidity validity = new DSpaceValidity();
|
||||
validity.add(context, dso);
|
||||
this.validity = validity.complete();
|
||||
DSpaceValidity newValidity = new DSpaceValidity();
|
||||
newValidity.add(context, dso);
|
||||
this.validity = newValidity.complete();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -159,6 +161,12 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
/**
|
||||
* Add the item's title and trail links to the page's metadata.
|
||||
* @throws org.xml.sax.SAXException
|
||||
* @throws org.dspace.app.xmlui.wing.WingException if a crosswalk fails.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws SAXException,
|
||||
@@ -322,6 +330,12 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
/**
|
||||
* Display a single item
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addBody(Body body) throws SAXException, WingException,
|
||||
@@ -413,23 +427,17 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
/**
|
||||
* Determine if the full item should be referenced or just a summary.
|
||||
* @param objectModel to get the request.
|
||||
* @return true if the full item should be shown.
|
||||
*/
|
||||
public static boolean showFullItem(Map objectModel)
|
||||
{
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String show = request.getParameter("show");
|
||||
|
||||
if (show != null && show.length() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return show != null && show.length() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recycle
|
||||
*/
|
||||
@Override
|
||||
public void recycle() {
|
||||
this.validity = null;
|
||||
|
@@ -50,12 +50,13 @@ import org.dspace.handle.service.HandleService;
|
||||
*/
|
||||
public class SendItemRequestAction extends AbstractAction
|
||||
{
|
||||
private static Logger log = Logger.getLogger(SendItemRequestAction.class);
|
||||
private static final Logger log = Logger.getLogger(SendItemRequestAction.class);
|
||||
|
||||
protected HandleService handleService = HandleServiceFactory.getInstance().getHandleService();
|
||||
protected RequestItemService requestItemService = RequestItemServiceFactory.getInstance().getRequestItemService();
|
||||
protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
|
||||
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
|
||||
String source, Parameters parameters) throws Exception
|
||||
{
|
||||
@@ -81,7 +82,7 @@ public class SendItemRequestAction extends AbstractAction
|
||||
{
|
||||
// Either the user did not fill out the form or this is the
|
||||
// first time they are visiting the page.
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("bitstreamId",bitstreamId);
|
||||
|
||||
if (StringUtils.isEmpty(requesterEmail))
|
||||
@@ -141,19 +142,21 @@ public class SendItemRequestAction extends AbstractAction
|
||||
|
||||
/**
|
||||
* Get the link to the author in RequestLink email.
|
||||
* @param context
|
||||
* @param requestItem
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @param context DSpace session context.
|
||||
* @param token token.
|
||||
* @return the link.
|
||||
* @throws SQLException passed through.
|
||||
*/
|
||||
protected String getLinkTokenEmail(Context context, String token)
|
||||
throws SQLException
|
||||
{
|
||||
String base = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.url");
|
||||
|
||||
String specialLink = (new StringBuffer()).append(base).append(
|
||||
base.endsWith("/") ? "" : "/").append(
|
||||
"itemRequestResponse/").append(token)
|
||||
String specialLink = new StringBuffer()
|
||||
.append(base)
|
||||
.append(base.endsWith("/") ? "" : "/")
|
||||
.append("itemRequestResponse/")
|
||||
.append(token)
|
||||
.toString()+"/";
|
||||
|
||||
return specialLink;
|
||||
|
@@ -12,11 +12,9 @@ import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.apache.cocoon.util.HashUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.excalibur.source.SourceValidity;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.util.MetadataExposureServiceImpl;
|
||||
import org.dspace.app.util.factory.UtilServiceFactory;
|
||||
import org.dspace.app.util.service.MetadataExposureService;
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
@@ -43,7 +41,6 @@ import org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguratio
|
||||
import org.dspace.discovery.configuration.DiscoverySortConfiguration;
|
||||
import org.dspace.discovery.configuration.DiscoverySortConfiguration.SORT_ORDER;
|
||||
import org.dspace.discovery.configuration.DiscoverySortFieldConfiguration;
|
||||
import org.dspace.handle.HandleServiceImpl;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -58,7 +55,7 @@ import java.util.List;
|
||||
* This is an abstract search page. It is a collection of search methods that
|
||||
* are common between different search implementation. An implementer must
|
||||
* implement at least three methods: addBody(), getQuery(), and generateURL().
|
||||
* <p/>
|
||||
* <p>
|
||||
* See the SimpleSearch implementation.
|
||||
*
|
||||
* @author Kevin Van de Velde (kevin at atmire dot com)
|
||||
@@ -124,11 +121,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
protected MetadataExposureService metadataExposureService = UtilServiceFactory.getInstance().getMetadataExposureService();
|
||||
protected HandleService handleService = HandleServiceFactory.getInstance().getHandleService();
|
||||
|
||||
|
||||
/**
|
||||
* Generate the unique caching key.
|
||||
* This key must be unique inside the space of this component.
|
||||
* @return the key.
|
||||
*/
|
||||
@Override
|
||||
public Serializable getKey() {
|
||||
try {
|
||||
String key = "";
|
||||
@@ -153,7 +151,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
return HashUtil.hash(key);
|
||||
} catch (RuntimeException re) {
|
||||
throw re;
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException | UIException e) {
|
||||
// Ignore all errors and just don't cache.
|
||||
return "0";
|
||||
}
|
||||
@@ -161,30 +159,32 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
|
||||
/**
|
||||
* Generate the cache validity object.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This validity object should never "over cache" because it will
|
||||
* perform the search, and serialize the results using the
|
||||
* DSpaceValidity object.
|
||||
* @return the validity.
|
||||
*/
|
||||
@Override
|
||||
public SourceValidity getValidity() {
|
||||
if (this.validity == null) {
|
||||
try {
|
||||
DSpaceValidity validity = new DSpaceValidity();
|
||||
DSpaceValidity newValidity = new DSpaceValidity();
|
||||
|
||||
DSpaceObject scope = getScope();
|
||||
validity.add(context, scope);
|
||||
newValidity.add(context, scope);
|
||||
|
||||
performSearch(scope);
|
||||
|
||||
List<DSpaceObject> results = this.queryResults.getDspaceObjects();
|
||||
|
||||
if (results != null) {
|
||||
validity.add("total:"+this.queryResults.getTotalSearchResults());
|
||||
validity.add("start:"+this.queryResults.getStart());
|
||||
validity.add("size:" + results.size());
|
||||
newValidity.add("total:"+this.queryResults.getTotalSearchResults());
|
||||
newValidity.add("start:"+this.queryResults.getStart());
|
||||
newValidity.add("size:" + results.size());
|
||||
|
||||
for (DSpaceObject dso : results) {
|
||||
validity.add(context, dso);
|
||||
newValidity.add(context, dso);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,15 +193,15 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
List<DiscoverResult.FacetResult> facetValues = facetResults.get(facetField);
|
||||
for (DiscoverResult.FacetResult facetResult : facetValues)
|
||||
{
|
||||
validity.add(facetField + facetResult.getAsFilterQuery() + facetResult.getCount());
|
||||
newValidity.add(facetField + facetResult.getAsFilterQuery() + facetResult.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
this.validity = validity.complete();
|
||||
this.validity = newValidity.complete();
|
||||
} catch (RuntimeException re) {
|
||||
throw re;
|
||||
}
|
||||
catch (Exception e) {
|
||||
catch (SQLException | UIException | SearchServiceException e) {
|
||||
this.validity = null;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,14 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
|
||||
/**
|
||||
* Build the resulting search DRI document.
|
||||
* @throws org.xml.sax.SAXException whenever.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException whenever.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException whenever.
|
||||
* @throws java.sql.SQLException whenever.
|
||||
* @throws java.io.IOException whenever.
|
||||
* @throws org.dspace.authorize.AuthorizeException whenever.
|
||||
*/
|
||||
@Override
|
||||
public abstract void addBody(Body body) throws SAXException, WingException,
|
||||
UIException, SQLException, IOException, AuthorizeException;
|
||||
|
||||
@@ -224,6 +231,8 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* This form will be used for all discovery queries, filters, ....
|
||||
* At the moment however this form is only used to track search result hits
|
||||
* @param searchDiv the division to add the form to
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
*/
|
||||
protected void buildMainForm(Division searchDiv) throws WingException, SQLException {
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
@@ -284,6 +293,10 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* which contains results for this search query.
|
||||
*
|
||||
* @param search The search division to contain the search-results division.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws org.dspace.discovery.SearchServiceException passed through.
|
||||
*/
|
||||
protected void buildSearchResultsDivision(Division search)
|
||||
throws IOException, SQLException, WingException, SearchServiceException {
|
||||
@@ -299,7 +312,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
log.error(e.getMessage(), e);
|
||||
queryResults = null;
|
||||
}
|
||||
catch (Exception e) {
|
||||
catch (SQLException | UIException | SearchServiceException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
queryResults = null;
|
||||
}
|
||||
@@ -345,9 +358,9 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
// lastItemIndex = itemsTotal;
|
||||
int currentPage = this.queryResults.getStart() / this.queryResults.getMaxResults() + 1;
|
||||
int pagesTotal = (int) ((this.queryResults.getTotalSearchResults() - 1) / this.queryResults.getMaxResults()) + 1;
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
parameters.put("page", "{pageNum}");
|
||||
String pageURLMask = generateURL(parameters);
|
||||
Map<String, String> urlParameters = new HashMap<>();
|
||||
urlParameters.put("page", "{pageNum}");
|
||||
String pageURLMask = generateURL(urlParameters);
|
||||
pageURLMask = addFilterQueriesToUrl(pageURLMask);
|
||||
|
||||
results.setMaskedPagination(itemsTotal, firstItemIndex,
|
||||
@@ -360,8 +373,8 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
dspaceObjectsList = results.addList("search-results-repository",
|
||||
org.dspace.app.xmlui.wing.element.List.TYPE_DSO_LIST, "repository-search-results");
|
||||
|
||||
List<DSpaceObject> commCollList = new ArrayList<DSpaceObject>();
|
||||
List<Item> itemList = new ArrayList<Item>();
|
||||
List<DSpaceObject> commCollList = new ArrayList<>();
|
||||
List<Item> itemList = new ArrayList<>();
|
||||
for (DSpaceObject resultDso : queryResults.getDspaceObjects())
|
||||
{
|
||||
if(resultDso.getType() == Constants.COMMUNITY || resultDso.getType() == Constants.COLLECTION)
|
||||
@@ -509,9 +522,13 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* Render the given collection, all collection metadata is added to the list
|
||||
* @param collection the collection to be rendered
|
||||
* @param highlightedResults the highlighted results
|
||||
* @throws WingException
|
||||
* @param collectionMetadata list of metadata values.
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected void renderCollection(Collection collection, DiscoverResult.DSpaceObjectHighlightResult highlightedResults, org.dspace.app.xmlui.wing.element.List collectionMetadata) throws WingException {
|
||||
protected void renderCollection(Collection collection,
|
||||
DiscoverResult.DSpaceObjectHighlightResult highlightedResults,
|
||||
org.dspace.app.xmlui.wing.element.List collectionMetadata)
|
||||
throws WingException {
|
||||
|
||||
String description = collectionService.getMetadata(collection, "introductory_text");
|
||||
String description_abstract = collectionService.getMetadata(collection, "short_description");
|
||||
@@ -560,10 +577,14 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* Render the given collection, all collection metadata is added to the list
|
||||
* @param community the community to be rendered
|
||||
* @param highlightedResults the highlighted results
|
||||
* @throws WingException
|
||||
* @param communityMetadata list of metadata values.
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
|
||||
protected void renderCommunity(Community community, DiscoverResult.DSpaceObjectHighlightResult highlightedResults, org.dspace.app.xmlui.wing.element.List communityMetadata) throws WingException {
|
||||
protected void renderCommunity(Community community,
|
||||
DiscoverResult.DSpaceObjectHighlightResult highlightedResults,
|
||||
org.dspace.app.xmlui.wing.element.List communityMetadata)
|
||||
throws WingException {
|
||||
String description = communityService.getMetadata(community, "introductory_text");
|
||||
String description_abstract = communityService.getMetadata(community, "short_description");
|
||||
String description_table = communityService.getMetadata(community, "side_bar_text");
|
||||
@@ -573,27 +594,39 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
|
||||
if(StringUtils.isNotBlank(description))
|
||||
{
|
||||
addMetadataField(highlightedResults, "dc.description", communityMetadata.addList(community.getHandle() + ":dc.description"), description);
|
||||
addMetadataField(highlightedResults, "dc.description",
|
||||
communityMetadata.addList(community.getHandle() + ":dc.description"),
|
||||
description);
|
||||
}
|
||||
if(StringUtils.isNotBlank(description_abstract))
|
||||
{
|
||||
addMetadataField(highlightedResults, "dc.description.abstract", communityMetadata.addList(community.getHandle() + ":dc.description.abstract"), description_abstract);
|
||||
addMetadataField(highlightedResults, "dc.description.abstract",
|
||||
communityMetadata.addList(community.getHandle() + ":dc.description.abstract"),
|
||||
description_abstract);
|
||||
}
|
||||
if(StringUtils.isNotBlank(description_table))
|
||||
{
|
||||
addMetadataField(highlightedResults, "dc.description.tableofcontents", communityMetadata.addList(community.getHandle() + ":dc.description.tableofcontents"), description_table);
|
||||
addMetadataField(highlightedResults, "dc.description.tableofcontents",
|
||||
communityMetadata.addList(community.getHandle() + ":dc.description.tableofcontents"),
|
||||
description_table);
|
||||
}
|
||||
if(StringUtils.isNotBlank(identifier_uri))
|
||||
{
|
||||
addMetadataField(highlightedResults, "dc.identifier.uri", communityMetadata.addList(community.getHandle() + ":dc.identifier.uri"), identifier_uri);
|
||||
addMetadataField(highlightedResults, "dc.identifier.uri",
|
||||
communityMetadata.addList(community.getHandle() + ":dc.identifier.uri"),
|
||||
identifier_uri);
|
||||
}
|
||||
if(StringUtils.isNotBlank(rights))
|
||||
{
|
||||
addMetadataField(highlightedResults, "dc.rights", communityMetadata.addList(community.getHandle() + ":dc.rights"), rights);
|
||||
addMetadataField(highlightedResults, "dc.rights",
|
||||
communityMetadata.addList(community.getHandle() + ":dc.rights"),
|
||||
rights);
|
||||
}
|
||||
if(StringUtils.isNotBlank(title))
|
||||
{
|
||||
addMetadataField(highlightedResults, "dc.title", communityMetadata.addList(community.getHandle() + ":dc.title"), title);
|
||||
addMetadataField(highlightedResults, "dc.title",
|
||||
communityMetadata.addList(community.getHandle() + ":dc.title"),
|
||||
title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,7 +638,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* @param value the metadata value
|
||||
* @throws WingException
|
||||
*/
|
||||
protected void addMetadataField(DiscoverResult.DSpaceObjectHighlightResult highlightedResults, String metadataKey, org.dspace.app.xmlui.wing.element.List metadataFieldList, String value) throws WingException {
|
||||
protected void addMetadataField(
|
||||
DiscoverResult.DSpaceObjectHighlightResult highlightedResults,
|
||||
String metadataKey,
|
||||
org.dspace.app.xmlui.wing.element.List metadataFieldList,
|
||||
String value)
|
||||
throws WingException {
|
||||
if(value == null){
|
||||
//In the unlikely event that the value is null, do not attempt to render this
|
||||
return;
|
||||
@@ -648,10 +686,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
}
|
||||
|
||||
/**
|
||||
* Add our metadata value, this value will might contain the highlight ("<em></em>") tags, these will be removed & rendered as highlight wing fields.
|
||||
* @param metadataFieldList the metadata list we need to add the value to
|
||||
* Add our metadata value. This value will might contain the highlight
|
||||
* ("{@code <em></em>}") tags. These will be removed and rendered as highlight WING fields.
|
||||
*
|
||||
* @param metadataFieldList the metadata list we need to add the value to.
|
||||
* @param value the metadata value to be rendered
|
||||
* @throws WingException
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected void addMetadataField(org.dspace.app.xmlui.wing.element.List metadataFieldList, String value) throws WingException {
|
||||
//We need to put everything in <em> tags in a highlight !
|
||||
@@ -677,18 +717,19 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
/**
|
||||
* Add options to the search scope field. This field determines in which
|
||||
* communities or collections to search for the query.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The scope list will depend upon the current search scope. There are three
|
||||
* cases:
|
||||
* <p/>
|
||||
* No current scope: All top level communities are listed.
|
||||
* <p/>
|
||||
* The current scope is a community: All collections contained within the
|
||||
* community are listed.
|
||||
* <p/>
|
||||
* The current scope is a collection: All parent communities are listed.
|
||||
* <ul>
|
||||
* <li>No current scope: All top level communities are listed.
|
||||
* <li>The current scope is a community: All collections contained within the
|
||||
* community are listed.
|
||||
* <li>The current scope is a collection: All parent communities are listed.
|
||||
* </ul>
|
||||
*
|
||||
* @param scope The current scope field.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected void buildScopeList(Select scope) throws SQLException,
|
||||
WingException {
|
||||
@@ -729,10 +770,16 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
/**
|
||||
* Prepare DiscoverQuery given the current scope and query string
|
||||
*
|
||||
* @param scope the dspace object parent
|
||||
* @param scope the dspace object parent
|
||||
* @param query the query.
|
||||
* @param fqs the filter queries.
|
||||
* @return the prepared query.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws org.dspace.discovery.SearchServiceException passed through.
|
||||
*/
|
||||
public DiscoverQuery prepareQuery(DSpaceObject scope, String query, String[] fqs) throws UIException, SearchServiceException {
|
||||
|
||||
public DiscoverQuery prepareQuery(DSpaceObject scope, String query, String[] fqs)
|
||||
throws UIException, SearchServiceException {
|
||||
|
||||
this.queryArgs = new DiscoverQuery();
|
||||
|
||||
int page = getParameterPage();
|
||||
@@ -740,7 +787,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
// Escape any special characters in this user-entered query
|
||||
query = DiscoveryUIUtils.escapeQueryChars(query);
|
||||
|
||||
List<String> filterQueries = new ArrayList<String>();
|
||||
List<String> filterQueries = new ArrayList<>();
|
||||
|
||||
if (fqs != null) {
|
||||
filterQueries.addAll(Arrays.asList(fqs));
|
||||
@@ -835,8 +882,9 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* Query DSpace for a list of all items / collections / or communities that
|
||||
* match the given search query.
|
||||
*
|
||||
*
|
||||
* @param scope the dspace object parent
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws org.dspace.discovery.SearchServiceException passed through.
|
||||
*/
|
||||
public void performSearch(DSpaceObject scope) throws UIException, SearchServiceException {
|
||||
|
||||
@@ -854,7 +902,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
protected Map<String, String[]> getParameterFilterQueries()
|
||||
{
|
||||
try {
|
||||
Map<String, String[]> result = new HashMap<String, String[]>();
|
||||
Map<String, String[]> result = new HashMap<>();
|
||||
result.put("fq", ObjectModelHelper.getRequest(objectModel).getParameterValues("fq"));
|
||||
return result;
|
||||
}
|
||||
@@ -934,11 +982,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
/**
|
||||
* Determine if the scope of the search should fixed or is changeable by the
|
||||
* user.
|
||||
* <p/>
|
||||
* The search scope when performed by url, i.e. they are at the url handle/xxxx/xx/search
|
||||
* <p>
|
||||
* The search scope when performed by URL, i.e. they are at the URL handle/xxxx/xx/search
|
||||
* then it is fixed. However at the global level the search is variable.
|
||||
*
|
||||
* @return true if the scope is variable, false otherwise.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
*/
|
||||
protected boolean variableScope() throws SQLException {
|
||||
return (HandleUtil.obtainHandle(objectModel) == null);
|
||||
@@ -946,26 +995,25 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
|
||||
/**
|
||||
* Extract the query string. Under most implementations this will be derived
|
||||
* from the url parameters.
|
||||
* from the URL parameters.
|
||||
*
|
||||
* @return The query string.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException whenever.
|
||||
*/
|
||||
protected abstract String getQuery() throws UIException;
|
||||
|
||||
/**
|
||||
* Generate a url to the given search implementation with the associated
|
||||
* Generate a URL to the given search implementation with the associated
|
||||
* parameters included.
|
||||
*
|
||||
* @param parameters
|
||||
* @param parameters URL query parameters.
|
||||
* @return The post URL
|
||||
* @throws org.dspace.app.xmlui.utils.UIException whenever.
|
||||
*/
|
||||
protected abstract String generateURL(Map<String, String> parameters)
|
||||
throws UIException;
|
||||
|
||||
|
||||
/**
|
||||
* Recycle
|
||||
*/
|
||||
@Override
|
||||
public void recycle() {
|
||||
this.queryArgs = null;
|
||||
this.queryResults = null;
|
||||
@@ -973,7 +1021,6 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
super.recycle();
|
||||
}
|
||||
|
||||
|
||||
protected void buildSearchControls(Division div)
|
||||
throws WingException, SQLException {
|
||||
|
||||
@@ -1043,6 +1090,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement
|
||||
* specified then null is returned.
|
||||
*
|
||||
* @return The current scope.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
*/
|
||||
protected DSpaceObject getScope() throws SQLException {
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
|
@@ -66,7 +66,7 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
*/
|
||||
protected DiscoverQuery queryArgs;
|
||||
|
||||
private int DEFAULT_PAGE_SIZE = 10;
|
||||
private final int DEFAULT_PAGE_SIZE = 10;
|
||||
|
||||
public static final String OFFSET = "offset";
|
||||
public static final String FACET_FIELD = "field";
|
||||
@@ -85,7 +85,9 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
/**
|
||||
* Generate the unique caching key.
|
||||
* This key must be unique inside the space of this component.
|
||||
* @return the key.
|
||||
*/
|
||||
@Override
|
||||
public Serializable getKey() {
|
||||
try {
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
@@ -106,44 +108,46 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
|
||||
/**
|
||||
* Generate the cache validity object.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The validity object will include the collection being viewed and
|
||||
* all recently submitted items. This does not include the community / collection
|
||||
* hierarchy, when this changes they will not be reflected in the cache.
|
||||
* @return the validity.
|
||||
*/
|
||||
@Override
|
||||
public SourceValidity getValidity() {
|
||||
if (this.validity == null) {
|
||||
|
||||
try {
|
||||
DSpaceValidity validity = new DSpaceValidity();
|
||||
DSpaceValidity newValidity = new DSpaceValidity();
|
||||
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
|
||||
if (dso != null) {
|
||||
// Add the actual collection;
|
||||
validity.add(context, dso);
|
||||
newValidity.add(context, dso);
|
||||
}
|
||||
|
||||
// add recently submitted items, serialize solr query contents.
|
||||
DiscoverResult response = getQueryResponse(dso);
|
||||
|
||||
validity.add("numFound:" + response.getDspaceObjects().size());
|
||||
newValidity.add("numFound:" + response.getDspaceObjects().size());
|
||||
|
||||
for (DSpaceObject resultDso : response.getDspaceObjects()) {
|
||||
validity.add(context, resultDso);
|
||||
newValidity.add(context, resultDso);
|
||||
}
|
||||
|
||||
for (String facetField : response.getFacetResults().keySet()) {
|
||||
validity.add(facetField);
|
||||
newValidity.add(facetField);
|
||||
|
||||
List<DiscoverResult.FacetResult> facetValues = response.getFacetResults().get(facetField);
|
||||
for (DiscoverResult.FacetResult facetValue : facetValues) {
|
||||
validity.add(facetValue.getAsFilterQuery() + facetValue.getCount());
|
||||
newValidity.add(facetValue.getAsFilterQuery() + facetValue.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.validity = validity.complete();
|
||||
this.validity = newValidity.complete();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// Just ignore all errors and return an invalid cache.
|
||||
@@ -158,6 +162,7 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
* Get the recently submitted items for the given community or collection.
|
||||
*
|
||||
* @param scope The collection.
|
||||
* @return recently submitted items.
|
||||
*/
|
||||
protected DiscoverResult getQueryResponse(DSpaceObject scope) {
|
||||
|
||||
@@ -246,8 +251,16 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
|
||||
/**
|
||||
* Add a page title and trail links.
|
||||
*
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
public void addPageMeta(PageMeta pageMeta) throws SAXException, WingException, SQLException, IOException, AuthorizeException {
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta)
|
||||
throws SAXException, WingException, SQLException, IOException, AuthorizeException {
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String facetField = request.getParameter(FACET_FIELD);
|
||||
|
||||
@@ -284,7 +297,7 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
Map<String, List<DiscoverResult.FacetResult>> facetFields = this.queryResults.getFacetResults();
|
||||
if (facetFields == null)
|
||||
{
|
||||
facetFields = new LinkedHashMap<String, List<DiscoverResult.FacetResult>>();
|
||||
facetFields = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
// facetFields.addAll(this.queryResults.getFacetDates());
|
||||
@@ -320,7 +333,7 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
|
||||
Table singleTable = results.addTable("browse-by-" + facetField + "-results", (int) (queryResults.getDspaceObjects().size() + 1), 1);
|
||||
|
||||
List<String> filterQueries = new ArrayList<String>();
|
||||
List<String> filterQueries = new ArrayList<>();
|
||||
if(request.getParameterValues("fq") != null)
|
||||
{
|
||||
filterQueries = Arrays.asList(request.getParameterValues("fq"));
|
||||
@@ -379,26 +392,26 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
}
|
||||
|
||||
private String getNextPageURL(Request request) {
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
parameters.put(FACET_FIELD, request.getParameter(FACET_FIELD));
|
||||
Map<String, String> urlParameters = new HashMap<>();
|
||||
urlParameters.put(FACET_FIELD, request.getParameter(FACET_FIELD));
|
||||
if (queryArgs.getFacetOffset() != -1)
|
||||
{
|
||||
parameters.put(OFFSET, String.valueOf(queryArgs.getFacetOffset() + DEFAULT_PAGE_SIZE));
|
||||
urlParameters.put(OFFSET, String.valueOf(queryArgs.getFacetOffset() + DEFAULT_PAGE_SIZE));
|
||||
}
|
||||
|
||||
// Add the filter queries
|
||||
String url = generateURL("browse-discovery", parameters);
|
||||
String newURL = generateURL("browse-discovery", urlParameters);
|
||||
String[] fqs = getParameterFacetQueries();
|
||||
if (fqs != null) {
|
||||
StringBuilder urlBuilder = new StringBuilder(url);
|
||||
StringBuilder urlBuilder = new StringBuilder(newURL);
|
||||
for (String fq : fqs) {
|
||||
urlBuilder.append("&fq=").append(fq);
|
||||
}
|
||||
|
||||
url = urlBuilder.toString();
|
||||
newURL = urlBuilder.toString();
|
||||
}
|
||||
|
||||
return url;
|
||||
return newURL;
|
||||
}
|
||||
|
||||
private String getPreviousPageURL(Request request) {
|
||||
@@ -408,32 +421,29 @@ public class BrowseFacet extends AbstractDSpaceTransformer implements CacheableP
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
parameters.put(FACET_FIELD, request.getParameter(FACET_FIELD));
|
||||
Map<String, String> urlParameters = new HashMap<>();
|
||||
urlParameters.put(FACET_FIELD, request.getParameter(FACET_FIELD));
|
||||
if (queryArgs.getFacetOffset() != -1)
|
||||
{
|
||||
parameters.put(OFFSET, String.valueOf(queryArgs.getFacetOffset() - DEFAULT_PAGE_SIZE));
|
||||
urlParameters.put(OFFSET, String.valueOf(queryArgs.getFacetOffset() - DEFAULT_PAGE_SIZE));
|
||||
}
|
||||
|
||||
// Add the filter queries
|
||||
String url = generateURL("browse-discovery", parameters);
|
||||
String newURL = generateURL("browse-discovery", urlParameters);
|
||||
String[] fqs = getParameterFacetQueries();
|
||||
if (fqs != null) {
|
||||
StringBuilder urlBuilder = new StringBuilder(url);
|
||||
StringBuilder urlBuilder = new StringBuilder(newURL);
|
||||
for (String fq : fqs) {
|
||||
urlBuilder.append("&fq=").append(fq);
|
||||
}
|
||||
|
||||
url = urlBuilder.toString();
|
||||
newURL = urlBuilder.toString();
|
||||
}
|
||||
|
||||
return url;
|
||||
return newURL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recycle
|
||||
*/
|
||||
@Override
|
||||
public void recycle() {
|
||||
// Clear out our item's cache.
|
||||
this.queryResults = null;
|
||||
|
@@ -109,7 +109,9 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
/**
|
||||
* Generate the unique caching key.
|
||||
* This key must be unique inside the space of this component.
|
||||
* @return the key.
|
||||
*/
|
||||
@Override
|
||||
public Serializable getKey() {
|
||||
try {
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
@@ -130,44 +132,46 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
|
||||
/**
|
||||
* Generate the cache validity object.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The validity object will include the collection being viewed and
|
||||
* all recently submitted items. This does not include the community / collection
|
||||
* hierarchy, when this changes they will not be reflected in the cache.
|
||||
* @return the validity.
|
||||
*/
|
||||
@Override
|
||||
public SourceValidity getValidity() {
|
||||
if (this.validity == null) {
|
||||
|
||||
try {
|
||||
DSpaceValidity validity = new DSpaceValidity();
|
||||
DSpaceValidity newValidity = new DSpaceValidity();
|
||||
|
||||
DSpaceObject dso = getScope();
|
||||
|
||||
if (dso != null) {
|
||||
// Add the actual collection;
|
||||
validity.add(context, dso);
|
||||
newValidity.add(context, dso);
|
||||
}
|
||||
|
||||
// add recently submitted items, serialize solr query contents.
|
||||
DiscoverResult response = getQueryResponse(dso);
|
||||
|
||||
validity.add("numFound:" + response.getDspaceObjects().size());
|
||||
newValidity.add("numFound:" + response.getDspaceObjects().size());
|
||||
|
||||
for (DSpaceObject resultDso : queryResults.getDspaceObjects()) {
|
||||
validity.add(context, resultDso);
|
||||
newValidity.add(context, resultDso);
|
||||
}
|
||||
|
||||
for (String facetField : queryResults.getFacetResults().keySet()) {
|
||||
validity.add(facetField);
|
||||
newValidity.add(facetField);
|
||||
|
||||
java.util.List<DiscoverResult.FacetResult> facetValues = queryResults.getFacetResults().get(facetField);
|
||||
for (DiscoverResult.FacetResult facetValue : facetValues) {
|
||||
validity.add(facetField + facetValue.getAsFilterQuery() + facetValue.getCount());
|
||||
newValidity.add(facetField + facetValue.getAsFilterQuery() + facetValue.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.validity = validity.complete();
|
||||
this.validity = newValidity.complete();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// Just ignore all errors and return an invalid cache.
|
||||
@@ -182,6 +186,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
* Get the recently submitted items for the given community or collection.
|
||||
*
|
||||
* @param scope The collection.
|
||||
* @return recently submitted items.
|
||||
*/
|
||||
protected DiscoverResult getQueryResponse(DSpaceObject scope) {
|
||||
|
||||
@@ -227,18 +232,16 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
String facetField = request.getParameter(SearchFilterParam.FACET_FIELD);
|
||||
DiscoverFacetField discoverFacetField;
|
||||
// Enumerations don't handle mixed cases, setting to uppercase to match convention
|
||||
SORT sortOrder = getSortOrder(request);
|
||||
SORT requestSortOrder = getSortOrder(request);
|
||||
if(request.getParameter(SearchFilterParam.STARTS_WITH) != null)
|
||||
{
|
||||
discoverFacetField = new DiscoverFacetField(facetField, DiscoveryConfigurationParameters.TYPE_TEXT, getPageSize() + 1, sortOrder, request.getParameter(SearchFilterParam.STARTS_WITH).toLowerCase());
|
||||
discoverFacetField = new DiscoverFacetField(facetField, DiscoveryConfigurationParameters.TYPE_TEXT, getPageSize() + 1, requestSortOrder, request.getParameter(SearchFilterParam.STARTS_WITH).toLowerCase());
|
||||
}else{
|
||||
discoverFacetField = new DiscoverFacetField(facetField, DiscoveryConfigurationParameters.TYPE_TEXT, getPageSize() + 1, sortOrder);
|
||||
discoverFacetField = new DiscoverFacetField(facetField, DiscoveryConfigurationParameters.TYPE_TEXT, getPageSize() + 1, requestSortOrder);
|
||||
}
|
||||
|
||||
|
||||
queryArgs.addFacetField(discoverFacetField);
|
||||
|
||||
|
||||
try {
|
||||
queryResults = searchService.search(context, scope, queryArgs);
|
||||
} catch (SearchServiceException e) {
|
||||
@@ -265,14 +268,19 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
|
||||
/**
|
||||
* Add a page title and trail links.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws SAXException, WingException, SQLException, IOException, AuthorizeException {
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String facetField = request.getParameter(SearchFilterParam.FACET_FIELD);
|
||||
|
||||
pageMeta.addMetadata("title").addContent(message("xmlui.Discovery.AbstractSearch.type_" + facetField));
|
||||
|
||||
|
||||
pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
|
||||
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
@@ -309,7 +317,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
Map<String, List<DiscoverResult.FacetResult>> facetFields = this.queryResults.getFacetResults();
|
||||
if (facetFields == null)
|
||||
{
|
||||
facetFields = new LinkedHashMap<String, List<DiscoverResult.FacetResult>>();
|
||||
facetFields = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
// facetFields.addAll(this.queryResults.getFacetDates());
|
||||
@@ -397,7 +405,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
Division jump = div.addInteractiveDivision("filter-navigation", action,
|
||||
Division.METHOD_POST, "secondary navigation");
|
||||
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.putAll(browseParams.getCommonBrowseParams());
|
||||
// Add all the query parameters as hidden fields on the form
|
||||
for(Map.Entry<String, String> param : params.entrySet()){
|
||||
@@ -457,16 +465,16 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
cell.addContent(displayedValue + " (" + value.getCount() + ")");
|
||||
} else {
|
||||
//Add the basics
|
||||
Map<String, String> urlParams = new HashMap<String, String>();
|
||||
Map<String, String> urlParams = new HashMap<>();
|
||||
urlParams.putAll(browseParams.getCommonBrowseParams());
|
||||
String url = generateURL(contextPath + (dso == null ? "" : "/handle/" + dso.getHandle()) + "/discover", urlParams);
|
||||
String xrefURL = generateURL(contextPath + (dso == null ? "" : "/handle/" + dso.getHandle()) + "/discover", urlParams);
|
||||
//Add already existing filter queries
|
||||
url = addFilterQueriesToUrl(url);
|
||||
xrefURL = addFilterQueriesToUrl(xrefURL);
|
||||
//Last add the current filter query
|
||||
url += "&filtertype=" + facetField;
|
||||
url += "&filter_relational_operator="+value.getFilterType();
|
||||
url += "&filter=" + URLEncoder.encode(value.getAsFilterQuery(), "UTF-8");
|
||||
cell.addXref(url, displayedValue + " (" + value.getCount() + ")"
|
||||
xrefURL += "&filtertype=" + facetField;
|
||||
xrefURL += "&filter_relational_operator="+value.getFilterType();
|
||||
xrefURL += "&filter=" + URLEncoder.encode(value.getAsFilterQuery(), "UTF-8");
|
||||
cell.addXref(xrefURL, displayedValue + " (" + value.getCount() + ")"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -478,17 +486,17 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
offSet = currentOffset;
|
||||
}
|
||||
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
parameters.putAll(browseParams.getCommonBrowseParams());
|
||||
parameters.putAll(browseParams.getControlParameters());
|
||||
parameters.put(SearchFilterParam.OFFSET, String.valueOf(offSet + getPageSize()));
|
||||
parameters.put(SearchFilterParam.ORDER, getSortOrder(request).name());
|
||||
Map<String, String> urlParameters = new HashMap<>();
|
||||
urlParameters.putAll(browseParams.getCommonBrowseParams());
|
||||
urlParameters.putAll(browseParams.getControlParameters());
|
||||
urlParameters.put(SearchFilterParam.OFFSET, String.valueOf(offSet + getPageSize()));
|
||||
urlParameters.put(SearchFilterParam.ORDER, getSortOrder(request).name());
|
||||
|
||||
// Add the filter queries
|
||||
String url = generateURL("search-filter", parameters);
|
||||
url = addFilterQueriesToUrl(url);
|
||||
String newURL = generateURL("search-filter", urlParameters);
|
||||
newURL = addFilterQueriesToUrl(newURL);
|
||||
|
||||
return url;
|
||||
return newURL;
|
||||
}
|
||||
|
||||
private String getPreviousPageURL(SearchFilterParam browseParams, Request request) throws UnsupportedEncodingException, UIException {
|
||||
@@ -505,23 +513,20 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
parameters.putAll(browseParams.getCommonBrowseParams());
|
||||
parameters.putAll(browseParams.getControlParameters());
|
||||
parameters.put(SearchFilterParam.ORDER, getSortOrder(request).name());
|
||||
Map<String, String> urlParameters = new HashMap<>();
|
||||
urlParameters.putAll(browseParams.getCommonBrowseParams());
|
||||
urlParameters.putAll(browseParams.getControlParameters());
|
||||
urlParameters.put(SearchFilterParam.ORDER, getSortOrder(request).name());
|
||||
String offSet = String.valueOf((currentOffset - getPageSize()<0)? 0:currentOffset - getPageSize());
|
||||
parameters.put(SearchFilterParam.OFFSET, offSet);
|
||||
urlParameters.put(SearchFilterParam.OFFSET, offSet);
|
||||
|
||||
// Add the filter queries
|
||||
String url = generateURL("search-filter", parameters);
|
||||
url = addFilterQueriesToUrl(url);
|
||||
return url;
|
||||
String newURL = generateURL("search-filter", urlParameters);
|
||||
newURL = addFilterQueriesToUrl(newURL);
|
||||
return newURL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recycle
|
||||
*/
|
||||
@Override
|
||||
public void recycle() {
|
||||
// Clear out our item's cache.
|
||||
this.queryResults = null;
|
||||
@@ -549,7 +554,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
}
|
||||
|
||||
private static class SearchFilterParam {
|
||||
private Request request;
|
||||
private final Request request;
|
||||
|
||||
/** The always present commond params **/
|
||||
public static final String QUERY = "query";
|
||||
@@ -570,7 +575,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
}
|
||||
|
||||
public Map<String, String> getCommonBrowseParams(){
|
||||
Map<String, String> result = new HashMap<String, String>();
|
||||
Map<String, String> result = new HashMap<>();
|
||||
result.put(FACET_FIELD, request.getParameter(FACET_FIELD));
|
||||
if(request.getParameter(QUERY) != null)
|
||||
result.put(QUERY, request.getParameter(QUERY));
|
||||
@@ -581,7 +586,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
}
|
||||
|
||||
public Map<String, String> getControlParameters(){
|
||||
Map<String, String> paramMap = new HashMap<String, String>();
|
||||
Map<String, String> paramMap = new HashMap<>();
|
||||
|
||||
paramMap.put(OFFSET, request.getParameter(OFFSET));
|
||||
if(request.getParameter(STARTS_WITH) != null)
|
||||
@@ -641,7 +646,7 @@ public class SearchFacetFilter extends AbstractDSpaceTransformer implements Cach
|
||||
throws WingException
|
||||
{
|
||||
// Prepare a Map of query parameters required for all links
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<>();
|
||||
|
||||
queryParams.putAll(params.getCommonBrowseParams());
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
|
@@ -28,23 +28,27 @@ import org.dspace.eperson.EPerson;
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the user based upon their presented credentials.
|
||||
* This action uses the http parameters of login_email, login_password, and
|
||||
* This action uses the HTTP parameters of login_email, login_password, and
|
||||
* login_realm as credentials.
|
||||
*
|
||||
* If the authentication attempt is successful then an HTTP redirect will be
|
||||
* <p>If the authentication attempt is successful then an HTTP redirect will be
|
||||
* sent to the browser redirecting them to their original location in the
|
||||
* system before authenticated or if none is supplied back to the DSpace
|
||||
* homepage. The action will also return true, thus contents of the action will
|
||||
* be excuted.
|
||||
*
|
||||
* If the authentication attempt fails, the action returns false.
|
||||
*
|
||||
* Example use:
|
||||
*
|
||||
* home page. The action will also return true, thus contents of the action will
|
||||
* be executed.
|
||||
*
|
||||
* <p>If the authentication attempt fails, the action returns false.
|
||||
*
|
||||
* <p>Example use:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:act name="Authenticate">
|
||||
* <map:serialize type="xml"/>
|
||||
* </map:act>
|
||||
* <map:transform type="try-to-login-again-transformer">
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
@@ -54,7 +58,15 @@ public class AuthenticateAction extends AbstractAction
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the user.
|
||||
* @param redirector redirector.
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel object model.
|
||||
* @param source source
|
||||
* @param parameters sitemap parameters.
|
||||
* @return result of the action.
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
|
||||
String source, Parameters parameters) throws Exception
|
||||
{
|
||||
|
@@ -28,20 +28,24 @@ import org.dspace.eperson.EPerson;
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the user based upon their presented credentials. This
|
||||
* action uses the http parameters of username, ldap_password, and login_realm
|
||||
* action uses the HTTP parameters of username, ldap_password, and login_realm
|
||||
* as credentials.
|
||||
*
|
||||
* If the authentication attempt is successful then an HTTP redirect will be
|
||||
* <p>If the authentication attempt is successful then an HTTP redirect will be
|
||||
* sent to the browser redirecting them to their original location in the system
|
||||
* before authenticated or if none is supplied back to the DSpace homepage. The
|
||||
* action will also return true, thus contents of the action will be excuted.
|
||||
* before authenticated or if none is supplied back to the DSpace home page. The
|
||||
* action will also return true, thus contents of the action will be executed.
|
||||
*
|
||||
* If the authentication attempt fails, the action returns false.
|
||||
*
|
||||
* Example use:
|
||||
* <p>If the authentication attempt fails, the action returns false.
|
||||
*
|
||||
* <p>Example use:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:act name="LDAPAuthenticate"> <map:serialize type="xml"/> </map:act>
|
||||
* <map:transform type="try-to-login-again-transformer">
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Jay Paz
|
||||
*/
|
||||
@@ -50,10 +54,19 @@ public class LDAPAuthenticateAction extends AbstractAction {
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the user.
|
||||
* @param redirector redirector.
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel object model.
|
||||
* @param source source.
|
||||
* @param parameters sitemap parameters.
|
||||
* @return results of the action.
|
||||
* @throws org.apache.cocoon.sitemap.PatternException if unable to authenticate.
|
||||
* @throws java.lang.Exception passed through.
|
||||
*/
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver,
|
||||
Map objectModel, String source, Parameters parameters)
|
||||
throws Exception {
|
||||
throws PatternException, Exception {
|
||||
// First check if we are performing a new login
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
|
||||
@@ -82,12 +95,12 @@ public class LDAPAuthenticateAction extends AbstractAction {
|
||||
redirectURL += AuthenticationUtil
|
||||
.resumeInterruptedRequest(objectModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise direct the user to the specified 'loginredirect' page (or homepage by default)
|
||||
String loginRedirect = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("xmlui.user.loginredirect");
|
||||
redirectURL += (loginRedirect != null) ? loginRedirect.trim() : "/";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise direct the user to the specified 'loginredirect' page (or homepage by default)
|
||||
String loginRedirect = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("xmlui.user.loginredirect");
|
||||
redirectURL += (loginRedirect != null) ? loginRedirect.trim() : "/";
|
||||
}
|
||||
|
||||
// Authentication successful send a redirect.
|
||||
final HttpServletResponse httpResponse = (HttpServletResponse) objectModel
|
||||
|
@@ -28,23 +28,27 @@ import org.dspace.eperson.EPerson;
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the user based upon their presented shibboleth credentials.
|
||||
* This action uses the http parameters as supplied by Shibboleth SP.
|
||||
* This action uses the HTTP parameters as supplied by Shibboleth SP.
|
||||
* Read dspace.cfg for configuration detail.
|
||||
*
|
||||
* If the authentication attempt is successful then an HTTP redirect will be
|
||||
*
|
||||
* <p>If the authentication attempt is successful then an HTTP redirect will be
|
||||
* sent to the browser redirecting them to their original location in the
|
||||
* system before authenticated or if none is supplied back to the DSpace
|
||||
* homepage. The action will also return true, thus contents of the action will
|
||||
* be excuted.
|
||||
*
|
||||
* If the authentication attempt fails, the action returns false.
|
||||
*
|
||||
* Example use:
|
||||
* home page. The action will also return true, thus contents of the action will
|
||||
* be executed.
|
||||
*
|
||||
* <p>If the authentication attempt fails, the action returns false.
|
||||
*
|
||||
* <p>Example use:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:act name="Shibboleth">
|
||||
* <map:serialize type="xml"/>
|
||||
* </map:act>
|
||||
* <map:transform type="try-to-login-again-transformer">
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="mailto:bliong@melcoe.mq.edu.au">Bruc Liong, MELCOE</a>
|
||||
*/
|
||||
@@ -53,10 +57,21 @@ public class ShibbolethAction extends AbstractAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the user.
|
||||
* Attempt to authenticate the user.
|
||||
*
|
||||
* @param redirector redirector.
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel object model.
|
||||
* @param source source.
|
||||
* @param parameters sitemap parameters.
|
||||
* @return result of the action.
|
||||
* @throws org.apache.cocoon.sitemap.PatternException if authentication fails.
|
||||
* @throws java.lang.Exception passed through.
|
||||
*/
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
|
||||
String source, Parameters parameters) throws Exception
|
||||
String source, Parameters parameters)
|
||||
throws PatternException, Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -23,28 +23,32 @@ import org.dspace.app.xmlui.utils.AuthenticationUtil;
|
||||
/**
|
||||
*
|
||||
* This action will start the necessary steps to authenticate a user. After the user
|
||||
* successfuly authenticates, the user will resume this request with all parameters
|
||||
* successfully authenticates, the user will resume this request with all parameters
|
||||
* and attributes intact. An optional message can be added that will be displayed
|
||||
* on the login form. This could be used to provide a reason why the user is being
|
||||
* queried for a user name and password.
|
||||
*
|
||||
* Possible parameters are:
|
||||
*
|
||||
* header: An i18n message that will be used as the header for the message.
|
||||
*
|
||||
* message: An i18n message tag.
|
||||
*
|
||||
* characters: Characters to be displayed, possibly for untranslated error messages
|
||||
*
|
||||
*
|
||||
*
|
||||
* <p>Possible parameters are:
|
||||
*
|
||||
* <ul>
|
||||
* <li>header: An i18n message that will be used as the header for the message.
|
||||
* <li>message: An i18n message tag.
|
||||
* <li>characters: Characters to be displayed, possibly for untranslated error messages
|
||||
* </ul>
|
||||
*
|
||||
* <p>Example:
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:action name="StartAuthenticationAction" src="org.dspace.app.xmlui.eperson.StartAuthenticationAction"/>
|
||||
*
|
||||
*
|
||||
* <map:act type="StartAuthenticationAction"/>
|
||||
*
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Typically, this is used in conjunction with the AuthenticatedSelector as:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:select type="AuthenticatedSelector">
|
||||
* <map:when test="eperson">
|
||||
* ...
|
||||
@@ -55,6 +59,8 @@ import org.dspace.app.xmlui.utils.AuthenticationUtil;
|
||||
* </map:act>
|
||||
* </map:otherwise>
|
||||
* </map:select>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
@@ -63,7 +69,15 @@ public class StartAuthenticationAction extends AbstractAction
|
||||
{
|
||||
/**
|
||||
* Redirect the user to the login page.
|
||||
* @param redirector redirector.
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel object model.
|
||||
* @param source source.
|
||||
* @param parameters sitemap parameters.
|
||||
* @return result of the action.
|
||||
* @throws java.lang.Exception passed through.
|
||||
*/
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver,
|
||||
Map objectModel, String source, Parameters parameters)
|
||||
throws Exception
|
||||
|
@@ -28,15 +28,19 @@ import org.dspace.eperson.EPerson;
|
||||
* Unauthenticate the current user. There is no way this action will fail,
|
||||
* so any components inside the action will be executed.
|
||||
*
|
||||
* This action will always send an HTTP redirect to the DSpace homepage.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <p>This action will always send an HTTP redirect to the DSpace home page.
|
||||
*
|
||||
* <p>Example:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:action name="UnAuthenticateAction" src="org.dspace.app.xmlui.eperson.UnAuthenticateAction"/>
|
||||
*
|
||||
* <map:act type="UnAuthenticateAction">
|
||||
* <map:serialize type="xml"/>
|
||||
* </map:act>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
@@ -47,13 +51,16 @@ public class UnAuthenticateAction extends AbstractAction
|
||||
/**
|
||||
* Logout the current user.
|
||||
*
|
||||
* @param redirector
|
||||
* @param resolver
|
||||
* @param redirector redirector.
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel
|
||||
* Cocoon's object model
|
||||
* @param source
|
||||
* @param parameters
|
||||
* @param source source.
|
||||
* @param parameters sitemap parameters.
|
||||
* @return result of the action.
|
||||
* @throws java.lang.Exception passed through.
|
||||
*/
|
||||
@Override
|
||||
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
|
||||
String source, Parameters parameters) throws Exception
|
||||
{
|
||||
|
@@ -14,7 +14,6 @@ import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.selection.Selector;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.xmlui.utils.ContextUtil;
|
||||
import org.dspace.authorize.AuthorizeServiceImpl;
|
||||
import org.dspace.authorize.factory.AuthorizeServiceFactory;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.core.Context;
|
||||
@@ -23,11 +22,11 @@ import org.dspace.eperson.EPerson;
|
||||
/**
|
||||
* This simple selector operates on the authenticated DSpace user and selects
|
||||
* between two levels of access.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:selector name="AuthenticatedSelector" src="org.dspace.app.xmlui.AuthenticatedSelector"/>
|
||||
*
|
||||
*
|
||||
*
|
||||
* <map:select type="AuthenticatedSelector">
|
||||
* <map:when test="administrator">
|
||||
* ...
|
||||
@@ -39,11 +38,13 @@ import org.dspace.eperson.EPerson;
|
||||
* ...
|
||||
* </map:otherwise>
|
||||
* </map:select>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* There are only two defined test expressions: "administrator" and "eperson".
|
||||
* Remember an administrator is also an eperson so if you need to check for
|
||||
* Remember that an administrator is also an eperson, so if you need to check for
|
||||
* administrators distinct from epersons that select must come first.
|
||||
*
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
|
||||
@@ -51,9 +52,9 @@ public class AuthenticatedSelector extends AbstractLogEnabled implements
|
||||
Selector
|
||||
{
|
||||
|
||||
private static Logger log = Logger.getLogger(AuthenticatedSelector.class);
|
||||
private static final Logger log = Logger.getLogger(AuthenticatedSelector.class);
|
||||
|
||||
/** Test expressiots */
|
||||
/** Test expressions */
|
||||
public static final String EPERSON = "eperson";
|
||||
|
||||
public static final String ADMINISTRATOR = "administrator";
|
||||
@@ -62,7 +63,12 @@ public class AuthenticatedSelector extends AbstractLogEnabled implements
|
||||
|
||||
/**
|
||||
* Determine if the authenticated eperson matches the given expression.
|
||||
* @param expression the given expression.
|
||||
* @param objectModel object model.
|
||||
* @param parameters sitemap parameters.
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean select(String expression, Map objectModel,
|
||||
Parameters parameters)
|
||||
{
|
||||
|
@@ -37,29 +37,44 @@ import org.xml.sax.SAXException;
|
||||
* back to the indicated form fields in the window that launched it.
|
||||
* Some necessary logic is in JavaScript, see choice-control.js.
|
||||
*
|
||||
* Expected Parameters:
|
||||
* field - name of metadata field in "_" notation, eg: dc_contributor_author
|
||||
* value - maybe-partial value of field
|
||||
* formID - the @id of <form> tag in calling window containing the inputs we are to set.
|
||||
* valueInput - @name of input field in DOM for value.
|
||||
* authorityInput - @name of input field in DOM for authority value
|
||||
* isRepeating - true if metadata value can be repeated
|
||||
* isName - true if this is a name value (i.e. last/first boxes)
|
||||
* start - starting index, default 0
|
||||
* limit - maximum values to return, default 0 (none)
|
||||
* <p>Expected Parameters:
|
||||
* <dl>
|
||||
* <dt>field <dd>name of metadata field in "_" notation, eg: dc_contributor_author
|
||||
* <dt>value <dd>maybe-partial value of field
|
||||
* <dt>formID <dd>the @id of {@code <form>} tag in calling window containing the inputs we are to set.
|
||||
* <dt>valueInput <dd>@name of input field in DOM for value.
|
||||
* <dt>authorityInput <dd>@name of input field in DOM for authority value
|
||||
* <dt>isRepeating <dd>true if metadata value can be repeated
|
||||
* <dt>isName <dd>true if this is a name value (i.e. last/first boxes)
|
||||
* <dt>start <dd>starting index, default 0
|
||||
* <dt>limit <dd>maximum values to return, default 0 (none)
|
||||
* </dl>
|
||||
*
|
||||
* Configuration Properties:
|
||||
* xmlui.lookup.select.size = 12 (default, entries to show in SELECT widget.)
|
||||
* <p>Configuration Properties:
|
||||
* <ul>
|
||||
* <li>xmlui.lookup.select.size = 12 (default, entries to show in SELECT widget.)
|
||||
* </ul>
|
||||
*
|
||||
* For each FIELD, e.g. dc.contributor.author, these message properties
|
||||
* <p>For each FIELD, e.g. dc.contributor.author, these message properties
|
||||
* will OVERRIDE the corresponding i18n message catalog entries:
|
||||
* xmlui.lookup.field.FIELD.title = title of lookup page
|
||||
* <dl>
|
||||
* <dt>xmlui.lookup.field.FIELD.title
|
||||
* <dd>title of lookup page
|
||||
* (e.g. xmlui.lookup.field.dc_contributor_author.title = Author..)
|
||||
* xmlui.lookup.field.FIELD.nonauthority = template for "non-authority" label in options
|
||||
* xmlui.lookup.field.FIELD.help = help message for single input
|
||||
*
|
||||
* <dt>xmlui.lookup.field.FIELD.nonauthority
|
||||
* <dd>template for "non-authority" label in options
|
||||
*
|
||||
* <dt>xmlui.lookup.field.FIELD.help
|
||||
* <dd>help message for single input
|
||||
* (NOTE this is still required even for name inputs)
|
||||
* xmlui.lookup.field.FIELD.help.last = help message for last name of Name-oriented input
|
||||
* xmlui.lookup.field.FIELD.help.first = help message for first name of Name-oriented input
|
||||
*
|
||||
* <dt>xmlui.lookup.field.FIELD.help.last
|
||||
* <dd>help message for last name of Name-oriented input
|
||||
*
|
||||
* <dt>xmlui.lookup.field.FIELD.help.first
|
||||
* <dd>help message for first name of Name-oriented input
|
||||
* </dl>
|
||||
*
|
||||
* @author Larry Stone
|
||||
*/
|
||||
@@ -79,6 +94,7 @@ public class ChoiceLookupTransformer extends AbstractDSpaceTransformer
|
||||
|
||||
protected ChoiceAuthorityService choicheAuthorityService = ContentAuthorityServiceFactory.getInstance().getChoiceAuthorityService();
|
||||
|
||||
@Override
|
||||
public void addBody(Body body) throws SAXException, WingException,
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
@@ -250,6 +266,7 @@ public class ChoiceLookupTransformer extends AbstractDSpaceTransformer
|
||||
cancel.setValue(T_cancel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta) throws SAXException,
|
||||
WingException, UIException, SQLException, IOException,
|
||||
AuthorizeException
|
||||
|
@@ -24,8 +24,10 @@ import org.dspace.core.Constants;
|
||||
* returns true if the Item in the request has not been modified since that
|
||||
* date. The expression is ignored since the test is inherent in the request.
|
||||
*
|
||||
* Typical sitemap usage:
|
||||
* <p>Typical sitemap usage:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:match type="HandleTypeMatcher" pattern="item">
|
||||
* <map:select type="IfModifiedSinceSelector">
|
||||
* <map:when test="true">
|
||||
@@ -38,13 +40,15 @@ import org.dspace.core.Constants;
|
||||
* </map:otherwise>
|
||||
* </map:select>
|
||||
* </map:match>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Larry Stone
|
||||
*/
|
||||
public class IfModifiedSinceSelector implements Selector
|
||||
{
|
||||
|
||||
private static Logger log = Logger.getLogger(IfModifiedSinceSelector.class);
|
||||
private static final Logger log = Logger.getLogger(IfModifiedSinceSelector.class);
|
||||
|
||||
/**
|
||||
* Check for If-Modified-Since header on request,
|
||||
@@ -53,9 +57,12 @@ public class IfModifiedSinceSelector implements Selector
|
||||
*
|
||||
* @param expression is ignored
|
||||
* @param objectModel
|
||||
* environment passed through via cocoon
|
||||
* environment passed through via Cocoon.
|
||||
* @param parameters
|
||||
* sitemap parameters.
|
||||
* @return null or map containing value of sitemap parameter 'pattern'
|
||||
*/
|
||||
@Override
|
||||
public boolean select(String expression, Map objectModel,
|
||||
Parameters parameters)
|
||||
{
|
||||
|
@@ -21,32 +21,34 @@ import org.dspace.authorize.AuthorizeException;
|
||||
* this transformer is used after an action has been performed to let the
|
||||
* user know if an operation succeeded or failed.
|
||||
*
|
||||
* The possible paramaters are:
|
||||
*
|
||||
* outcome: The outcome determines whether the notice is positive or negative.
|
||||
* <p>The possible parameters are:
|
||||
*
|
||||
* <p>outcome: The outcome determines whether the notice is positive or negative.
|
||||
* Possible values are: "success", "failure", or "neutral". If no values are
|
||||
* supplied then neutral is assumed.
|
||||
*
|
||||
* header: An i18n dictionary key referencing the text that should be used
|
||||
*
|
||||
* <p>header: An i18n dictionary key referencing the text that should be used
|
||||
* as a header for this notice.
|
||||
*
|
||||
* message: An i18n dictionary key referencing the text that should be used as
|
||||
* <p>message: An i18n dictionary key referencing the text that should be used as
|
||||
* the content for this notice.
|
||||
*
|
||||
* characters: Plain text string that should be used as the content for this
|
||||
* <p>characters: Plain text string that should be used as the content for this
|
||||
* notice. Normally, all messages should be i18n dictionary keys, however this
|
||||
* parameter is useful for error messages that are not necessarily translated.
|
||||
*
|
||||
* All parameters are optional but you must supply at least the message or the
|
||||
* characters
|
||||
* <p>All parameters are optional but you must supply at least the message or the
|
||||
* characters.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Example:
|
||||
* <p>Example:
|
||||
* <pre>
|
||||
* {@code
|
||||
* <map:transformer type="notice">
|
||||
* <map:parameter name="outcome" value="success"/>
|
||||
* <map:parameter name="message" value="xmlui.<aspect>.<class>.<type>"/>
|
||||
* </map:transformer>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Scott Phillips
|
||||
* @author Alexey Maslov
|
||||
@@ -60,7 +62,11 @@ public class NoticeTransformer extends AbstractDSpaceTransformer
|
||||
|
||||
/**
|
||||
* Add the notice div to the body.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void addBody(Body body) throws WingException, SQLException, AuthorizeException
|
||||
{
|
||||
String outcome = parameters.getParameter("outcome",null);
|
||||
|
@@ -49,7 +49,7 @@ import org.xml.sax.SAXException;
|
||||
*/
|
||||
public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
{
|
||||
private static Logger log = Logger.getLogger(AbstractStep.class);
|
||||
private static final Logger log = Logger.getLogger(AbstractStep.class);
|
||||
|
||||
/** General Language Strings */
|
||||
protected static final Message T_submission_title =
|
||||
@@ -155,7 +155,16 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
*
|
||||
* If the implementer set any required parameters then ensure that
|
||||
* they are all present.
|
||||
*
|
||||
* @param resolver source resolver.
|
||||
* @param objectModel TBD
|
||||
* @param src TBD
|
||||
* @param parameters sitemap parameters.
|
||||
* @throws org.apache.cocoon.ProcessingException
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters)
|
||||
throws ProcessingException, SAXException, IOException
|
||||
{
|
||||
@@ -217,10 +226,17 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
|
||||
/**
|
||||
* Base pageMeta that is added to ALL submission stages
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
* @throws org.dspace.app.xmlui.utils.UIException passed through.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
* @throws java.io.IOException passed through.
|
||||
* @throws org.dspace.authorize.AuthorizeException passed through.
|
||||
*/
|
||||
public void addPageMeta(PageMeta pageMeta) throws SAXException,
|
||||
WingException, UIException, SQLException, IOException,
|
||||
AuthorizeException
|
||||
@Override
|
||||
public void addPageMeta(PageMeta pageMeta)
|
||||
throws SAXException, WingException, UIException, SQLException,
|
||||
IOException, AuthorizeException
|
||||
{
|
||||
if (submission instanceof WorkspaceItem)
|
||||
{
|
||||
@@ -258,6 +274,7 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
* Add a submission progress list to the current div for this step.
|
||||
*
|
||||
* @param div The division to add the list to.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addSubmissionProgressList(Division div) throws WingException
|
||||
{
|
||||
@@ -303,6 +320,7 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
* @param stepAndPage
|
||||
* The step and page (a double of the form 'step.page', e.g. 1.2)
|
||||
* which this button will jump back to
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addJumpButton(List list, Message buttonText, StepAndPage stepAndPage)
|
||||
throws WingException
|
||||
@@ -318,9 +336,9 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the "<-Previous", "Save/Cancel" and "Next->" buttons
|
||||
* to a given form. This method ensures that the same
|
||||
* default control/paging buttons appear on each submission page.
|
||||
* Adds the "{@literal <-Previous}", "{@literal Save/Cancel}" and
|
||||
* "{@literal Next->}" buttons to a given form. This method ensures that
|
||||
* the same default control/paging buttons appear on each submission page.
|
||||
* <P>
|
||||
* Note: A given step may define its own buttons as necessary,
|
||||
* and not call this method (since it must be explicitly invoked by
|
||||
@@ -328,6 +346,7 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
*
|
||||
* @param controls
|
||||
* The List which will contain all control buttons
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addControlButtons(List controls)
|
||||
throws WingException
|
||||
@@ -430,6 +449,8 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
* Find the maximum step and page that the user has
|
||||
* reached in the submission processes.
|
||||
* If this submission is a workflow then return max-int.
|
||||
* @return the maximum step and page reached.
|
||||
* @throws java.sql.SQLException passed through.
|
||||
*/
|
||||
public StepAndPage getMaxStepAndPageReached() throws SQLException {
|
||||
|
||||
@@ -460,11 +481,12 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
* Retrieve error fields from the list of parameters
|
||||
* and return a List of all fields which had errors
|
||||
*
|
||||
* @return java.util.List of field names with errors
|
||||
* @param parameters the list to search for error fields.
|
||||
* @return {@link java.util.List} of field names with errors
|
||||
*/
|
||||
public java.util.List<String> getErrorFields(Parameters parameters)
|
||||
{
|
||||
java.util.List<String> fields = new ArrayList<String>();
|
||||
java.util.List<String> fields = new ArrayList<>();
|
||||
|
||||
String errors = parameters.getParameter("error_fields","");
|
||||
|
||||
@@ -521,10 +543,7 @@ public abstract class AbstractStep extends AbstractDSpaceTransformer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recycle
|
||||
*/
|
||||
@Override
|
||||
public void recycle()
|
||||
{
|
||||
this.id = null;
|
||||
|
@@ -224,18 +224,22 @@ public abstract class AbstractDSpaceTransformer extends AbstractWingTransformer
|
||||
|
||||
/**
|
||||
* Generate a URL for the given base URL with the given parameters. This is
|
||||
* a convenance method to make it easier to generate URL references with
|
||||
* a convenience method to make it easier to generate URL references with
|
||||
* parameters.
|
||||
*
|
||||
* Example
|
||||
* <p>Example:
|
||||
*
|
||||
* <pre>{@code
|
||||
* Map<String,String> parameters = new Map<String,String>();
|
||||
* parameters.put("arg1","value1");
|
||||
* parameters.put("arg2","value2");
|
||||
* parameters.put("arg3","value3");
|
||||
* String url = genrateURL("/my/url",parameters);
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* would result in the string:
|
||||
* url == "/my/url?arg1=value1&arg2=value2&arg3=value3"
|
||||
*
|
||||
* <pre>{@code url == "/my/url?arg1=value1&arg2=value2&arg3=value3"}</pre>
|
||||
*
|
||||
* @param baseURL The baseURL without any parameters.
|
||||
* @param parameters The parameters to be encoded on in the URL.
|
||||
|
@@ -57,7 +57,7 @@ import org.xml.sax.helpers.NamespaceSupport;
|
||||
|
||||
public abstract class AbstractAdapter
|
||||
{
|
||||
/** Namespace declaration for METS & XLINK */
|
||||
/** Namespace declaration for METS and XLINK */
|
||||
public static final String METS_URI = "http://www.loc.gov/METS/";
|
||||
public static final Namespace METS = new Namespace(METS_URI);
|
||||
public static final String XLINK_URI = "http://www.w3.org/TR/xlink/";
|
||||
|
@@ -38,7 +38,7 @@ import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* This is an adapter which translates DSpace containers
|
||||
* (communities & collections) into METS documents. This adapter follows
|
||||
* (communities and collections) into METS documents. This adapter follows
|
||||
* the DSpace METS profile, however that profile does not define how a
|
||||
* community or collection should be described, but we make the obvious
|
||||
* decisions to deviate when necessary from the profile.
|
||||
|
@@ -29,10 +29,10 @@ import org.xml.sax.SAXException;
|
||||
* document. Unfortunately, there is no real definition of what this is. So
|
||||
* we just kind of made it up based upon what we saw for the item profile.
|
||||
*
|
||||
* The basic structure is simply two parts, the descriptive metadata and a
|
||||
* The basic structure is simply two parts: the descriptive metadata and a
|
||||
* structural map. The descriptive metadata is a place to put metadata about
|
||||
* the whole repository. The structural map is used to map relationships
|
||||
* between communities & collections in dspace.
|
||||
* between communities and collections in DSpace.
|
||||
*
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
|
@@ -26,10 +26,10 @@ import org.dspace.eperson.Group;
|
||||
* This is a validity object specifically implemented for the caching
|
||||
* needs of DSpace, Manakin, and Cocoon.
|
||||
*
|
||||
* <p>The basic idea is that each time a DSpace object rendered by a Cocoon
|
||||
* component the object and everything about it that makes it unique should
|
||||
* <p>The basic idea is that, each time a DSpace object is rendered by a Cocoon
|
||||
* component, the object and everything about it that makes it unique should
|
||||
* be reflected in the validity object for the component. By following this
|
||||
* principle if the object has been updated externally then the cache will be
|
||||
* principle, if the object has been updated externally then the cache will be
|
||||
* invalidated.
|
||||
*
|
||||
* <p>This DSpaceValidity object makes this processes easier by abstracting out
|
||||
@@ -215,14 +215,19 @@ public class DSpaceValidity implements SourceValidity
|
||||
* validity object is created.
|
||||
*
|
||||
* Below are the following transitive rules for adding
|
||||
* objects, i.e. if an item is added then all the items
|
||||
* bundles & bitstreams will also be added.
|
||||
* objects, i.e. if an item is added then all the item's
|
||||
* bundles and bitstreams will also be added.
|
||||
*
|
||||
* Communities -> logo bitstream
|
||||
* Collection -> logo bitstream
|
||||
* Item -> bundles -> bitstream
|
||||
* Bundles -> bitstreams
|
||||
* EPeople -> groups
|
||||
* <p>
|
||||
* {@literal Communities -> logo bitstream}
|
||||
* <br>
|
||||
* {@literal Collection -> logo bitstream}
|
||||
* <br>
|
||||
* {@literal Item -> bundles -> bitstream}
|
||||
* <br>
|
||||
* {@literal Bundles -> bitstreams}
|
||||
* <br>
|
||||
* {@literal EPeople -> groups}
|
||||
*
|
||||
* @param context
|
||||
* session context.
|
||||
@@ -410,8 +415,9 @@ public class DSpaceValidity implements SourceValidity
|
||||
|
||||
/**
|
||||
* Determine if the cache is still valid
|
||||
* @return {@link SourceValidity.VALID}, {@link SourceValidity.UNKNOWN},
|
||||
* or {@link SourceValidity.INVALID}.
|
||||
* @return {@link org.apache.excalibur.source.SourceValidity#VALID},
|
||||
* {@link org.apache.excalibur.source.SourceValidity#UNKNOWN},
|
||||
* or {@link org.apache.excalibur.source.SourceValidity#INVALID}.
|
||||
*/
|
||||
@Override
|
||||
public int isValid()
|
||||
@@ -446,7 +452,8 @@ public class DSpaceValidity implements SourceValidity
|
||||
*
|
||||
* @param otherObject
|
||||
* The other validity object.
|
||||
* @return {@link SourceValidity.VALID} or {@link SourceValidity.INVALID}.
|
||||
* @return {@link org.apache.excalibur.source.SourceValidity#VALID}
|
||||
* or {@link org.apache.excalibur.source.SourceValidity#INVALID}.
|
||||
*/
|
||||
@Override
|
||||
public int isValid(SourceValidity otherObject)
|
||||
|
@@ -71,7 +71,7 @@ public class Data extends AbstractWingElement
|
||||
* where to route SAX events and what i18n catalogue to use.
|
||||
* @param message
|
||||
* (Required) translatable data
|
||||
* @throws WingException
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected Data(WingContext context, Message message)
|
||||
throws WingException
|
||||
@@ -89,7 +89,7 @@ public class Data extends AbstractWingElement
|
||||
* where to route SAX events and what i18n catalogue to use.
|
||||
* @param characters
|
||||
* (Required) Untranslated character data.
|
||||
* @throws WingException
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected Data(WingContext context, String characters) throws WingException
|
||||
{
|
||||
|
@@ -164,7 +164,7 @@ public class Division extends AbstractWingElement implements StructuralElement,
|
||||
public static final String[] METHODS = { METHOD_GET, METHOD_POST,
|
||||
METHOD_MULTIPART };
|
||||
|
||||
/** The possible pagination types: simple & masked */
|
||||
/** The possible pagination types: simple and masked */
|
||||
public static final String PAGINATION_SIMPLE = "simple";
|
||||
|
||||
public static final String PAGINATION_MASKED = "masked";
|
||||
|
@@ -64,7 +64,7 @@ public class Figure extends TextContainer implements StructuralElement
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws WingException
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected Figure(WingContext context, String source, String target,
|
||||
String rend) throws WingException
|
||||
|
@@ -58,11 +58,11 @@ public class Highlight extends RichTextContainer implements StructuralElement
|
||||
* events should be routed to the contentHandler found in the WingContext.
|
||||
*
|
||||
* @param contentHandler
|
||||
* (Required) The registered contentHandler where SAX events
|
||||
* should be routed too.
|
||||
* (Required) The registered contentHandler to which SAX events
|
||||
* should be routed.
|
||||
* @param lexicalHandler
|
||||
* (Required) The registered lexicalHandler where lexical
|
||||
* events (such as CDATA, DTD, etc) should be routed too.
|
||||
* (Required) The registered lexicalHandler to which lexical
|
||||
* events (such as CDATA, DTD, etc) should be routed.
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
|
@@ -34,7 +34,8 @@ public class Instance extends Container
|
||||
* Construct a new field value, when used in a multiple value context
|
||||
*
|
||||
* @param context
|
||||
* (Required) The context this element is contained in
|
||||
* (Required) The context this element is contained in.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Instance(WingContext context) throws WingException
|
||||
{
|
||||
@@ -48,6 +49,8 @@ public class Instance extends Container
|
||||
|
||||
/**
|
||||
* Set the raw value of the field removing any previous raw values.
|
||||
* @return the new Value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setValue() throws WingException
|
||||
{
|
||||
@@ -62,6 +65,7 @@ public class Instance extends Container
|
||||
*
|
||||
* @param characters
|
||||
* (May be null) Field value as a string
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setValue(String characters) throws WingException
|
||||
{
|
||||
@@ -75,6 +79,7 @@ public class Instance extends Container
|
||||
* @param message
|
||||
* (Required) A key into the i18n catalogue for translation into
|
||||
* the user's preferred language.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setValue(Message message) throws WingException
|
||||
{
|
||||
@@ -89,6 +94,7 @@ public class Instance extends Container
|
||||
*
|
||||
* @param checked
|
||||
* (Required) Whether the checkbox is checked or not.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setValue(boolean checked) throws WingException
|
||||
{
|
||||
@@ -100,6 +106,8 @@ public class Instance extends Container
|
||||
/**
|
||||
* Set the authority value of the field removing any previous authority values.
|
||||
* Initialized to an empty value.
|
||||
* @return the new authority Value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setAuthorityValue() throws WingException
|
||||
{
|
||||
@@ -111,6 +119,9 @@ public class Instance extends Container
|
||||
*
|
||||
* @param characters
|
||||
* (May be null) Field value as a string
|
||||
* @param confidence measure of confidence.
|
||||
* @return the new Value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setAuthorityValue(String characters, String confidence) throws WingException
|
||||
{
|
||||
@@ -126,6 +137,7 @@ public class Instance extends Container
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The return value of the option to be selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setOptionSelected(String returnValue) throws WingException
|
||||
{
|
||||
@@ -138,6 +150,7 @@ public class Instance extends Container
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The return value of the option to be selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setOptionSelected(int returnValue) throws WingException
|
||||
{
|
||||
@@ -151,6 +164,8 @@ public class Instance extends Container
|
||||
/**
|
||||
* Set the interpreted value of the field removing any previous interpreted
|
||||
* values.
|
||||
* @return the new Value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setInterpretedValue() throws WingException
|
||||
{
|
||||
@@ -166,6 +181,7 @@ public class Instance extends Container
|
||||
*
|
||||
* @param characters
|
||||
* (May be null) Field value as a string
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setInterpretedValue(String characters) throws WingException
|
||||
{
|
||||
@@ -180,6 +196,7 @@ public class Instance extends Container
|
||||
* @param message
|
||||
* (Required) A key into the i18n catalogue for translation into
|
||||
* the user's preferred language.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setInterpretedValue(Message message) throws WingException
|
||||
{
|
||||
@@ -198,6 +215,8 @@ public class Instance extends Container
|
||||
*
|
||||
* @param option
|
||||
* (Required) The return value of the selected option.
|
||||
* @return the new Value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value addOptionValue(String option) throws WingException
|
||||
{
|
||||
@@ -215,6 +234,7 @@ public class Instance extends Container
|
||||
* (Required) determine if the value is selected or not.
|
||||
* @param characters
|
||||
* (may be null) The returned value for this field, if selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setCheckedValue(boolean checked, String characters) throws WingException
|
||||
{
|
||||
@@ -238,8 +258,10 @@ public class Instance extends Container
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler,
|
||||
LexicalHandler lexicalHandler, NamespaceSupport namespaces)
|
||||
throws SAXException
|
||||
@@ -257,7 +279,7 @@ public class Instance extends Container
|
||||
*/
|
||||
private void removeValueOfType(String removeType)
|
||||
{
|
||||
List<Value> found = new ArrayList<Value>();
|
||||
List<Value> found = new ArrayList<>();
|
||||
for (AbstractWingElement awe : contents)
|
||||
{
|
||||
if (awe instanceof Value)
|
||||
|
@@ -33,10 +33,10 @@ public class Item extends RichTextContainer implements StructuralElement
|
||||
public static final String E_ITEM = "item";
|
||||
|
||||
/** the item's name */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** Special rendering hints for this item */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/**
|
||||
* Construct a new item.
|
||||
@@ -49,6 +49,7 @@ public class Item extends RichTextContainer implements StructuralElement
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Item(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
@@ -72,7 +73,9 @@ public class Item extends RichTextContainer implements StructuralElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
|
@@ -29,10 +29,10 @@ public class Label extends TextContainer implements StructuralElement
|
||||
public static final String E_LABEL = "label";
|
||||
|
||||
/** The label's name */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** Special rendering hints */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/**
|
||||
* Construct a new label.
|
||||
@@ -44,7 +44,7 @@ public class Label extends TextContainer implements StructuralElement
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws WingException
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected Label(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
@@ -67,7 +67,9 @@ public class Label extends TextContainer implements StructuralElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
|
@@ -91,19 +91,19 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
TYPE_BULLETED, TYPE_GLOSS, TYPE_PROGRESS, TYPE_FORM, TYPE_DSO_LIST };
|
||||
|
||||
/** The list's name */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** The list's type, see types above. * */
|
||||
private String type;
|
||||
private final String type;
|
||||
|
||||
/** Any special rendering instructions * */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/** The lists head * */
|
||||
private Head head;
|
||||
|
||||
/** All content of this container, items & lists */
|
||||
private java.util.List<AbstractWingElement> contents = new ArrayList<AbstractWingElement>();
|
||||
private java.util.List<AbstractWingElement> contents = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new list.
|
||||
@@ -123,6 +123,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element. There are a set of predefined
|
||||
* rendering values, see the class documentation above.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected List(WingContext context, String name, String type, String rend)
|
||||
throws WingException
|
||||
@@ -143,12 +144,14 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* Set the head element which is the label associated with this list. This
|
||||
* method should be called before any other elements have been added to the
|
||||
* list.
|
||||
* @return the new Head.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Head setHead() throws WingException
|
||||
{
|
||||
Head head = new Head(context, null);
|
||||
this.head = head;
|
||||
return head;
|
||||
Head newHead = new Head(context, null);
|
||||
this.head = newHead;
|
||||
return newHead;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,11 +162,12 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param characters
|
||||
* (Required) Untranslated character data to be included as the
|
||||
* list's head.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setHead(String characters) throws WingException
|
||||
{
|
||||
Head head = setHead();
|
||||
head.addContent(characters);
|
||||
Head newHead = setHead();
|
||||
newHead.addContent(characters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,11 +178,12 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param key
|
||||
* (Required) Key to the i18n catalogue to translate the content
|
||||
* into the language preferred by the user.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setHead(Message key) throws WingException
|
||||
{
|
||||
Head head = setHead();
|
||||
head.addContent(key);
|
||||
Head newHead = setHead();
|
||||
newHead.addContent(key);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,6 +197,8 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @return the new Label.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Label addLabel(String name, String rend) throws WingException
|
||||
{
|
||||
@@ -207,6 +214,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
*
|
||||
* @param characters
|
||||
* (Required) Untranslated character data to be included.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addLabel(String characters) throws WingException
|
||||
{
|
||||
@@ -224,6 +232,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* bullet. This version of label provides no textual label but may be used
|
||||
* to indicate some implicit labeling such as ordered lists.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addLabel() throws WingException
|
||||
{
|
||||
@@ -239,6 +248,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param key
|
||||
* (Required) Key to the i18n catalogue to translate the content
|
||||
* into the language preferred by the user.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addLabel(Message key) throws WingException
|
||||
{
|
||||
@@ -253,6 +263,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* Add an empty unnamed item.
|
||||
*
|
||||
* @return a new Item
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Item addItem() throws WingException
|
||||
{
|
||||
@@ -273,6 +284,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element. *
|
||||
* @return a new Item
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Item addItem(String name, String rend) throws WingException
|
||||
{
|
||||
@@ -286,6 +298,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
*
|
||||
* @param characters
|
||||
* (Required) Untranslated character data to be included.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addItem(String characters) throws WingException
|
||||
{
|
||||
@@ -302,6 +315,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param key
|
||||
* (Required) Key to the i18n catalogue to translate the content
|
||||
* into the language preferred by the user.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addItem(Message key) throws WingException
|
||||
{
|
||||
@@ -320,6 +334,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param characters
|
||||
* (Required) Untranslated character data to be included as the
|
||||
* link's body.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addItemXref(String target, String characters)
|
||||
throws WingException
|
||||
@@ -337,6 +352,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* @param key
|
||||
* (Required) i18n key for translating content into the user's
|
||||
* preferred language.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addItemXref(String target, Message key) throws WingException
|
||||
{
|
||||
@@ -358,6 +374,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @return A new sub list.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public List addList(String name, String type, String rend)
|
||||
throws WingException
|
||||
@@ -377,6 +394,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* (May be null) determines the list type. If this is blank the
|
||||
* list type is inferred from the context and use.
|
||||
* @return A new sub list.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public List addList(String name, String type)
|
||||
throws WingException
|
||||
@@ -393,14 +411,13 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* (Required) a local identifier used to differentiate the
|
||||
* element from its siblings.
|
||||
* @return A new sub list.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public List addList(String name) throws WingException
|
||||
{
|
||||
return addList(name, null, null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Determine if the given SAX startElement event is equivalent to this list.
|
||||
*
|
||||
@@ -414,6 +431,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* The element's attributes
|
||||
* @return True if this list is equivalent to the given SAX Event.
|
||||
*/
|
||||
@Override
|
||||
public boolean mergeEqual(String namespace, String localName, String qName,
|
||||
Attributes attributes)
|
||||
{
|
||||
@@ -426,16 +444,12 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
{
|
||||
return false;
|
||||
}
|
||||
String name = attributes.getValue(A_NAME);
|
||||
if (name == null)
|
||||
String theName = attributes.getValue(A_NAME);
|
||||
if (theName == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!name.equals(this.name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return theName.equals(this.name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -455,6 +469,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* The element's attributes
|
||||
* @return The child element
|
||||
*/
|
||||
@Override
|
||||
public WingMergeableElement mergeChild(String namespace, String localName,
|
||||
String qName, Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
@@ -491,6 +506,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
*
|
||||
* @return The attributes for this merged element
|
||||
*/
|
||||
@Override
|
||||
public Attributes merge(Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
{
|
||||
@@ -512,6 +528,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -550,9 +567,7 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
if (head != null)
|
||||
|
@@ -55,6 +55,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
* Set a new user oriented metadata set.
|
||||
*
|
||||
* @return The user oriented metadata set.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException never.
|
||||
*/
|
||||
public UserMeta setUserMeta() throws WingException
|
||||
{
|
||||
@@ -65,6 +66,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
* Set a new page oriented metadata set.
|
||||
*
|
||||
* @return The page oriented metadata set.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException never.
|
||||
*/
|
||||
public PageMeta setPageMeta() throws WingException
|
||||
{
|
||||
@@ -75,6 +77,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
* Set a new repository oriented metadata set.
|
||||
*
|
||||
* @return The repository oriented metadata set.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException never.
|
||||
*/
|
||||
public RepositoryMeta setRepositoryMeta() throws WingException
|
||||
{
|
||||
@@ -94,6 +97,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
* The element's attributes
|
||||
* @return True if this WingElement is equivalent to the given SAX Event.
|
||||
*/
|
||||
@Override
|
||||
public boolean mergeEqual(String namespace, String localName, String qName,
|
||||
Attributes attributes) throws SAXException, WingException
|
||||
{
|
||||
@@ -102,12 +106,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!E_META.equals(localName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return E_META.equals(localName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,6 +122,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
* The element's attributes
|
||||
* @return The child element
|
||||
*/
|
||||
@Override
|
||||
public WingMergeableElement mergeChild(String namespace, String localName,
|
||||
String qName, Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
@@ -132,9 +132,9 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
&& this.userMeta.mergeEqual(namespace, localName, qName,
|
||||
attributes))
|
||||
{
|
||||
UserMeta userMeta = this.userMeta;
|
||||
UserMeta thisUserMeta = this.userMeta;
|
||||
this.userMeta = null;
|
||||
return userMeta;
|
||||
return thisUserMeta;
|
||||
}
|
||||
|
||||
// page
|
||||
@@ -142,9 +142,9 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
&& this.pageMeta.mergeEqual(namespace, localName, qName,
|
||||
attributes))
|
||||
{
|
||||
PageMeta pageMeta = this.pageMeta;
|
||||
PageMeta thisPageMeta = this.pageMeta;
|
||||
this.pageMeta = null;
|
||||
return pageMeta;
|
||||
return thisPageMeta;
|
||||
}
|
||||
|
||||
// repository
|
||||
@@ -152,9 +152,9 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
&& this.repositoryMeta.mergeEqual(namespace, localName, qName,
|
||||
attributes))
|
||||
{
|
||||
RepositoryMeta repositoryMeta = this.repositoryMeta;
|
||||
RepositoryMeta thisRepositoryMeta = this.repositoryMeta;
|
||||
this.repositoryMeta = null;
|
||||
return repositoryMeta;
|
||||
return thisRepositoryMeta;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -165,6 +165,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
*
|
||||
* @return The attributes for this merged element
|
||||
*/
|
||||
@Override
|
||||
public Attributes merge(Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
{
|
||||
@@ -185,6 +186,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -212,9 +214,7 @@ public class Meta extends AbstractWingElement implements WingMergeableElement
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
if (this.userMeta != null)
|
||||
|
@@ -38,24 +38,26 @@ public class Metadata extends TextContainer implements MetadataElement
|
||||
public static final String A_LANGUAGE = "lang";
|
||||
|
||||
/** The metadata's element */
|
||||
private String element;
|
||||
private final String element;
|
||||
|
||||
/** The metadata's qualifier */
|
||||
private String qualifier;
|
||||
private final String qualifier;
|
||||
|
||||
/** The metadata's language */
|
||||
private String language;
|
||||
private final String language;
|
||||
|
||||
/**
|
||||
* Determine the additive model for the metadata, should
|
||||
* the metadata always be added to the document or only if
|
||||
* it does not already exist?
|
||||
*/
|
||||
private boolean allowMultiple;
|
||||
private final boolean allowMultiple;
|
||||
|
||||
/**
|
||||
* Construct a new metadata.
|
||||
*
|
||||
* @param context
|
||||
* (Required) The request context.
|
||||
* @param element
|
||||
* (Required) The element of this metadata
|
||||
* @param qualifier
|
||||
@@ -65,6 +67,7 @@ public class Metadata extends TextContainer implements MetadataElement
|
||||
* @param allowMultiple
|
||||
* (Required) Are multiple metadata elements with the same element,
|
||||
* qualifier, and language allowed?
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Metadata(WingContext context, String element, String qualifier,
|
||||
String language, boolean allowMultiple) throws WingException
|
||||
@@ -80,6 +83,8 @@ public class Metadata extends TextContainer implements MetadataElement
|
||||
* If an metadata with the same element, qualifier, and language exist
|
||||
* within the document should this metadata element be added into the
|
||||
* document or should only one metadata be allowed.
|
||||
*
|
||||
* @return true if multiple values are allowed.
|
||||
*/
|
||||
protected boolean allowMultiple()
|
||||
{
|
||||
@@ -162,7 +167,9 @@ public class Metadata extends TextContainer implements MetadataElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
|
@@ -27,10 +27,9 @@ public class Option extends TextContainer
|
||||
|
||||
/** The name of the return value attribute */
|
||||
public static final String A_RETURN_VALUE = "returnValue";
|
||||
|
||||
|
||||
/** The submited value for this option */
|
||||
private String returnValue;
|
||||
|
||||
/** The submitted value for this option */
|
||||
private final String returnValue;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -39,6 +38,7 @@ public class Option extends TextContainer
|
||||
* (Required) The context this element is contained in
|
||||
* @param returnValue
|
||||
* (may be null) The options return value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Option(WingContext context, String returnValue) throws WingException
|
||||
{
|
||||
@@ -60,8 +60,9 @@ public class Option extends TextContainer
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler,
|
||||
LexicalHandler lexicalHandler, NamespaceSupport namespaces)
|
||||
throws SAXException
|
||||
|
@@ -49,7 +49,7 @@ public class Options extends AbstractWingElement implements
|
||||
|
||||
/**
|
||||
* Add a new sublist to this item. Note that an item may contain either
|
||||
* characters (with formating & fields) or lists but not both.
|
||||
* characters (with formating and fields) or lists but not both.
|
||||
*
|
||||
* @param name
|
||||
* (Required) a local identifier used to differentiate the
|
||||
@@ -74,7 +74,7 @@ public class Options extends AbstractWingElement implements
|
||||
|
||||
/**
|
||||
* Add a new sublist to this item. Note that an item may contain either
|
||||
* characters (with formating & fields) or lists but not both.
|
||||
* characters (with formating and fields) or lists but not both.
|
||||
*
|
||||
* @param name
|
||||
* (Required) a local identifier used to differentiate the
|
||||
|
@@ -40,8 +40,8 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* metadata. Each of these types are separated so that
|
||||
* we can search through each time as we merge documents.
|
||||
*/
|
||||
private List<Metadata> metadatum = new ArrayList<Metadata>();
|
||||
private List<Trail> trails = new ArrayList<Trail>();
|
||||
private List<Metadata> metadatum = new ArrayList<>();
|
||||
private List<Trail> trails = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new pageMeta
|
||||
@@ -49,6 +49,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* @param context
|
||||
* (Required) The context this element is contained in, such as
|
||||
* where to route SAX events and what i18n catalogue to use.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected PageMeta(WingContext context) throws WingException
|
||||
{
|
||||
@@ -68,6 +69,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* (Required) determine if multiple metadata elements with the same
|
||||
* element, qualifier and language are allowed.
|
||||
* @return A new metadata
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Metadata addMetadata(String element, String qualifier,
|
||||
String language, boolean allowMultiple) throws WingException
|
||||
@@ -87,6 +89,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* @param language
|
||||
* (May be null) The metadata language
|
||||
* @return A new metadata
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Metadata addMetadata(String element, String qualifier, String language)
|
||||
throws WingException
|
||||
@@ -102,6 +105,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* @param qualifier
|
||||
* (May be null) The metadata qualifier.
|
||||
* @return A new metadata
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Metadata addMetadata(String element, String qualifier)
|
||||
throws WingException
|
||||
@@ -115,6 +119,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* @param element
|
||||
* (Required) The metadata element.
|
||||
* @return A new metadata
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Metadata addMetadata(String element) throws WingException
|
||||
{
|
||||
@@ -129,6 +134,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* @param rend
|
||||
* (May be null) Special rendering instructions
|
||||
* @return a new trail
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Trail addTrail(String target, String rend)
|
||||
throws WingException
|
||||
@@ -142,6 +148,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* Add a new trail to the page without a link or render attribute.
|
||||
*
|
||||
* @return a new trail
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Trail addTrail()
|
||||
throws WingException
|
||||
@@ -156,6 +163,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* (May be null) The Target URL for this trail item.
|
||||
* @param characters
|
||||
* (May be null) The textual contents of this trail item.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addTrailLink(String target, String characters)
|
||||
throws WingException
|
||||
@@ -172,6 +180,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* @param message
|
||||
* (Required) The textual contents of this trail item to be
|
||||
* translated
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addTrailLink(String target, Message message)
|
||||
throws WingException
|
||||
@@ -193,6 +202,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* The element's attributes
|
||||
* @return True if this WingElement is equivalent to the given SAX Event.
|
||||
*/
|
||||
@Override
|
||||
public boolean mergeEqual(String namespace, String localName, String qName,
|
||||
Attributes attributes) throws SAXException, WingException
|
||||
{
|
||||
@@ -202,17 +212,13 @@ public class PageMeta extends AbstractWingElement implements
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!E_PAGE_META.equals(localName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return E_PAGE_META.equals(localName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Since metadata can not be merged there are no mergeable children. This
|
||||
* just return's null.
|
||||
*
|
||||
* just returns null.
|
||||
*
|
||||
* @param namespace
|
||||
* The element's name space
|
||||
* @param localName
|
||||
@@ -223,6 +229,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* The element's attributes
|
||||
* @return The child element
|
||||
*/
|
||||
@Override
|
||||
public WingMergeableElement mergeChild(String namespace, String localName,
|
||||
String qName, Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
@@ -245,7 +252,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
String qualifier = attributes.getValue(Metadata.A_QUALIFIER);
|
||||
String language = attributes.getValue(Metadata.A_LANGUAGE);
|
||||
|
||||
List<Metadata> remove = new ArrayList<Metadata>();
|
||||
List<Metadata> remove = new ArrayList<>();
|
||||
for (Metadata metadata : metadatum)
|
||||
{
|
||||
if (metadata.equals(element,qualifier,language) && !metadata.allowMultiple())
|
||||
@@ -268,6 +275,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
/**
|
||||
* Inform this element that it is being merged with an existing element.
|
||||
*/
|
||||
@Override
|
||||
public Attributes merge(Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
{
|
||||
@@ -288,6 +296,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -312,9 +321,7 @@ public class PageMeta extends AbstractWingElement implements
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
for (Metadata metadata : metadatum)
|
||||
|
@@ -31,10 +31,10 @@ public class Para extends RichTextContainer implements StructuralElement
|
||||
public static final String E_PARA = "p";
|
||||
|
||||
/** The para's name */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** Any special rendering instructions for the para */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/**
|
||||
* Construct a new paragraph. Typically names for paragraphs are not
|
||||
@@ -52,6 +52,7 @@ public class Para extends RichTextContainer implements StructuralElement
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Para(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
@@ -75,8 +76,10 @@ public class Para extends RichTextContainer implements StructuralElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
|
@@ -139,6 +139,7 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
* @param context
|
||||
* (Required) The context this element is contained in, such as
|
||||
* where to route SAX events and what i18n catalogue to use.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*
|
||||
*/
|
||||
protected Params(WingContext context) throws WingException
|
||||
@@ -150,6 +151,7 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
* Enable the add operation for this field set. When this is enabled the
|
||||
* front end will add a button to add more items to the field.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException never.
|
||||
*/
|
||||
public void enableAddOperation() throws WingException
|
||||
{
|
||||
@@ -161,6 +163,7 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
* the front end will provide a way for the user to select fields (probably
|
||||
* checkboxes) along with a submit button to delete the selected fields.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException never.
|
||||
*/
|
||||
public void enableDeleteOperation()throws WingException
|
||||
{
|
||||
@@ -301,7 +304,7 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
/**
|
||||
* Set the field's autofocus attribute, an HTML5 feature.
|
||||
* Valid input values to enable autofocus are: autofocus, and empty string.
|
||||
* @param value
|
||||
* @param value "autofocus" or empty.
|
||||
*/
|
||||
public void setAutofocus(String value)
|
||||
{
|
||||
@@ -322,6 +325,7 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
* select vs. suggest. Value must match one of the PRESENTATIONS.
|
||||
*
|
||||
* @param value pre-determined metadata field key
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setChoicesPresentation(String value)
|
||||
throws WingException
|
||||
@@ -364,7 +368,9 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler,
|
||||
LexicalHandler lexicalHandler, NamespaceSupport namespaces)
|
||||
throws SAXException
|
||||
@@ -400,8 +406,6 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
attributes.put(A_OPERATIONS, operations);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (this.returnValue != null)
|
||||
{
|
||||
attributes.put(A_RETURN_VALUE, this.returnValue);
|
||||
@@ -412,7 +416,6 @@ public class Params extends AbstractWingElement implements StructuralElement
|
||||
attributes.put(A_SIZE, this.size);
|
||||
}
|
||||
|
||||
|
||||
if (!this.evtBehavior.equals(""))
|
||||
{
|
||||
attributes.put(A_EVTBEHAVIOR, this.evtBehavior);
|
||||
|
@@ -35,6 +35,7 @@ public class Password extends Field
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Password(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
|
@@ -37,6 +37,7 @@ public class Radio extends Field
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Radio(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
@@ -49,6 +50,7 @@ public class Radio extends Field
|
||||
* Enable the add operation for this field. When this is enabled the
|
||||
* front end will add a button to add more items to the field.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void enableAddOperation() throws WingException
|
||||
{
|
||||
@@ -60,24 +62,21 @@ public class Radio extends Field
|
||||
* the front end will provide a way for the user to select fields (probably
|
||||
* checkboxes) along with a submit button to delete the selected fields.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void enableDeleteOperation()throws WingException
|
||||
{
|
||||
this.params.enableDeleteOperation();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add an option.
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @return the new option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through
|
||||
*/
|
||||
public Option addOption(String returnValue)
|
||||
throws WingException
|
||||
@@ -96,6 +95,8 @@ public class Radio extends Field
|
||||
* @param returnValue
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @return the new option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Option addOption(boolean selected, String returnValue)
|
||||
throws WingException
|
||||
@@ -115,6 +116,7 @@ public class Radio extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(String returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -132,6 +134,7 @@ public class Radio extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected,String returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -150,6 +153,7 @@ public class Radio extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(int returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -167,6 +171,7 @@ public class Radio extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected, int returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -184,7 +189,8 @@ public class Radio extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(String returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -201,7 +207,8 @@ public class Radio extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected, String returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -219,7 +226,8 @@ public class Radio extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(int returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -236,7 +244,8 @@ public class Radio extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected, int returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -252,6 +261,7 @@ public class Radio extends Field
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The return value of the option to be selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setOptionSelected(String returnValue) throws WingException
|
||||
{
|
||||
@@ -264,20 +274,18 @@ public class Radio extends Field
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The return value of the option to be selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setOptionSelected(int returnValue) throws WingException
|
||||
{
|
||||
Value value = new Value(context,Value.TYPE_OPTION,String.valueOf(returnValue));
|
||||
values.add(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add a field instance
|
||||
* @return instance
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Instance addInstance() throws WingException
|
||||
{
|
||||
|
@@ -51,7 +51,7 @@ public class Reference extends AbstractWingElement implements
|
||||
private String type;
|
||||
|
||||
/** All content of this container */
|
||||
private java.util.List<AbstractWingElement> contents = new ArrayList<AbstractWingElement>();
|
||||
private java.util.List<AbstractWingElement> contents = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new object reference.
|
||||
@@ -62,6 +62,8 @@ public class Reference extends AbstractWingElement implements
|
||||
*
|
||||
* @param object
|
||||
* (Required) The referenced object.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException
|
||||
* if the object cannot be managed.
|
||||
*/
|
||||
protected Reference(WingContext context, Object object)
|
||||
throws WingException
|
||||
@@ -98,6 +100,8 @@ public class Reference extends AbstractWingElement implements
|
||||
* @param render
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @return the new set.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public ReferenceSet addReferenceSet(String type, String orderBy, String render)
|
||||
throws WingException
|
||||
@@ -115,6 +119,8 @@ public class Reference extends AbstractWingElement implements
|
||||
* (required) The reference type, see referenceSet.TYPES
|
||||
* @param orderBy
|
||||
* (May be null) A statement of ordering for reference sets.
|
||||
* @return the new set.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public ReferenceSet addReferenceSet(String type, String orderBy)
|
||||
throws WingException
|
||||
@@ -127,6 +133,8 @@ public class Reference extends AbstractWingElement implements
|
||||
*
|
||||
* @param type
|
||||
* (required) The include type, see includeSet.TYPES
|
||||
* @return the new set.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public ReferenceSet addReferenceSet(String type) throws WingException
|
||||
{
|
||||
@@ -145,7 +153,9 @@ public class Reference extends AbstractWingElement implements
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -167,9 +177,7 @@ public class Reference extends AbstractWingElement implements
|
||||
endElement(contentHandler, namespaces, E_REFERENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
if (contents != null)
|
||||
|
@@ -49,22 +49,22 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
public static final String[] TYPES = { TYPE_SUMMARY_LIST, TYPE_SUMMARY_VIEW, TYPE_DETAIL_LIST, TYPE_DETAIL_VIEW };
|
||||
|
||||
/** The name assigned to this metadata set */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** The ordering mechanism to use. */
|
||||
private String orderBy;
|
||||
private final String orderBy;
|
||||
|
||||
/** The reference type, see TYPES defined above */
|
||||
private String type;
|
||||
private final String type;
|
||||
|
||||
/** Special rendering instructions */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/** The head label for this referenceset */
|
||||
/** The head label for this reference set */
|
||||
private Head head;
|
||||
|
||||
/** All content of this container, items & lists */
|
||||
private java.util.List<AbstractWingElement> contents = new ArrayList<AbstractWingElement>();
|
||||
private java.util.List<AbstractWingElement> contents = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new referenceSet
|
||||
@@ -86,6 +86,7 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected ReferenceSet(WingContext context, boolean childreference, String name, String type, String orderBy, String rend)
|
||||
throws WingException
|
||||
@@ -109,25 +110,26 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
|
||||
/**
|
||||
* Set the head element which is the label associated with this referenceset.
|
||||
* @return the new head.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Head setHead() throws WingException
|
||||
{
|
||||
this.head = new Head(context, null);
|
||||
return head;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the head element which is the label associated with this referenceset.
|
||||
* Set the head element which is the label associated with this reference set.
|
||||
*
|
||||
* @param characters
|
||||
* (May be null) Unprocessed characters to be referenced
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setHead(String characters) throws WingException
|
||||
{
|
||||
Head head = this.setHead();
|
||||
head.addContent(characters);
|
||||
|
||||
Head newHead = this.setHead();
|
||||
newHead.addContent(characters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,11 +138,12 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
* @param message
|
||||
* (Required) A key into the i18n catalogue for translation into
|
||||
* the user's preferred language.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setHead(Message message) throws WingException
|
||||
{
|
||||
Head head = this.setHead();
|
||||
head.addContent(message);
|
||||
Head newHead = this.setHead();
|
||||
newHead.addContent(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,6 +151,8 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
*
|
||||
* @param object
|
||||
* (Required) The referenced object.
|
||||
* @return the reference.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Reference addReference(Object object)
|
||||
throws WingException
|
||||
@@ -169,7 +174,9 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -208,9 +215,7 @@ public class ReferenceSet extends AbstractWingElement implements
|
||||
endElement(contentHandler, namespaces, E_REFERENCE_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
if (contents != null)
|
||||
|
@@ -44,7 +44,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
private boolean merged = false;
|
||||
|
||||
/** The registered repositories on this page */
|
||||
private Map<String,String> repositories = new HashMap<String,String>();
|
||||
private Map<String,String> repositories = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Construct a new RepositoryMeta
|
||||
@@ -52,6 +52,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
* @param context
|
||||
* (Required) The context this element is contained in, such as
|
||||
* where to route SAX events and what i18n catalogue to use.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected RepositoryMeta(WingContext context) throws WingException
|
||||
{
|
||||
@@ -78,6 +79,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
* The element's attributes
|
||||
* @return True if this WingElement is equivalent to the given SAX Event.
|
||||
*/
|
||||
@Override
|
||||
public boolean mergeEqual(String namespace, String localName, String qName,
|
||||
Attributes attributes) throws SAXException, WingException
|
||||
{
|
||||
@@ -87,11 +89,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!E_REPOSITORY_META.equals(localName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return E_REPOSITORY_META.equals(localName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,6 +109,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
* The element's attributes
|
||||
* @return The child element
|
||||
*/
|
||||
@Override
|
||||
public WingMergeableElement mergeChild(String namespace, String localName,
|
||||
String qName, Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
@@ -140,6 +139,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
/**
|
||||
* Inform this element that it is being merged with an existing element.
|
||||
*/
|
||||
@Override
|
||||
public Attributes merge(Attributes attributes) throws SAXException,
|
||||
WingException
|
||||
{
|
||||
@@ -161,6 +161,7 @@ public class RepositoryMeta extends AbstractWingElement implements WingMergeable
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler,
|
||||
LexicalHandler lexicalHandler, NamespaceSupport namespaces)
|
||||
throws SAXException
|
||||
|
@@ -38,13 +38,13 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
public static final String A_ROLE = "role";
|
||||
|
||||
/** The row's name */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** The row's role, see ROLES below */
|
||||
private String role;
|
||||
private final String role;
|
||||
|
||||
/** Special rendering instructions */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/** The row (and cell) role types: */
|
||||
public static final String ROLE_DATA = "data";
|
||||
@@ -55,7 +55,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
public static final String[] ROLES = { ROLE_DATA, ROLE_HEADER };
|
||||
|
||||
/** The contents of this row */
|
||||
List<AbstractWingElement> contents = new ArrayList<AbstractWingElement>();
|
||||
List<AbstractWingElement> contents = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new table row.
|
||||
@@ -72,6 +72,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Row(WingContext context, String name, String role, String rend)
|
||||
throws WingException
|
||||
@@ -108,6 +109,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @return a new table cell.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Cell addCell(String name, String role, int rows, int cols,
|
||||
String rend) throws WingException
|
||||
@@ -131,6 +133,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* (May be zero for no defined value) determines how many columns
|
||||
* does this cell span.
|
||||
* @return a new table cell.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Cell addCell(int rows, int cols) throws WingException
|
||||
{
|
||||
@@ -156,6 +159,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @return a new table cell.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Cell addCell(String name, String role, String rend)
|
||||
throws WingException
|
||||
@@ -174,6 +178,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* (May be null) determines what kind of information the cell
|
||||
* carries, either header or data. See cell.ROLES
|
||||
* @return a new table cell.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Cell addCell(String role) throws WingException
|
||||
{
|
||||
@@ -188,6 +193,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* form fields.
|
||||
*
|
||||
* @return a new table cell.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Cell addCell() throws WingException
|
||||
{
|
||||
@@ -206,6 +212,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
*
|
||||
* @param characters
|
||||
* (Required) Untranslated character data to be included.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addCellContent(String characters) throws WingException
|
||||
{
|
||||
@@ -226,6 +233,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* @param message
|
||||
* (Required) Key to the i18n catalogue to translate the content
|
||||
* into the language preferred by the user.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addCellContent(Message message) throws WingException
|
||||
{
|
||||
@@ -246,7 +254,9 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -275,9 +285,7 @@ public class Row extends AbstractWingElement implements StructuralElement
|
||||
endElement(contentHandler, namespaces, E_ROW);
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
for (AbstractWingElement content : contents)
|
||||
|
@@ -37,6 +37,7 @@ public class Select extends Field
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Select(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
@@ -90,6 +91,7 @@ public class Select extends Field
|
||||
* Enable the add operation for this field. When this is enabled the
|
||||
* front end will add a button to add more items to the field.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void enableAddOperation() throws WingException
|
||||
{
|
||||
@@ -101,6 +103,7 @@ public class Select extends Field
|
||||
* the front end will provide a way for the user to select fields (probably
|
||||
* checkboxes) along with a submit button to delete the selected fields.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void enableDeleteOperation()throws WingException
|
||||
{
|
||||
@@ -114,6 +117,8 @@ public class Select extends Field
|
||||
* @param returnValue
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @return the new option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Option addOption(String returnValue)
|
||||
throws WingException
|
||||
@@ -132,6 +137,8 @@ public class Select extends Field
|
||||
* @param returnValue
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @return the new option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Option addOption(boolean selected, String returnValue)
|
||||
throws WingException
|
||||
@@ -151,6 +158,7 @@ public class Select extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(String returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -168,6 +176,7 @@ public class Select extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected,String returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -186,6 +195,7 @@ public class Select extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(int returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -203,6 +213,7 @@ public class Select extends Field
|
||||
* selected.
|
||||
* @param characters
|
||||
* (Required) The text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected, int returnValue, String characters) throws WingException
|
||||
{
|
||||
@@ -220,7 +231,8 @@ public class Select extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(String returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -237,7 +249,8 @@ public class Select extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected, String returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -255,7 +268,8 @@ public class Select extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(int returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -272,7 +286,8 @@ public class Select extends Field
|
||||
* (Required) The value to be passed back if this option is
|
||||
* selected.
|
||||
* @param message
|
||||
* (Required) The transalted text to set as the visible option.
|
||||
* (Required) The translated text to set as the visible option.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void addOption(boolean selected, int returnValue, Message message) throws WingException
|
||||
{
|
||||
@@ -288,6 +303,7 @@ public class Select extends Field
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The return value of the option to be selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setOptionSelected(String returnValue) throws WingException
|
||||
{
|
||||
@@ -300,6 +316,7 @@ public class Select extends Field
|
||||
*
|
||||
* @param returnValue
|
||||
* (Required) The return value of the option to be selected.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setOptionSelected(int returnValue) throws WingException
|
||||
{
|
||||
@@ -310,6 +327,7 @@ public class Select extends Field
|
||||
/**
|
||||
* Add a field instance
|
||||
* @return instance
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Instance addInstance() throws WingException
|
||||
{
|
||||
|
@@ -68,7 +68,7 @@ public class SimpleHTMLFragment extends AbstractWingElement {
|
||||
* paragraphs delimeters.
|
||||
* @param fragment
|
||||
* (Required) The HTML Fragment to be translated into DRI.
|
||||
* @throws WingException
|
||||
* @throws WingException passed through.
|
||||
*/
|
||||
protected SimpleHTMLFragment(WingContext context, boolean blankLines,
|
||||
String fragment) throws WingException {
|
||||
@@ -522,7 +522,7 @@ public class SimpleHTMLFragment extends AbstractWingElement {
|
||||
* following email, point #1:
|
||||
*
|
||||
* <a href="http://www.servlets.com/archive/servlet/ReadMsg?msgId=491592&listName=jdom-interest">
|
||||
* http://www.servlets.com/archive/servlet/ReadMsg?msgId=491592&listName=jdom-interest
|
||||
* {@literal http://www.servlets.com/archive/servlet/ReadMsg?msgId=491592&listName=jdom-interest}
|
||||
* </a>
|
||||
*
|
||||
* <p>I, Scott Phillips, checked the JDOM CVS source tree on 3-8-2006 and the
|
||||
|
@@ -40,22 +40,22 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
public static final String A_COLS = "cols";
|
||||
|
||||
/** The name assigned to this table */
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/** Special rendering instructions for this table */
|
||||
private String rend;
|
||||
private final String rend;
|
||||
|
||||
/** The number of rows in the table */
|
||||
private int rows;
|
||||
private final int rows;
|
||||
|
||||
/** The number of cols in the table */
|
||||
private int cols;
|
||||
private final int cols;
|
||||
|
||||
/** The table's head */
|
||||
private Head head;
|
||||
|
||||
/** the rows contained in the table */
|
||||
private List<AbstractWingElement> contents = new ArrayList<AbstractWingElement>();
|
||||
private List<AbstractWingElement> contents = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Construct a new row.
|
||||
@@ -75,6 +75,7 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Table(WingContext context, String name, int rows, int cols,
|
||||
String rend) throws WingException
|
||||
@@ -92,6 +93,8 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
|
||||
/**
|
||||
* Set the head element which is the label associated with this table.
|
||||
* @return the new head.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Head setHead() throws WingException
|
||||
{
|
||||
@@ -105,11 +108,12 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
*
|
||||
* @param characters
|
||||
* (May be null) Unprocessed characters to be included
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setHead(String characters) throws WingException
|
||||
{
|
||||
Head head = this.setHead();
|
||||
head.addContent(characters);
|
||||
Head newHead = this.setHead();
|
||||
newHead.addContent(characters);
|
||||
|
||||
}
|
||||
|
||||
@@ -119,11 +123,12 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
* @param message
|
||||
* (Required) A key into the i18n catalogue for translation into
|
||||
* the user's preferred language.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setHead(Message message) throws WingException
|
||||
{
|
||||
Head head = this.setHead();
|
||||
head.addContent(message);
|
||||
Head newHead = this.setHead();
|
||||
newHead.addContent(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,6 +148,7 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
* display of the element.
|
||||
*
|
||||
* @return a new table row
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Row addRow(String name, String role, String rend)
|
||||
throws WingException
|
||||
@@ -162,6 +168,7 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
* carries, either header or data. See row.ROLES
|
||||
*
|
||||
* @return a new table row
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Row addRow(String role) throws WingException
|
||||
{
|
||||
@@ -173,6 +180,7 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
* and serves as a container of cell elements.
|
||||
*
|
||||
* @return a new table row
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Row addRow() throws WingException
|
||||
{
|
||||
@@ -192,8 +200,9 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
* @param namespaces
|
||||
* (Required) SAX Helper class to keep track of namespaces able
|
||||
* to determine the correct prefix for a given namespace URI.
|
||||
* @throws org.xml.sax.SAXException passed through.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
|
||||
NamespaceSupport namespaces) throws SAXException
|
||||
{
|
||||
@@ -219,9 +228,7 @@ public class Table extends AbstractWingElement implements StructuralElement
|
||||
endElement(contentHandler, namespaces, E_TABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* dispose
|
||||
*/
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
if (head != null)
|
||||
|
@@ -35,6 +35,7 @@ public class Text extends Field
|
||||
* @param rend
|
||||
* (May be null) a rendering hint used to override the default
|
||||
* display of the element.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
protected Text(WingContext context, String name, String rend)
|
||||
throws WingException
|
||||
@@ -75,6 +76,7 @@ public class Text extends Field
|
||||
* Enable the add operation for this field. When this is enabled the
|
||||
* front end will add a button to add more items to the field.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void enableAddOperation() throws WingException
|
||||
{
|
||||
@@ -86,6 +88,7 @@ public class Text extends Field
|
||||
* the front end will provide a way for the user to select fields (probably
|
||||
* checkboxes) along with a submit button to delete the selected fields.
|
||||
*
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void enableDeleteOperation()throws WingException
|
||||
{
|
||||
@@ -99,6 +102,8 @@ public class Text extends Field
|
||||
|
||||
/**
|
||||
* Set the raw value of the field removing any previous raw values.
|
||||
* @return the new value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setValue() throws WingException
|
||||
{
|
||||
@@ -113,6 +118,7 @@ public class Text extends Field
|
||||
*
|
||||
* @param characters
|
||||
* (May be null) Field value as a string
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setValue(String characters) throws WingException
|
||||
{
|
||||
@@ -126,6 +132,7 @@ public class Text extends Field
|
||||
* @param message
|
||||
* (Required) A key into the i18n catalogue for translation into
|
||||
* the user's preferred language.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public void setValue(Message message) throws WingException
|
||||
{
|
||||
@@ -136,6 +143,8 @@ public class Text extends Field
|
||||
/**
|
||||
* Set the authority value of the field removing any previous authority values.
|
||||
* Initialized to an empty value.
|
||||
* @return the new value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setAuthorityValue() throws WingException
|
||||
{
|
||||
@@ -145,6 +154,10 @@ public class Text extends Field
|
||||
/**
|
||||
* Set the authority value of the field removing any previous authority values.
|
||||
* Initialized to an empty value.
|
||||
* @param characters new value.
|
||||
* @param confidence confidence in this value
|
||||
* @return the new value.
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Value setAuthorityValue(String characters, String confidence) throws WingException
|
||||
{
|
||||
@@ -158,6 +171,7 @@ public class Text extends Field
|
||||
/**
|
||||
* Add a field instance
|
||||
* @return instance
|
||||
* @throws org.dspace.app.xmlui.wing.WingException passed through.
|
||||
*/
|
||||
public Instance addInstance() throws WingException
|
||||
{
|
||||
|
Reference in New Issue
Block a user