mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 05:23:14 +00:00

git-svn-id: http://scm.dspace.org/svn/repo/trunk@1500 9c30dcfa-912a-0410-8fc2-9e0234be79fd
438 lines
18 KiB
Plaintext
438 lines
18 KiB
Plaintext
<%--
|
|
- main.jsp
|
|
-
|
|
- Version: $Revision$
|
|
-
|
|
- Date: $Date$
|
|
-
|
|
- Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
|
|
- Institute of Technology. All rights reserved.
|
|
-
|
|
- Redistribution and use in source and binary forms, with or without
|
|
- modification, are permitted provided that the following conditions are
|
|
- met:
|
|
-
|
|
- - Redistributions of source code must retain the above copyright
|
|
- notice, this list of conditions and the following disclaimer.
|
|
-
|
|
- - Redistributions in binary form must reproduce the above copyright
|
|
- notice, this list of conditions and the following disclaimer in the
|
|
- documentation and/or other materials provided with the distribution.
|
|
-
|
|
- - Neither the name of the Hewlett-Packard Company nor the name of the
|
|
- Massachusetts Institute of Technology nor the names of their
|
|
- contributors may be used to endorse or promote products derived from
|
|
- this software without specific prior written permission.
|
|
-
|
|
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
- HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
- DAMAGE.
|
|
--%>
|
|
|
|
<%--
|
|
- Main My DSpace page
|
|
-
|
|
-
|
|
- Attributes:
|
|
- mydspace.user: current user (EPerson)
|
|
- workspace.items: WorkspaceItem[] array for this user
|
|
- workflow.items: WorkflowItem[] array of submissions from this user in
|
|
- workflow system
|
|
- workflow.owned: WorkflowItem[] array of tasks owned
|
|
- workflow.pooled WorkflowItem[] array of pooled tasks
|
|
--%>
|
|
|
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"
|
|
prefix="fmt" %>
|
|
|
|
|
|
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
|
|
|
|
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
|
|
|
<%@ page import="org.dspace.app.webui.servlet.MyDSpaceServlet" %>
|
|
<%@ page import="org.dspace.content.Collection" %>
|
|
<%@ page import="org.dspace.content.DCDate" %>
|
|
<%@ page import="org.dspace.content.DCValue" %>
|
|
<%@ page import="org.dspace.content.Item" %>
|
|
<%@ page import="org.dspace.content.SupervisedItem" %>
|
|
<%@ page import="org.dspace.content.WorkspaceItem" %>
|
|
<%@ page import="org.dspace.core.Utils" %>
|
|
<%@ page import="org.dspace.eperson.EPerson" %>
|
|
<%@ page import="org.dspace.eperson.Group" %>
|
|
<%@ page import="org.dspace.workflow.WorkflowItem" %>
|
|
<%@ page import="org.dspace.workflow.WorkflowManager" %>
|
|
|
|
<%
|
|
EPerson user = (EPerson) request.getAttribute("mydspace.user");
|
|
|
|
WorkspaceItem[] workspaceItems =
|
|
(WorkspaceItem[]) request.getAttribute("workspace.items");
|
|
|
|
WorkflowItem[] workflowItems =
|
|
(WorkflowItem[]) request.getAttribute("workflow.items");
|
|
|
|
WorkflowItem[] owned =
|
|
(WorkflowItem[]) request.getAttribute("workflow.owned");
|
|
|
|
WorkflowItem[] pooled =
|
|
(WorkflowItem[]) request.getAttribute("workflow.pooled");
|
|
|
|
Group [] groupMemberships =
|
|
(Group []) request.getAttribute("group.memberships");
|
|
|
|
SupervisedItem[] supervisedItems =
|
|
(SupervisedItem[]) request.getAttribute("supervised.items");
|
|
%>
|
|
|
|
<dspace:layout titlekey="jsp.mydspace" nocache="true">
|
|
|
|
<table width="100%" border="0">
|
|
<tr>
|
|
<td align="left">
|
|
<h1>
|
|
<fmt:message key="jsp.mydspace"/>: <%= user.getFullName() %>
|
|
</h1>
|
|
</td>
|
|
<td align="right" class="standard">
|
|
<dspace:popup page="/help/index.html#mydspace"><fmt:message key="jsp.help"/></dspace:popup>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<%-- Task list: Only display if the user has any tasks --%>
|
|
<%
|
|
if (owned.length > 0)
|
|
{
|
|
%>
|
|
<h2><fmt:message key="jsp.mydspace.main.heading2"/></h2>
|
|
|
|
<p class="submitFormHelp">
|
|
<%-- Below are the current tasks that you have chosen to do. --%>
|
|
<fmt:message key="jsp.mydspace.main.text1"/>
|
|
</p>
|
|
|
|
<table class="miscTable" align="center" summary="Table listing owned tasks">
|
|
<tr>
|
|
<th id="t1" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.task"/></th>
|
|
<th id="t2" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.item"/></th>
|
|
<th id="t3" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.subto"/></th>
|
|
<th id="t4" class="oddRowEvenCol"><fmt:message key="jsp.mydspace.main.subby"/></th>
|
|
<th id="t5" class="oddRowEvenCol"> </th>
|
|
</tr>
|
|
<%
|
|
// even or odd row: Starts even since header row is odd (1). Toggled
|
|
// between "odd" and "even" so alternate rows are light and dark, for
|
|
// easier reading.
|
|
String row = "even";
|
|
|
|
for (int i = 0; i < owned.length; i++)
|
|
{
|
|
DCValue[] titleArray =
|
|
owned[i].getItem().getDC("title", null, Item.ANY);
|
|
String title = (titleArray.length > 0 ? titleArray[0].value
|
|
: LocaleSupport.getLocalizedMessage(pageContext,"jsp.general.untitled") );
|
|
EPerson submitter = owned[i].getItem().getSubmitter();
|
|
%>
|
|
<tr>
|
|
<td headers="t1" class="<%= row %>RowOddCol">
|
|
<%
|
|
switch (owned[i].getState())
|
|
{
|
|
|
|
//There was once some code...
|
|
case WorkflowManager.WFSTATE_STEP1: %><fmt:message key="jsp.mydspace.main.sub1"/><% break;
|
|
case WorkflowManager.WFSTATE_STEP2: %><fmt:message key="jsp.mydspace.main.sub2"/><% break;
|
|
case WorkflowManager.WFSTATE_STEP3: %><fmt:message key="jsp.mydspace.main.sub3"/><% break;
|
|
}
|
|
%>
|
|
</td>
|
|
<td headers="t2" class="<%= row %>RowEvenCol"><%= Utils.addEntities(title) %></td>
|
|
<td headers="t3" class="<%= row %>RowOddCol"><%= owned[i].getCollection().getMetadata("name") %></td>
|
|
<td headers="t4" class="<%= row %>RowEvenCol"><a href="mailto:<%= submitter.getEmail() %>"><%= submitter.getFullName() %></a></td>
|
|
<!-- <td headers="t5" class="<%= row %>RowOddCol"></td> -->
|
|
<td headers="t5" class="<%= row %>RowEvenCol">
|
|
<form action="<%= request.getContextPath() %>/mydspace" method="post">
|
|
<input type="hidden" name="step" value="<%= MyDSpaceServlet.MAIN_PAGE %>" />
|
|
<input type="hidden" name="workflow_id" value="<%= owned[i].getID() %>" />
|
|
<input type="submit" name="submit_perform" value="<fmt:message key="jsp.mydspace.main.perform.button"/>" />
|
|
<input type="submit" name="submit_return" value="<fmt:message key="jsp.mydspace.main.return.button"/>" />
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
row = (row.equals("even") ? "odd" : "even" );
|
|
}
|
|
%>
|
|
</table>
|
|
<%
|
|
}
|
|
|
|
// Pooled tasks - only show if there are any
|
|
if (pooled.length > 0)
|
|
{
|
|
%>
|
|
<h2><fmt:message key="jsp.mydspace.main.heading3"/></h2>
|
|
|
|
<p class="submitFormHelp">
|
|
<%--Below are tasks in the task pool that have been assigned to you. --%>
|
|
<fmt:message key="jsp.mydspace.main.text2"/>
|
|
</p>
|
|
|
|
<table class="miscTable" align="center" summary="Table listing the tasks in the pool">
|
|
<tr>
|
|
<th id="t6" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.task"/></th>
|
|
<th id="t7" class="oddRowEvenCol"><fmt:message key="jsp.mydspace.main.item"/></th>
|
|
<th id="t8" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.subto"/></th>
|
|
<th id="t9" class="oddRowEvenCol"><fmt:message key="jsp.mydspace.main.subby"/></th>
|
|
</tr>
|
|
<%
|
|
// even or odd row: Starts even since header row is odd (1). Toggled
|
|
// between "odd" and "even" so alternate rows are light and dark, for
|
|
// easier reading.
|
|
String row = "even";
|
|
|
|
for (int i = 0; i < pooled.length; i++)
|
|
{
|
|
DCValue[] titleArray =
|
|
pooled[i].getItem().getDC("title", null, Item.ANY);
|
|
String title = (titleArray.length > 0 ? titleArray[0].value
|
|
: LocaleSupport.getLocalizedMessage(pageContext,"jsp.general.untitled") );
|
|
EPerson submitter = pooled[i].getItem().getSubmitter();
|
|
%>
|
|
<tr>
|
|
<td headers="t6" class="<%= row %>RowOddCol">
|
|
<%
|
|
switch (pooled[i].getState())
|
|
{
|
|
case WorkflowManager.WFSTATE_STEP1POOL: %><fmt:message key="jsp.mydspace.main.sub1"/><% break;
|
|
case WorkflowManager.WFSTATE_STEP2POOL: %><fmt:message key="jsp.mydspace.main.sub2"/><% break;
|
|
case WorkflowManager.WFSTATE_STEP3POOL: %><fmt:message key="jsp.mydspace.main.sub3"/><% break;
|
|
}
|
|
%>
|
|
</td>
|
|
<td headers="t7" class="<%= row %>RowEvenCol"><%= Utils.addEntities(title) %></td>
|
|
<td headers="t8" class="<%= row %>RowOddCol"><%= pooled[i].getCollection().getMetadata("name") %></td>
|
|
<td headers="t9" class="<%= row %>RowEvenCol"><a href="mailto:<%= submitter.getEmail() %>"><%= submitter.getFullName() %></a></td>
|
|
<td class="<%= row %>RowOddCol">
|
|
<form action="<%= request.getContextPath() %>/mydspace" method="post">
|
|
<input type="hidden" name="step" value="<%= MyDSpaceServlet.MAIN_PAGE %>" />
|
|
<input type="hidden" name="workflow_id" value="<%= pooled[i].getID() %>" />
|
|
<input type="submit" name="submit_claim" value="<fmt:message key="jsp.mydspace.main.take.button"/>" />
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
row = (row.equals("even") ? "odd" : "even");
|
|
}
|
|
%>
|
|
</table>
|
|
<%
|
|
}
|
|
%>
|
|
|
|
<form action="<%= request.getContextPath() %>/mydspace" method="post">
|
|
<input type="hidden" name="step" value="<%= MyDSpaceServlet.MAIN_PAGE %>" />
|
|
<center>
|
|
<table border="0" width="70%">
|
|
<tr>
|
|
<td align="left">
|
|
<input type="submit" name="submit_new" value="<fmt:message key="jsp.mydspace.main.start.button"/>" />
|
|
</td>
|
|
<td align="right">
|
|
<input type="submit" name="submit_own" value="<fmt:message key="jsp.mydspace.main.view.button"/>" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</center>
|
|
</form>
|
|
|
|
<p align="center"><a href="<%= request.getContextPath() %>/subscribe"><fmt:message key="jsp.mydspace.main.link"/></a></p>
|
|
|
|
<%
|
|
// Display workspace items (authoring or supervised), if any
|
|
if (workspaceItems.length > 0 || supervisedItems.length > 0)
|
|
{
|
|
// even or odd row: Starts even since header row is odd (1)
|
|
String row = "even";
|
|
%>
|
|
|
|
<h2><fmt:message key="jsp.mydspace.main.heading4"/></h2>
|
|
|
|
<p><fmt:message key="jsp.mydspace.main.text4" /></p>
|
|
|
|
<table class="miscTable" align="center" summary="Table listing unfinished submissions">
|
|
<tr>
|
|
<th class="oddRowOddCol"> </th>
|
|
<th id="t10" class="oddRowEvenCol"><fmt:message key="jsp.mydspace.main.subby"/></th>
|
|
<th id="t11" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.elem1"/></th>
|
|
<th id="t12" class="oddRowEvenCol"><fmt:message key="jsp.mydspace.main.elem2"/></th>
|
|
<th id="t13" class="oddRowOddCol"> </th>
|
|
</tr>
|
|
<%
|
|
if (supervisedItems.length > 0 && workspaceItems.length > 0)
|
|
{
|
|
%>
|
|
<tr>
|
|
<th colspan="5">
|
|
<%-- Authoring --%>
|
|
<fmt:message key="jsp.mydspace.main.authoring" />
|
|
</th>
|
|
</tr>
|
|
<%
|
|
}
|
|
|
|
for (int i = 0; i < workspaceItems.length; i++)
|
|
{
|
|
DCValue[] titleArray =
|
|
workspaceItems[i].getItem().getDC("title", null, Item.ANY);
|
|
String title = (titleArray.length > 0 ? titleArray[0].value
|
|
: LocaleSupport.getLocalizedMessage(pageContext,"jsp.general.untitled") );
|
|
EPerson submitter = workspaceItems[i].getItem().getSubmitter();
|
|
%>
|
|
<tr>
|
|
<td class="<%= row %>RowOddCol">
|
|
<form action="<%= request.getContextPath() %>/workspace" method="post">
|
|
<input type="hidden" name="workspace_id" value="<%= workspaceItems[i].getID() %>"/>
|
|
<input type="submit" name="submit_open" value="<fmt:message key="jsp.mydspace.general.open" />"/>
|
|
</form>
|
|
</td>
|
|
<td headers="t10" class="<%= row %>RowEvenCol">
|
|
<a href="mailto:<%= submitter.getEmail() %>"><%= submitter.getFullName() %></a>
|
|
</td>
|
|
<td headers="t11" class="<%= row %>RowOddCol"><%= Utils.addEntities(title) %></td>
|
|
<td headers="t12" class="<%= row %>RowEvenCol"><%= workspaceItems[i].getCollection().getMetadata("name") %></td>
|
|
<td headers="t13" class="<%= row %>RowOddCol">
|
|
<form action="<%= request.getContextPath() %>/mydspace" method="post">
|
|
<input type="hidden" name="step" value="<%= MyDSpaceServlet.MAIN_PAGE %>"/>
|
|
<input type="hidden" name="workspace_id" value="<%= workspaceItems[i].getID() %>"/>
|
|
<input type="submit" name="submit_delete" value="<fmt:message key="jsp.mydspace.general.remove" />"/>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
row = (row.equals("even") ? "odd" : "even" );
|
|
}
|
|
%>
|
|
|
|
<%-- Start of the Supervisors workspace list --%>
|
|
<%
|
|
if (supervisedItems.length > 0)
|
|
{
|
|
%>
|
|
<tr>
|
|
<th colspan="5">
|
|
<fmt:message key="jsp.mydspace.main.supervising" />
|
|
</th>
|
|
</tr>
|
|
<%
|
|
}
|
|
|
|
for (int i = 0; i < supervisedItems.length; i++)
|
|
{
|
|
DCValue[] titleArray =
|
|
supervisedItems[i].getItem().getDC("title", null, Item.ANY);
|
|
String title = (titleArray.length > 0 ? titleArray[0].value
|
|
: LocaleSupport.getLocalizedMessage(pageContext,"jsp.general.untitled") );
|
|
EPerson submitter = supervisedItems[i].getItem().getSubmitter();
|
|
%>
|
|
|
|
<tr>
|
|
<td class="<%= row %>RowOddCol">
|
|
<form action="<%= request.getContextPath() %>/workspace" method="post">
|
|
<input type="hidden" name="workspace_id" value="<%= supervisedItems[i].getID() %>"/>
|
|
<input type="submit" name="submit_open" value="<fmt:message key="jsp.mydspace.general.open" />"/>
|
|
</form>
|
|
</td>
|
|
<td class="<%= row %>RowEvenCol">
|
|
<a href="mailto:<%= submitter.getEmail() %>"><%= submitter.getFullName() %></a>
|
|
</td>
|
|
<td class="<%= row %>RowOddCol"><%= Utils.addEntities(title) %></td>
|
|
<td class="<%= row %>RowEvenCol"><%= supervisedItems[i].getCollection().getMetadata("name") %></td>
|
|
<td class="<%= row %>RowOddCol">
|
|
<form action="<%= request.getContextPath() %>/mydspace" method="post">
|
|
<input type="hidden" name="step" value="<%= MyDSpaceServlet.MAIN_PAGE %>"/>
|
|
<input type="hidden" name="workspace_id" value="<%= supervisedItems[i].getID() %>"/>
|
|
<input type="submit" name="submit_delete" value="<fmt:message key="jsp.mydspace.general.remove" />"/>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
row = (row.equals("even") ? "odd" : "even" );
|
|
}
|
|
%>
|
|
</table>
|
|
<%
|
|
}
|
|
%>
|
|
|
|
<%
|
|
// Display workflow items, if any
|
|
if (workflowItems.length > 0)
|
|
{
|
|
// even or odd row: Starts even since header row is odd (1)
|
|
String row = "even";
|
|
%>
|
|
<h2><fmt:message key="jsp.mydspace.main.heading5"/></h2>
|
|
|
|
<table class="miscTable" align="center" summary="Table listing submissions in workflow process">
|
|
<tr>
|
|
<th id="t14" class="oddRowOddCol"><fmt:message key="jsp.mydspace.main.elem1"/></th>
|
|
<th id="t15" class="oddRowEvenCol"><fmt:message key="jsp.mydspace.main.elem2"/></th>
|
|
</tr>
|
|
<%
|
|
for (int i = 0; i < workflowItems.length; i++)
|
|
{
|
|
DCValue[] titleArray =
|
|
workflowItems[i].getItem().getDC("title", null, Item.ANY);
|
|
String title = (titleArray.length > 0 ? titleArray[0].value
|
|
: LocaleSupport.getLocalizedMessage(pageContext,"jsp.general.untitled") );
|
|
%>
|
|
<tr>
|
|
<td headers="t14" class="<%= row %>RowOddCol"><%= Utils.addEntities(title) %></td>
|
|
<td headers="t15" class="<%= row %>RowEvenCol">
|
|
<form action="<%= request.getContextPath() %>/mydspace" method="post">
|
|
<%= workflowItems[i].getCollection().getMetadata("name") %>
|
|
<input type="hidden" name="step" value="<%= MyDSpaceServlet.MAIN_PAGE %>" />
|
|
<input type="hidden" name="workflow_id" value="<%= workflowItems[i].getID() %>" />
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
row = (row.equals("even") ? "odd" : "even" );
|
|
}
|
|
%>
|
|
</table>
|
|
<%
|
|
}
|
|
|
|
if(groupMemberships.length>0)
|
|
{
|
|
%>
|
|
<h2><fmt:message key="jsp.mydspace.main.heading6"/></h2>
|
|
<ul>
|
|
<%
|
|
for(int i=0; i<groupMemberships.length; i++)
|
|
{
|
|
%>
|
|
<li><%=groupMemberships[i].getName()%></li>
|
|
<%
|
|
}
|
|
%>
|
|
</ul>
|
|
<%
|
|
}
|
|
%>
|
|
</dspace:layout>
|