Project

General

Profile

« Previous | Next » 

Revision 7100

use 'formatId' for listObjects() parameter
https://redmine.dataone.org/issues/2550

View differences:

src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java
904 904
        { //call listObjects with specified params
905 905
            Date startTime = null;
906 906
            Date endTime = null;
907
            ObjectFormat objectFormat = null;
907
            ObjectFormatIdentifier formatId = null;
908 908
            boolean replicaStatus = false;
909 909
            int start = 0;
910 910
            //TODO: make the max count into a const
......
941 941
                        endTime = null;
942 942
                    }
943 943
                }
944
                else if(name.equals("objectFormat") && value != null) 
944
                else if(name.equals("formatId") && value != null) 
945 945
                {
946
                    objectFormat = ObjectFormatCache.getInstance().getFormat(value[0]);
946
                	formatId = new ObjectFormatIdentifier();
947
                	formatId.setValue(value[0]);
947 948
                }
948 949
                else if(name.equals("replicaStatus") && value != null)
949 950
                {
......
965 966
            }
966 967
            //make the crud call
967 968
            logMetacat.debug("session: " + session + " startTime: " + startTime +
968
                    " endtime: " + endTime + " objectFormat: " + 
969
                    objectFormat + " replicaStatus: " + replicaStatus + 
969
                    " endTime: " + endTime + " formatId: " + 
970
                    formatId + " replicaStatus: " + replicaStatus + 
970 971
                    " start: " + start + " count: " + count);
971 972
           
972
            ObjectFormatIdentifier fmtid = null;
973
           
974
            if ( objectFormat != null ) {
975
          	 fmtid = objectFormat.getFormatId();
976
          	 
977
            }
978 973
            ObjectList ol = 
979 974
           	 MNodeService.getInstance(request).listObjects(session, startTime, endTime, 
980
               fmtid, replicaStatus, start, count);
975
           			formatId, replicaStatus, start, count);
981 976
           
982 977
            out = response.getOutputStream();  
983 978
            response.setStatus(200);
src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java
1173 1173

  
1174 1174
        Date startTime = null;
1175 1175
        Date endTime = null;
1176
        ObjectFormatIdentifier fmtid = null;
1176
        ObjectFormatIdentifier formatId = null;
1177 1177
        boolean replicaStatus = false;
1178 1178
        int start = 0;
1179 1179
        int count = -1;
......
1204 1204
                    logMetacat.warn("Could not parse toDate: " + value);
1205 1205
                    endTime = null;
1206 1206
                }
1207
            } else if (name.equals("objectFormat") && value != null) {
1208
            	fmtid = new ObjectFormatIdentifier();
1209
            	fmtid.setValue(value);
1207
            } else if (name.equals("formatId") && value != null) {
1208
            	formatId = new ObjectFormatIdentifier();
1209
            	formatId.setValue(value);
1210 1210
            } else if (name.equals("replicaStatus") && value != null) {
1211 1211
                replicaStatus = Boolean.parseBoolean(value);
1212 1212
            } else if (name.equals("start") && value != null) {
......
1217 1217
        }
1218 1218
        // make the call
1219 1219
        logMetacat.debug("session: " + session + " fromDate: " + startTime
1220
                + " toDate: " + endTime + " objectFormat: " + fmtid
1220
                + " toDate: " + endTime + " formatId: " + formatId
1221 1221
                + " replicaStatus: " + replicaStatus + " start: " + start
1222 1222
                + " count: " + count);        
1223 1223

  
1224 1224
        // get the list
1225 1225
        ObjectList ol = CNodeService.getInstance(request).listObjects(session,
1226
                startTime, endTime, fmtid, replicaStatus, start, count);
1226
                startTime, endTime, formatId, replicaStatus, start, count);
1227 1227

  
1228 1228
        // send it
1229 1229
        OutputStream out = response.getOutputStream();

Also available in: Unified diff