Revision 7475
Added by ben leinfelder almost 12 years ago
src/edu/ucsb/nceas/metacat/DocInfoHandler.java | ||
---|---|---|
1 |
/** |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: a class to handle document info request xml strings |
|
4 |
* Copyright: 2000 Regents of the University of California and the |
|
5 |
* National Center for Ecological Analysis and Synthesis |
|
6 |
* Authors: Chad Berkley |
|
7 |
* |
|
8 |
* '$Author$' |
|
9 |
* '$Date$' |
|
10 |
* '$Revision$' |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or modify |
|
13 |
* it under the terms of the GNU General Public License as published by |
|
14 |
* the Free Software Foundation; either version 2 of the License, or |
|
15 |
* (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
25 |
*/ |
|
26 |
|
|
27 |
package edu.ucsb.nceas.metacat; |
|
28 |
|
|
29 |
import java.util.Stack; |
|
30 |
import java.util.Vector; |
|
31 |
import java.util.Hashtable; |
|
32 |
|
|
33 |
import org.xml.sax.Attributes; |
|
34 |
import org.xml.sax.SAXException; |
|
35 |
import org.xml.sax.helpers.DefaultHandler; |
|
36 |
|
|
37 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface; |
|
38 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList; |
|
39 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO; |
|
40 |
|
|
41 |
/** |
|
42 |
* A Class implementing callback methods for the SAX parser to |
|
43 |
* call when processing the XML messages from the replication handler |
|
44 |
*/ |
|
45 |
public class DocInfoHandler extends DefaultHandler { |
|
46 |
|
|
47 |
private Hashtable<String, String> _docinfo = new Hashtable<String, String>(); |
|
48 |
private String _currentTag = null; |
|
49 |
private XMLAccessDAO _currentAccessDAO = null; |
|
50 |
private String _accessPermOrder; |
|
51 |
private String _accessFileId; |
|
52 |
private String _subTreeId; |
|
53 |
private String _guid; |
|
54 |
private boolean _inPrincipal = false; |
|
55 |
private boolean _inPermission = false; |
|
56 |
private boolean _inAllow = false; |
|
57 |
private boolean _inDeny = false; |
|
58 |
|
|
59 |
private Vector<XMLAccessDAO> xmlAccessDAOList = new Vector<XMLAccessDAO>(); |
|
60 |
private Stack<XMLAccessDAO> xmlAccessDAOStack = new Stack<XMLAccessDAO>(); |
|
61 |
|
|
62 |
private String chars = ""; |
|
63 |
|
|
64 |
public DocInfoHandler() { |
|
65 |
} |
|
66 |
|
|
67 |
public DocInfoHandler(String guid) { |
|
68 |
_guid = guid; |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* capture the name of the tag. |
|
73 |
*/ |
|
74 |
public void startElement(String uri, String localName, String qName, |
|
75 |
Attributes attributes) throws SAXException { |
|
76 |
chars = ""; |
|
77 |
_currentTag = localName; |
|
78 |
if (_currentTag.equals("access")) { |
|
79 |
if (_accessPermOrder == null) { |
|
80 |
_accessPermOrder = attributes.getValue("order"); |
|
81 |
} |
|
82 |
if (_accessFileId == null) { |
|
83 |
_accessFileId = attributes.getValue("accessfileid"); |
|
84 |
} |
|
85 |
if (_subTreeId == null) { |
|
86 |
_subTreeId = attributes.getValue("subtreeid"); |
|
87 |
} |
|
88 |
} else if (_currentTag.equals(AccessControlInterface.ALLOW)) { |
|
89 |
_inAllow = true; |
|
90 |
} else if (_currentTag.equals(AccessControlInterface.DENY)) { |
|
91 |
_inDeny = true; |
|
92 |
} else if (_currentTag.equals(AccessControlInterface.PERMISSION)) { |
|
93 |
_inPermission = true; |
|
94 |
} else if (_currentTag.equals(AccessControlInterface.PRINCIPAL)) { |
|
95 |
// new principal means new DAO for storing it |
|
96 |
_inPrincipal = true; |
|
97 |
_currentAccessDAO = new XMLAccessDAO(); |
|
98 |
_currentAccessDAO.setGuid(_guid); |
|
99 |
_currentAccessDAO.setPermOrder(_accessPermOrder); |
|
100 |
_currentAccessDAO.setAccessFileId(_accessFileId); |
|
101 |
_currentAccessDAO.setSubTreeId(_subTreeId); |
|
102 |
if (_inAllow) { |
|
103 |
_currentAccessDAO.setPermType(AccessControlInterface.ALLOW); |
|
104 |
} |
|
105 |
if (_inDeny) { |
|
106 |
_currentAccessDAO.setPermType(AccessControlInterface.DENY); |
|
107 |
} |
|
108 |
} |
|
109 |
} |
|
110 |
|
|
111 |
public void endElement(String uri, String localName, String qName) |
|
112 |
throws SAXException { |
|
113 |
|
|
114 |
_docinfo.put(_currentTag, chars); |
|
115 |
|
|
116 |
if (_currentTag.equals(AccessControlInterface.PRINCIPAL) && _inPrincipal) { |
|
117 |
if (_currentAccessDAO != null) { |
|
118 |
_currentAccessDAO.setPrincipalName(chars); |
|
119 |
} |
|
120 |
} else if (_currentTag.equals(AccessControlInterface.PERMISSION) && _inPermission) { |
|
121 |
if (_currentAccessDAO != null) { |
|
122 |
String permString = chars; |
|
123 |
Long permLong = Long.valueOf(AccessControlList.intValue(permString)); |
|
124 |
//add this permission for each DAO in the stack |
|
125 |
for (int i = 0; i < xmlAccessDAOStack.size(); i++) { |
|
126 |
xmlAccessDAOStack.get(i).addPermission(permLong); |
|
127 |
} |
|
128 |
} |
|
129 |
} |
|
130 |
|
|
131 |
if (localName.equals(AccessControlInterface.ALLOW)) { |
|
132 |
_inAllow = false; |
|
133 |
} else if (localName.equals(AccessControlInterface.DENY)) { |
|
134 |
_inDeny = false; |
|
135 |
} else if (_currentTag.equals(AccessControlInterface.PRINCIPAL)) { |
|
136 |
_inPrincipal = false; |
|
137 |
xmlAccessDAOStack.push(_currentAccessDAO); |
|
138 |
} else if (_currentTag.equals(AccessControlInterface.PERMISSION)) { |
|
139 |
_inPermission = false; |
|
140 |
} |
|
141 |
//end of a section for allow/deny |
|
142 |
if ( |
|
143 |
localName.equals(AccessControlInterface.ALLOW) |
|
144 |
|| |
|
145 |
localName.equals(AccessControlInterface.DENY) |
|
146 |
) { |
|
147 |
//get all the DAOs for this section and add them to the overall list |
|
148 |
xmlAccessDAOList.addAll(xmlAccessDAOStack); |
|
149 |
xmlAccessDAOStack.clear(); |
|
150 |
} |
|
151 |
} |
|
152 |
|
|
153 |
/** |
|
154 |
* put the content and the name of the tag into the hashtable. the name of |
|
155 |
* the tag is the key. |
|
156 |
*/ |
|
157 |
public void characters(char[] ch, int start, int length) throws SAXException |
|
158 |
{ |
|
159 |
chars += new String(ch, start, length); |
|
160 |
} |
|
161 |
|
|
162 |
public Hashtable<String,String> getDocInfo() |
|
163 |
{ |
|
164 |
return _docinfo; |
|
165 |
} |
|
166 |
|
|
167 |
public Vector<XMLAccessDAO> getAccessControlList() { |
|
168 |
return xmlAccessDAOList; |
|
169 |
} |
|
170 |
} |
|
171 | 0 |
src/edu/ucsb/nceas/metacat/accesscontrol/XMLAccessDAO.java | ||
---|---|---|
1 |
/** |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: A Class that represents an XML Text node and its contents, |
|
4 |
* and can build itself from a database connection |
|
5 |
* Copyright: 2000 Regents of the University of California and the |
|
6 |
* National Center for Ecological Analysis and Synthesis |
|
7 |
* Authors: Matt Jones |
|
8 |
* |
|
9 |
* '$Author: daigle $' |
|
10 |
* '$Date: 2008-10-21 15:20:52 -0700 (Tue, 21 Oct 2008) $' |
|
11 |
* '$Revision: 4468 $' |
|
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 |
package edu.ucsb.nceas.metacat.accesscontrol; |
|
29 |
|
|
30 |
import java.sql.Date; |
|
31 |
|
|
32 |
import org.apache.log4j.Logger; |
|
33 |
|
|
34 |
import edu.ucsb.nceas.metacat.shared.BaseDAO; |
|
35 |
|
|
36 |
/** |
|
37 |
* A Class that represents an XML access rule. It include principal and |
|
38 |
* permission |
|
39 |
*/ |
|
40 |
public class XMLAccessDAO extends BaseDAO { |
|
41 |
|
|
42 |
private String _guid = null; |
|
43 |
private String _accessFileId = null; |
|
44 |
private String _principalName = null; |
|
45 |
private Long _permission = null; |
|
46 |
private String _permType = null; |
|
47 |
private String _permOrder = null; |
|
48 |
private Date _beginTime = null; |
|
49 |
private Date _endTime = null; |
|
50 |
private Long _ticketCount = null; |
|
51 |
private String _subTreeId = null; |
|
52 |
private String _startNodeId = null; |
|
53 |
private String _endNodeId = null; |
|
54 |
|
|
55 |
public String getGuid() { |
|
56 |
return _guid; |
|
57 |
} |
|
58 |
|
|
59 |
public void setGuid(String guid) { |
|
60 |
if (guid != null && guid.equals("")) { |
|
61 |
guid = null; |
|
62 |
} else { |
|
63 |
_guid = guid; |
|
64 |
} |
|
65 |
} |
|
66 |
|
|
67 |
public String getAccessFileId() { |
|
68 |
return _accessFileId; |
|
69 |
} |
|
70 |
|
|
71 |
public void setAccessFileId(String accessFileId) { |
|
72 |
if(accessFileId != null && accessFileId.equals("")) { |
|
73 |
_accessFileId = null; |
|
74 |
} else { |
|
75 |
_accessFileId = accessFileId; |
|
76 |
} |
|
77 |
} |
|
78 |
|
|
79 |
public String getPrincipalName() { |
|
80 |
return _principalName; |
|
81 |
} |
|
82 |
|
|
83 |
public void setPrincipalName(String principalName) { |
|
84 |
if (principalName != null && principalName.equals("")) { |
|
85 |
_principalName = null; |
|
86 |
} else { |
|
87 |
_principalName = principalName; |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
91 |
public Long getPermission() { |
|
92 |
return _permission; |
|
93 |
} |
|
94 |
|
|
95 |
public void setPermission(Long permission) { |
|
96 |
if (_permission == null) { |
|
97 |
_permission = new Long(0); |
|
98 |
} |
|
99 |
_permission = permission; |
|
100 |
} |
|
101 |
|
|
102 |
public void addPermission(Long permission) { |
|
103 |
if (_permission != null) { |
|
104 |
_permission |= permission; |
|
105 |
} else { |
|
106 |
_permission = permission; |
|
107 |
} |
|
108 |
} |
|
109 |
|
|
110 |
public String getPermType() { |
|
111 |
return _permType; |
|
112 |
} |
|
113 |
|
|
114 |
public void setPermType(String permType) { |
|
115 |
if (permType != null && permType.equals("")) { |
|
116 |
_permType = null; |
|
117 |
} else { |
|
118 |
_permType = permType; |
|
119 |
} |
|
120 |
} |
|
121 |
|
|
122 |
public String getPermOrder() { |
|
123 |
return _permOrder; |
|
124 |
} |
|
125 |
|
|
126 |
public void setPermOrder(String permOrder) { |
|
127 |
if (permOrder != null && permOrder.equals("")) { |
|
128 |
_permOrder = null; |
|
129 |
} else { |
|
130 |
_permOrder = permOrder; |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
134 |
public Date getBeginTime() { |
|
135 |
return _beginTime; |
|
136 |
} |
|
137 |
|
|
138 |
public void setBeginTime(Date beginTime) { |
|
139 |
_beginTime = beginTime; |
|
140 |
} |
|
141 |
|
|
142 |
public Date getEndTime() { |
|
143 |
return _endTime; |
|
144 |
} |
|
145 |
|
|
146 |
public void setEndTime(Date endTime) { |
|
147 |
_endTime = endTime; |
|
148 |
} |
|
149 |
|
|
150 |
public Long getTicketCount() { |
|
151 |
return _ticketCount; |
|
152 |
} |
|
153 |
|
|
154 |
public void setTicketCount(Long ticketCount) { |
|
155 |
_ticketCount = ticketCount; |
|
156 |
} |
|
157 |
|
|
158 |
public String getSubTreeId() { |
|
159 |
return _subTreeId; |
|
160 |
} |
|
161 |
|
|
162 |
public void setSubTreeId(String subTreeId) { |
|
163 |
if (subTreeId != null && subTreeId.equals("")) { |
|
164 |
_subTreeId = null; |
|
165 |
} else { |
|
166 |
_subTreeId = subTreeId; |
|
167 |
} |
|
168 |
} |
|
169 |
|
|
170 |
public String getStartNodeId() { |
|
171 |
return _startNodeId; |
|
172 |
} |
|
173 |
|
|
174 |
public void setStartNodeId(String startNodeId) { |
|
175 |
if (startNodeId != null && startNodeId.equals("")) { |
|
176 |
_startNodeId = null; |
|
177 |
} else { |
|
178 |
_startNodeId = startNodeId; |
|
179 |
} |
|
180 |
} |
|
181 |
|
|
182 |
public String getEndNodeId() { |
|
183 |
return _endNodeId; |
|
184 |
} |
|
185 |
|
|
186 |
public void setEndNodeId(String endNodeId) { |
|
187 |
if (endNodeId != null && endNodeId.equals("")) { |
|
188 |
endNodeId = null; |
|
189 |
} else { |
|
190 |
_endNodeId = endNodeId; |
|
191 |
} |
|
192 |
} |
|
193 |
|
|
194 |
} |
|
195 | 0 |
src/edu/ucsb/nceas/metacat/accesscontrol/AccessControlInterface.java | ||
---|---|---|
1 |
/** |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: A Class that loads eml-access.xml file containing ACL |
|
4 |
* for a metadata document into relational DB |
|
5 |
* Copyright: 2000 Regents of the University of California and the |
|
6 |
* National Center for Ecological Analysis and Synthesis |
|
7 |
* Authors: Jivka Bojilova |
|
8 |
* |
|
9 |
* '$Author$' |
|
10 |
* '$Date$' |
|
11 |
* '$Revision$' |
|
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 |
package edu.ucsb.nceas.metacat.accesscontrol; |
|
29 |
|
|
30 |
/** |
|
31 |
* This interface will handle the access control for different documents: |
|
32 |
* the package-orented, single eml2 document and other single file |
|
33 |
*/ |
|
34 |
public interface AccessControlInterface |
|
35 |
{ |
|
36 |
public static final String CHMODSTRING = "CHANGEPERMISSION"; |
|
37 |
public static final String WRITESTRING = "WRITE"; |
|
38 |
public static final String READSTRING = "READ"; |
|
39 |
public static final String ALLSTRING = "ALL"; |
|
40 |
public static final int CHMOD = 1; |
|
41 |
public static final int WRITE = 2; |
|
42 |
public static final int READ = 4; |
|
43 |
public static final int ALL = 7; |
|
44 |
public static final String ALLOWFIRST="allowFirst"; |
|
45 |
public static final String DENYFIRST="denyFirst"; |
|
46 |
public static final String ALLOW="allow"; |
|
47 |
public static final String DENY="deny"; |
|
48 |
public static final String PUBLIC="public"; |
|
49 |
public static final String ACLID="acl"; |
|
50 |
public static final String ACCESS="access"; |
|
51 |
public static final String PERMISSION="permission"; |
|
52 |
public static final String PRINCIPAL="principal"; |
|
53 |
|
|
54 |
|
|
55 |
} |
|
56 | 0 |
src/edu/ucsb/nceas/metacat/shared/BaseDAO.java | ||
---|---|---|
1 |
/** |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: A Class that holds the data from the scheduled_task |
|
4 |
* table in the database. |
|
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: daigle $' |
|
10 |
* '$Date: 2009-03-23 13:56:56 -0800 (Mon, 23 Mar 2009) $' |
|
11 |
* '$Revision: 4854 $' |
|
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 |
package edu.ucsb.nceas.metacat.shared; |
|
28 |
|
|
29 |
import java.sql.Timestamp; |
|
30 |
|
|
31 |
public class BaseDAO { |
|
32 |
|
|
33 |
private Long _id; |
|
34 |
private Timestamp _createTime; |
|
35 |
private Timestamp _modTime; |
|
36 |
private String _status; |
|
37 |
|
|
38 |
public Long getId() { |
|
39 |
return _id; |
|
40 |
} |
|
41 |
|
|
42 |
public void setId(Long id) { |
|
43 |
_id = id; |
|
44 |
} |
|
45 |
|
|
46 |
public Timestamp getCreateTime() { |
|
47 |
return _createTime; |
|
48 |
} |
|
49 |
|
|
50 |
public void setCreateTime(Timestamp createTime) { |
|
51 |
_createTime = createTime; |
|
52 |
} |
|
53 |
|
|
54 |
public Timestamp getModTime() { |
|
55 |
return _modTime; |
|
56 |
} |
|
57 |
|
|
58 |
public void setModTime(Timestamp modTime) { |
|
59 |
_modTime = modTime; |
|
60 |
} |
|
61 |
|
|
62 |
public String getStatus() { |
|
63 |
return _status; |
|
64 |
} |
|
65 |
|
|
66 |
public void setStatus(String status) { |
|
67 |
_status = status; |
|
68 |
} |
|
69 |
|
|
70 |
} |
src/edu/ucsb/nceas/metacat/accesscontrol/XMLAccessAccess.java | ||
---|---|---|
39 | 39 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
40 | 40 |
import edu.ucsb.nceas.metacat.shared.AccessException; |
41 | 41 |
import edu.ucsb.nceas.metacat.shared.BaseAccess; |
42 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
43 |
import edu.ucsb.nceas.utilities.access.XMLAccessDAO; |
|
42 | 44 |
|
43 | 45 |
public class XMLAccessAccess extends BaseAccess { |
44 | 46 |
|
src/edu/ucsb/nceas/metacat/accesscontrol/AccessControlForSingleFile.java | ||
---|---|---|
43 | 43 |
import org.xml.sax.helpers.XMLReaderFactory; |
44 | 44 |
|
45 | 45 |
import edu.ucsb.nceas.metacat.DBUtil; |
46 |
import edu.ucsb.nceas.metacat.DocInfoHandler; |
|
47 | 46 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
48 | 47 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
49 | 48 |
import edu.ucsb.nceas.metacat.McdbException; |
... | ... | |
54 | 53 |
import edu.ucsb.nceas.metacat.shared.AccessException; |
55 | 54 |
import edu.ucsb.nceas.metacat.util.DocumentUtil; |
56 | 55 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
56 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
57 |
import edu.ucsb.nceas.utilities.access.DocInfoHandler; |
|
58 |
import edu.ucsb.nceas.utilities.access.XMLAccessDAO; |
|
57 | 59 |
|
58 | 60 |
|
59 | 61 |
/** |
src/edu/ucsb/nceas/metacat/accesscontrol/AccessControlList.java | ||
---|---|---|
55 | 55 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
56 | 56 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
57 | 57 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
58 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
58 | 59 |
|
59 | 60 |
/** |
60 | 61 |
* A Class that loads eml-access.xml file containing ACL for a metadata |
src/edu/ucsb/nceas/metacat/clientview/ClientViewHelper.java | ||
---|---|---|
14 | 14 |
import com.oreilly.servlet.multipart.ParamPart; |
15 | 15 |
import com.oreilly.servlet.multipart.Part; |
16 | 16 |
|
17 |
import edu.ucsb.nceas.metacat.DocInfoHandler; |
|
18 | 17 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
19 | 18 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
20 | 19 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlException; |
21 | 20 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile; |
22 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface; |
|
23 | 21 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList; |
24 | 22 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessAccess; |
25 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO; |
|
26 | 23 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
27 | 24 |
import edu.ucsb.nceas.metacat.client.MetacatClient; |
28 | 25 |
import edu.ucsb.nceas.metacat.client.MetacatException; |
... | ... | |
35 | 32 |
import edu.ucsb.nceas.metacat.util.SessionData; |
36 | 33 |
import edu.ucsb.nceas.utilities.XMLUtilities; |
37 | 34 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
35 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
36 |
import edu.ucsb.nceas.utilities.access.DocInfoHandler; |
|
37 |
import edu.ucsb.nceas.utilities.access.XMLAccessDAO; |
|
38 |
|
|
38 | 39 |
import java.io.BufferedReader; |
39 | 40 |
import java.io.ByteArrayOutputStream; |
40 | 41 |
import java.io.IOException; |
src/edu/ucsb/nceas/metacat/PermissionController.java | ||
---|---|---|
27 | 27 |
*/ |
28 | 28 |
package edu.ucsb.nceas.metacat; |
29 | 29 |
|
30 |
import java.sql.*; |
|
30 |
import java.sql.PreparedStatement; |
|
31 |
import java.sql.ResultSet; |
|
32 |
import java.sql.SQLException; |
|
31 | 33 |
import java.util.Enumeration; |
32 | 34 |
import java.util.Hashtable; |
33 |
import java.util.Stack; |
|
34 | 35 |
import java.util.Vector; |
35 |
import java.util.Iterator; |
|
36 | 36 |
|
37 | 37 |
import org.apache.log4j.Logger; |
38 | 38 |
|
39 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile; |
|
40 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface; |
|
41 | 39 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList; |
42 | 40 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
43 | 41 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
44 | 42 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
45 | 43 |
import edu.ucsb.nceas.metacat.service.SessionService; |
44 |
import edu.ucsb.nceas.metacat.shared.MetacatUtilException; |
|
46 | 45 |
import edu.ucsb.nceas.metacat.util.AuthUtil; |
47 | 46 |
import edu.ucsb.nceas.metacat.util.DocumentUtil; |
48 | 47 |
import edu.ucsb.nceas.metacat.util.MetacatUtil; |
49 | 48 |
import edu.ucsb.nceas.metacat.util.SessionData; |
50 | 49 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
51 |
import edu.ucsb.nceas.metacat.shared.MetacatUtilException; |
|
52 |
import edu.ucsb.nceas.metacat.shared.ServiceException; |
|
50 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
53 | 51 |
|
54 | 52 |
public class PermissionController |
55 | 53 |
{ |
src/edu/ucsb/nceas/metacat/DocumentImpl.java | ||
---|---|---|
58 | 58 |
|
59 | 59 |
import javax.xml.bind.DatatypeConverter; |
60 | 60 |
|
61 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface;
|
|
61 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface;
|
|
62 | 62 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList; |
63 | 63 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
64 | 64 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
src/edu/ucsb/nceas/metacat/MetacatHandler.java | ||
---|---|---|
80 | 80 |
|
81 | 81 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlException; |
82 | 82 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile; |
83 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface;
|
|
83 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface;
|
|
84 | 84 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList; |
85 | 85 |
import edu.ucsb.nceas.metacat.cart.CartManager; |
86 | 86 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
src/edu/ucsb/nceas/metacat/DBQuery.java | ||
---|---|---|
62 | 62 |
|
63 | 63 |
import org.apache.log4j.Logger; |
64 | 64 |
|
65 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface; |
|
66 | 65 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
67 | 66 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
68 | 67 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
... | ... | |
71 | 70 |
import edu.ucsb.nceas.metacat.util.MetacatUtil; |
72 | 71 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
73 | 72 |
|
73 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
74 | 74 |
import edu.ucsb.nceas.utilities.triple.Triple; |
75 | 75 |
import edu.ucsb.nceas.utilities.triple.TripleCollection; |
76 | 76 |
|
src/edu/ucsb/nceas/metacat/shared/BaseAccess.java | ||
---|---|---|
35 | 35 |
|
36 | 36 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
37 | 37 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
38 |
import edu.ucsb.nceas.utilities.BaseDAO; |
|
38 | 39 |
|
39 | 40 |
public abstract class BaseAccess { |
40 | 41 |
|
src/edu/ucsb/nceas/metacat/XMLQueryresultAccess.java | ||
---|---|---|
37 | 37 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
38 | 38 |
import edu.ucsb.nceas.metacat.shared.AccessException; |
39 | 39 |
import edu.ucsb.nceas.metacat.shared.BaseAccess; |
40 |
import edu.ucsb.nceas.metacat.shared.BaseDAO;
|
|
40 |
import edu.ucsb.nceas.utilities.BaseDAO;
|
|
41 | 41 |
|
42 | 42 |
public class XMLQueryresultAccess extends BaseAccess { |
43 | 43 |
|
src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java | ||
---|---|---|
52 | 52 |
import org.xml.sax.Attributes; |
53 | 53 |
import org.xml.sax.SAXException; |
54 | 54 |
|
55 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface;
|
|
55 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface;
|
|
56 | 56 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessRule; |
57 | 57 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessSection; |
58 | 58 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java | ||
---|---|---|
46 | 46 |
import org.xml.sax.Attributes; |
47 | 47 |
import org.xml.sax.SAXException; |
48 | 48 |
|
49 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface;
|
|
49 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface;
|
|
50 | 50 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessRule; |
51 | 51 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessSection; |
52 | 52 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
src/edu/ucsb/nceas/metacat/IdentifierManager.java | ||
---|---|---|
54 | 54 |
import org.dataone.service.types.v1.Subject; |
55 | 55 |
import org.dataone.service.types.v1.SystemMetadata; |
56 | 56 |
|
57 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface; |
|
58 | 57 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessAccess; |
59 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO; |
|
60 | 58 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
61 | 59 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
62 | 60 |
import edu.ucsb.nceas.metacat.database.DatabaseService; |
... | ... | |
65 | 63 |
import edu.ucsb.nceas.metacat.shared.ServiceException; |
66 | 64 |
import edu.ucsb.nceas.metacat.util.DocumentUtil; |
67 | 65 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
66 |
import edu.ucsb.nceas.utilities.access.AccessControlInterface; |
|
67 |
import edu.ucsb.nceas.utilities.access.XMLAccessDAO; |
|
68 | 68 |
|
69 | 69 |
/** |
70 | 70 |
* Manage the relationship between Metacat local identifiers (LocalIDs) that are |
src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java | ||
---|---|---|
58 | 58 |
|
59 | 59 |
import edu.ucsb.nceas.metacat.CatalogMessageHandler; |
60 | 60 |
import edu.ucsb.nceas.metacat.DBUtil; |
61 |
import edu.ucsb.nceas.metacat.DocInfoHandler; |
|
62 | 61 |
import edu.ucsb.nceas.metacat.DocumentImpl; |
63 | 62 |
import edu.ucsb.nceas.metacat.DocumentImplWrapper; |
64 | 63 |
import edu.ucsb.nceas.metacat.EventLog; |
... | ... | |
66 | 65 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
67 | 66 |
import edu.ucsb.nceas.metacat.SchemaLocationResolver; |
68 | 67 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile; |
69 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO; |
|
70 | 68 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
71 | 69 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
72 | 70 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
... | ... | |
77 | 75 |
import edu.ucsb.nceas.metacat.util.MetacatUtil; |
78 | 76 |
import edu.ucsb.nceas.metacat.util.ReplicationUtil; |
79 | 77 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
78 |
import edu.ucsb.nceas.utilities.access.DocInfoHandler; |
|
79 |
import edu.ucsb.nceas.utilities.access.XMLAccessDAO; |
|
80 | 80 |
|
81 | 81 |
|
82 | 82 |
|
src/edu/ucsb/nceas/metacat/replication/ReplicationService.java | ||
---|---|---|
69 | 69 |
import org.xml.sax.SAXException; |
70 | 70 |
import org.xml.sax.XMLReader; |
71 | 71 |
|
72 |
import edu.ucsb.nceas.metacat.DocInfoHandler; |
|
73 | 72 |
import edu.ucsb.nceas.metacat.DocumentImpl; |
74 | 73 |
import edu.ucsb.nceas.metacat.DocumentImplWrapper; |
75 | 74 |
import edu.ucsb.nceas.metacat.EventLog; |
... | ... | |
79 | 78 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlException; |
80 | 79 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile; |
81 | 80 |
import edu.ucsb.nceas.metacat.accesscontrol.PermOrderException; |
82 |
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO; |
|
83 | 81 |
import edu.ucsb.nceas.metacat.admin.upgrade.dataone.GenerateORE; |
84 | 82 |
import edu.ucsb.nceas.metacat.admin.upgrade.dataone.GenerateSystemMetadata; |
85 | 83 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
... | ... | |
98 | 96 |
import edu.ucsb.nceas.utilities.FileUtil; |
99 | 97 |
import edu.ucsb.nceas.utilities.GeneralPropertyException; |
100 | 98 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
99 |
import edu.ucsb.nceas.utilities.access.DocInfoHandler; |
|
100 |
import edu.ucsb.nceas.utilities.access.XMLAccessDAO; |
|
101 | 101 |
|
102 | 102 |
public class ReplicationService extends BaseService { |
103 | 103 |
|
src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobDAO.java | ||
---|---|---|
30 | 30 |
import java.sql.Timestamp; |
31 | 31 |
import java.util.HashMap; |
32 | 32 |
|
33 |
import edu.ucsb.nceas.metacat.shared.BaseDAO;
|
|
33 |
import edu.ucsb.nceas.utilities.BaseDAO;
|
|
34 | 34 |
|
35 |
|
|
35 | 36 |
public class ScheduledJobDAO extends BaseDAO { |
36 | 37 |
|
37 | 38 |
public static String SECONDLY = "s"; |
src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamDAO.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package edu.ucsb.nceas.metacat.scheduler; |
29 | 29 |
|
30 |
import edu.ucsb.nceas.metacat.shared.BaseDAO;
|
|
30 |
import edu.ucsb.nceas.utilities.BaseDAO;
|
|
31 | 31 |
|
32 | 32 |
public class ScheduledJobParamDAO extends BaseDAO { |
33 | 33 |
|
Also available in: Unified diff
move DocInfo parsing into utilities project so that it can be used by Morpho as well as Metacat.
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5737