speckleworks / SpeckleCore

Check a brand new Speckle at: https://github.com/specklesystems
https://speckle.systems
MIT License
38 stars 17 forks source link

StreamAdd #12

Closed PaulPoinet closed 6 years ago

PaulPoinet commented 6 years ago

Some notes here about what I was suggesting for StreamAdd.

StreamAdd would be useful in the case scenario where the user adds to an existing stream (containing objects & layers) new objects and new layers (among those, some objects or some layers might already exist in the stream).

The following steps would be: 1 - running through all the objects the user intends to add and dismiss the ones whose Guid matches with existing ones in the DB. 2 - running through all the layers the user intends to add and dismiss the ones whose Guid matches with existing ones in the DB. 3 - Finally, it remains to the user to organize his objects and layers so they can match startIndex and objectCount before calling StreamAdd. However, StreamAdd should be aware of the number of objects existing in the stream, so the startIndices found by the user when running through the new list of objects he intends to add (let's say 0-2, 3-8, 9-13) would be shifted and become (if 8 objects exist): 8-11, 12-17 etc. etc. Let's hope that this way of operating would not be too expensive with a large amount of objects

didimitrie commented 6 years ago

As discussed, StreamAdd aka AddObjectsToStream - from a random rhino selection of objects, will be implemented in the rhino application client wrapper on top of SpeckleCore, but outside it since it relies on a lot of rhino specific ways of dealing with document objects, etc.

didimitrie commented 6 years ago

I'm going to close this one. REST api guidelines are confusing when it comes to lists; this operation can be done with more a tiny bit more effort on the client side