Project

General

Profile

« Previous | Next » 

Revision 5691

Added by berkley almost 14 years ago

changed d1 url to knb/d1/....

View differences:

lib/web.xml.tomcat5
367 367

  
368 368
    <servlet-mapping>
369 369
        <servlet-name>RestServlet</servlet-name>
370
        <url-pattern>/object/*</url-pattern>
370
        <url-pattern>/d1/object/*</url-pattern>
371 371
    </servlet-mapping>
372 372
    
373 373
    <servlet-mapping>
374 374
        <servlet-name>RestServlet</servlet-name>
375
        <url-pattern>/meta/*</url-pattern>
375
        <url-pattern>/d1/meta/*</url-pattern>
376 376
    </servlet-mapping>
377 377

  
378 378
    <servlet-mapping>
379 379
        <servlet-name>RestServlet</servlet-name>
380
        <url-pattern>/session/*</url-pattern>
380
        <url-pattern>/d1/session/*</url-pattern>
381 381
    </servlet-mapping>
382 382

  
383 383
    <servlet-mapping>
384 384
        <servlet-name>RestServlet</servlet-name>
385
        <url-pattern>/identifier/*</url-pattern>
385
        <url-pattern>/d1/identifier/*</url-pattern>
386 386
    </servlet-mapping>
387 387
    
388 388
    <servlet-mapping>
389 389
        <servlet-name>RestServlet</servlet-name>
390
        <url-pattern>/log/*</url-pattern>
390
        <url-pattern>/d1/log/*</url-pattern>
391 391
    </servlet-mapping>
392 392
    
393 393
    <servlet-mapping>
394 394
        <servlet-name>RestServlet</servlet-name>
395
        <url-pattern>/checksum/*</url-pattern>
395
        <url-pattern>/d1/checksum/*</url-pattern>
396 396
    </servlet-mapping>
397 397

  
398 398

  
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
253 253
        logMetacat = Logger.getLogger(ResourceHandler.class);
254 254
        try {
255 255
            String resource = request.getServletPath();
256
            //substring off the /d1/
257
            resource = resource.substring(resource.indexOf("d1/") + 3, resource.length());
258
            resource = resource.trim();
256 259
            String verb = "";
257 260
            
258
            System.out.println("handling verb " + httpVerb + " request with resource " + resource);
261
            System.out.println("handling verb " + httpVerb + " request with resource '" + resource + "'");
259 262
            boolean status = false;
260 263
            loadSessionData();
261 264

  
262 265
            if (resource != null) {
263
                resource = request.getServletPath().substring(1);
266
                //resource = request.getServletPath().substring(1);
264 267

  
265 268
                params = new Hashtable<String, String[]>();
266 269
                initParams();
......
271 274
                if (resource.equals(RESOURCE_SESSION) && 
272 275
                        httpVerb == POST && 
273 276
                        params.get(FUNCTION_KEYWORD) != null) {
277
                    System.out.println("Using resource 'session'");
274 278
                    //System.out.println("function_keyword: " + params.get(FUNCTION_KEYWORD)[0]);
275 279
                    if (params.get(FUNCTION_KEYWORD)[0].equals(FUNCTION_NAME_LOGIN)) {
276 280
                        login();
......
284 288
                        //System.out.println("done setting access");
285 289
                    }
286 290
                } else if (resource.equals(RESOURCE_META)) {
291
                    System.out.println("Using resource 'meta'");
287 292
                    if(params != null && params.get(FUNCTION_KEYWORD) != null &&
288 293
                            params.get(FUNCTION_KEYWORD)[0].equals(FUNCTION_NAME_GENERATE_MISSING_SYSTEM_METADATA))
289 294
                    { //generate system metadata for any object that is
......
307 312
                    }
308 313

  
309 314
                } else if (resource.equals(RESOURCE_OBJECTS)) {
315
                    System.out.println("Using resource 'object'");
310 316
                    logMetacat.debug("D1 Rest: Starting resource processing...");
311 317
                    loadSessionData();
312 318

  
......
341 347
                    
342 348

  
343 349
                } else if (resource.equals(RESOURCE_IDENTIFIER)) {
344

  
350
                    System.out.println("Using resource 'identifier'");
345 351
                    String identifierId = request.getPathInfo();
346 352
                    if (identifierId != null && identifierId.length() > 1)
347 353
                        identifierId = request.getPathInfo().substring(1); //trim the slash
......
373 379
                    }
374 380

  
375 381
                } else if (resource.equals(RESOURCE_LOG)) {
382
                    System.out.println("Using resource 'log'");
376 383
                    //handle log events
377 384
                    if(httpVerb == GET)
378 385
                    {
......
388 395
                    }
389 396

  
390 397
                } else if(resource.equals(RESOURCE_CHECKSUM)) {
398
                    System.out.println("Using resource 'checksum'");
391 399
                    //handle checksum requests
392
                    System.out.println("Handling getChecksum request");
393 400
                    if(httpVerb == GET)
394 401
                    {
395 402
                        String guid = null;

Also available in: Unified diff