Package org.waveprotocol.wave.model.document

Examples of org.waveprotocol.wave.model.document.ObservableDocument


        "<node key=\"mime_type\" value=\"" + ATTACHMENT_MIMETYPE + "\"></node>" +
        "<node key=\"filename\" value=\"CIMG0217.JPG\"></node>" +
        "<node key=\"thumbnail_url\" value=\"/thumbnail/CIMG0217_thumb.jpg?id=xJFILMDj3&amp;" +
            "key=AH0qf5woLURO3-CemfDebYFaWA9fD3PMuA\"></node>" +
        "<node key=\"attachment_url\" value=\"" + ATTACHMENT_URL + "\"></node>";
    ObservableDocument document = mock(ObservableDocument.class);
    when(document.toXmlString()).thenReturn(xmlString);

    Wavelet wavelet = mock(Wavelet.class);
    when(wavelet.getDocument("attach+" + attachmentId)).thenReturn(document);
    return wavelet;
  }
View Full Code Here


  public static void copyDocument(Wavelet sourceWavelet, Wavelet destWavelet, String docId) {
    Document document = sourceWavelet.getDocument(docId);
    DocInitialization docInit = document.toInitialization();
    // TODO(user): add a createDocument method to Wavelet so that we can push this ugliness
    // down the stack.
    ObservableDocument destDoc = destWavelet.getDocument(docId);
    destDoc.hackConsume(Nindo.fromDocOp(docInit, false /* don't remove skip */));
  }
View Full Code Here

  /**
   * Creates and stores a conversation container. If the container has a
   * conversation then initializes that too.
   */
  private ConversationContainer createContainer(ObservableWavelet wavelet) {
    ObservableDocument manifestDoc = wavelet.getDocument(IdConstants.MANIFEST_DOCUMENT_ID);
    DocEventRouter router = DefaultDocEventRouter.create(manifestDoc);
    ObservableSingleton<DocumentBasedManifest, Void> manifestContainer =
        DocumentBasedSingleton.create(router, manifestDoc.getDocumentElement(),
           DocumentBasedManifest.MANIFEST_TOP_TAG, DocumentBasedManifest.FACTORY);
    ConversationContainer container = new ConversationContainer(wavelet, manifestContainer);
    manifestContainer.addListener(container);
    containers.put(wavelet, container);

View Full Code Here

        }});
      tags.processInitialState();
    }

    // Add the participant roles.
    ObservableDocument rolesDocument = wavelet.getDocument(IdConstants.ROLES_DATA_DOC_ID);
    if (rolesDocument != null) {
      DocumentBasedRoles roles = DocumentBasedRoles.create(rolesDocument);
      for (ParticipantId participantId : wavelet.getParticipantIds()) {
        waveletData.setParticipantRole(participantId.getAddress(),
            roles.getRole(participantId).name());
View Full Code Here

    folders = fungeCreateFolders(userData.getDocument(FOLDERS_DOCUMENT));
    muted = fungeCreateMuted(userData.getDocument(MUTED_DOCUMENT));
    waveletArchiveVersions = fungeCreateWaveletArchiveState(
        userData.getDocument(ARCHIVING_DOCUMENT));
    archiveCleared = fungeCreateCleared(userData.getDocument(CLEARED_DOCUMENT));
    ObservableDocument readState = userData.getDocument(READSTATE_DOCUMENT);
    read = fungeCreateReadState(readState, forwardingListener);
    collapsed = fungeCreateCollapsedState(
        userData.getDocument(PRESENTATION_DOCUMENT), forwardingListener);
    abuseStore = fungeCreateAbuseStore(userData.getDocument(ABUSE_DOCUMENT));
    seenVersion = fungeCreateSeenVersion(userData.getDocument(SEEN_DOCUMENT));
View Full Code Here

    if (blip != null) {
      String blipId1 = blip.getId();

      EventGeneratingDocumentHandler docHandler = docHandlers.get(blipId1);
      if (docHandler == null) {
        ObservableDocument doc = (ObservableDocument) blip.getContent();
        docHandler = new EventGeneratingDocumentHandler(
            doc, blip, capabilities, messages, deltaAuthor, timestamp);
        doc.addListener(docHandler);
        docHandlers.put(blipId1, docHandler);
      } else {
        docHandler.setAuthorAndTimeStamp(deltaAuthor, timestamp);
      }
    }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.ObservableDocument

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.