Open pablojan opened 6 years ago
until https://github.com/SwellRT/jetpad/issues/2 is implemented the pad title can not change, right? :thinking: although it is supported anyway....
Right ;) you can also implement #2 :)
El 12 jul. 2018 7:52 p. m., Ana María Martínez Gómez notifications@github.com escribió:
until #2 is implemented the pad title can not change, right? 🤔
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.
@pablojan I have some questions:
The id would be the first name? or would we another kind of id? It is maybe a good idea to have something different as id, it would allow us to do things like having the same pad name for different users and with a url like <user-name>/<pad-title>
but for that the id needs to be different from the title. :thinking:
currently in SwellRT there is a getObjectNames
method, which returns all the names given a name or the id. But what we actually want is the id given a name, because getting all the names don't really helps us. I think we are not going to show all the names of a Pad, but only looking for the document to render (identied by the id) from a given name. Wouldn't it be a good idea implement a getObjectIdfromName
method in SwellRT or did you have another approach in mind? In case we want a getObjectIdfromName
method , can I give it a try? :smile:
Swell assigns an auto generated id to objects if no custom id is provided, for example local.net/s+34cs5z2 , and I think that it must be the canonical id for the object.
Secondly, to make things easier for the users, we can set a first object name, using the title.
Regarding your idea of different names by user <user-name>/<pad-title>
I can't say now if it is a useful approach.
I am pretty sure that getObjectNames() returns the object id together with all names for that id. Maybe doc is not clear enough. :dancer:
@pablojan
I am pretty sure that getObjectNames() returns the object id together with all names for that id. Maybe doc is not clear enough.
I see... the WaveNaming
is converted to JSON so the id
is there, just missed in the documentation... :thinking: I'll update the documentation :wink:
ok... it is there... but it is still not really nice... It returns something like:
{ "waveId": { "domain": "local.net", "id": "hola" }, "names": [ { "name": "hola", "created": 1531492853419 } ] }
what would mean that to get the id
you would have to do something like in the frontend:
names_json['waveId']['domain'].concat('/').concat(names_json['waveId']['id'])
or is there a better way to do this? :thinking: because if not, it would be nicer to just return { id: "local.net/hola", names: ["hola"] }. So, parsing it manually instead of using toJson
of a WaveNaming
hehe sure, the response will be nicer returning the id in one single string. I did open an issue in swellrt for it https://github.com/P2Pvalue/swellrt/issues/242
We want to have friendly URLs for the pads. A pad URL must be aligned with the pad title. If a pad title changes, a new URL for that title must be accepted as well as previous URLs It is ok to store the current title as a pad's object property.
SwellRT provides utility methods for handling this, check out. https://github.com/P2Pvalue/swellrt/blob/develop/wave/doc/swellrt/Reference.md#friendly-names-for-collaborative-objects