@ Manu :
Edit/ Re-generate function is not supported yet. The initial plan was to
have a gadget generation tool which is similar to what was there in DAS but
with extension points to plug providers and chart templates.

@ Jerad :
Please see my inline comments.
On Wed, Jun 8, 2016 at 10:04 AM, Jerad Rutnam <je...@wso2.com> wrote:

> Hi Tanya,
>
> Few more suggestions for the offline chat we had previously, what if we do
> below changes?
>
> *Chart template structure*
>
> └── line-chart
>     ├── api.js
>     ├── config.json
>     ├── chart-libs - *libs **[template folder could be something other
> than a chart type. e.g. Map, Widget]*
>     │   └── vendorName_version
>     │       └── [ js_css_images_etc_as_same_as_vendor_ships ]
>     ├── css
>     │   └── line-chart.css
>     └── js
>         └── line-chart.js
>
>
> *Generated gadget structure*
>
> └── test_gadget
>     ├── conf.json
>     ├── gadget-controller.jag
>     ├── gadget.json
>     ├── index.png
>     ├── index.xml
>     ├── chart-libs - *libs **[this folder can have any third party
> libraries, not only chart libraries]*
>     │   └── vendorName_version
>     │       └── [ js_css_images_etc_as_same_as_vendor_ships ]
>     ├── css
>     │   └── line-chart.css
>     └── js
>         ├── core-js - *core **[we are already in js folder - so we can
> take out the js part]*
>         │   ├── gadget-core.js
>         │   ├── line-chart-api.js
>         │   └── provider-api.js
>         └── line-chart.js
>
>
> And in chart *config.json*: What if we have file extensions along with
> the file name? Any reason to remove it?
>
> "*imports*": {
>         "js": ["vendorName_version/common*.js*"],
>         "css": ["vendorName_version/common*.css*"]
>     },
> "*shared_imports*": { *[indicates users that all these are shared
> imports]*
>         "js": ["vendorName_version/d3.min*.js*", "vendorName_version/vega
> *.js*", "line-chart*.js*"],
>         "css": ["vendorName_version/graph*.css*, line-chart*.css*"]
>     }
>
> Shouldn't this be other way round? First one should be shared_imports
(fetched from /portal/libs/ ) and second one will be imports (inside chart
template folder)

>
> WDYT? This will make it more generic. So we can avoid restricting to the
> term "chart".
>
>
> Cheers!
> Jerad
>
>
> On Tue, Jun 7, 2016 at 5:49 PM, Tanya Madurapperuma <ta...@wso2.com>
> wrote:
>
>> Hi all,
>>
>> Thank you for your inputs.
>>
>> @ Dakshika :
>> Based on your input following modifications were made.
>>
>> *Chart template structure*
>>
>> └── line-chart
>>     ├── api.js
>>     ├── config.json
>>     ├── chart-libs
>>     │   └── vendorName_version
>>     │       └── js_css_images_etc_as_same_as_vendor_ships
>>     ├── css
>>     │   └── line-chart.css
>>     └── js
>>         └── line-chart.js
>>
>>
>> *Generated gadget structure*
>>
>> └── test_gadget
>>     ├── conf.json
>>     ├── gadget-controller.jag
>>     ├── gadget.json
>>     ├── index.png
>>     ├── index.xml
>>     ├── chart-libs
>>     │   └── vendorName_version
>>     │       └── js_css_images_etc_as_same_as_vendor_ships
>>     ├── css
>>     │   └── line-chart.css
>>     └── js
>>         ├── core-js
>>         │   ├── gadget-core.js
>>         │   ├── line-chart-api.js
>>         │   └── provider-api.js
>>         └── line-chart.js
>>
>>
>> *Folder structure for storing common libs*
>>
>> portal
>>       |── libs
>>
>>   ├── vendorName_version
>>   │   ├── <js/css/images and all files as the vendor ships>
>>
>>
>> *Changes to the existing model*
>>
>>    - common libs will reside inside portal/libs/
>>
>> *chart config.json*
>>
>> "common": {
>>         "js": ["vendorName_version/common"],
>>         "css": ["vendorName_version/common"]
>>     },
>> "chart": {
>>         "js": ["vendorName_version/d3.min", "vendorName_version/vega",
>> "line-chart"],
>>         "css": ["vendorName_version/graph, line-chart"]
>>     }
>>
>> "common" is for libs fetched from /portal/libs
>> "chart" is for both chart specfic libs inside js folder of chart template
>> and chart-libs that are coming from vendors.
>>
>> So with the change suggested by Dakshika we will have to specify the
>> directory path of chart-libs in the config.json (ex:
>>  "vendorName_version/d3.min" )
>> But if it is a chart specific js file (in this example line-chart.js)
>> specifying the file name is enough.
>>
>> In the gadget xml of the generated gadget we will be using the relative
>> path for libs fetched from /portal/libs.
>>
>> @ Suho : Yes, the gadgets generated via old wizard will still work, I was
>> worried about the consistency between old gadgets and new gadgets generated
>> via the wizard. As per the offline chat we had, no obligations from IOT
>> side.
>>
>> Thanks,
>> Tanya
>>
>> --
>> Tanya Madurapperuma
>>
>> Senior Software Engineer,
>> WSO2 Inc. : wso2.com
>> Mobile : +94718184439
>> Blog : http://tanyamadurapperuma.blogspot.com
>>
>> On Tue, Jun 7, 2016 at 3:53 PM, Dakshika Jayathilaka <daksh...@wso2.com>
>> wrote:
>>
>>> Hi All,
>>>
>>> IMO it's better if we can maintain third-party libraries as a separate
>>> entity. Usually, most of the third party libs have their own dependencies
>>> (ex: some CSS files refer images/ fonts ). If we place them separately it's
>>> hard to identify relevant dependency at a glance.
>>>
>>>  At the same time, I would like to propose to have library version as
>>> well. This will really useful if someone wants to upgrade third-party lib
>>> etc.
>>>
>>> Regards,
>>>
>>> *Dakshika Jayathilaka*
>>> PMC Member & Committer of Apache Stratos
>>> Senior Software Engineer
>>> WSO2, Inc.
>>> lean.enterprise.middleware
>>> 0771100911
>>>
>>> On Tue, Jun 7, 2016 at 3:11 PM, Tanya Madurapperuma <ta...@wso2.com>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> During an offline discussion with Jerad following modification were
>>>> suggested regarding the directory structure of the extension model. All
>>>> these changes are subjected to js and css file locations.
>>>>
>>>> *Chart template structure*
>>>>
>>>> |── line-chart
>>>>   │   ├── css
>>>>   │   │   └── line-chart.css
>>>>   │   └── js
>>>>   │       ├── d3.min.js
>>>>   │       ├── vega.js
>>>>   │       └── VizGrammar.min.js
>>>>    |── config.json
>>>>   ├── api.js
>>>>
>>>>
>>>> *Changes to the existing model*
>>>>
>>>>    - rename index.js to api.js
>>>>    - rename chart-libs folder to js
>>>>    - have a css folder in the same level
>>>>
>>>>
>>>> *Generated gadget structure*
>>>>
>>>> └── test_gadget
>>>> │       │       ├── conf.json
>>>> │       │       ├── css
>>>> │       │       │   └── line-chart.css
>>>> │       │       ├── gadget-controller.jag
>>>> │       │       ├── gadget.json
>>>> │       │       ├── index.png
>>>> │       │       ├── index.xml
>>>> │       │       └── js
>>>> │       │           ├── core
>>>> │       │           │   ├── gadget-core.js
>>>> │       │           │   ├── line-chart-api.js
>>>> │       │           │   └── provider-api.js
>>>> │       │           ├── d3.min.js
>>>> │       │           ├── vega.js
>>>> │       │           └── VizGrammar.min.js
>>>>
>>>>
>>>> *Changes to the existing model*
>>>>
>>>>    - Instead of the *chart-libs* folder inside *js* folder, have a *core
>>>>    *folder inside *js *folder and place chart specific js files in js
>>>>    folder
>>>>
>>>>
>>>> *Folder structure for storing common libs*
>>>>
>>>> portal
>>>>       |── gadget-commons
>>>>
>>>>    ├── css
>>>>    │   └── common.css
>>>>    └── js
>>>>        └── common.js
>>>>
>>>>
>>>> *Changes to the existing model*
>>>>
>>>>    - Now we have common libs inside portal/libs/common-chart-libs/
>>>>
>>>> *chart config.json*
>>>>
>>>> "common": {
>>>>         "js": ["common"],
>>>>         "css": ["common"]
>>>>     },
>>>>     "chart": {
>>>>         "js": ["d3.min", "vega", "VizGrammar.min"],
>>>>         "css": ["line-chart"]
>>>>     }
>>>>
>>>> *existing config.json*
>>>>
>>>> "common-libs" : ["wso2gadgets","chart-utils"],
>>>> "chart-libs" : ["d3.min","vega","VizGrammar.min"]
>>>>
>>>> I think this model is cleaner and intuitive than the exiting model.
>>>> AFAIK existing wizard is only used for IOT analytics. If there are no
>>>> concerns from them shall we move to this new model?
>>>>
>>>> @ Suho, Dunith : WDYT ? Will this incur lot of changes from IOT side?
>>>> Appreciate your input.
>>>>
>>>> Thanks,
>>>> Tanya
>>>>
>>>> --
>>>> Tanya Madurapperuma
>>>>
>>>> Senior Software Engineer,
>>>> WSO2 Inc. : wso2.com
>>>> Mobile : +94718184439
>>>> Blog : http://tanyamadurapperuma.blogspot.com
>>>>
>>>
>>>
>>
>>
>> --
>> Tanya Madurapperuma
>>
>> Senior Software Engineer,
>> WSO2 Inc. : wso2.com
>> Mobile : +94718184439
>> Blog : http://tanyamadurapperuma.blogspot.com
>>
>
>
>
> --
> *Jerad Rutnam*
> *Software Engineer*
>
> WSO2 Inc.
> lean | enterprise | middleware
> M : +94 77 959 1609 | E : je...@wso2.com | W : www.wso2.com
>



-- 
Tanya Madurapperuma

Senior Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94718184439
Blog : http://tanyamadurapperuma.blogspot.com
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to