Extends Base Project

Hi CUBA team,

I am abit confused about Extensibility inside Studio.

Said I have a project named projectbase with an entity Customer and 2 columns name and email.

I will create a project named projectextend. How do I extends Customer from projectbase and add more columns said “age” and “balance”.

When I run projectextend, there will be a table called projectbase_customer table with 4 columns.

Possible to do this inside Studio or I have to do it inside intelliJ IDEA?

I need a link or document describe how to do above extends.

Thanks for helping up.

Hi CUBA team,

Appreciate if someone can answer my issue.

I have tried a few times but not working. Also done with some reading but found no correct steps.

Am I in the wrong zone? I mean the extends suppose to be done in IDE instead of Studio?
Or may be the extends can only done on CUBA own classes like User etc. instead of project classes like Customer?

From the reading,

  1. modify gradle config in IDE
  2. modify project properties
  3. include path in IDE for the Libraries <<< I don’t know the steps to do this as I normally use NetBeans and Light Eclipse.
  4. extends (not sure it’s inside Studio or IDE)

Thanks for helping up.

There is an appropriate way to extend your project by the Studio means. It has not been described in the Developer’s Manual yet, but the Studio context help contains the information on it.

If you want to use your project as a base project do the following:

  1. Open the project in Studio.

  2. Generate DB-update scripts for the required database.
    F.e. if you want to use Postgres in the Extension, adjust the Postgres in the application properties of the project.
    After that press the “Generate DB scripts” button or (which is better) start the application.

  3. Install the project to local Maven repository. To do this, launch the “gradle install” in the root of the project.
    As a result, project artifacts should appear in the ${user.home}/.m2 directory. The ‘app-core’ folder in the repository should contain a .zip - archive with scripts created on the previous step.

  4. Open the PROJECT PROPERTIES tab and press the Extend Studio button. Chose the ‘Base project configuration’ option and press OK.

  5. Restart the Studio server.

  6. Open the Studio and create a new project. Choose your base project in the “Base project version” field (see the attached screenshot).

Note, that Studio caches the base project and if you make some modifications in it you should erase the corresponding folder from ${user.home}/.haulmont/studio/cache