Project

General

Profile

« Previous | Next » 

Revision 2290

Added by sgarg over 19 years ago

Added a function which returns inline data id with out the revision number.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatUtil.java
534 534
    }
535 535

  
536 536
    /**
537
     * This method will get inline data id without the revision number.
538
     * So if inlineData.1.2 is passed as input, inlineData.2 is returned.
539
     */
540
    public static String getInlineDataIdWithoutRev(String accessionNumber)
541
    {
542
        String docid = null;
543
        if (accessionNumber == null) { return docid; }
544
        String seperator = getOption("accNumSeparator");
545
        int indexOfLastSeperator = accessionNumber.lastIndexOf(seperator);
546
        String version = accessionNumber.substring(indexOfLastSeperator,
547
                                                   accessionNumber.length());
548
        accessionNumber = accessionNumber.substring(0, indexOfLastSeperator);
549
        indexOfLastSeperator = accessionNumber.lastIndexOf(seperator);
550
        docid = accessionNumber.substring(0, indexOfLastSeperator) + version;
551
        MetaCatUtil.debugMessage("after parsing accessionnumber, docid is "
552
                                 + docid, 30);
553

  
554
        return docid;
555
    }
556

  
557
    /**
537 558
     * This method will call both getDocIdFromString and
538 559
     * getDocIdFromAccessionNumber. So first, if the string looks str1.str2,
539 560
     * the docid will be str1.str2. If the string is str1.str2.str3, the docid

Also available in: Unified diff