Revision 5082
Added by daigle about 15 years ago
lib/style/skins/sanparks/searchWorkflowRun.jsp | ||
---|---|---|
40 | 40 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/widgets/form-fields-widget.js"></script> |
41 | 41 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js"></script> |
42 | 42 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/ajax-utils.js"></script> |
43 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/searchWorkflowRun.js"></script></script>
|
|
43 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/searchWorkflowRun.js"></script> |
|
44 | 44 |
</head> |
45 | 45 |
<body class="main-section" onload="setWorkflowQueryFormField('tpcSearch');submitFormIntoDiv('<%=SERVLET_URL%>','tpcSearch','workflow-search-results')"> |
46 | 46 |
<jsp:include page="header2.jsp"/> |
lib/style/skins/sanparks/sanparks-scheduled-jobs.css | ||
---|---|---|
47 | 47 |
margin:0px 60px 20px 178px; |
48 | 48 |
} |
49 | 49 |
|
50 |
.content-subsection { |
|
51 |
vertical-align: middle; |
|
52 |
margin: 0px 0px 0px 195px; |
|
53 |
width: 820px; |
|
54 |
} |
|
55 |
|
|
56 | 50 |
.content-subsection-header { |
57 | 51 |
margin: 10px 0px 5px 0px; |
58 | 52 |
padding: 0px 0px 0px 0px; |
lib/style/skins/sanparks/changeAccess.jsp | ||
---|---|---|
1 |
<%@ page language="java" %> |
|
2 |
|
|
3 |
<% |
|
4 |
/* |
|
5 |
* '$RCSfile$' |
|
6 |
* Copyright: 2009 Regents of the University of California and the |
|
7 |
* National Center for Ecological Analysis and Synthesis |
|
8 |
* |
|
9 |
* '$Author: daigle $' |
|
10 |
* '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $' |
|
11 |
* '$Revision: 4080 $' |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or modify |
|
14 |
* it under the terms of the GNU General Public License as published by |
|
15 |
* the Free Software Foundation; either version 2 of the License, or |
|
16 |
* (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
26 |
*/ |
|
27 |
|
|
28 |
%> |
|
29 |
<%@ include file="settings.jsp"%> |
|
30 |
|
|
31 |
<html> |
|
32 |
<head> |
|
33 |
<title>Sanparks TPC Report Search</title> |
|
34 |
<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks.css"/> |
|
35 |
<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks-scheduled-jobs.css"/> |
|
36 |
<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/header2.css"/> |
|
37 |
<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/left-nav2.css"/> |
|
38 |
<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/footer2.css"/> |
|
39 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_SKINS_URL%>/sanparks/sanparks.js"></script> |
|
40 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/branding.js"></script> |
|
41 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js"></script> |
|
42 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/ajax-utils.js"></script> |
|
43 |
<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/access.js"></script> |
|
44 |
</head> |
|
45 |
<body class="main-section" onload="getAccessSection('<%=SERVLET_URL%>','<%=request.getParameter("workflowid")%>','<%=request.getParameter("workflowname")%>','sanparks','access-info-content')"> |
|
46 |
<jsp:include page="header2.jsp"/> |
|
47 |
|
|
48 |
<!-- Main content --> |
|
49 |
<jsp:include page="left-nav2.jsp"/> |
|
50 |
<div class="content-section"> |
|
51 |
<div class="content-subsection" id="access-info-section"> |
|
52 |
<div class="content-subsection-header-emphasis">Workflow Summary</div> |
|
53 |
<div class="form-input-row" id="form-base-row"> |
|
54 |
<div class="summary-field" id='workflow-name-label' >Name: </div> |
|
55 |
<div class="summary-value" id='workflow-name-value' ><%=request.getParameter("workflowname")%></div> |
|
56 |
<br/> |
|
57 |
<div class="summary-field" id='workflow-lsid-label' >LSID: </div> |
|
58 |
<div class="summary-value" id='workflow-lsid-value' ><%=request.getParameter("workflowid")%></div> |
|
59 |
</div> |
|
60 |
</div> |
|
61 |
|
|
62 |
<div class="access-info-content" id="access-info-content"></div> |
|
63 |
</div> |
|
64 |
|
|
65 |
<!-- Footer Content --> |
|
66 |
<jsp:include page="footer2.jsp" /> |
|
67 |
</body> |
|
68 |
</html> |
lib/style/skins/sanparks/sanparks.css | ||
---|---|---|
35 | 35 |
|
36 | 36 |
@import url(../../../style/common/eml_xsl.css); |
37 | 37 |
b { |
38 |
font-weight: bold; |
|
38 |
font-weight: bold;
|
|
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
/** |
... | ... | |
735 | 735 |
} |
736 | 736 |
|
737 | 737 |
.content-subsection { |
738 |
margin: 0px 0px 6px 180px; |
|
739 | 738 |
vertical-align: middle; |
739 |
margin: 0px 0px 0px 195px; |
|
740 |
width: 820px; |
|
740 | 741 |
} |
741 | 742 |
|
742 | 743 |
.content-subsection-header { |
... | ... | |
745 | 746 |
font-size: 16px; |
746 | 747 |
} |
747 | 748 |
|
749 |
.content-subsection-header-emphasis { |
|
750 |
font-size: 16px; |
|
751 |
color: #DD7744; |
|
752 |
margin-bottom: 5px; |
|
753 |
} |
|
754 |
|
|
748 | 755 |
/********************************************************************** |
749 | 756 |
* form field settings |
750 | 757 |
**********************************************************************/ |
... | ... | |
846 | 853 |
.col4 { |
847 | 854 |
width: 100px; |
848 | 855 |
} |
856 |
|
|
857 |
/********************************************************************** |
|
858 |
* change access specific settings |
|
859 |
**********************************************************************/ |
|
860 |
|
|
861 |
.change-access-header { |
|
862 |
color: #255333; |
|
863 |
font-size: 16px; |
|
864 |
font-style: normal; |
|
865 |
font-weight: bold; |
|
866 |
margin-left: 10px; |
|
867 |
} |
|
868 |
|
|
869 |
.change-access-header-emphasis { |
|
870 |
color: #DD7744; |
|
871 |
font-size: 16px; |
|
872 |
display: inline; |
|
873 |
float: left; |
|
874 |
margin-left: 10px; |
|
875 |
} |
|
876 |
|
|
877 |
.change-access-header-workflow { |
|
878 |
font-size: 16px; |
|
879 |
margin-left:10px; |
|
880 |
display: inline; |
|
881 |
float: left; |
|
882 |
} |
|
883 |
|
|
884 |
.change-access-indent-emphasis { |
|
885 |
color: #DD7744; |
|
886 |
font-size: 16px; |
|
887 |
font-weight: normal; |
|
888 |
display: inline; |
|
889 |
float: left; |
|
890 |
margin-left: 30px; |
|
891 |
} |
|
892 |
|
|
893 |
.change-access-row { |
|
894 |
display: block; |
|
895 |
margin-bottom: 5px; |
|
896 |
} |
|
897 |
|
|
898 |
.col_label { |
|
899 |
color: #255333; |
|
900 |
font-size: 14px; |
|
901 |
} |
|
902 |
|
|
903 |
.access_info_text { |
|
904 |
font-size: 14px; |
|
905 |
} |
|
906 |
|
|
907 |
.access_order_col { |
|
908 |
width: 90px; |
|
909 |
margin-left: 10px; |
|
910 |
display: inline; |
|
911 |
float: left; |
|
912 |
} |
|
913 |
.access_type_col { |
|
914 |
width: 85px; |
|
915 |
margin-left: 10px; |
|
916 |
display: inline; |
|
917 |
float: left; |
|
918 |
} |
|
919 |
|
|
920 |
.principal_col { |
|
921 |
width: 400px; |
|
922 |
margin-left: 10px; |
|
923 |
display: inline; |
|
924 |
float: left; |
|
925 |
} |
|
926 |
|
|
927 |
.permissions_col { |
|
928 |
width: 100px; |
|
929 |
margin-left: 10px; |
|
930 |
display: inline; |
|
931 |
} |
|
932 |
|
|
933 |
.permission_element { |
|
934 |
display: inline; |
|
935 |
font-size: 14px; |
|
936 |
} |
|
937 |
|
|
938 |
.access-submit-button { |
|
939 |
margin: 20px 0px 10px 300px; |
|
940 |
width: 150px; |
|
941 |
} |
|
942 |
|
lib/style/skins/sanparks/sanparks.xml | ||
---|---|---|
24 | 24 |
<doctype publicid="-//NCEAS//unauth_login//EN"> |
25 | 25 |
<target publicid="-//W3C//HTML//EN">/style/skins/sanparks/knp-login.xsl</target> |
26 | 26 |
</doctype> |
27 |
<doctype publicid="-//NCEAS//getaccesscontrol//EN"> |
|
28 |
<target publicid="-//W3C//HTML//EN">/style/common/accessInfo.xsl</target> |
|
29 |
</doctype> |
|
30 |
<doctype publicid="-//NCEAS//getaccesscontrol//EN"> |
|
31 |
<target publicid="-//W3C//HTML//EN">/style/common/accessInfo.xsl</target> |
|
32 |
</doctype> |
|
27 | 33 |
|
28 | 34 |
<!-- |
29 | 35 |
ARE THESE STILL NEEDED???????????? |
lib/style/skins/sanparks/scheduleWorkflowRun.jsp | ||
---|---|---|
66 | 66 |
%> |
67 | 67 |
<div class="warning-header">You have view permissions only for this workflow</div> |
68 | 68 |
<% |
69 |
} |
|
70 |
%> |
|
71 |
<div class="result-header-emphasis">Workflow Summary</div>
|
|
69 |
}
|
|
70 |
%>
|
|
71 |
<div class="content-subsection-header-emphasis">Workflow Summary</div>
|
|
72 | 72 |
<div class="form-input-row" id="form-base-row"> |
73 | 73 |
<div class="summary-field" id='workflow-name-label' >Name: </div> |
74 | 74 |
<% |
... | ... | |
84 | 84 |
if (request.getParameter("workflowid") != null) { |
85 | 85 |
%> |
86 | 86 |
<div class="summary-value" id='workflow-lsid-value' ><%=request.getParameter("workflowid")%></div> |
87 |
(<jsp:text><![CDATA[<a href=./changeAccess.jsp?workflowid=]]></jsp:text><jsp:expression>request.getParameter("workflowid")</jsp:expression><jsp:text><![CDATA[&workflowname=]]></jsp:text><jsp:expression>request.getParameter("workflowname")</jsp:expression><jsp:text><![CDATA[>Change Access Permissions</a>]]></jsp:text>) |
|
88 |
|
|
87 | 89 |
<% |
88 | 90 |
} |
89 | 91 |
%> |
lib/style/common/access.js | ||
---|---|---|
1 |
/* |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: Basic funtions to support showing the schedule workflows |
|
4 |
* pages |
|
5 |
* Copyright: 2009 Regents of the University of California and the |
|
6 |
* National Center for Ecological Analysis and Synthesis |
|
7 |
* Authors: Michael Daigle |
|
8 |
* |
|
9 |
* '$Author: leinfelder $' |
|
10 |
* '$Date: 2008-06-17 13:16:32 -0700 (Tue, 17 Jun 2008) $' |
|
11 |
* '$Revision: 4006 $' |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or modify |
|
14 |
* it under the terms of the GNU General Public License as published by |
|
15 |
* the Free Software Foundation; either version 2 of the License, or |
|
16 |
* (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
26 |
*/ |
|
27 |
|
|
28 |
/* puts together the url to get the workflow section of a page given the workflow |
|
29 |
* id. |
|
30 |
* Params: |
|
31 |
* url - metacat url to hit |
|
32 |
* workflowId - get all runs for this id |
|
33 |
* workflowName - used for display purposes. |
|
34 |
* divId - the name of the div where the results should be put |
|
35 |
*/ |
|
36 |
function getAccessSection(url, workflowId, workflowname, qformat, divId) { |
|
37 |
var requestUrl = url + '?action=getaccesscontrol&docid=' + workflowId + |
|
38 |
"&workflowname=" + workflowname + '&qformat=' + qformat; |
|
39 |
//alert('getAccessSection - url: ' + requestUrl); |
|
40 |
var submitResults = submitUrlIntoDiv(requestUrl, divId); |
|
41 |
} |
|
42 |
|
|
43 |
function setPermission(formObj) { |
|
44 |
|
|
45 |
//alert("principal: " + formObj.principal.value); |
|
46 |
if ( formObj.principal.value == null || formObj.principal.value == "") { |
|
47 |
alert("you must provide a pricipal"); |
|
48 |
return; |
|
49 |
} |
|
50 |
|
|
51 |
var permission = ""; |
|
52 |
if (formObj.permission_read_checkbox.checked) { |
|
53 |
permission += "READ"; |
|
54 |
} |
|
55 |
if (formObj.permission_write_checkbox.checked) { |
|
56 |
if (permission.length > 0) { |
|
57 |
permission += "|"; |
|
58 |
} |
|
59 |
permission += "WRITE"; |
|
60 |
} |
|
61 |
if (formObj.permission_chmod_checkbox.checked) { |
|
62 |
if (permission.length > 0) { |
|
63 |
permission += "|"; |
|
64 |
} |
|
65 |
permission |= CHMOD; |
|
66 |
} |
|
67 |
if (formObj.permission_all_checkbox.checked) { |
|
68 |
if (permission.length > 0) { |
|
69 |
permission += "|"; |
|
70 |
} |
|
71 |
permission |= "ALL"; |
|
72 |
} |
|
73 |
//alert("permission: " + permission); |
|
74 |
formObj.permission.value = permission; |
|
75 |
|
|
76 |
if (permission == "") { |
|
77 |
alert("You must choose a permission value"); |
|
78 |
return; |
|
79 |
} |
|
80 |
} |
|
81 |
|
|
82 |
function doNothing() { |
|
83 |
} |
|
84 |
|
|
85 |
|
|
0 | 86 |
lib/style/common/accessInfo.xsl | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
* '$RCSfile$' |
|
4 |
* Authors: Michael Daigle |
|
5 |
* Copyright: 2009 Regents of the University of California and the |
|
6 |
* National Center for Ecological Analysis and Synthesis |
|
7 |
* For Details: http://www.nceas.ucsb.edu/ |
|
8 |
* |
|
9 |
* '$Author: leinfelder $' |
|
10 |
* '$Date: 2009-04-02 14:20:05 -0800 (Thu, 02 Apr 2009) $' |
|
11 |
* '$Revision: 4893 $' |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or modify |
|
14 |
* it under the terms of the GNU General Public License as published by |
|
15 |
* the Free Software Foundation; either version 2 of the License, or |
|
16 |
* (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
26 |
* |
|
27 |
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to |
|
28 |
* convert an XML file showing the resultset of a query |
|
29 |
* into an HTML format suitable for rendering with modern web browsers. |
|
30 |
--> |
|
31 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
|
32 |
|
|
33 |
<xsl:output method="html" /> |
|
34 |
<xsl:param name="sessid" /> |
|
35 |
<xsl:param name="qformat">default</xsl:param> |
|
36 |
<xsl:param name="enableediting">false</xsl:param> |
|
37 |
<xsl:param name="contextURL" /> |
|
38 |
<xsl:param name="servletURL" /> |
|
39 |
<xsl:param name="workflowname" /> |
|
40 |
<xsl:param name="docid" /> |
|
41 |
|
|
42 |
<xsl:template match="/"> |
|
43 |
|
|
44 |
<div class="content-subsection"> |
|
45 |
<div class="content-subsection-header-emphasis">Access Rules</div> |
|
46 |
<div class="change-access-row"> |
|
47 |
<div class="col_label access_order_col">Access Order</div> |
|
48 |
<div class="col_label access_type_col">Access Type</div> |
|
49 |
<div class="col_label principal_col">Principal</div> |
|
50 |
<div class="col_label permissions_col">Permission</div> |
|
51 |
</div> |
|
52 |
<xsl:choose> |
|
53 |
<xsl:when test="acl/resource/@order = 'allowFirst'"> |
|
54 |
<xsl:for-each select="acl/resource/allow/principal"> |
|
55 |
<div class="access_info_text access_order_col">allowFirst</div> |
|
56 |
<div class="access_info_text access_type_col">allow </div> |
|
57 |
<div class="access_info_text principal_col"> |
|
58 |
<xsl:value-of select="."/> |
|
59 |
</div> |
|
60 |
<div class="permissions_col"> |
|
61 |
<xsl:for-each select="../permission"> |
|
62 |
<div class="permission_element"><xsl:value-of select="."/></div> |
|
63 |
</xsl:for-each> |
|
64 |
</div><br/> |
|
65 |
</xsl:for-each> |
|
66 |
<xsl:for-each select="acl/resource/deny/principal"> |
|
67 |
<div class="access_info_text access_order_col">allowFirst</div> |
|
68 |
<div class="access_info_text access_type_col">deny </div> |
|
69 |
<div class="access_info_text principal_col"> |
|
70 |
<xsl:value-of select="."/> |
|
71 |
</div> |
|
72 |
<div class="permissions_col"> |
|
73 |
<xsl:for-each select="../permission"> |
|
74 |
<div class="permission_element"><xsl:value-of select="."/></div> |
|
75 |
</xsl:for-each> |
|
76 |
</div> |
|
77 |
</xsl:for-each> |
|
78 |
</xsl:when> |
|
79 |
|
|
80 |
<xsl:when test="count(acl/resource/@order[denyFirst]) > 0"> |
|
81 |
<xsl:for-each select="acl/resource/allow/principal"> |
|
82 |
<div class="access_info_text access_order_col">denyFirst</div> |
|
83 |
<div class="access_info_text access_type_col">allow </div> |
|
84 |
<div class="access_info_text principal_col"> |
|
85 |
<xsl:value-of select="."/> |
|
86 |
</div> |
|
87 |
<div class="permissions_col"> |
|
88 |
<xsl:for-each select="../permission"> |
|
89 |
<div class="permission_element"><xsl:value-of select="."/></div> |
|
90 |
</xsl:for-each> |
|
91 |
</div> |
|
92 |
</xsl:for-each> |
|
93 |
<xsl:for-each select="acl/resource/deny/principal"> |
|
94 |
<div class="access_info_text access_order_col">denyFirst</div> |
|
95 |
<div class="access_info_text access_type_col">deny </div> |
|
96 |
<div class="access_info_text principal_col"> |
|
97 |
<xsl:value-of select="."/> |
|
98 |
</div> |
|
99 |
<div class="permissions_col"> |
|
100 |
<xsl:for-each select="../permission"> |
|
101 |
<div class="permission_element"><xsl:value-of select="."/></div> |
|
102 |
</xsl:for-each> |
|
103 |
</div> |
|
104 |
</xsl:for-each> |
|
105 |
</xsl:when> |
|
106 |
</xsl:choose> |
|
107 |
</div><br/> |
|
108 |
<div class="content-subsection"> |
|
109 |
<div class="content-subsection-header-emphasis">Add Access Rule</div> |
|
110 |
<div class="change-access-row"> |
|
111 |
<div class="col_label access_order_col">Access Order</div> |
|
112 |
<div class="col_label access_type_col">Access Type</div> |
|
113 |
<div class="col_label principal_col">Principal</div> |
|
114 |
<div class="col_label permissions_col">Permission</div> |
|
115 |
</div> |
|
116 |
|
|
117 |
<div class="change-access-row"> |
|
118 |
<form name="addAccess" action="{$servletURL}" id="addAccess" onsubmit="setPermission(this)"> |
|
119 |
<input name="action" value="setaccess" type="hidden" /> |
|
120 |
<input name="qformat" value="sanparks" type="hidden" /> |
|
121 |
<input name="forwardto" value="changeAccess.jsp" type="hidden" /> |
|
122 |
<input name="permission" id="permission" type="hidden" /> |
|
123 |
<input name="docid" value="{$docid}" type="hidden" /> |
|
124 |
<input name="workflowid" value="{$docid}" type="hidden" /> |
|
125 |
<input name="workflowname" value="{$workflowname}" type="hidden" /> |
|
126 |
|
|
127 |
<select class="access_order_col" name="permOrder" id="permOrder"> |
|
128 |
<option value="allowFirst">Allow First</option> |
|
129 |
<option value="denyFirst">Deny First</option> |
|
130 |
</select> |
|
131 |
<select class="access_type_col" name="permType" id="permType"> |
|
132 |
<option value="allow">Allow</option> |
|
133 |
<option value="deny">Deny</option> |
|
134 |
</select> |
|
135 |
<input class="principal_col" name="principal" id="principal" type="text" /> |
|
136 |
<div class="permissions_col"> |
|
137 |
<input type="checkbox" name="permission_read_checkbox" id="permission_read_checkbox">Read</input> |
|
138 |
<input type="checkbox" name="permission_write_checkbox" id="permission_write_checkbox">Write</input> |
|
139 |
<input type="checkbox" name="permission_chmod_checkbox" id="permission_chmod_checkbox">Chmod</input> |
|
140 |
<input type="checkbox" name="permission_all_checkbox" id="permission_all_checkbox">All</input> |
|
141 |
</div> |
|
142 |
|
|
143 |
<br/> |
|
144 |
<input class="access-submit-button" value="Add" type="submit"/> |
|
145 |
|
|
146 |
</form> |
|
147 |
</div> |
|
148 |
</div> |
|
149 |
|
|
150 |
</xsl:template> |
|
151 |
|
|
152 |
</xsl:stylesheet> |
|
0 | 153 |
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
105 | 105 |
import edu.ucsb.nceas.utilities.FileUtil; |
106 | 106 |
import edu.ucsb.nceas.utilities.GeneralPropertyException; |
107 | 107 |
import edu.ucsb.nceas.utilities.LSIDUtil; |
108 |
import edu.ucsb.nceas.utilities.ParseLSIDException; |
|
108 | 109 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
109 | 110 |
import edu.ucsb.nceas.utilities.UtilException; |
110 | 111 |
|
... | ... | |
932 | 933 |
out.close(); |
933 | 934 |
} else if (action.equals("setaccess")) { |
934 | 935 |
PrintWriter out = response.getWriter(); |
935 |
handleSetAccessAction(out, params, userName); |
|
936 |
handleSetAccessAction(out, params, userName, request, response);
|
|
936 | 937 |
out.close(); |
937 | 938 |
} else if (action.equals("getaccesscontrol")) { |
938 | 939 |
PrintWriter out = response.getWriter(); |
... | ... | |
2697 | 2698 |
private void handleGetAccessControlAction(PrintWriter out, |
2698 | 2699 |
Hashtable<String,String[]> params, HttpServletResponse response, String username, |
2699 | 2700 |
String[] groupnames) { |
2701 |
|
|
2702 |
Logger logMetacat = Logger.getLogger(MetaCatServlet.class); |
|
2700 | 2703 |
DBConnection dbConn = null; |
2701 | 2704 |
int serialNumber = -1; |
2702 | 2705 |
String docid = params.get("docid")[0]; |
2706 |
if (docid.startsWith("urn:")) { |
|
2707 |
try { |
|
2708 |
String actualDocId = LSIDUtil.getDocId(docid, false); |
|
2709 |
docid = actualDocId; |
|
2710 |
} catch (ParseLSIDException ple) { |
|
2711 |
logMetacat.error("MetaCatServlet.handleGetAccessControlAction - " + |
|
2712 |
"could not parse lsid: " + docid + " : " + ple.getMessage()); |
|
2713 |
} |
|
2714 |
} |
|
2703 | 2715 |
|
2716 |
String qformat = "xml"; |
|
2717 |
if (params.get("qformat") != null) { |
|
2718 |
qformat = (params.get("qformat"))[0]; |
|
2719 |
} |
|
2720 |
|
|
2704 | 2721 |
try { |
2705 | 2722 |
|
2706 | 2723 |
// get connection from the pool |
... | ... | |
2709 | 2726 |
serialNumber = dbConn.getCheckOutSerialNumber(); |
2710 | 2727 |
AccessControlList aclobj = new AccessControlList(dbConn); |
2711 | 2728 |
String acltext = aclobj.getACL(docid, username, groupnames); |
2712 |
out.println(acltext); |
|
2713 |
|
|
2729 |
if (qformat.equals("xml")) { |
|
2730 |
response.setContentType("text/xml"); |
|
2731 |
out.println(acltext); |
|
2732 |
} else { |
|
2733 |
DBTransform trans = new DBTransform(); |
|
2734 |
response.setContentType("text/html"); |
|
2735 |
trans.transformXMLDocument(acltext,"-//NCEAS//getaccesscontrol//EN", |
|
2736 |
"-//W3C//HTML//EN", qformat, out, params, null); |
|
2737 |
} |
|
2714 | 2738 |
} catch (Exception e) { |
2715 | 2739 |
out.println("<?xml version=\"1.0\"?>"); |
2716 | 2740 |
out.println("<error>"); |
... | ... | |
3479 | 3503 |
* A method to handle set access action |
3480 | 3504 |
*/ |
3481 | 3505 |
private void handleSetAccessAction(PrintWriter out, Hashtable<String, String[]> params, |
3482 |
String username) { |
|
3506 |
String username, HttpServletRequest request, HttpServletResponse response) {
|
|
3483 | 3507 |
Logger logMetacat = Logger.getLogger(MetaCatServlet.class); |
3484 | 3508 |
String[] docList = null; |
3485 | 3509 |
String[] principalList = null; |
3486 | 3510 |
String[] permissionList = null; |
3487 | 3511 |
String[] permTypeList = null; |
3488 | 3512 |
String[] permOrderList = null; |
3513 |
String[] qformatList = null; |
|
3489 | 3514 |
String permission = null; |
3490 | 3515 |
String permType = null; |
3491 | 3516 |
String permOrder = null; |
... | ... | |
3515 | 3540 |
|
3516 | 3541 |
} |
3517 | 3542 |
|
3543 |
if (params.containsKey("qformat")) { |
|
3544 |
qformatList = params.get("qformat"); |
|
3545 |
|
|
3546 |
} |
|
3547 |
|
|
3518 | 3548 |
// Make sure the parameter is not null |
3519 | 3549 |
if (docList == null || principalList == null || permTypeList == null |
3520 | 3550 |
|| permissionList == null) { |
... | ... | |
3552 | 3582 |
|
3553 | 3583 |
// handle every accessionNumber |
3554 | 3584 |
for (int i = 0; i < docList.length; i++) { |
3555 |
String accessionNumber = docList[i]; |
|
3585 |
String docid = docList[i]; |
|
3586 |
if (docid.startsWith("urn:")) { |
|
3587 |
try { |
|
3588 |
String actualDocId = LSIDUtil.getDocId(docid, false); |
|
3589 |
docid = actualDocId; |
|
3590 |
} catch (ParseLSIDException ple) { |
|
3591 |
logMetacat.error("MetaCatServlet.handleGetAccessControlAction - " + |
|
3592 |
"could not parse lsid: " + docid + " : " + ple.getMessage()); |
|
3593 |
} |
|
3594 |
} |
|
3595 |
|
|
3596 |
String accessionNumber = docid; |
|
3556 | 3597 |
String owner = null; |
3557 | 3598 |
String publicId = null; |
3558 | 3599 |
// Get document owner and public id |
... | ... | |
3635 | 3676 |
logMetacat.debug("ForceReplicationHandler created: " + frh.toString()); |
3636 | 3677 |
|
3637 | 3678 |
} |
3638 |
outputResponse(successList, errorList, out); |
|
3679 |
if (params.get("forwardto") != null) { |
|
3680 |
try { |
|
3681 |
RequestUtil.forwardRequest(request, response, params); |
|
3682 |
} catch (MetacatUtilException mue) { |
|
3683 |
logMetacat.error("metaCatServlet.handleSetAccessAction - could not forward " + |
|
3684 |
"request. Sending output to response writer"); |
|
3685 |
outputResponse(successList, errorList, out); |
|
3686 |
} |
|
3687 |
} else { |
|
3688 |
outputResponse(successList, errorList, out); |
|
3689 |
} |
|
3639 | 3690 |
} |
3640 | 3691 |
|
3641 | 3692 |
/* |
src/edu/ucsb/nceas/metacat/AccessControlList.java | ||
---|---|---|
31 | 31 |
import java.sql.*; |
32 | 32 |
import java.util.Stack; |
33 | 33 |
import java.util.Vector; |
34 |
import java.util.Hashtable; |
|
35 |
import java.net.URL; |
|
36 |
import java.net.MalformedURLException; |
|
37 | 34 |
|
38 | 35 |
import org.apache.log4j.Logger; |
39 | 36 |
import org.xml.sax.Attributes; |
... | ... | |
42 | 39 |
import org.xml.sax.EntityResolver; |
43 | 40 |
import org.xml.sax.ErrorHandler; |
44 | 41 |
import org.xml.sax.SAXException; |
45 |
import org.xml.sax.SAXParseException; |
|
46 | 42 |
import org.xml.sax.XMLReader; |
47 | 43 |
import org.xml.sax.helpers.XMLReaderFactory; |
48 | 44 |
import org.xml.sax.helpers.DefaultHandler; |
49 | 45 |
|
50 | 46 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
51 | 47 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
52 |
import edu.ucsb.nceas.metacat.database.DatabaseService; |
|
53 | 48 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
54 | 49 |
import edu.ucsb.nceas.metacat.util.MetacatUtil; |
55 | 50 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
... | ... | |
836 | 831 |
endTime != null && !endTime.equals(end_prev) || |
837 | 832 |
beginTime != null && !beginTime.equals(begin_prev) || |
838 | 833 |
ticketCount != ticket_prev ) { |
839 |
if ( (permission & READ) != 0 ) {
|
|
834 |
if ( (permission & READ) == READ ) {
|
|
840 | 835 |
outTemp.append(" <permission>read</permission>\n"); |
841 | 836 |
} |
842 |
if ( (permission & WRITE) != 0 ) {
|
|
837 |
if ( (permission & WRITE) == WRITE ) {
|
|
843 | 838 |
outTemp.append(" <permission>write</permission>\n"); |
844 | 839 |
} |
845 |
if ( (permission & ALL) != 0 ) {
|
|
840 |
if ( (permission & ALL) == ALL ) {
|
|
846 | 841 |
outTemp.append(" <permission>all</permission>\n"); |
847 | 842 |
} |
848 | 843 |
if ( (beginTime != null) || (endTime != null) ) { |
Also available in: Unified diff
Add ability for doc owner to add user access to workflows.