Changeset 4505


Ignore:
Timestamp:
2003-06-06T15:45:40+12:00 (21 years ago)
Author:
kjdon
Message:

when adding a new element to a metadata set, we now need to pass in the value tree so that can get added at teh same time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java

    r4500 r4505  
    654654        boolean cont = false;
    655655        Element mde_new = mds_new.getElement(i);
     656        GValueModel mde_values = mds_new.getValueTree(new ElementWrapper(mde_new));
    656657        // See if the element already exists in the current set
    657658        Element mde_cur = mds_cur.getElement(mde_new.getAttribute("name"));
     
    681682            // Only available to brand new elements, this options
    682683            // simply adds the element to the set.
    683             reason = mds_cur.addElement(mde_new);
     684            reason = mds_cur.addElement(mde_new, mde_values);
    684685            if(reason == null) {
    685686            cont = true;
     
    708709            break;
    709710        case Declarations.RENAME:
    710             ///ystem.err.println("Rename element");
    711711            // This case adds the Element, but requires the user to
    712712            // enter a unique name.
    713713            String new_name = prompt.rename(mde_new);
    714714            if(new_name != null && new_name.length() > 0) {
    715             reason = mds_cur.addElement(mde_new, new_name);
     715            reason = mds_cur.addElement(mde_new, new_name, mde_values);
    716716            if(reason == null) {
    717717                mde_cur = mds_cur.getElement(new_name);
     
    733733        case Declarations.REPLACE:
    734734            // Removes the existing Element then adds the new.
     735           
    735736            mds_cur.removeElement(mde_cur);
    736             reason = mds_cur.addElement(mde_new);
     737           
     738            reason = mds_cur.addElement(mde_new, mde_values);
    737739            if(reason == null) {
    738740            cont = true;
Note: See TracChangeset for help on using the changeset viewer.