[deepamehta-devel] Question About the Webclients Controller

Jörn Weißenborn joern.weissenborn at gmail.com
Di Jan 28 21:30:02 CET 2014


Hi,

thanks for clarification. But still a few questions:

I also want to employ the assoc, topicmap and topic models of the standart
client. Is there a stright forward way to e.g. get a topicmap_viewmodel in
my application?

How does the RestClient know where to connect?

Are you planning to provide a "standart" websocketservice?


Best,

Joern


2014-01-28 Jörg Richter <jri at deepamehta.de>

>
> Yes, you can access the DM Core Service from a 3rd-party Webclient by
> loading and instantiating DM's RESTClient, which is part of the
> dm4-webclient module:
>
> https://github.com/jri/deepamehta/blob/master/modules/dm4-webclient/src/main/resources/web/script/util/rest_client.js
>
> The RESTClient is standalone. It does not depend on any DM client-side
> code. However, it depends (for the moment) on jQuery.
>
> You can either bundle rest_client.js with your plugin, or, you can load
> the DM Webclient's one (provided this module is included in your
> installation):
>
>         <script
> src="/de.deepamehta.webclient/script/util/rest_client.js"></script>
>
> Then your plugin can instantiate a RESTClient and send requests to the DM
> Core Service:
>
>         var restc = new RESTClient()
>         var topic = restc.get_topic_by_id(1234)
>
> For available methods and for RESTClient constructor options look inside
> the rest_client.js source.
>
> In case you need other services of the DM standard distro (besides the
> Core Service), e.g. the Topicmaps Service, you can enrich your RESTClient
> instance as needed.
>
>         restc.get_topicmap = function(topicmap_id) {
>                 return this.request("GET", "/topicmap/" + topicmap_id)
>         }
>
> For available methods see the === REST Client Extension === section at the
> beginning of the respective module's plugin.js file.
>
> Sending a request to the Topicmaps Service is straight-forward then:
>
>         var topicmap = restc.get_topicmap(2345)
>
> For the service to be provided the respective module (here: DM4 Topicmaps)
> must be included in your installation. Your RESTClient is still standalone
> and does not rely on the client-side Topicmaps code.
>
> To enrich your RESTClient instance with methods for accessing your own
> service (in case your plugin provides one) you would use the very same
> approach.
>
> Cheers,
> Jörg
>
>
> On Jan 27, 2014, at 21:28, Jörn Weißenborn wrote:
>
> > Hi,
> >
> > Is it possible, e.g. by embedding the js file with a script tag, to
> include and employ the dm4s service in a third party web applications?
> >
> > Best,
> >
> > Joern
>
> _______________________________________________
> deepamehta-devel mailing list
> deepamehta-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/deepamehta-devel
>
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://lists.deepamehta.de/mailman/private/devel-lists.deepamehta.de/attachments/20140128/e5ab3ab2/attachment.html>


Mehr Informationen über die Mailingliste devel