Project

General

Profile

« Previous | Next » 

Revision 5403

Added by berkley over 14 years ago

changed getSessionData so that it will respond property to public tokens

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
467 467
          MetacatResultSet rs = handler.query(metacatUrl, params, sessionData.getUserName(), 
468 468
                  sessionData.getGroupNames(), sessionData.getId());
469 469
          List docs = rs.getDocuments();
470

  
471 470
          if(count == 1000)
472 471
          {
473 472
              count = docs.size();
474 473
          }
474
          
475 475
          for(int i=start; i<count; i++)
476 476
          {
477
              //get the document from the results
477
              //get the document from the result
478 478
              Document d = (Document)docs.get(i);
479 479
              ObjectFormat returnedObjectFormat = ObjectFormat.convert(d.getField("objectFormat"));
480 480
              if(returnedObjectFormat == null)
......
522 522
              ChecksumAlgorithm ca = ChecksumAlgorithm.convert(csalg);
523 523
              cs.setAlgorithm(ca);
524 524
              info.setChecksum(cs);
525
              //System.out.println("info.checksum: " + info.getChecksum().getValue());
526 525
              info.setDateSysMetadataModified(dateSysMetadataModified);
527 526
              Identifier id = new Identifier();
528 527
              id.setValue(d.getField("identifier"));
......
531 530
              info.setSize(new Long(d.getField("size").trim()).longValue());
532 531
              //add the ObjectInfo to the ObjectList
533 532
              ol.addObjectInfo(info);
534
              //System.out.println(d.toString());
535 533
          }
536 534
      }
537 535
      catch(Exception e)
......
926 924
        
927 925
        // if the session id is registered in SessionService, get the
928 926
        // SessionData for it. Otherwise, use the public session.
929
        if (SessionService.getInstance().isSessionRegistered(sessionId)) {
927
        if (sessionId != null &&
928
            !sessionId.equals("PUBLIC") &&
929
            SessionService.getInstance().isSessionRegistered(sessionId)) 
930
        {
931
            System.out.println("looking for registered session");
930 932
            sessionData = SessionService.getInstance().getRegisteredSession(sessionId);
931 933
        } else {
934
            System.out.println("returning public session");
932 935
            sessionData = SessionService.getInstance().getPublicSession();
933 936
        }
934 937
        

Also available in: Unified diff