Is this library a client-side JavaScript file or a *.js file with server
side JavaScript(Jaggery)?

If it is a Jaggery code, then best option would be to make it a Jaggery
module[1]. So, you can version it, share it etc.

If it is a clientside static *.js file, in the current caramel model, we
keep it under <app>/themes/{name}/js directory. But in the future, we will
put all the sharable JavaScripts into different app and refer the path from
that app in your apps. i.e. In the product we will have an app to mock a
CDN.

This will help to minimize the sharable *.js file duplication across
different apps. Further, when people go into production, they can even move
their CDN directory into a real CDN and configure the app's CDN url
pointing to the new CDN url.

So, in summary, you keep resources like below.

http://<server-url>/cdn/jquery/1.11.1/jquery.min.js
http://<server-url>/cdn/bootstrap/3.2.0/bootstrap.min.js
http://<server-url>/cdn/bootstrap/3.2.0/bootstrap.min.css

In your apps, you make the http://<server-url>/cdn, a configurable value.
For the app name, we will have to decide a better one, either *cdn* or
*static* or any better name.

[1] https://github.com/wso2/jaggery-extensions



On Fri, Nov 21, 2014 at 6:14 AM, Sumedha Rubasinghe <sume...@wso2.com>
wrote:

> Ruchira/Sameera/Manu,
>
> AFAIK we do not have a specific folder to keep JS libraries related to BE
> functionality in the current Jaggery App Structure. Only libraries I have
> seen (could be wrong) are in  themes/{theme name}/lib.
>
> But these libraries are mostly related to UI presentation.
>
> If I am correct on above, shall we go ahead and create a place holder for
> such libraries?
>
> What would be a good location? {app-name}/site/lib?
>
>
>
>
>
> On Thu, Nov 20, 2014 at 3:07 PM, Lahiru Cooray <lahi...@wso2.com> wrote:
>
>> Hi,
>>
>> *Please refer the mail thread : "[Architecture] [AF] Capturing BAM events
>> with an objective of understanding user activity"*
>>
>> Currently I'm working on implementing a common JS library modifying the
>> above mentioned JS to make it more generic.
>>
>> User can give the below inputs to this Javascript as a json string:
>>
>>    - *isActive* : switch to activate the JS features
>>    - *path* : Publisher Jaggery Path (JS library will post an event with
>>    results to mentioned path)
>>    - *appData* : Data in the web page which needs to add to the event
>>    (eg: ApiID, SubscriberID,Email, Username,  etc)
>>    - *appControls : *User can mention some HTML controls here and for
>>    the changes in those controls this JS will execute
>>    - *publishedPeriod *: Time gap which user needs to publish.
>>
>>
>> Then the Js will periodically post the result (appData, Timestamp) to the
>> defined publisher path.
>>
>> *Please suggest the best place to keep these type of shareable resources.*
>>
>> --
>> *Lahiru Cooray*
>> Software Engineer
>> WSO2, Inc.;http://wso2.com/
>> lean.enterprise.middleware
>>
>> Mobile: +94 715 654154
>>
>
>
>
> --
> /sumedha
> m: +94 773017743
> b :  bit.ly/sumedha
>



-- 

*Ruchira Wageesha**Associate Technical Lead*
*WSO2 Inc. - lean . enterprise . middleware |  wso2.com <http://wso2.com>*

*email: ruch...@wso2.com <ruch...@wso2.com>,   blog:
ruchirawageesha.blogspot.com <http://ruchirawageesha.blogspot.com>,
mobile: +94 77 5493444*
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to