{"id":22389962,"url":"https://github.com/entando/component-generator","last_synced_at":"2025-07-31T07:32:49.282Z","repository":{"id":16095994,"uuid":"18840820","full_name":"entando/component-generator","owner":"entando","description":"Ninja code generator for Entando Platform.","archived":false,"fork":false,"pushed_at":"2022-11-16T09:53:44.000Z","size":369,"stargazers_count":11,"open_issues_count":6,"forks_count":4,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-04-14T07:54:24.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/entando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-16T13:35:25.000Z","updated_at":"2024-04-14T07:54:24.979Z","dependencies_parsed_at":"2023-01-11T20:24:31.017Z","dependency_job_id":null,"html_url":"https://github.com/entando/component-generator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fcomponent-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fcomponent-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fcomponent-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fcomponent-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entando","download_url":"https://codeload.github.com/entando/component-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228224669,"owners_count":17887844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T03:13:57.075Z","updated_at":"2024-12-05T03:13:57.795Z","avatar_url":"https://github.com/entando.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edo\n\n![](edo-logo-350.png)\n\nEdo is the official code generator tool for Entando, started with love by Stefano Puddu \u003cs.puddu@entando.com\u003e and maintained with pride by the Entando dev team.\n\nUse it to generate the following parts of Entando Components with a single command:\n\n* Pojo\n* DAO, Manager, events\n* Entando component descriptor and related files\n* REST API, CXF and SpringMVC\n* Backoffice actions, validations, tiles and JSPs\n* A basic set of utility classes for JUnit tests\n* Widgets, custom tags\n* InternalServlet widget\n* Final report\n\n## Tentative Roadmap\n\n* More than one bean at the same time\n* admin console UI producers\n* Change the template engine\n\n\n## Installation from binary package\n\nIf you obtained Edo as a pre-compiled binary package, follow these easy installation steps:\n\n1. Copy `edo-x.y.z.jar` into a folder of your choice\n2. (Optional for OS X and *nix systems) configure a shell alias like so:  \nalias edo=\"java -jar /folder-of-your-choice/edo-x.y.z.jar\"\n\n## Installation from sources\n\nThe source comes with an Ant script, and **you'll need Ant 1.9+** to make it work.\n\n### Build and Install\n\n#### OS X and Linux / Unix\n\nThe `build-and-install` Ant task is the default one, so you just have to run:\n\n```\n$ ant\n```\n\n#### Windows\n\n1. Build (see next section)\n2. Copy `target/edo-x.y.z.jar` into a folder of your choice\n\n### Build only\n\n```\n$ ant build\n```\n\n## Usage\n\n### Windows and OS X / Unix without the `edo` alias\n\n```\n$ java -jar \u003cPATH_TO_YOUR_JAR\u003e/edo-x.y.z.jar [options]\n```\n\n**Example:**  \n\n```\n$ java -jar \u003cPATH_TO_YOUR_JAR\u003e/edo-x.y.z.jar -f edoDescriptor.json\n```\n\n### OS X / Unix with the `edo` alias\n\n```\n$ edo [options] \n```\n\n**Example:**  \n\n```\n$ edo -f edoDescriptor.json\n```\n\n### Options (must be set BEFORE any argument):\n\n* **--file**    (Required) The path of the edo _file descriptor_.\n* **--zip**     (Optional) Path of a directory where Edo will save the assets as zip file\n\n### File Descriptor:\nThis file contains the parameters used to build your assets.\n\n```\n{\n  \"baseDir\" : \"/path/to/my/project/projectName\",\n  \"permission\" : \"superuser\",\n  \"packageName\" : \"org.entando.entando.plugins.jpzoo\",\n  \"model\" : {\n    \"name\" : \"Animal\",\n    \"fields\" : [ {\n      \"name\" : \"name\",\n      \"type\" : \"string\",\n      \"required\" : true,\n      \"length\" : null,\n      \"primaryKey\" : false\n    }, {\n      \"name\" : \"weight\",\n      \"type\" : \"int\",\n      \"required\" : false,\n      \"length\" : null,\n      \"primaryKey\" : false\n    } ]\n  },\n  \"assets\" : {\n    \"rest\" : true,\n    \"cxf\" : true,\n    \"specialWidget\" : true,\n    \"internalServlet\" : true,\n    \"adminConsole\" : true,\n    \"adminConsoleProducer\" : null\n  }\n}\n\n```\n\n* `baseDir`: The path of the main directory, the root folder of your project. A `pom.xml` file must exist in the same directory.   If the output is a zip file, eg: `java -jar edo-\u003cversion\u003e.jar -f /tmp/edo/foo.json  -z /tmp/projects/sandbox` the `pom.xml` is non necessary anymore and `baseDir` can be null.\n* `permission`: The `code` of an existing Entando permission. If not specified, default value is *superuser*\n* `packageName`: The package that will be used. If not specified, Edo will create a package following the *Entando Plugin Pattern*. See *Plugin mode* for more details\n* `model/name`: The name of the bean\n\n* `model/fields`: The bean fields \n* `model/fields/name`: the field name\n* `model/fields/type`: the filed type, one of _Field Data Types_\n* `model/fields/required`: whether the field is required (optional)\n* `model/fields/length`: the field length (optional)\n* `model/fields/primaryKey`: whether the field is the primary key (optional)\n\n* `assets/rest`: whether to produce _SpringMVC_ rest endpoints   \n* `assets/cxf`: whether to produce _CXF_ rest endpoints   \n* `assets/specialWidget`: whether to produce the assets needed for an entando _widget_   \n* `assets/internalServlet`: whether to produce the assets needed to expose CRUD operations through entando _internalServlet widget_     \n* `assets/adminConsole`: whether to produce the assets needed for _backoffice_ administration UI     \n* `assets/adminConsoleProducer`: [TODO] the adminConsole UI producer     \n\n\n\n\n#### Field Data Types\n\n* **string**\n* **int**\n* **date**\n* **bigdecimal**\n* **primary_key**\n\n\n#### Primary Key\n\nIf no primary key is specified, by default Edo creates a `id:int` field and uses it as the primary key. \n\nIf you want to specify a different name for the primary key, declare it as first field with the property `primaryKey: true`.\n\n#### Plugin mode\n\nIf the packageName is like `org.entando.entando.plugins.jp\u003cname\u003e` than Edo applies the *Entando Plugin Pattern*, otherwise it will act as you are building a custom feature.    \nIn this case, if your assets contains `apache-tiles` definitions make sure to register them in your web.xml    \nEdo creates a file like this:   `/WEB-INF/\u003cprojectName\u003e/apsadmin/**tiles.xml`   \nthat must be registered in your `web.xml`.\n\n### Warning\n\nEdo will overwrite any existing file, so be careful.\n\nOnly the following files won't get overwritten, because these files are meant to exist just once per Plugin:\n\n**Note:** `[sub-path]` can be the project name or `plugins/jp[beanName]`\n\n* `src/main/resources/api/[sub-path]/aps/apiMethods.xml`\n* `src/main/resources/entando-struts-plugin.xml`\n* `src/main/resources/component/[sub-path]/component.xml`\n* `src/main/resources/shortcuts/[sub-path]/apsadmin/shortcuts.xml`\n* `src/main/resources/sql/[sub-path]/port_data_production.sql`\n* `src/main/resources/sql/[sub-path]/serv_data_production.sql`\n* `src/main/tld/[sub-path]/name-core.tld`\n* `src/main/webapp/WEB-INF/[sub-path]/apsadmin/tiles.xml`\n* `src/main/webapp/WEB-INF/[sub-path]/apsadmin/jsp/common/layouts/subMenu.jsp`\n* `src/test/resources/sql/[sub-path]/port_data_test.sql`\n* `src/test/resources/sql/[sub-path]/serv_data_test.sql`\n\n## A full example\n\nGiven this file `/tmp/edo/foo.json` \n\n```\n{\n  \"packageName\" : \"org.mycompany\",\n  \"model\" : {\n    \"name\" : \"Foo\",\n    \"fields\" : [ {\n      \"name\" : \"name\",\n      \"type\" : \"string\",\n      \"required\" : true,\n      \"length\" : 10,\n      \"primaryKey\" : false\n    } ]\n  },\n  \"assets\" : {\n    \"rest\" : true,\n    \"cxf\" : true,\n    \"specialWidget\" : true,\n    \"internalServlet\" : true,\n    \"adminConsole\" : true,\n    \"adminConsoleProducer\" : null\n  }\n}\n```\n\n```\n$ java -jar edo-\u003cversion\u003e.jar -f /tmp/edo/foo.json \n```\n\nEdo will create these files:\n\n```\n\n├── edo_20180424_135604_Foo-report.txt\n└── src\n    ├── main\n    │   ├── java\n    │   │   └── org\n    │   │       └── mycompany\n    │   │           ├── aps\n    │   │           │   ├── internalservlet\n    │   │           │   │   └── foo\n    │   │           │   │       ├── FooFinderFrontEndAction.java\n    │   │           │   │       ├── FooFrontEndAction.java\n    │   │           │   │       └── fooFront.xml\n    │   │           │   ├── system\n    │   │           │   │   ├── init\n    │   │           │   │   │   └── servdb\n    │   │           │   │   │       └── Foo.java\n    │   │           │   │   └── services\n    │   │           │   │       └── foo\n    │   │           │   │           ├── api\n    │   │           │   │           │   ├── FooListResponse.java\n    │   │           │   │           │   ├── FooListResponseResult.java\n    │   │           │   │           │   ├── FooResponse.java\n    │   │           │   │           │   ├── FooResponseResult.java\n    │   │           │   │           │   └── JAXBFoo.java\n    │   │           │   │           ├── event\n    │   │           │   │           │   ├── FooChangedEvent.java\n    │   │           │   │           │   └── FooChangedObserver.java\n    │   │           │   │           ├── FooDAO.java\n    │   │           │   │           ├── Foo.java\n    │   │           │   │           ├── FooManager.java\n    │   │           │   │           ├── FooService.java\n    │   │           │   │           ├── IFooDAO.java\n    │   │           │   │           ├── IFooManager.java\n    │   │           │   │           ├── IFooService.java\n    │   │           │   │           └── model\n    │   │           │   │               └── FooDto.java\n    │   │           │   └── tags\n    │   │           │       ├── FooListTag.java\n    │   │           │       └── FooTag.java\n    │   │           ├── apsadmin\n    │   │           │   ├── foo\n    │   │           │   │   ├── FooAction.java\n    │   │           │   │   ├── FooAction-validation.xml\n    │   │           │   │   ├── FooFinderAction.java\n    │   │           │   │   ├── foo.xml\n    │   │           │   │   ├── package_en.properties\n    │   │           │   │   └── package_it.properties\n    │   │           │   └── portal\n    │   │           │       └── specialwidget\n    │   │           │           └── foo\n    │   │           │               ├── FooConfigAction.java\n    │   │           │               ├── fooSpecialWidget.xml\n    │   │           │               ├── package_en.properties\n    │   │           │               └── package_it.properties\n    │   │           └── web\n    │   │               └── foo\n    │   │                   ├── FooController.java\n    │   │                   ├── model\n    │   │                   │   └── FooRequest.java\n    │   │                   └── validator\n    │   │                       └── FooValidator.java\n    │   ├── resources\n    │   │   ├── api\n    │   │   │   └── 1\n    │   │   │       └── aps\n    │   │   │           └── apiMethods.xml\n    │   │   ├── component\n    │   │   │   └── 1\n    │   │   │       └── component.xml\n    │   │   ├── entando-struts-plugin.xml\n    │   │   ├── shortcuts\n    │   │   │   └── 1\n    │   │   │       └── apsadmin\n    │   │   │           └── shortcuts.xml\n    │   │   ├── spring\n    │   │   │   ├── aps\n    │   │   │   │   └── managers\n    │   │   │   │       └── 1FooManagersConfig.xml\n    │   │   │   └── apsadmin\n    │   │   │       └── 1FooActionsConfig.xml\n    │   │   └── sql\n    │   │       └── misc\n    │   │           └── 1\n    │   │               ├── port_data_production.sql\n    │   │               └── serv_data_production.sql\n    │   ├── tld\n    │   │   └── 1\n    │   │       └── 1-core.tld\n    │   └── webapp\n    │       └── WEB-INF\n    │           ├── 1\n    │           │   └── apsadmin\n    │           │       ├── 1-tiles.xml\n    │           │       └── jsp\n    │           │           ├── common\n    │           │           │   └── layouts\n    │           │           │       └── assets-more\n    │           │           │           ├── foo-entry-extras.jsp\n    │           │           │           ├── foo-list-extras.jsp\n    │           │           │           └── foo-trash-extras.jsp\n    │           │           ├── foo\n    │           │           │   ├── foo-entry.jsp\n    │           │           │   ├── foo-list.jsp\n    │           │           │   └── foo-trash.jsp\n    │           │           └── portal\n    │           │               └── specialwidget\n    │           │                   └── foo\n    │           │                       └── foo-config.jsp\n    │           └── aps\n    │               └── jsp\n    │                   ├── internalservlet\n    │                   │   └── foo\n    │                   │       ├── frontend-foo-entry.jsp\n    │                   │       ├── frontend-foo-error.jsp\n    │                   │       ├── frontend-foo-list.jsp\n    │                   │       └── frontend-foo-trash.jsp\n    │                   └── widgets\n    │                       └── Foo.jsp\n    └── test\n        ├── java\n        │   └── org\n        │       └── mycompany\n        │           ├── 1ConfigTestUtils.java\n        │           ├── aps\n        │           │   ├── 1BaseTestCase.java\n        │           │   └── system\n        │           │       └── services\n        │           │           └── TestFooManager.java\n        │           └── apsadmin\n        │               ├── 1ApsAdminBaseTestCase.java\n        │               └── foo\n        │                   ├── TestFooAction.java\n        │                   └── TestFooFinderAction.java\n        └── resources\n            └── sql\n                └── misc\n                    └── 1\n                        ├── port_data_test.sql\n                        └── serv_data_test.sql\n\n\n```\n\n## Issues\n\nA lot :D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentando%2Fcomponent-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentando%2Fcomponent-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentando%2Fcomponent-generator/lists"}