Hi Thomas, There's nothing hard about doing auto-linking. I say just go for it. Here are some ideas:
Call addUpdateListener() on the editor with a listener for changes. I'm not sure where the right place to register it is, but take a look at where SelectionExtractor is registered, which is a good example listener. You can also use it as a reference for how to get the current selection - then just look at the text in the vicinity (DocHelper.getText() might come in handy) and do some regex tricks to detect links. Mark them with the annotation "link/auto" Ignore the hackedTextNode thing, that's a workaround for a safari 4 bug. Happy to help you in any way I can. Dan Στις 20 Ιουλίου 2011 9:12 π.μ., ο χρήστης Thomas Wrobel <darkfl...@gmail.com> έγραψε: > If you are talking about the modularisation separating out the client > and server, that might lead to a chicken and egg situation, as you'd > need the c/s protocol first to do that no? I'm trying to learn enough > to help with that - but as you point out even simple things seem > rather complex to an outsider like me. > > I am starting to understand how some stuff fits together, so I'll > probably figure out how to apply the link in the end. Just a seemingly > steep learning curve. > > -Thomas > > On 20 July 2011 01:06, Paul Thomas <dt01pqt...@yahoo.com> wrote: >> It is a little concerning that something that should ordinarily be so >> trivial as >> auto-linking is considered advanced. >> >> I wonder if it is worth looking again at the overall architecture. From >> outside >> it seems a hard sell, you need developers to want to get involved, both >> helping >> WAIB grow and ease of implementation. Otherwise there the is no point. >> >> >> I know there was talk of modularisation before and that was pushed back. I >> know >> that modularisation in itself doesn't necessarily solve that issue, however >> generally separation of concerns is important. I appreciate that might be >> tricky but ultimately necessary. >> >> >> I also think that not dealing with this issue, might be detrimental, it is >> going >> to get harder to do later, no? >> >> >> >> ________________________________ >> From: Yuri Z <vega...@gmail.com> >> To: wave-dev@incubator.apache.org >> Sent: Tue, 19 July, 2011 22:06:25 >> Subject: Re: Client/Server protocol (again) >> >> BTW Thomas, are you working on this issue? If so, can you please assign it >> to yourself in the Wave Jira? >> >> >> 2011/7/17 Thomas Wrobel <darkfl...@gmail.com> >> >>> hu? >>> Auto-Linking was the first starter project on the list; >>> >>>https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=labels+%3D+StarterProject >>>t >>> Thats what I was trying to do. >>> -Thomas >>> >>> >>> On 17 July 2011 14:55, Yuri Z <vega...@gmail.com> wrote: >>> > IMHO, you should be looking at diff highlighting implementation to serve >>> as >>> > example. Probably David Hearnden can give you more details. >>> > But, this is advanced issue. How about taking first on the >>> StarterProject? >>> > >>> > 2011/7/17 Thomas Wrobel <darkfl...@gmail.com> >>> > >>> >> Thanks, might have to take you up on that at some point. >>> >> For the moment I'm just looking around the code trying to work out how >>> >> it works and where the new code will need to go for the Auto-Linking >>> >> ( >>> >> >>>https://issues.apache.org/jira/browse/WAVE-275?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs >>>s >>> >> ). >>> >> >>> >> Looking at the EditorImpl.java in something called the TypingSink theres >>> >> lines >>> >> refering to "Node link = hackedTextNode.getPreviousSibling();" >>> >> I assume this is a different sort of link being talked about. >>> >> >>> >> -Thomas >>> >> >>> >> On 16 July 2011 01:02, Michael MacFadden <michael.macfad...@gmail.com> >>> >> wrote: >>> >> > If you need any help getting thing going, I would be more than happy >>> to >>> >> help. We could do desktop sharing through skype or something. >>> >> > >>> >> > ~Michael >>> >> > >>> >> > On Jul 15, 2011, at 12:12 PM, Thomas Wrobel wrote: >>> >> > >>> >> >> err..sure. >>> >> >> That could take awhile, still getting set up here. :) >>> >> >> Got the Wave Panel Harness to work, but eclipse refuses to make a >>> >> >> connection for debugging (firewall off). Failed to connect to remote >>> >> >> VM. Connection refused. >>> >> >> >>> >> >> Thinking though it might not be worth my time getting to the bottom >>> of >>> >> >> this error as eventually I'll need to work on server-side stuff too. >>> >> >> Instead I'll try to get a working server again on my ubuntu netbook >>> >> >> and try to connect to that. I managed to do this before way back with >>> >> >> fedone....think I just changed two lines temporary in the client code >>> >> >> to point it at a different IP. >>> >> >> >>> >> >> -Thomas >>> >> >> >>> >> >> ps. If your wondering why I dont just do both on the same machine, >>> its >>> >> >> because I have most of my work set up on my windows desktop machine, >>> >> >> which isnt the best place the run a wave server. >>> >> >> >>> >> >> On 15 July 2011 19:25, Yuri Z <vega...@gmail.com> wrote: >>> >> >>> Great, let me know if you run out of the StarterProjects :) >>> >> >>> >>> >> >>> 2011/7/15 Thomas Wrobel <darkfl...@gmail.com> >>> >> >>> >>> >> >>>> Been away a bit, so sorry for the delay. >>> >> >>>> >>> >> >>>> Thanks for all the information, this is incredibly useful. >>> >> >>>> >>> >> >>>> I'm going to start with doing one of the..well, starter projects >>> and >>> >> >>>> see how well I handle that. If that goes smooth I'll investigating >>> how >>> >> >>>> the protocol is currently working (code-wise) and see if I can see >>> the >>> >> >>>> steps needed to convert to the new model. This could take awhile. >>> >> >>>> >>> >> >>>> Thanks again for the pointers, >>> >> >>>> Thomas >>> >> >>>> >>> >> >>>> >>> >> >>>> On 11 July 2011 10:48, David Hearnden <hearn...@google.com> wrote: >>> >> >>>>> Hi Thomas, >>> >> >>>>> >>> >> >>>>> Instructions are at: http://www.waveprotocol.org/code >>> >> >>>>> >>> >> >>>>> A good starting point would be to check out the code, and build >>> and >>> >> run >>> >> >>>> WIAB >>> >> >>>>> in development mode (ant compile-gwt-dev). In the debug log in >>> the >>> >> web >>> >> >>>>> client, you'll see all the messages being transferred over the >>> >> websocket. >>> >> >>>>> The messages are JSON, and their structure is defined by some >>> protos, >>> >> and >>> >> >>>>> enveloped as (see WaveWebSocketClient$MessageWrapper): >>> >> >>>>> { sequenceNumber: <unused I think>, messageType: <message class >>> >> name>, >>> >> >>>>> message: <object> } >>> >> >>>>> >>> >> >>>>> WaveWebSocketClient essentially defines the client side of the >>> >> protocol, >>> >> >>>> and >>> >> >>>>> it's very trivial. Over a bidirectional stream (websocket), the >>> >> client >>> >> >>>>> sends an open request (ProtocolOpenRequest), some number of submit >>> >> >>>> requests >>> >> >>>>> (ProtocolSubmitRequest), and then closes the web socket. After >>> the >>> >> open >>> >> >>>>> request, the client receives a constant stream of >>> >> ProtocolWaveletUpdates, >>> >> >>>>> containing either wavelet snapshots or wavelet deltas, interleaved >>> >> with >>> >> >>>>> ProtocolSubmitResponses, which contain the success/failure of the >>> >> >>>> client's >>> >> >>>>> own submits. Details about those particular messages can be found >>> in >>> >> >>>>> waveclient-rpc.proto, but the previous sentence above covers >>> almost >>> >> the >>> >> >>>>> entire protocol, and it's expressed quite simply in the code. The >>> >> bit I >>> >> >>>>> left out is the authentication messages, which I never looked >>> into, >>> >> but >>> >> >>>> the >>> >> >>>>> code looks pretty straightforward. >>> >> >>>>> >>> >> >>>>> The problems with the protocol are: >>> >> >>>>> * it does not support opening at particular versions, which is >>> >> required >>> >> >>>> for >>> >> >>>>> diff-on-open >>> >> >>>>> * it bundles state and deltas over the same channel, rather than a >>> >> >>>> RESTful >>> >> >>>>> state service plus a streaming delta service, >>> >> >>>>> * a few others that have escaped my memory (something about >>> closing >>> >> >>>>> connections? or losing access because of a participant change?). >>> >> Listing >>> >> >>>>> the diff between the old and new protocol behaviour should produce >>> a >>> >> >>>>> complete list. >>> >> >>>>> >>> >> >>>>> Hope that helps, >>> >> >>>>> >>> >> >>>>> -Dave >>> >> >>>>> >>> >> >>>>> On Sun, Jul 10, 2011 at 8:22 AM, Thomas Wrobel < >>> darkfl...@gmail.com> >>> >> >>>> wrote: >>> >> >>>>> >>> >> >>>>>> oh, quick question; wheres the current wiab repository? >>> >> >>>>>> >>> >> >>>>>> ~~~~~~ >>> >> >>>>>> Reviews of anything, by anyone; >>> >> >>>>>> www.rateoholic.co.uk >>> >> >>>>>> Please try out my new site and give feedback :) >>> >> >>>>>> >>> >> >>>>>> >>> >> >>>>>> >>> >> >>>>>> On 9 July 2011 23:11, Thomas Wrobel <darkfl...@gmail.com> wrote: >>> >> >>>>>>> Guess I could have a go at those - they seem client based stuff >>> so >>> >> I >>> >> >>>>>>> should be able to handle it. >>> >> >>>>>>> I'll download a new checkout now and have a look. >>> >> >>>>>>> >>> >> >>>>>>> However, Can I have confirmation of the state of that proposed >>> c/s >>> >> >>>>>>> protocol however as Joseph didn't know? >>> >> >>>>>>> >>> >> >>>>>>> At he moment Im a guy that doesn't know how it works at the >>> moment, >>> >> >>>>>>> not knowing what exactly should be implemented/changed, and >>> unsure >>> >> if >>> >> >>>>>>> he has the skills needed to do it :p >>> >> >>>>>>> >>> >> >>>>>>> Perhaps I'm wrong, or being pessimistic, but at the moment I I >>> feel >>> >> >>>>>>> like I could fix 10-20 client side bugs or feature requests in >>> the >>> >> >>>>>>> time it will take me to understand how the wiab client and >>> server >>> >> >>>>>>> should communicate with eachother. >>> >> >>>>>>> >>> >> >>>>>>> -Thomas >>> >> >>>>>>> >>> >> >>>>>>> >>> >> >>>>>>> >>> >> >>>>>>> On 9 July 2011 19:40, Yuri Z <vega...@gmail.com> wrote: >>> >> >>>>>>>> A great way to familiarize yourself with WIAB is by comepleting >>> >> >>>>>>>> StarterProject< >>> >> >>>>>> >>> >> >>>> >>> >> >>>https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=labels+%3D+StarterProject >>>t >>> >> >>>>>>> >>> >> >>>>>>>> . >>> >> >>>>>>>> >>> >> >>>>>>>> 2011/7/9 Joseph Gentle <jose...@gmail.com> >>> >> >>>>>>>> >>> >> >>>>>>>>> On Sat, Jul 9, 2011 at 8:19 AM, Thomas Wrobel < >>> >> darkfl...@gmail.com> >>> >> >>>>>> wrote: >>> >> >>>>>>>>>>> As far as I know, the client-server protocol for wave in a >>> box >>> >> is >>> >> >>>>>>>>>>> pretty stable at this point. Its documented here: >>> >> >>>>>>>>>>> >>> >> >>>>>>>>> >>> >> >>>>>> >>> >> >>>> >>> >> >>> http://www.waveprotocol.org/protocol/design-proposals/clientserver-protocol >>> >> >>>>>>>>>>> ... Though that documentation is probably out of date. >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> It was my understanding it wasnt yet implemented? >>> >> >>>>>>>>>> There was an older thread here about it; >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> >>> >> >>>>>>>>> >>> >> >>>>>> >>> >> >>>> >>> >> >>>http://mail-archives.apache.org/mod_mbox/incubator-wave-dev/201105.mbox/%3cbanlktimi_a6zkpsrxqqvhwysrfhh35-...@mail.gmail.com%3e >>>e >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> David Hearnden there said; >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> "I would strongly encourage not building too much on the >>> current >>> >> >>>>>>>>> protocol, >>> >> >>>>>>>>>> since it has a number of known limitations. The new protocol >>> is >>> >> >>>>>> simpler >>> >> >>>>>>>>> and >>> >> >>>>>>>>>> achieves a better separation of functionality. " >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> Which put me off doing a anything with the code as-is. >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> Has this changed now? >>> >> >>>>>>>>> >>> >> >>>>>>>>> I don't know - I haven't been working with the wave in a box >>> code >>> >> >>>> for >>> >> >>>>>>>>> the last 6 months or so. >>> >> >>>>>>>>> >>> >> >>>>>>>>>>> If you care about the client/server API enough to dig >>> through >>> >> the >>> >> >>>>>>>>>>> code, writing up some proper documentation describing what >>> you >>> >> >>>> find >>> >> >>>>>>>>>>> would be great. >>> >> >>>>>>>>>> >>> >> >>>>>>>>>> Id be happy to - but that might be overestimating my skills >>> >> >>>> somewhat. >>> >> >>>>>>>>>> My java skills uptill now have purely been GWT or Android >>> based >>> >> >>>>>> stuff. >>> >> >>>>>>>>>> Haven't ever done any server stuff, and the wiab code is a >>> >> rather >>> >> >>>>>>>>>> steep learning curve every time I try getting to grips with >>> bits >>> >> >>>> of >>> >> >>>>>>>>>> it. >>> >> >>>>>>>>> >>> >> >>>>>>>>> I worked with the wave / wave in a box code for about half a >>> >> year, >>> >> >>>> and >>> >> >>>>>>>>> I still feel like that whenever I dive in there. Despite >>> >> referring >>> >> >>>> to >>> >> >>>>>>>>> (& editing) those protobuf files maybe a dozen times, it still >>> >> took >>> >> >>>> me >>> >> >>>>>>>>> 5-10 minutes to find them again. You can still get work done >>> with >>> >> >>>> that >>> >> >>>>>>>>> feeling, but it is slow going. >>> >> >>>>>>>>> >>> >> >>>>>>>>> If you want a good client/server protocol for wiab, >>> familiarise >>> >> >>>>>>>>> yourself with the WIAB code and implement those changes >>> Hearnden >>> >> was >>> >> >>>>>>>>> talking about. >>> >> >>>>>>>>> >>> >> >>>>>>>>> -J >>> >> >>>>>>>>> >>> >> >>>>>>>>>> -Thomas >>> >> >>>>>>>>>> >>> >> >>>>>>>>> >>> >> >>>>>>>> >>> >> >>>>>>> >>> >> >>>>>> >>> >> >>>>> >>> >> >>>> >>> >> >>> >>> >> > >>> >> > >>> >> >>> > >>> >> >