36 |
36 |
* When "UPDATE", accession # is required.
|
37 |
37 |
* When "DELETE", accession # is required.
|
38 |
38 |
*/
|
39 |
|
public static String generate (String accNumber, String action)
|
|
39 |
public String generate (String accNumber, String action)
|
40 |
40 |
throws AccessionNumberException, SQLException, ClassNotFoundException
|
41 |
41 |
{
|
42 |
42 |
|
... | ... | |
98 |
98 |
}
|
99 |
99 |
|
100 |
100 |
/** put unique accession # into db connection */
|
101 |
|
private static String put (Connection conn, String globalName,
|
|
101 |
private String put (Connection conn, String globalName,
|
102 |
102 |
String localId, String sep)
|
103 |
103 |
throws SQLException
|
104 |
104 |
{
|
... | ... | |
133 |
133 |
}
|
134 |
134 |
|
135 |
135 |
/** check for existence of Accesssion Number xml_acc_numbers table */
|
136 |
|
private static boolean accNumberUsed(Connection conn, String globalName,
|
|
136 |
private boolean accNumberUsed(Connection conn, String globalName,
|
137 |
137 |
String localId) throws SQLException {
|
138 |
138 |
|
139 |
139 |
boolean hasAccNumber = false;
|
... | ... | |
160 |
160 |
}
|
161 |
161 |
|
162 |
162 |
/** check for existence of Accesssion Number in xml_documents table */
|
163 |
|
private static boolean accNumberIsCurrent(
|
|
163 |
private boolean accNumberIsCurrent(
|
164 |
164 |
Connection conn, String accNumber) throws SQLException {
|
165 |
165 |
|
166 |
166 |
boolean hasCurrentAccNumber = false;
|
... | ... | |
186 |
186 |
}
|
187 |
187 |
|
188 |
188 |
/** get the last in order local ID by a given global name */
|
189 |
|
private static int get (Connection conn, String globalName)
|
|
189 |
private int get (Connection conn, String globalName)
|
190 |
190 |
throws SQLException
|
191 |
191 |
{
|
192 |
192 |
try {
|
... | ... | |
214 |
214 |
|
215 |
215 |
|
216 |
216 |
// get the global part of the accession number
|
217 |
|
private static String getGlobalName (String accNumber, String sep)
|
|
217 |
private String getGlobalName (String accNumber, String sep)
|
218 |
218 |
throws StringIndexOutOfBoundsException {
|
219 |
219 |
|
220 |
220 |
return accNumber.substring(0, accNumber.lastIndexOf(sep));
|
221 |
221 |
}
|
222 |
222 |
|
223 |
223 |
// get the local part of the accession number
|
224 |
|
private static String getLocalId (String accNumber, String sep)
|
|
224 |
private String getLocalId (String accNumber, String sep)
|
225 |
225 |
throws StringIndexOutOfBoundsException {
|
226 |
226 |
|
227 |
227 |
return accNumber.substring(accNumber.lastIndexOf(sep)+1);
|
... | ... | |
230 |
230 |
|
231 |
231 |
/**
|
232 |
232 |
* '$Log$
|
|
233 |
* 'Revision 1.11 2000/08/14 20:53:33 jones
|
|
234 |
* 'Added "release" keyword to all metacat source files so that the release
|
|
235 |
* 'number will be evident in software distributions.
|
|
236 |
* '
|
233 |
237 |
* 'Revision 1.10 2000/06/27 04:31:07 jones
|
234 |
238 |
* 'Fixed bugs associated with the new UPDATE and DELETE functions of
|
235 |
239 |
* 'DBWriter. There were problematic interactions between some static
|
cleared static methods in AccessionNumber classes for fixing bug found
when multiple requests to the servlet at a time.