mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 05:23:14 +00:00
JSP indentation problems.
This commit is contained in:
@@ -43,17 +43,17 @@
|
|||||||
// Obtain DSpace context
|
// Obtain DSpace context
|
||||||
Context context = UIUtil.obtainContext(request);
|
Context context = UIUtil.obtainContext(request);
|
||||||
|
|
||||||
//get submission information object
|
//get submission information object
|
||||||
SubmissionInfo subInfo = SubmissionController.getSubmissionInfo(context, request);
|
SubmissionInfo subInfo = SubmissionController.getSubmissionInfo(context, request);
|
||||||
|
|
||||||
//get the step number (for jump-to link and to determine page)
|
//get the step number (for jump-to link and to determine page)
|
||||||
String stepJump = (String) request.getParameter("submission.jump");
|
String stepJump = (String) request.getParameter("submission.jump");
|
||||||
|
|
||||||
//extract out the step & page numbers from the stepJump (format: stepNum.pageNum)
|
//extract out the step & page numbers from the stepJump (format: stepNum.pageNum)
|
||||||
//(since there are multiple pages, we need to know which page we are reviewing!)
|
//(since there are multiple pages, we need to know which page we are reviewing!)
|
||||||
String[] fields = stepJump.split("\\."); //split on period
|
String[] fields = stepJump.split("\\."); //split on period
|
||||||
int stepNum = Integer.parseInt(fields[0]);
|
int stepNum = Integer.parseInt(fields[0]);
|
||||||
int pageNum = Integer.parseInt(fields[1]);
|
int pageNum = Integer.parseInt(fields[1]);
|
||||||
|
|
||||||
Item item = subInfo.getSubmissionItem().getItem();
|
Item item = subInfo.getSubmissionItem().getItem();
|
||||||
|
|
||||||
@@ -88,133 +88,131 @@
|
|||||||
%>
|
%>
|
||||||
|
|
||||||
<%!void layoutSection(HttpServletRequest request,
|
<%!void layoutSection(HttpServletRequest request,
|
||||||
javax.servlet.jsp.JspWriter out,
|
javax.servlet.jsp.JspWriter out,
|
||||||
DCInputSet inputSet,
|
DCInputSet inputSet,
|
||||||
SubmissionInfo subInfo,
|
SubmissionInfo subInfo,
|
||||||
Item item,
|
Item item,
|
||||||
String documentType,
|
String documentType,
|
||||||
int pageNum,
|
int pageNum,
|
||||||
PageContext pageContext)
|
PageContext pageContext)
|
||||||
throws ServletException, IOException
|
throws ServletException, IOException
|
||||||
{
|
{
|
||||||
ItemService itemService = ContentServiceFactory.getInstance().getItemService();
|
ItemService itemService = ContentServiceFactory.getInstance().getItemService();
|
||||||
InProgressSubmission ip = subInfo.getSubmissionItem();
|
InProgressSubmission ip = subInfo.getSubmissionItem();
|
||||||
|
|
||||||
//need to actually get the rows for pageNum-1 (since first page is index 0)
|
//need to actually get the rows for pageNum-1 (since first page is index 0)
|
||||||
DCInput[] inputs = inputSet.getPageRows(pageNum-1,
|
DCInput[] inputs = inputSet.getPageRows(pageNum-1,
|
||||||
ip.hasMultipleTitles(),
|
ip.hasMultipleTitles(),
|
||||||
ip.isPublishedBefore());
|
ip.isPublishedBefore());
|
||||||
|
|
||||||
MetadataAuthorityService mam = ContentAuthorityServiceFactory.getInstance().getMetadataAuthorityService();
|
MetadataAuthorityService mam = ContentAuthorityServiceFactory.getInstance().getMetadataAuthorityService();
|
||||||
|
|
||||||
|
for (int z = 0; z < inputs.length; z++)
|
||||||
|
{
|
||||||
|
// Omit fields not allowed for this document type
|
||||||
|
if(!inputs[z].isAllowedFor(documentType))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String scope = subInfo.isInWorkflow() ? DCInput.WORKFLOW_SCOPE : DCInput.SUBMISSION_SCOPE;
|
||||||
|
if (!inputs[z].isVisible(scope) && !inputs[z].isReadOnly(scope))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String inputType = inputs[z].getInputType();
|
||||||
|
String pairsName = inputs[z].getPairsType();
|
||||||
|
String value;
|
||||||
|
List<MetadataValue> values;
|
||||||
|
StringBuffer row = new StringBuffer();
|
||||||
|
|
||||||
for (int z = 0; z < inputs.length; z++)
|
row.append("<div class=\"row\">");
|
||||||
{
|
row.append("<span class=\"metadataFieldLabel col-md-4 \">");
|
||||||
// Omit fields not allowed for this document type
|
row.append(inputs[z].getLabel());
|
||||||
if(!inputs[z].isAllowedFor(documentType))
|
row.append("</span>");
|
||||||
{
|
row.append("<span class=\"metadataFieldValue col-md-8\">");
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String scope = subInfo.isInWorkflow() ? DCInput.WORKFLOW_SCOPE : DCInput.SUBMISSION_SCOPE;
|
|
||||||
if (!inputs[z].isVisible(scope) && !inputs[z].isReadOnly(scope))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String inputType = inputs[z].getInputType();
|
|
||||||
String pairsName = inputs[z].getPairsType();
|
|
||||||
String value;
|
|
||||||
List<MetadataValue> values;
|
|
||||||
StringBuffer row = new StringBuffer();
|
|
||||||
|
|
||||||
row.append("<div class=\"row\">");
|
if (inputType.equals("qualdrop_value"))
|
||||||
row.append("<span class=\"metadataFieldLabel col-md-4 \">");
|
{
|
||||||
row.append(inputs[z].getLabel());
|
values = itemService.getMetadata(item, inputs[z].getSchema(), inputs[z].getElement(), Item.ANY, Item.ANY);
|
||||||
row.append("</span>");
|
}
|
||||||
row.append("<span class=\"metadataFieldValue col-md-8\">");
|
else
|
||||||
|
{
|
||||||
|
values = itemService.getMetadata(item, inputs[z].getSchema(), inputs[z].getElement(), inputs[z].getQualifier(), Item.ANY);
|
||||||
|
}
|
||||||
|
if (values.size() == 0)
|
||||||
|
{
|
||||||
|
row.append(LocaleSupport.getLocalizedMessage(pageContext, "jsp.submit.review.no_md"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boolean isAuthorityControlled = mam.isAuthorityControlled(inputs[z].getSchema()+ "." +
|
||||||
|
inputs[z].getElement() + "." + inputs[z].getQualifier());
|
||||||
|
|
||||||
if (inputType.equals("qualdrop_value"))
|
for (int i = 0; i < values.size(); i++)
|
||||||
{
|
|
||||||
values = itemService.getMetadata(item, inputs[z].getSchema(), inputs[z].getElement(), Item.ANY, Item.ANY);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
values = itemService.getMetadata(item, inputs[z].getSchema(), inputs[z].getElement(), inputs[z].getQualifier(), Item.ANY);
|
|
||||||
}
|
|
||||||
if (values.size() == 0)
|
|
||||||
{
|
|
||||||
row.append(LocaleSupport.getLocalizedMessage(pageContext, "jsp.submit.review.no_md"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
boolean isAuthorityControlled = mam.isAuthorityControlled(inputs[z].getSchema()+ "." +
|
|
||||||
inputs[z].getElement() + "." + inputs[z].getQualifier());
|
|
||||||
|
|
||||||
for (int i = 0; i < values.size(); i++)
|
|
||||||
{
|
|
||||||
boolean newline = true;
|
|
||||||
if (inputType.equals("date"))
|
|
||||||
{
|
{
|
||||||
DCDate date = new DCDate(values.get(i).getValue());
|
boolean newline = true;
|
||||||
row.append(UIUtil.displayDate(date, false, true, request));
|
if (inputType.equals("date"))
|
||||||
}
|
{
|
||||||
else if (inputType.equals("dropdown") || inputType.equals("list"))
|
DCDate date = new DCDate(values.get(i).getValue());
|
||||||
{
|
row.append(UIUtil.displayDate(date, false, true, request));
|
||||||
String storedVal = values.get(i).getValue();
|
}
|
||||||
String displayVal = inputs[z].getDisplayString(pairsName,
|
else if (inputType.equals("dropdown") || inputType.equals("list"))
|
||||||
storedVal);
|
{
|
||||||
if (displayVal != null && !displayVal.equals(""))
|
String storedVal = values.get(i).getValue();
|
||||||
{
|
String displayVal = inputs[z].getDisplayString(pairsName, storedVal);
|
||||||
row.append(Utils.addEntities(displayVal));
|
if (displayVal != null && !displayVal.equals(""))
|
||||||
}
|
|
||||||
else if (storedVal != null && !storedVal.equals(""))
|
|
||||||
{
|
|
||||||
// use the stored value as label rather than null
|
|
||||||
row.append(Utils.addEntities(storedVal));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (inputType.equals("qualdrop_value"))
|
|
||||||
{
|
|
||||||
String qual = values.get(i).getMetadataField().getQualifier();
|
|
||||||
if(qual==null)
|
|
||||||
{
|
|
||||||
qual = "";
|
|
||||||
newline = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
String displayQual = inputs[z].getDisplayString(pairsName,qual);
|
|
||||||
String displayValue = Utils.addEntities(values.get(i).getValue());
|
|
||||||
if (displayQual != null)
|
|
||||||
{
|
{
|
||||||
row.append(displayQual + ":" + displayValue);
|
row.append(Utils.addEntities(displayVal));
|
||||||
|
}
|
||||||
|
else if (storedVal != null && !storedVal.equals(""))
|
||||||
|
{
|
||||||
|
// use the stored value as label rather than null
|
||||||
|
row.append(Utils.addEntities(storedVal));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (inputType.equals("qualdrop_value"))
|
||||||
|
{
|
||||||
|
String qual = values.get(i).getMetadataField().getQualifier();
|
||||||
|
if(qual==null)
|
||||||
|
{
|
||||||
|
qual = "";
|
||||||
|
newline = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newline = false;
|
String displayQual = inputs[z].getDisplayString(pairsName,qual);
|
||||||
|
String displayValue = Utils.addEntities(values.get(i).getValue());
|
||||||
|
if (displayQual != null)
|
||||||
|
{
|
||||||
|
row.append(displayQual + ":" + displayValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newline = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
row.append(Utils.addEntities(values.get(i).getValue()));
|
||||||
|
}
|
||||||
|
if (isAuthorityControlled)
|
||||||
|
{
|
||||||
|
row.append("<span class=\"ds-authority-confidence cf-")
|
||||||
|
.append(values.get(i).getConfidence()).append("\">")
|
||||||
|
.append(" </span>");
|
||||||
|
}
|
||||||
|
if (newline)
|
||||||
|
{
|
||||||
|
row.append("<br />");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
row.append("</span>");
|
||||||
row.append(Utils.addEntities(values.get(i).getValue()));
|
row.append("</div>");
|
||||||
}
|
|
||||||
if (isAuthorityControlled)
|
|
||||||
{
|
|
||||||
row.append("<span class=\"ds-authority-confidence cf-")
|
|
||||||
.append(values.get(i).getConfidence()).append("\">")
|
|
||||||
.append(" </span>");
|
|
||||||
}
|
|
||||||
if (newline)
|
|
||||||
{
|
|
||||||
row.append("<br />");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
row.append("</span>");
|
|
||||||
row.append("</div>");
|
|
||||||
|
|
||||||
out.write(row.toString());
|
out.write(row.toString());
|
||||||
}
|
}
|
||||||
}%>
|
}%>
|
||||||
|
|
||||||
|
|
||||||
@@ -233,9 +231,9 @@
|
|||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
||||||
<%
|
<%
|
||||||
layoutSection(request, out, inputSet, subInfo, item, documentType, pageNum, pageContext);
|
layoutSection(request, out, inputSet, subInfo, item, documentType, pageNum, pageContext);
|
||||||
%>
|
%>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<input class="btn btn-default" type="submit" name="submit_jump_<%=stepJump%>" value="<fmt:message key="jsp.submit.review.button.correct"/>" />
|
<input class="btn btn-default" type="submit" name="submit_jump_<%=stepJump%>" value="<fmt:message key="jsp.submit.review.button.correct"/>" />
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user