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

Examples of com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo.toDb()


          toModify.setLastDocIdInserted(maxDocId);
         
          // We've modified the share so update it:
          savedQueryShare.setShare(toModify.toApi());
          savedQueryShare.setModified(new Date());
          DbManager.getSocial().getShare().save(savedQueryShare.toDb());
         
        }//(end found some docs)
       
      }//(end found share)
     
View Full Code Here


      queryShare.setType("infinite-saved-query");
      queryShare.setTitle("test query " + testNum);
      queryShare.setDescription("test query " + testNum);
      queryShare.setShare(query.getQueryInfo().getQuery().toApi());   
      addSocial(queryShare);
      DbManager.getSocial().getShare().save(queryShare.toDb());

      query.getQueryInfo().setQuery(null);
    }
   
    // Build a template share
View Full Code Here

    share.setTitle("test" + testNum);
    share.setDescription("test1" + testNum);
    share.setShare(query.toApi());   
    addSocial(share);
   
    DbManager.getSocial().getShare().save(share.toDb());
  }
  private static void addSocial(SharePojo share) {
    ShareOwnerPojo person = new ShareOwnerPojo();
    person.set_id(new ObjectId("4e3706c48d26852237078005")); // (admin)
    person.setEmail("infinite_default@ikanow.com");
View Full Code Here

      //Save the binary objects into separate db
      ObjectId gridid = saveGridFile(bytes);
      share.setBinaryId(gridid);
     
      // Save the document to the share collection
      DbManager.getSocial().getShare().save(share.toDb());
      rp.setResponse(new ResponseObject("Share", true, "New binary share added successfully. ID in data field"));
      rp.setData(id.toString(), null);
    }
    catch (Exception e)
    {
View Full Code Here

        share.setDescription(description);
        share.setMediaType(mediatype);
        share.setBinaryData(null);
        share.setBinaryId(updateGridFile(share.getBinaryId(), bytes));
       
        DbManager.getSocial().getShare().update(query, share.toDb());
       
        rp.setResponse(new ResponseObject("Update Share", true, "Binary share updated successfully"));
      }
      else
      {
View Full Code Here

        share.setTitle(title);
        share.setDescription(description);
        share.setShare(json);
       
        // Save the document to the share collection
        DbManager.getSocial().getShare().update(query, share.toDb());
        rp.setData(share, new SharePojoApiMap(null));
        rp.setResponse(new ResponseObject("Share", true, "Share updated successfully."));
      }
      // Create new share
      else
View Full Code Here

        share.setOwner(getOwner(owner));
        share.setCommunities(getPersonalCommunity(owner));

        // Serialize the ID and Dates in the object to MongoDB format
        // Save the document to the share collection
        DbManager.getSocial().getShare().save(share.toDb());
        rp.setData(share, new SharePojoApiMap(null));
        rp.setResponse(new ResponseObject("Share", true, "New share added successfully."));
      }
    }
    catch (Exception e)
View Full Code Here

      // Set Personal Community
      share.setCommunities(getPersonalCommunity(owner));

      // Serialize the ID and Dates in the object to MongoDB format
      // Save the document to the share collection
      DbManager.getSocial().getShare().save(share.toDb());
      rp.setResponse(new ResponseObject("Share", true, "New share added successfully. ID in data field."));
      rp.setData(share.get_id().toString(), null);
    }
    catch (Exception e)
    {
View Full Code Here

        // Set Personal Community
        share.setCommunities(getPersonalCommunity(owner));

        // Serialize the ID and Dates in the object to MongoDB format
        // Save the document to the share collection
        DbManager.getSocial().getShare().update(query, share.toDb());
        rp.setResponse(new ResponseObject("Share", true, "Share updated successfully."));
      }
      else
      {
        rp.setResponse(new ResponseObject("Share", false, "Unable to update share: only the owner of the share or admin can update it."));
View Full Code Here

            }
            //TESTED - adding as admin/community owner, not adding if not
          }         
          share.setModified(new Date());

          DbManager.getSocial().getShare().update(query, share.toDb());
          rp.setResponse(new ResponseObject("Share", true, "Community successfully added to the share"));
        }
        // Community already in share.communities
        else
        {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.