Package org.latexlab.docs.client.gdocs

Examples of org.latexlab.docs.client.gdocs.DocumentServiceEntry


    addNamedField(primary, "Primary Resource: ");
    ok = new Button("OK", new ClickHandler(){
      public void onClick(ClickEvent event) {
        hide();
        String primaryResourceId = primary.getValue(primary.getSelectedIndex());
        DocumentServiceEntry primaryResource = null;
        ArrayList<DocumentServiceEntry> resources = getSelectedResources();
        if (!primaryResourceId.equals("")) {
          for (DocumentServiceEntry entry : resources) {
            if (entry.getDocumentId().equals(primaryResourceId)) {
              primaryResource = entry;
View Full Code Here


   */
  public ArrayList<DocumentServiceEntry> getSelectedEntries() {
  ArrayList<DocumentServiceEntry> selected = new ArrayList<DocumentServiceEntry>();
  for (ExplorerTreeItem item : entries.keySet()) {
    if (item.isSelected()) {
      DocumentServiceEntry entry = entries.get(item);
      selected.add(entry);
    }
    }
    return selected;
  }
View Full Code Here

   *
   * @param entry the document entry to reference
   * @return a document reference
   */
  private DocumentServiceEntry getDocumentReference(DocumentListEntry entry) {
    DocumentServiceEntry doc = new DocumentServiceEntry();
    doc.setType(entry.getType());
    doc.setDocumentId(entry.getDocId());
    doc.setResourceId(entry.getResourceId());
    doc.setTitle(entry.getTitle().getPlainText());
    doc.setIdentifier(doc.getTitle().replaceAll("[^a-zA-Z0-9_\\-\\.]", ""));
    doc.setAuthor(entry.getAuthors().get(0).getEmail());
    doc.setCreated(new Date(entry.getPublished().getValue()));
    doc.setEdited(new Date(entry.getEdited().getValue()));
    doc.setEditor(entry.getLastModifiedBy().getName());
    doc.setEtag(entry.getEtag());
    doc.setStarred(entry.isStarred());
    String prefix = getResourceIdPrefix(entry.getResourceId());
    if (prefix != null && prefix.equalsIgnoreCase("document")) {
      doc.setContentType("text/plain");
      if (entry.getContent() != null) {
        MediaContent mc = (MediaContent) entry.getContent();
      doc.setContentLink(mc.getUri() + "&format=txt&exportFormat=txt");
      } else {
        doc.setContentLink(DOCS_SCOPE +
            "download/documents/Export?format=txt&exportFormat=txt&docID=" +
            entry.getResourceId() + "&id=" + entry.getResourceId());
      }
    } else {
      MediaContent mc = (MediaContent) entry.getContent();
      doc.setContentType(mc.getMimeType().getMediaType());
      doc.setContentLink(mc.getUri());
    }
    //System.out.println("Content Link: " + doc.getContentLink());
    List<Link> parents = entry.getParentLinks();
    String[] folders = new String[parents.size()];
    for (int i=0; i<parents.size(); i++) {
      folders[i] = parents.get(i).getTitle();
    }
    doc.setFolders(folders);
    return doc;
  }
View Full Code Here

   * Retrieves a new, unsaved, document.
   */
  @Override
  public DocumentServiceEntry getNewDocument() {
    UserService userService = UserServiceFactory.getUserService();
    DocumentServiceEntry doc = new DocumentServiceEntry();
    doc.setTitle("Untitled Document");
    doc.setIdentifier(doc.getTitle().replaceAll("[^a-zA-Z0-9_\\-\\.]", ""));
    doc.setAuthor(userService.getCurrentUser().getEmail());
    doc.setEditor(userService.getCurrentUser().getNickname());
    return doc;
  }
View Full Code Here

        }
        public void onSuccess(DocumentServiceEntry[] result) {
          allDocuments = result;
          if (settings.getResources().size() > 0) {
            ArrayList<DocumentServiceEntry> resources = new ArrayList<DocumentServiceEntry>();
            DocumentServiceEntry primary = null;
            for (DocumentServiceEntry res : settings.getResources()) {
              for (DocumentServiceEntry doc : result) {
              if (doc.equals(res)) {
                resources.add(doc);
              }
View Full Code Here

      @Override
      public void onSuccess(DocumentSignedLocation[] result) {
      ClsiResourceReference[] refs = new ClsiResourceReference[size];
        for (int i=0; i<size; i++) {
          DocumentSignedLocation dsl = result[i];
          DocumentServiceEntry entry = settings.getResources().get(i);
          refs[i] = ClsiResourceReference.newInstance(entry.getDocumentId(),
              entry.getIdentifier(), dsl.getUrl(), dsl.getAuthorization(),
              entry.getContentType(), null, entry.getEdited());
        }
        callback.onSuccess(refs);
      }
    });
  } else {
View Full Code Here

TOP

Related Classes of org.latexlab.docs.client.gdocs.DocumentServiceEntry

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.