Package com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo

Examples of com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo.DocumentLocationPojo


      share.setDescription(description);
      share.setCreated(new Date());
      share.setModified(new Date());
     
      // Create DocumentLocationPojo and add to the share
      DocumentLocationPojo documentLocation = new DocumentLocationPojo();
      setRefLocation(location, documentLocation);
      share.setDocumentLocation(documentLocation);
      if (null == documentLocation.getDatabase()) { // (local file)
        // Check, need to be admin:
        if (!RESTTools.adminLookup(ownerIdStr, false)) {
          rp.setResponse(new ResponseObject("Share", false, "Permission denied: you need to be admin to create a local file ref"));
          return rp;
        }       
        if ((null != type) && (type.equalsIgnoreCase("binary") || type.startsWith("binary:"))) {
          String[] binaryType = type.split(":", 2);
          if (binaryType.length > 1) {
            share.setMediaType(binaryType[1]);
            share.setType("binary");
          }
          else {
            share.setMediaType(MimeUtils.getMimeType(FilenameUtils.getExtension(idStr)));
          }
        }
        documentLocation.setCollection(idStr); // collection==file, database==id==null
      }//TESTED
      else {
        documentLocation.set_id(new ObjectId(idStr));       
      }
     
      // Get ShareOwnerPojo object
      PersonPojo owner = getPerson(new ObjectId(ownerIdStr));
      share.setOwner(getOwner(owner));
View Full Code Here


        share.setTitle(title);
        share.setDescription(description);
        share.setModified(new Date());

        // Create DocumentLocationPojo and add to the share
        DocumentLocationPojo documentLocation = new DocumentLocationPojo();
        setRefLocation(location, documentLocation);
        share.setDocumentLocation(documentLocation);
        if (null == documentLocation.getDatabase()) { // (local file)
          // Check, need to be admin:
          if (!RESTTools.adminLookup(ownerIdStr, false)) {
            rp.setResponse(new ResponseObject("Share", false, "Permission denied: you need to be admin to update a local file ref"));
            return rp;
          }       
          if ((null != type) && (type.equalsIgnoreCase("binary") || type.startsWith("binary:"))) {
            String[] binaryType = type.split(":", 2);
            if (binaryType.length > 1) {
              share.setMediaType(binaryType[1]);
              share.setType("binary");
            }
            else {
              share.setMediaType(MimeUtils.getMimeType(FilenameUtils.getExtension(idStr)));
            }
          }
          documentLocation.setCollection(idStr); // collection==file, database==id==null
        }//TESTED
        else {
          documentLocation.set_id(new ObjectId(idStr));       
        }

        // Get ShareOwnerPojo object
        PersonPojo owner = getPerson(new ObjectId(ownerIdStr));
        share.setOwner(getOwner(owner));
View Full Code Here

    List<ShareCommunityPojo> communities = new ArrayList<SharePojo.ShareCommunityPojo>();
    ShareCommunityPojo scp = new ShareCommunityPojo();
    scp.set_id(new ObjectId("4c927585d591d31d7b37097a")); //this is inf system i think
    communities.add(scp);
    share_ref.setCommunities(communities);
    DocumentLocationPojo dlp = new DocumentLocationPojo();
    dlp.setDatabase("doc_metadata");
    dlp.setCollection("metadata");
    dlp.set_id(new ObjectId("53fe2c83e4b060b5b2a6e779")); //this needs to be a valid doc
    share_ref.setDocumentLocation(dlp);
    String share_string = share_ref.toDb().toString();
   
    Representation entity = new StringRepresentation(share_string);
    Representation rep = shareV2Interface.post(entity);
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo.DocumentLocationPojo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.