@Override public void onBlipAdded(ObservableConversationBlip blip) { if (capabilities.containsKey(EventType.WAVELET_BLIP_CREATED)) { String rootBlipId = ConversationUtil.getRootBlipId(conversation); WaveletBlipCreatedEvent event = new WaveletBlipCreatedEvent( null, null, deltaAuthor.getAddress(), deltaTimestamp, rootBlipId, blip.getId()); addEvent(event, capabilities, rootBlipId, messages); } }
@Override public void onBlipDeleted(ObservableConversationBlip blip) { if (capabilities.containsKey(EventType.WAVELET_BLIP_REMOVED)) { String rootBlipId = ConversationUtil.getRootBlipId(conversation); WaveletBlipRemovedEvent event = new WaveletBlipRemovedEvent( null, null, deltaAuthor.getAddress(), deltaTimestamp, rootBlipId, blip.getId()); addEvent(event, capabilities, rootBlipId, messages); } }
String blipId1 = blip.getId();
@Override public void execute( OperationRequest operation, OperationContext context, ParticipantId participant) throws InvalidRequestException { String title = OperationUtil.getRequiredParameter(operation, ParamsProperty.WAVELET_TITLE); ObservableConversation conversation = context.openConversation(operation, participant).getRoot(); String blipId = conversation.getRootThread().getFirstBlip().getId(); Document doc = context.getBlip(conversation, blipId).getContent(); TitleHelper.setExplicitTitle(doc, title); }
public void testGenerateWaveletBlipCreatedEvent() throws Exception { ObservableConversationView conversation = conversationUtil.buildConversation(wavelet); ObservableConversationBlip newBlip = conversation.getRoot().getRootThread().appendBlip(); EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_BLIP_CREATED); assertEquals("Expected one event", 1, messages.getEvents().size()); WaveletBlipCreatedEvent event = WaveletBlipCreatedEvent.as(messages.getEvents().get(0)); assertEquals("Expected the same id as the new blip", newBlip.getId(), event.getNewBlipId()); }
public void testGenerateWaveletBlipCreatedEvent() throws Exception { ObservableConversationView conversation = conversationUtil.buildConversation(wavelet); ObservableConversationBlip newBlip = conversation.getRoot().getRootThread().appendBlip(); EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_BLIP_CREATED); assertEquals("Expected one event", 1, messages.getEvents().size()); WaveletBlipCreatedEvent event = WaveletBlipCreatedEvent.as(messages.getEvents().get(0)); assertEquals("Expected the same id as the new blip", newBlip.getId(), event.getNewBlipId()); }
@Override protected void setUp() throws Exception { service = DocumentModifyService.create(); helper = new OperationServiceHelper(WAVELET_NAME, ALEX); ObservableConversationBlip rootBlip = getRootBlip(); rootBlipId = rootBlip.getId(); LineContainers.appendToLastLine( rootBlip.getContent(), XmlStringBuilder.createText(INITIAL_CONTENT)); }
@Override protected void setUp() throws Exception { service = DocumentModifyService.create(); helper = new OperationServiceHelper(WAVELET_NAME, ALEX); ObservableConversationBlip rootBlip = getRootBlip(); rootBlipId = rootBlip.getId(); LineContainers.appendToLastLine( rootBlip.getContent(), XmlStringBuilder.createText(INITIAL_CONTENT)); }
public void testGenerateWaveletBlipRemovedEvent() throws Exception { ObservableConversationThread rootThread = conversationUtil.buildConversation(wavelet).getRoot().getRootThread(); ObservableConversationBlip newBlip = rootThread.appendBlip(); newBlip.delete(); EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_BLIP_REMOVED); assertEquals("Expected two events", 2, messages.getEvents().size()); // Blip removed should be the second event. WaveletBlipRemovedEvent event = WaveletBlipRemovedEvent.as(messages.getEvents().get(1)); assertEquals("Expected the same id as the removed blip", newBlip.getId(), event.getRemovedBlipId()); }
public void testGenerateWaveletBlipRemovedEvent() throws Exception { ObservableConversationThread rootThread = conversationUtil.buildConversation(wavelet).getRoot().getRootThread(); ObservableConversationBlip newBlip = rootThread.appendBlip(); newBlip.delete(); EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_BLIP_REMOVED); assertEquals("Expected two events", 2, messages.getEvents().size()); // Blip removed should be the second event. WaveletBlipRemovedEvent event = WaveletBlipRemovedEvent.as(messages.getEvents().get(1)); assertEquals("Expected the same id as the removed blip", newBlip.getId(), event.getRemovedBlipId()); }
public void testFetchWave() throws Exception { String message = "A message"; OperationRequest operation = operationRequest(OperationType.ROBOT_FETCH_WAVE, Parameter.of(ParamsProperty.MESSAGE, message)); OperationContextImpl context = helper.getContext(); WaveletProvider waveletProvider = helper.getWaveletProvider(); when(waveletProvider.checkAccessPermission(WAVELET_NAME, ALEX)).thenReturn(true); service.execute(operation, context, ALEX); ObservableConversation conversation = context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot(); JsonRpcResponse response = context.getResponse(OPERATION_ID); assertNotNull("expected a response", response); assertFalse("expected a success response", response.isError()); assertEquals("Expected the response to carry the message", message, response.getData().get(ParamsProperty.MESSAGE)); assertNotNull("Expected the response to carry a wavelet", response.getData().get(ParamsProperty.WAVELET_DATA)); assertEquals("Expected the response to carry root blip id", conversation.getRootThread().getFirstBlip().getId(), response.getData().get(ParamsProperty.BLIP_ID)); }
public void testFetchWave() throws Exception { String message = "A message"; OperationRequest operation = operationRequest(OperationType.ROBOT_FETCH_WAVE, Parameter.of(ParamsProperty.MESSAGE, message)); OperationContextImpl context = helper.getContext(); WaveletProvider waveletProvider = helper.getWaveletProvider(); when(waveletProvider.checkAccessPermission(WAVELET_NAME, ALEX)).thenReturn(true); service.execute(operation, context, ALEX); ObservableConversation conversation = context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot(); JsonRpcResponse response = context.getResponse(OPERATION_ID); assertNotNull("expected a response", response); assertFalse("expected a success response", response.isError()); assertEquals("Expected the response to carry the message", message, response.getData().get(ParamsProperty.MESSAGE)); assertNotNull("Expected the response to carry a wavelet", response.getData().get(ParamsProperty.WAVELET_DATA)); assertEquals("Expected the response to carry root blip id", conversation.getRootThread().getFirstBlip().getId(), response.getData().get(ParamsProperty.BLIP_ID)); }
WaveletCreatedEvent event = new WaveletCreatedEvent(null, null, participant.getAddress(), System.currentTimeMillis(), rootBlip.getId(), message, ApiIdSerializer.instance().serialiseWaveId(waveletName.waveId), ApiIdSerializer.instance().serialiseWaveletId(waveletName.waveletId));
rootBlipId = rootBlip.getId(); LineContainers.appendToLastLine(rootBlip.getContent(), XmlStringBuilder.createFromXmlString(gadgetXml));
rootBlipId = rootBlip.getId(); LineContainers.appendToLastLine(rootBlip.getContent(), XmlStringBuilder.createFromXmlString(gadgetXml));
inlineBlipElement.setProperty("id", firstInlineBlip.getId()); OperationRequest operation = operationRequest( OperationType.DOCUMENT_INSERT_INLINE_BLIP_AFTER_ELEMENT, rootBlipId,
inlineBlipElement.setProperty("id", firstInlineBlip.getId()); OperationRequest operation = operationRequest( OperationType.DOCUMENT_INSERT_INLINE_BLIP_AFTER_ELEMENT, rootBlipId,