Deploy custom directory to public folder or "App/Published"?

Hi Cuba Support,

Was just wondering if there is a way to publish a custom directory in the same way that a Javascript AbstractComponent would?

Either, when accessing the screen - create custom directory with files in to be available in sources.

Or put directory/files in App/Published on accessing of the screen?

Thanks

Matt

Any input on this would be great.

Thank you

Regards

Matt

Hi,

Can you please explain in more detail what do you need? Your post isn’t clear at all.

What is “App/Published”, some Android thing?

What do you mean by “publishing a custom directory”? Publish to whom?
Where “create custom directory with files”? In the project? On the server during deployment?

Hi Alex,

Apologies if the post was unclear.

I would like to deploy a public folder published from the server that can be accessed by the browser.

For example by default when a javascript component is deployed via cuba, the javascript and css files get placed into App/Published. See screenshot below:

image

I would like to be able to deploy my own directory or add another folder into the existing directory to place a build folder that is outputted from a react build. (I have re-created the calendar in the screenshot with a project built in react and am using the javascript connector to pass data to it.)

Any ideas as to if this is possible?

Thanks

Matt

Hi Alex,

Is the above just a case of creating a Gradle task to publish static resources?

If so, any example of how this could be done?

Thank you

Regards

Matt

Hi, files under APP/PUBLISHED are resolved dynamically (by Vaadin), so there is no option to extract/copy them automatically (e.g. by gradle task). React app has it’s own build toolchain and you should move desired resources to the React project (into public or src directory).
Anyway it’s still quite unclear what do you want to achieve. Could you please elaborate what is the purpose of moving resources from GUI to React ?

Hi Vlad,

Thank you for the response.

I have created a javascript component built in react that is external to Cuba as we couldn’t get along with the app-front Cuba component.

React builds the component and exports a build folder which I want to make available to users when they access the planner Cuba screen.

I have managed to get it working by placing the files in the themes folder but would prefer it could be placed in it’s own directory as it has nothing to do with themes.

Please see attached:

image

I would like to be able to publish static content from somewhere within the client tier.

Thanks

regards

Matt

Hi,

Did you consider to deploy it as a separate web app (war or directory) to the Tomcat?