Skip to content

Commit

Permalink
Implement SwellRT#201 Remove Wave conversational model stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pablojan committed Nov 5, 2016
1 parent 9c634c5 commit 038dcb9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 54 deletions.
2 changes: 1 addition & 1 deletion wave/src/main/java/org/swellrt/api/SwellRT.java
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public void onSuccess(WaveLoader wave) {
ModelJS cobJsFacade = null;

Model cob =
Model.create(wave.getWave().getWave(), wave.getLocalDomain(),
Model.create(wave.getWave(), wave.getLocalDomain(),
wave.getLoggedInUser(),
wave.isNewWave(), wave.getIdGenerator());

Expand Down
4 changes: 2 additions & 2 deletions wave/src/main/java/org/swellrt/api/WaveClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public void onLoad(WaveLoader wrapper) {
ModelJS modelJS = null;

Model model =
Model.create(wrapper.getWave().getWave(), wrapper.getLocalDomain(),
Model.create(wrapper.getWave(), wrapper.getLocalDomain(),
wrapper.getLoggedInUser(),
wrapper.isNewWave(), wrapper.getIdGenerator());

Expand Down Expand Up @@ -345,7 +345,7 @@ public void onLoad(WaveLoader wrapper) {
ModelJS modelJS = null;

Model model =
Model.create(wrapper.getWave().getWave(), wrapper.getLocalDomain(),
Model.create(wrapper.getWave(), wrapper.getLocalDomain(),
wrapper.getLoggedInUser(), wrapper.isNewWave(), wrapper.getIdGenerator());

modelJS = ModelJS.create(model);
Expand Down
36 changes: 0 additions & 36 deletions wave/src/main/java/org/swellrt/client/StageTwo.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,10 @@
*/
public interface StageTwo {

/** @return the (live) conversations in the wave. */
ObservableConversationView getConversations();

/** @return the core wave. */
ObservableWaveView getWave();

/** @return the signed-in user's (live) supplementary data in the wave. */
LocalSupplementedWave getSupplement();

/** @return the registry of document objects used for conversational blips. */
WaveDocuments<? extends InteractiveDocument> getDocumentRegistry();
Expand Down Expand Up @@ -270,16 +266,6 @@ protected final WaveletOperationalizer getWavelets() {
return wavelets == null ? wavelets = createWavelets() : wavelets;
}

@Override
public final ObservableConversationView getConversations() {
return conversations == null ? conversations = createConversations() : conversations;
}

@Override
public final LocalSupplementedWave getSupplement() {
return supplement == null ? supplement = createSupplement() : supplement;
}


@Override
public final WaveDocuments<LazyContentDocument> getDocumentRegistry() {
Expand All @@ -293,11 +279,6 @@ protected final WaveViewData getWaveData() {
}


/** @return the id mangler for model objects. Subclasses may override. */
protected ModelIdMapper createModelIdMapper() {
return ModelIdMapperImpl.create(getConversations(), "UC");
}


/** @return the id of the signed-in user. Subclassses may override. */
protected abstract ParticipantId createSignedInUser();
Expand Down Expand Up @@ -364,23 +345,6 @@ protected ObservableConversationView createConversations() {
return WaveBasedConversationView.create(getWave(), getIdGenerator());
}

/** @return the user supplement of the wave. Subclasses may override. */
protected LocalSupplementedWave createSupplement() {
Wavelet udw = getWave().getUserData();
if (udw == null) {
udw = getWave().createUserData();
}
ObservablePrimitiveSupplement state = WaveletBasedSupplement.create(udw);
ObservableSupplementedWave live = new LiveSupplementedWaveImpl(
state, getWave(), getSignedInUser(), DefaultFollow.ALWAYS, getConversations());
return LocalSupplementedWaveImpl.create(getWave(), live);
}

/** @return a supplement to the supplement, to get exact read/unread counts. */
protected BlipReadStateMonitor createReadMonitor() {
return BlipReadStateMonitorImpl.create(
getWave().getWaveId(), getSupplement(), getConversations());
}

/** @return the registry of documents in the wave. Subclasses may override. */
protected WaveDocuments<LazyContentDocument> createDocumentRegistry() {
Expand Down
7 changes: 0 additions & 7 deletions wave/src/main/java/org/swellrt/client/StageTwoProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ protected WaveViewService createWaveViewService() {
@Override
protected void install() {
if (isNewWave) {
// For a new wave, initial state comes from local initialization.
// getConversations().createRoot().getRootThread().appendBlip();

// Adding any initial participant to the new wave
// getConversations().getRoot().addParticipantIds(otherParticipants);

getConversations().createRoot().addParticipantIds(otherParticipants);

super.install();
whenReady.use(StageTwoProvider.this);
Expand Down
14 changes: 6 additions & 8 deletions wave/src/main/java/org/swellrt/client/WaveLoader.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package org.swellrt.client;

import java.util.Set;

import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
import org.waveprotocol.wave.client.account.ProfileManager;
import org.waveprotocol.wave.client.common.util.AsyncHolder;
import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
import org.waveprotocol.wave.client.wave.InteractiveDocument;
import org.waveprotocol.wave.client.wave.WaveDocuments;
import org.waveprotocol.wave.concurrencycontrol.common.UnsavedDataListener;
import org.waveprotocol.wave.model.document.WaveContext;
import org.waveprotocol.wave.model.id.IdGenerator;
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.wave.opbased.ObservableWaveView;
import org.waveprotocol.wave.model.waveref.WaveRef;

import java.util.Set;

/**
* The Wave Loader encapsulates the process of loading a Wave and Wavelets from
* the server and build the in-memory structure.
Expand All @@ -40,7 +40,7 @@ public void call(Accessor<Object> accessor) {
private StageOne one;
private StageTwo two;
private StageThree three;
protected WaveContext wave;
protected ObservableWaveView wave;
protected WaveRef waveRef;
private RemoteViewServiceMultiplexer channel;
protected IdGenerator idGenerator;
Expand Down Expand Up @@ -116,9 +116,7 @@ private void onStageThreeLoaded(StageThree x, Accessor<StageThree> whenReady) {
return;
}
three = x;
wave =
new WaveContext(two.getWave(), two.getConversations(), two.getSupplement(),
null);
wave = two.getWave();
// Add into some Wave store?
install();
whenReady.use(x);
Expand Down Expand Up @@ -164,7 +162,7 @@ private <T> AsyncHolder<T> haltIfClosed(AsyncHolder<T> provider) {
}


public WaveContext getWave() {
public ObservableWaveView getWave() {
return wave;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public interface WaveView {
*
* @return the root wavelet, if it exists in the view.
*/
@Deprecated
Wavelet getRoot();

/**
Expand All @@ -69,13 +70,15 @@ public interface WaveView {
*
* @return the new wavelet.
*/
@Deprecated
Wavelet createRoot();

/**
* Gets the user-data wavelet in this view.
*
* @return the root wavelet, if it exists in the view.
*/
@Deprecated
Wavelet getUserData();

/**
Expand All @@ -84,6 +87,7 @@ public interface WaveView {
* @return the new wavelet.
* @throws IllegalStateException if the user-data wavelet already exists.
*/
@Deprecated
Wavelet createUserData();

/**
Expand Down

0 comments on commit 038dcb9

Please sign in to comment.