Revision 9512 org.gvsig.online/trunk/org.gvsig.online/org.gvsig.online.lib/org.gvsig.online.lib.impl/src/main/java/org/gvsig/online/lib/impl/workspace/tables/WorkspaceChangesTable.java

View differences:

WorkspaceChangesTable.java
40 40
import static org.gvsig.online.lib.api.OnlineManager.OP_UPDATE;
41 41
import static org.gvsig.online.lib.api.OnlineManager.STATE_CONFLICT;
42 42
import static org.gvsig.online.lib.api.OnlineManager.STATE_LOCAL_MODIFIED;
43
import static org.gvsig.online.lib.api.OnlineManager.STATE_LOCAL_NEW;
43 44
import static org.gvsig.online.lib.api.OnlineManager.STATE_LOCAL_UNMODIFIED;
44 45
import org.gvsig.online.lib.api.OnlineRuntimeException;
45 46
import org.gvsig.online.lib.impl.OnlineUtils;
......
688 689
        ft.add(STATUS, DataTypes.INTEGER)
689 690
                .setLabel("Status")
690 691
                .setAvailableValues(new DynObjectValueItem[] {
692
                    new DynObjectValueItem(STATE_LOCAL_NEW, "New"),
691 693
                    new DynObjectValueItem(STATE_LOCAL_UNMODIFIED, "Unmodified"),
692 694
                    new DynObjectValueItem(STATE_LOCAL_MODIFIED, "Modified"),
693 695
                    new DynObjectValueItem(STATE_CONFLICT, "Conflict")
......
863 865
        
864 866
        return r;
865 867
    }
868

  
869
    public void changeState(FeatureStore localChangesStore, String entityCode, int searchState, int replaceState) {
870
        try {
871
            boolean needFinish = false;
872
            if(localChangesStore.getMode() == FeatureStore.MODE_QUERY){
873
                localChangesStore.edit(MODE_PASS_THROUGH);
874
                needFinish = true;
875
            }
876
            String filter = "\""+COD_ENTITY+"\"='"+entityCode+"' AND \""+STATUS+"\"="+searchState;
877
            localChangesStore.update(STATUS,replaceState,filter);
878
            if(needFinish) {
879
                localChangesStore.finishEditing();
880
            }
881
        } catch (Exception ex) {
882
            throw new RuntimeException("Can't change state.", ex);
883
        }
884
    }
885

  
866 886
    
867 887
}

Also available in: Unified diff