Hi Dilan,

On Fri, Nov 24, 2017 at 7:55 AM, Dilan Udara Ariyaratne <[email protected]>
wrote:

> Hi Sajith,
>
> +1 for the effort. Few clarifications, BTW...
>
> [1] Since the purpose of <carbon-home>/deployment folder is solely any
> customizations, in a developer experience POV, wouldn't it be good to
> change the name of the folder to something like "custom-deployment"
>      rather than using the same naming convention used to original
> deployment folder which might bring any confusions ?
>
 <carbon-home>/deployment directory is not a new directory defined by the
Carbon UI Server, rather it is defined by the C5 product distribution
directory structure. (see mail "*[Architecture] Multiple runtime support
for C5 based products"* for more info). <carbon-home>/deployment directory
is for customer's deployment artifacts. Since the overriding web app
artifact is put by the customer, it should go into the
<carbon-home>/deployment directory. We use carbon-deployment engine to
pick-up those artifacts.


[2] Would there be any chance to have the same web-app inside multiple
> run-times ? If that is the case and what if a customer would only need to
> customize the web-app of one particular runtime ?
>
Since only one runtime is activated in a given time, we can safely assume
that whatever is in the <carbon-home>/deployment directory applies for the
current runtime.

Thanks.

>
> Thanks,
> Dilan.
>
> *Dilan U. Ariyaratne*
> Senior Software Engineer
> WSO2 Inc. <http://wso2.com/>
> Mobile: +94766405580 <%2B94766405580>
> lean . enterprise . middleware
>
>
> On Wed, Nov 22, 2017 at 12:07 PM, SajithAR Ariyarathna <[email protected]>
> wrote:
>
>> Hi All,
>>
>> We are in the process of implementing the option for customers to
>> customize (by overriding or adding new things) React based web apps.
>>
>> *Overriding:*
>>
>> Customer can override a file of a web app by putting the custom version
>> of that file in the same relative path inside the
>> <carbon-home>/deployment/web-ui-apps/<app-name> directory.
>>
>> e.g. Consider following web app "pets store" shipped in
>> <carbon-home>/wso2/<runtime>/deployment/web-ui-apps/pets-store
>> directory.
>>
>> pets-store
>>     ├── configuration.yaml
>>     │
>>     ├── extensions
>>     │   ├── widgets
>>     │       ├── line-chart/
>>     │       ├── bar-chart/
>>     │       └── calendar/
>>     │           ├── bundle.js
>>     │           ├── styles.css
>>     │           └── widget.json
>>     │
>>     ├── i18n
>>     │   └── en.json
>>     │
>>     ├── pages
>>     │   └── index.html
>>     │
>>     ├── public
>>     │   ├── images
>>     │   │   └── logo.png
>>     │   ├── css
>>     │   │   └── styles.css
>>     │   └── js
>>     │       └── bundle.js
>>     │
>>     └── themes
>>         ├── dark/
>>         └── light
>>             ├── js
>>             │   └── some.js
>>             └── css
>>                 └── styles.css
>>
>> # In order to change CSS styles of the "calendar" widget, customer needs
>> to put their "styles.css" file in <carbon-home>/deployment/web-u
>> i-apps/pets-store/extensions/widgets/calendar/styles.css path.
>>
>> # To change the logo, custom logo image needs to be put in
>> <carbon-home>/deployment/web-ui-apps/pets-store/public/images/logo.png
>> path.
>>
>> # App's configurations can be overridden by putting a custom
>> configuration.yaml file into <carbon-home>/deployment/
>> web-ui-apps/pets-store/ directory.
>>
>>
>> With above overrides, the  <carbon-home>/deployment/
>> web-ui-apps/pets-store/ directory looks like following.
>>
>>
>> pets-store
>>
>>     ├── configuration.yaml
>>
>>     │
>>
>>     ├── extensions
>>
>>     │   └── widgets
>>
>>     │       └── calendar
>>
>>     │           └── styles.css
>>
>>     │
>>
>>     └── public
>>
>>         └── images
>>
>>             └── logo.png
>>
>>
>> *Adding:*
>>
>> Customer can add a new entity (extensions, language files (i18n), themes)
>> by putting it to  <carbon-home>/deployment/w
>> eb-ui-apps/<app-name>/<entity-type>/ path.
>>
>> e.g. Consider the same "pets store" web app.
>>
>> # Customer can add a new widget "pie-chart" by putting it to
>> <carbon-home>/deployment/web-ui-apps/pets-store/extension
>> s/widgets/pie-chart location.
>>
>> # A new language file can be added by putting it to
>> <carbon-home>/deployment/web-ui-apps/pets-store/i18n/fr.json .
>>
>> # New "autum" theme can be added by putting it to
>> <carbon-home>/deployment/web-ui-apps/pets-store/themes/ directory.
>>
>>
>> With above additions, the  <carbon-home>/deployment/web-ui-apps/pets-st
>> ore/ directory looks like following.
>>
>> pets-store
>>     │
>>     ├── extensions
>>     │   └── widgets
>>     │       └── pie-chart/
>>     │           ├── bundle.js
>>     │           ├── styles.css
>>     │           └── widget.json
>>     │
>>     ├── i18n
>>     │   └── fr.json
>>     │
>>     └── themes
>>
>>         └── autum
>>
>>             ├── js
>>             │   └── some.js
>>             └── css
>>                 └── styles.css
>>
>>
>>
>> Carbon UI Server will do the app artifact merging (
>> <carbon-home>/wso2/<runtime>/deployment/web-ui-apps/pets-store/ and
>> <carbon-home>/deployment/web-ui-apps/pets-store/) at server start-up.
>>
>>    - When serving files, priority is always given to the customers
>>    version.
>>    - Customer can revert their customizations by deleting their app
>>    artifact <carbon-home>/deployment/web-ui-apps/<app-name> . When this
>>    happens, the "merged" web app will be undeployed and the "default version"
>>    (shipped by WSO2 in <carbon-home>/wso2/<runtime>/d
>>    eployment/web-ui-apps/<app-name>) will be redeployed.
>>
>>
>> Your feedback is highly appreciated.
>> Thanks.
>> --
>> Sajith Janaprasad Ariyarathna
>> Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
>> <https://wso2.com/signature>
>>
>
>


-- 
Sajith Janaprasad Ariyarathna
Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
<https://wso2.com/signature>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to