Project

General

Profile

« Previous | Next » 

Revision 5208

Added by daigle about 14 years ago

Move the chunking of large test element data to centralized location in DBSAXNode.writeChildNodeToDB(). Beff up logging

View differences:

DocumentUtil.java
65 65
        try {
66 66
        	separator = PropertyService.getProperty("document.accNumSeparator").charAt(0);
67 67
        } catch (PropertyNotFoundException pnfe) {
68
        	logMetacat.error("Could not retrieve account number separator. " 
68
        	logMetacat.error("DocumentUtil() - Could not retrieve account number separator. " 
69 69
        			+ "Separator set to '.' : " + pnfe.getMessage());
70 70
        }
71 71
    }
......
82 82
        int count = 0; //keep track how many & was found
83 83
        Vector list = new Vector();// keep index number for &
84 84
        if (url == null) {
85
            logMetacat.info("url is null and null will be returned");
85
            logMetacat.debug("DocumentUtil.getDocIdWithRevFromOnlineURL - url is null and null will be returned");
86 86
            return docid;
87 87
        }
88 88
        // the first element in list is 0
......
95 95
                // get substring beween two &
96 96
                String str = url.substring(
97 97
                        ((Integer) list.elementAt(count - 1)).intValue(), i);
98
                logMetacat.info("substring between two & is: " + str);
98
                logMetacat.debug("DocumentUtil.getDocIdWithRevFromOnlineURL - substring between two & is: " + str);
99 99
                //if the subString contains docid, we got it
100 100
                if (str.indexOf(DOCID) != -1) {
101 101
                    //get index of '="
......
110 110
        // and
111 111
        // the end of string
112 112
        if (!find) {
113
            logMetacat.info("Checking the last substring");
113
            logMetacat.debug("DocumentUtil.getDocIdWithRevFromOnlineURL - Checking the last substring");
114 114
            String str = url.substring(((Integer) list.elementAt(count))
115 115
                    .intValue() + 1, url.length());
116
            logMetacat.info("Last substring is: " + str);
116
            logMetacat.debug("DocumentUtil.getDocIdWithRevFromOnlineURL - Last substring is: " + str);
117 117
            if (str.indexOf(DOCID) != -1) {
118 118
                //get index of '="
119 119
                int start = getIndexForGivenChar(str, '=') + 1;
......
122 122
                find = true;
123 123
            }//if
124 124
        }//if
125
        logMetacat.info("The docid from online url is:" + docid);
125
        logMetacat.debug("DocumentUtil.getDocIdWithRevFromOnlineURL - The docid from online url is:" + docid);
126 126
        return docid.trim();
127 127
    }
128 128

  
......
145 145
        int end   = identifier.length();
146 146
        accessionNumber = identifier.substring(start, end);
147 147
      }
148
      logMetacat.warn("The accession number from url is " +
148
      logMetacat.warn("DocumentUtil.getAccessionNumberFromEcogridIdentifier - The accession number from url is " +
149 149
                                 accessionNumber);
150 150
      return accessionNumber;
151 151
    }
......
155 155
        int index = -1;
156 156
        // make sure str is not null
157 157
        if (str == null) {
158
            logMetacat.info(
158
            logMetacat.debug("DocumentUtil.getIndexForGivenChar - " +
159 159
                    "The given str is null and -1 will be returned");
160 160
            return index;
161 161
        }
......
167 167
                break;
168 168
            }//if
169 169
        }//for
170
        logMetacat.info("the index for char " + character + " is: "
171
                + index);
170
        logMetacat.info("DocumentUtil.getIndexForGivenChar - the index for char " + 
171
        		character + " is: " + index);
172 172
        return index;
173 173
    }
174 174

  
......
184 184
    {
185 185
        String docId = null;
186 186
        if (str == null) {
187
            logMetacat.info(
188
                    "The given str is null and null will be returned"
187
            logMetacat.debug(
188
                    "DocumentUtil.getDocIdFromString - The given str is null and null will be returned"
189 189
                            + " in getDocIdfromString");
190 190
            return docId;
191 191
        } //make sure docid is not null
......
305 305
        if (accessionNumber == null) { return docid; }
306 306
        int indexOfLastSeperator = accessionNumber.lastIndexOf(separator);
307 307
        docid = accessionNumber.substring(0, indexOfLastSeperator);
308
        logMetacat.info("after parsing accessionnumber, docid is "
308
        logMetacat.debug("DocumentUtil.getDocIdFromAccessionNumber - after parsing accession number, docid is "
309 309
                + docid);
310 310
        return docid;
311 311
    }
......
324 324
        accessionNumber = accessionNumber.substring(0, indexOfLastSeperator);
325 325
        indexOfLastSeperator = accessionNumber.lastIndexOf(separator);
326 326
        docid = accessionNumber.substring(0, indexOfLastSeperator) + version;
327
        logMetacat.info("after parsing accessionnumber, docid is "
327
        logMetacat.debug("DocumentUtil.getInlineDataIdWithoutRev - after parsing accessionnumber, docid is "
328 328
                                 + docid);
329 329

  
330 330
        return docid;
......
349 349
        if (docid == null) {
350 350
            docid = getDocIdFromAccessionNumber(str);
351 351
        }
352
        logMetacat.info("The docid get from smart docid getor is "
352
        logMetacat.debug("DocumentUtil.getSmartDocId - The docid get from smart docid getor is "
353 353
                + docid);
354 354
        return docid;
355 355
    }
......
369 369
        rev = accessionNumber.substring(indexOfLastSeperator + 1,
370 370
                accessionNumber.length());
371 371
        revNumber = Integer.parseInt(rev);
372
        logMetacat.info("after parsing accessionnumber, rev is "
372
        logMetacat.debug("DocumentUtil.getRevisionFromAccessionNumber - after parsing accessionnumber, rev is "
373 373
                + revNumber);
374 374
        return revNumber;
375 375
    }
......
398 398
            }
399 399
        }
400 400

  
401
        logMetacat.info("Docid without rev from inlinedata id: "
401
        logMetacat.debug("DocumentUtil.getDocIdWithoutRevFromInlineDataID - Docid without rev from inlinedata id: "
402 402
                + docidWithoutRev);
403 403
        return docidWithoutRev;
404 404

  

Also available in: Unified diff