Project

General

Profile

« Previous | Next » 

Revision 7070

do not allow "Metacat-conforming" identifiers to be used. "test.1.001" is interpreted as "test.1.1" which renders "test.1.002" unusable unless a traditional Metacat "update" is used for that id/revision which contradicts the DataONE use of Identifiers that have no lexical requirements for revisions.

View differences:

src/edu/ucsb/nceas/metacat/IdentifierManager.java
807 807
     * follows Metacat's docid semantics and format (scope.id.rev), and create
808 808
     * a mapping between these two identifiers.  This effectively reserves both
809 809
     * the global and the local identifier, as they will now be present in the
810
     * identifier mapping table.  If the incoming guid has the syntax of a
810
     * identifier mapping table.  
811
     * 
812
     * REMOVED feature: If the incoming guid has the syntax of a
811 813
     * Metacat docid (scope.id.rev), then simply use it.
814
     * WHY: because "test.1.001" becomes "test.1.1" which is not correct for DataONE
815
     * identifier use (those revision numbers are just chartacters and should not be interpreted)
812 816
     * 
813 817
     * @param guid the global string identifier
814 818
     * @param rev the revision number to be used in the localId
......
819 823
        String localId = "";
820 824
        boolean conformsToDocidFormat = false;
821 825
        
826
        // BRL -- do not allow Metacat-conforming IDs to be used:
827
        // test.1.001 becomes test.1.1 which is NOT correct for DataONE identifiers
822 828
        // Check if the guid passed in is already in docid (scope.id.rev) format
823
        try {
824
            AccessionNumber acc = new AccessionNumber(guid, "NONE");
825
            if (new Integer(acc.getRev()).intValue() > 0) {
826
                conformsToDocidFormat = true;
827
            }
828
        } catch (NumberFormatException e) {
829
            // No action needed, simply detecting invalid AccessionNumbers
830
        } catch (AccessionNumberException e) {
831
            // No action needed, simply detecting invalid AccessionNumbers
832
        } catch (SQLException e) {
833
            // No action needed, simply detecting invalid AccessionNumbers
834
        }
829
//        try {
830
//            AccessionNumber acc = new AccessionNumber(guid, "NONE");
831
//            if (new Integer(acc.getRev()).intValue() > 0) {
832
//                conformsToDocidFormat = true;
833
//            }
834
//        } catch (NumberFormatException e) {
835
//            // No action needed, simply detecting invalid AccessionNumbers
836
//        } catch (AccessionNumberException e) {
837
//            // No action needed, simply detecting invalid AccessionNumbers
838
//        } catch (SQLException e) {
839
//            // No action needed, simply detecting invalid AccessionNumbers
840
//        }
835 841
        
836 842
        if (conformsToDocidFormat) {
837 843
            // if it conforms, use it for both guid and localId

Also available in: Unified diff