Menu

Refactoring/renaming An Entire OX Project

2024-06-20
2024-06-25
  • Bernard Williams

    Greetings:
    Have an existing OX Project that needs to be Renamed. The last time I attempted this, the project stated that it was renamed but nothing would execute afterwards.

    Was there some step that I possibly missed?

    In the OX Workspace, the Project Folder is WICS; "Project Nam e WICS"

    End Users desire WDS

    What I would like to do is Refactor-Rename to entire Project and all related references to WICS (WDS)

    Whats the recommended method of doing this? What is the best practice for doing such? Please advise?

     
  • Bernard Williams

    I was also able to deploy using OX Deployment, Use WINRAR to extract the WAR file; upon execution, It created the SQL Database Correctly! Now I need to implement the new Project Name WDS; If I dont have to recreate the entire project, I would gladly welcome input.

     
  • Javier Paniza

    Javier Paniza - 2024-06-25

    Hi Bernard,

    If you use has enough with the label of the application, but it tolerates the URL, you can just change the label in the labels i18n file:

    WICS=WDS
    

    On the other hand, if you user want to use the wds name in the browser URL, you have to rename the project,

    To rename the project in OpenXava Studio choose Refactor > Rename on your project, just write the new project.

    Unfortunately, this is not enough, you have to change manually the project name in several places:

    • pom.xml: Where you have to change artifactId y finalName.
    • application.xml: Just change the application name.
    • In i18n folder change the file names to use your new project name as prefix.
    • The launcher class. This class is inside the run packaga, and has the same name of the project. Rename the class with the new name. Also edit the class and change AppServer.run("yournewname") to use your new name. If you use HSQLDB you can also change de DBServer.start("") and which case you should also rename de db in data folder.

    The above is enough. However, optionally you can also rename:

    • If you want to rename the datasource you have to edit persistence.xml and context.xml files.
    • You can also consider rename the Java package of your application.
    • If you're using HSQLDB you can rename the files in data folder.

    Help others in this forum as I help you.

    From inside OpenXava Studio use Refactor > Rename on your project. This rename the project from the

     

Log in to post a comment.