├── .gitignore ├── .project ├── .settings └── org.eclipse.m2e.core.prefs ├── LICENSE ├── README.md ├── build-maven.xml ├── build-properties.xml ├── build.xml ├── edo-logo-350.png ├── pom.xml └── src ├── main ├── config │ └── dist │ │ └── INSTALL.txt ├── java │ └── org │ │ └── entando │ │ └── edo │ │ ├── Edo.java │ │ ├── builder │ │ ├── Builder.java │ │ ├── ControllerFileBuilder.java │ │ ├── Filebuilder.java │ │ ├── FolderConstants.java │ │ ├── InternalServletFileBuilder.java │ │ ├── ServiceFileBuilder.java │ │ ├── TestCaseFileBuilder.java │ │ ├── WidgetFileBuilder.java │ │ └── out │ │ │ ├── EdoReportEntry.java │ │ │ ├── EdoWriter.java │ │ │ ├── FileSystemWriter.java │ │ │ ├── ZipWriter.java │ │ │ └── exception │ │ │ └── EdoWriterException.java │ │ ├── datatype │ │ ├── AbstractDataType.java │ │ ├── BigDecimalDataType.java │ │ ├── DataTypeManager.java │ │ ├── DateDataType.java │ │ ├── IntegerDataType.java │ │ ├── PrimaryKeyDataType.java │ │ └── StringDataType.java │ │ ├── model │ │ ├── EdoBean.java │ │ ├── EdoBuilder.java │ │ ├── EdoConstants.java │ │ ├── EdoField.java │ │ ├── json │ │ │ ├── BeanModel.java │ │ │ ├── EdoAssetsConf.java │ │ │ ├── EdoInput.java │ │ │ └── Field.java │ │ └── validation │ │ │ └── constraints │ │ │ ├── ValidBaseDir.java │ │ │ ├── ValidBaseDirValidator.java │ │ │ ├── ValidEdoClassName.java │ │ │ ├── ValidEdoClassNameValidator.java │ │ │ ├── ValidEdoDataType.java │ │ │ ├── ValidEdoDataTypeValidator.java │ │ │ ├── ValidEdoPackage.java │ │ │ └── ValidEdoPackageValidator.java │ │ ├── parser │ │ ├── CommandlineParser.java │ │ ├── EdoInputException.java │ │ ├── FieldsParser.java │ │ ├── IAgrumentParser.java │ │ ├── NameParser.java │ │ └── PackageValidator.java │ │ ├── report │ │ ├── Report.java │ │ └── ReportFileInfo.java │ │ └── template │ │ ├── Render.java │ │ └── Templates.java └── resources │ ├── log4j2.xml │ └── templates │ ├── common │ ├── license │ │ └── java_license.vm │ └── report_txt.vm │ ├── freemarker │ └── aps │ │ └── inc │ │ ├── frontend_input_fields.vm │ │ └── frontend_print_fields.vm │ ├── java │ ├── aps │ │ ├── api │ │ │ ├── apiListResponseResult_java.vm │ │ │ ├── apiListResponse_java.vm │ │ │ ├── apiResponseResult_java.vm │ │ │ ├── apiResponse_java.vm │ │ │ └── jaxb-bean_java.vm │ │ ├── init │ │ │ └── initBean_java.vm │ │ ├── internalservlet │ │ │ ├── FinderFrontEndAction_java.vm │ │ │ ├── FrontEndAction_java.vm │ │ │ └── action_xml.vm │ │ ├── managers │ │ │ ├── DaoInterface_java.vm │ │ │ ├── Dao_java.vm │ │ │ ├── EventObserver_java.vm │ │ │ ├── Event_java.vm │ │ │ ├── ManagerInterface_java.vm │ │ │ ├── Manager_java.vm │ │ │ ├── bean_java.vm │ │ │ └── inc │ │ │ │ ├── dao_stat_by_object.vm │ │ │ │ ├── dao_stat_by_param.vm │ │ │ │ ├── manager_api_imports.vm │ │ │ │ └── manager_api_methods.vm │ │ ├── services │ │ │ ├── ServiceInterface_java.vm │ │ │ ├── Service_java.vm │ │ │ └── dto_java.vm │ │ ├── tags │ │ │ ├── list_tag_java.vm │ │ │ └── tag_java.vm │ │ └── web │ │ │ ├── controller_java.vm │ │ │ ├── controller_validator_java.vm │ │ │ └── dto_request_java.vm │ └── apsadmin │ │ ├── action-conversion_properties.vm │ │ ├── action-validation_xml.vm │ │ ├── action_java.vm │ │ ├── action_specialwidget_java.vm │ │ ├── action_tiles_xml.vm │ │ ├── action_xml.vm │ │ ├── finder-action-conversion_properties.vm │ │ ├── finder_action_java.vm │ │ ├── package_properties.vm │ │ ├── plugin_global_properties.vm │ │ ├── specialwidget_action_xml.vm │ │ ├── specialwidget_package_properties.vm │ │ └── struts_plugin_xml.vm │ ├── jsp │ ├── aps │ │ ├── inc │ │ │ ├── frontend_input_fields.vm │ │ │ └── frontend_print_fields.vm │ │ ├── internalservlet │ │ │ ├── entry_jsp.vm │ │ │ ├── error_jsp.vm │ │ │ ├── list_jsp.vm │ │ │ └── trash_jsp.vm │ │ └── widgets │ │ │ └── widget.vm │ └── apsadmin │ │ ├── entry_extras_jsp.vm │ │ ├── entry_jsp.vm │ │ ├── inc │ │ ├── input_field_witherrors.vm │ │ ├── s_property.vm │ │ └── search_form_input_field.vm │ │ ├── list_extras_jsp.vm │ │ ├── list_jsp.vm │ │ ├── plugin_submenu_jsp.vm │ │ ├── specialwidget_config_jsp.vm │ │ ├── trash_extras_jsp.vm │ │ └── trash_jsp.vm │ ├── resources │ ├── api │ │ └── apiMethods_xml.vm │ ├── component │ │ └── component_xml.vm │ ├── spring │ │ ├── action │ │ │ └── actions_xml.vm │ │ └── manager │ │ │ └── managers_xml.vm │ └── sql │ │ ├── port_data_production_sql.vm │ │ ├── port_data_test_sql.vm │ │ ├── serv_data_production_sql.vm │ │ └── serv_data_test_sql.vm │ ├── shortcuts │ └── shortcuts_xml.vm │ ├── test │ └── java │ │ ├── ConfigTestUtils_java.vm │ │ ├── aps │ │ ├── ApsBaseTestCase_java.vm │ │ └── TestManager_java.vm │ │ └── apsadmin │ │ ├── ApsAdminBaseTestCase_java.vm │ │ ├── TestAction_java.vm │ │ └── TestFinderAction_java.vm │ └── tld │ └── aps-core_tld.vm └── test ├── java └── org │ └── entando │ └── edo │ ├── AllTests.java │ ├── builder │ ├── TestBuilder.java │ └── TestBuilderNoPlugin.java │ ├── mock │ ├── builder │ │ └── MockBuilder.java │ └── parser │ │ └── MockCommandLineParser.java │ ├── model │ ├── TestEdoBean.java │ └── json │ │ └── EdoInputTest.java │ ├── parser │ ├── TestCommandlineParser.java │ ├── TestFieldsParser.java │ ├── TestNameParser.java │ └── TestPackageValidator.java │ └── report │ └── TestReport.java ├── outcomes ├── noplugin_simple_1 │ ├── edo_20140421_173048_Cat-report.txt │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── myportal │ │ │ │ ├── aps │ │ │ │ ├── internalservlet │ │ │ │ │ └── cat │ │ │ │ │ │ ├── CatFinderFrontEndAction.java │ │ │ │ │ │ ├── CatFrontEndAction.java │ │ │ │ │ │ └── catFront.xml │ │ │ │ ├── system │ │ │ │ │ ├── init │ │ │ │ │ │ └── servdb │ │ │ │ │ │ │ └── Cat.java │ │ │ │ │ └── services │ │ │ │ │ │ └── cat │ │ │ │ │ │ ├── Cat.java │ │ │ │ │ │ ├── CatDAO.java │ │ │ │ │ │ ├── CatManager.java │ │ │ │ │ │ ├── ICatDAO.java │ │ │ │ │ │ ├── ICatManager.java │ │ │ │ │ │ ├── api │ │ │ │ │ │ ├── CatListResponse.java │ │ │ │ │ │ ├── CatListResponseResult.java │ │ │ │ │ │ ├── CatResponse.java │ │ │ │ │ │ ├── CatResponseResult.java │ │ │ │ │ │ └── JAXBCat.java │ │ │ │ │ │ └── event │ │ │ │ │ │ ├── CatChangedEvent.java │ │ │ │ │ │ └── CatChangedObserver.java │ │ │ │ └── tags │ │ │ │ │ ├── CatListTag.java │ │ │ │ │ └── CatTag.java │ │ │ │ └── apsadmin │ │ │ │ ├── cat │ │ │ │ ├── CatAction-conversion.properties │ │ │ │ ├── CatAction-validation.xml │ │ │ │ ├── CatAction.java │ │ │ │ ├── CatFinderAction-conversion.properties │ │ │ │ ├── CatFinderAction.java │ │ │ │ ├── cat.xml │ │ │ │ ├── package_en.properties │ │ │ │ └── package_it.properties │ │ │ │ └── portal │ │ │ │ └── specialwidget │ │ │ │ └── cat │ │ │ │ ├── CatConfigAction.java │ │ │ │ ├── catSpecialWidget.xml │ │ │ │ ├── package_en.properties │ │ │ │ └── package_it.properties │ │ ├── resources │ │ │ ├── api │ │ │ │ └── sandbox │ │ │ │ │ └── aps │ │ │ │ │ └── apiMethods.xml │ │ │ ├── component │ │ │ │ └── sandbox │ │ │ │ │ └── component.xml │ │ │ ├── entando-struts-plugin.xml │ │ │ ├── shortcuts │ │ │ │ └── sandbox │ │ │ │ │ └── apsadmin │ │ │ │ │ └── shortcuts.xml │ │ │ ├── spring │ │ │ │ ├── aps │ │ │ │ │ └── managers │ │ │ │ │ │ └── sandboxCatManagersConfig.xml │ │ │ │ └── apsadmin │ │ │ │ │ └── sandboxCatActionsConfig.xml │ │ │ └── sql │ │ │ │ └── misc │ │ │ │ └── sandbox │ │ │ │ ├── port_data_production.sql │ │ │ │ └── serv_data_production.sql │ │ ├── tld │ │ │ └── sandbox │ │ │ │ └── sandbox-core.tld │ │ └── webapp │ │ │ └── WEB-INF │ │ │ ├── aps │ │ │ └── jsp │ │ │ │ ├── internalservlet │ │ │ │ └── cat │ │ │ │ │ ├── frontend-cat-entry.jsp │ │ │ │ │ ├── frontend-cat-error.jsp │ │ │ │ │ ├── frontend-cat-list.jsp │ │ │ │ │ └── frontend-cat-trash.jsp │ │ │ │ └── widgets │ │ │ │ └── Cat.jsp │ │ │ └── sandbox │ │ │ └── apsadmin │ │ │ ├── jsp │ │ │ ├── cat │ │ │ │ ├── cat-entry.jsp │ │ │ │ ├── cat-list.jsp │ │ │ │ └── cat-trash.jsp │ │ │ ├── common │ │ │ │ └── layouts │ │ │ │ │ └── assets-more │ │ │ │ │ ├── cat-entry-extras.jsp │ │ │ │ │ ├── cat-list-extras.jsp │ │ │ │ │ └── cat-trash-extras.jsp │ │ │ └── portal │ │ │ │ └── specialwidget │ │ │ │ └── cat │ │ │ │ └── cat-config.jsp │ │ │ └── sandbox-tiles.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── myportal │ │ │ ├── SandboxConfigTestUtils.java │ │ │ ├── aps │ │ │ ├── SandboxBaseTestCase.java │ │ │ └── system │ │ │ │ └── services │ │ │ │ └── TestCatManager.java │ │ │ └── apsadmin │ │ │ ├── SandboxApsAdminBaseTestCase.java │ │ │ └── cat │ │ │ ├── TestCatAction.java │ │ │ └── TestCatFinderAction.java │ │ └── resources │ │ └── sql │ │ └── misc │ │ └── sandbox │ │ ├── port_data_test.sql │ │ └── serv_data_test.sql └── simple_1 │ ├── edo_20140418_080556_Cat-report.txt │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── entando │ │ │ └── entando │ │ │ └── plugins │ │ │ └── jppet │ │ │ ├── aps │ │ │ ├── internalservlet │ │ │ │ └── cat │ │ │ │ │ ├── CatFinderFrontEndAction.java │ │ │ │ │ ├── CatFrontEndAction.java │ │ │ │ │ └── catFront.xml │ │ │ ├── system │ │ │ │ ├── init │ │ │ │ │ └── servdb │ │ │ │ │ │ └── Cat.java │ │ │ │ └── services │ │ │ │ │ └── cat │ │ │ │ │ ├── Cat.java │ │ │ │ │ ├── CatDAO.java │ │ │ │ │ ├── CatManager.java │ │ │ │ │ ├── ICatDAO.java │ │ │ │ │ ├── ICatManager.java │ │ │ │ │ ├── api │ │ │ │ │ ├── CatListResponse.java │ │ │ │ │ ├── CatListResponseResult.java │ │ │ │ │ ├── CatResponse.java │ │ │ │ │ ├── CatResponseResult.java │ │ │ │ │ └── JAXBCat.java │ │ │ │ │ └── event │ │ │ │ │ ├── CatChangedEvent.java │ │ │ │ │ └── CatChangedObserver.java │ │ │ └── tags │ │ │ │ ├── CatListTag.java │ │ │ │ └── CatTag.java │ │ │ └── apsadmin │ │ │ ├── cat │ │ │ ├── CatAction-conversion.properties │ │ │ ├── CatAction-validation.xml │ │ │ ├── CatAction.java │ │ │ ├── CatFinderAction-conversion.properties │ │ │ ├── CatFinderAction.java │ │ │ ├── cat.xml │ │ │ ├── package_en.properties │ │ │ └── package_it.properties │ │ │ ├── global-messages_en.properties │ │ │ ├── global-messages_it.properties │ │ │ └── portal │ │ │ └── specialwidget │ │ │ └── cat │ │ │ ├── CatConfigAction.java │ │ │ ├── catSpecialWidget.xml │ │ │ ├── package_en.properties │ │ │ └── package_it.properties │ ├── resources │ │ ├── api │ │ │ └── plugins │ │ │ │ └── jppet │ │ │ │ └── aps │ │ │ │ └── apiMethods.xml │ │ ├── component │ │ │ └── plugins │ │ │ │ └── jppet │ │ │ │ └── component.xml │ │ ├── entando-struts-plugin.xml │ │ ├── shortcuts │ │ │ └── plugins │ │ │ │ └── jppet │ │ │ │ └── apsadmin │ │ │ │ └── shortcuts.xml │ │ ├── spring │ │ │ └── plugins │ │ │ │ └── jppet │ │ │ │ ├── aps │ │ │ │ └── managers │ │ │ │ │ └── jppetCatManagersConfig.xml │ │ │ │ └── apsadmin │ │ │ │ └── jppetCatActionsConfig.xml │ │ └── sql │ │ │ └── plugins │ │ │ └── jppet │ │ │ ├── port_data_production.sql │ │ │ └── serv_data_production.sql │ ├── tld │ │ └── plugins │ │ │ └── jppet │ │ │ └── jppet-core.tld │ └── webapp │ │ └── WEB-INF │ │ └── plugins │ │ └── jppet │ │ ├── aps │ │ └── jsp │ │ │ ├── internalservlet │ │ │ └── cat │ │ │ │ ├── frontend-cat-entry.jsp │ │ │ │ ├── frontend-cat-error.jsp │ │ │ │ ├── frontend-cat-list.jsp │ │ │ │ └── frontend-cat-trash.jsp │ │ │ └── widgets │ │ │ └── jppetCat.jsp │ │ └── apsadmin │ │ ├── jppet-tiles.xml │ │ └── jsp │ │ ├── cat │ │ ├── cat-entry.jsp │ │ ├── cat-list.jsp │ │ └── cat-trash.jsp │ │ ├── common │ │ └── layouts │ │ │ ├── assets-more │ │ │ ├── cat-entry-extras.jsp │ │ │ ├── cat-list-extras.jsp │ │ │ └── cat-trash-extras.jsp │ │ │ └── subMenu.jsp │ │ └── portal │ │ └── specialwidget │ │ └── cat │ │ └── cat-config.jsp │ └── test │ ├── java │ └── org │ │ └── entando │ │ └── entando │ │ └── plugins │ │ └── jppet │ │ ├── JppetConfigTestUtils.java │ │ ├── aps │ │ ├── JppetBaseTestCase.java │ │ └── system │ │ │ └── services │ │ │ └── TestCatManager.java │ │ └── apsadmin │ │ ├── JppetApsAdminBaseTestCase.java │ │ └── cat │ │ ├── TestCatAction.java │ │ └── TestCatFinderAction.java │ └── resources │ └── sql │ └── plugins │ └── jppet │ ├── port_data_test.sql │ └── serv_data_test.sql └── resources └── log4j2.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea 3 | dependency-reduced-pom.xml 4 | target/ 5 | .DS_Store 6 | .classpath 7 | .settings 8 | 9 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | edo 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | #Tue Dec 17 10:51:17 CET 2013 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | resolveWorkspaceProjects=true 5 | version=1 6 | -------------------------------------------------------------------------------- /build-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /edo-logo-350.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/edo-logo-350.png -------------------------------------------------------------------------------- /src/main/config/dist/INSTALL.txt: -------------------------------------------------------------------------------- 1 | # Edo 2 | 3 | This is an excerpt from the file `README.md`. 4 | 5 | The file `README.md` contains more useful information, and you should read it once Edo is installed. 6 | 7 | ## Installation from binary package 8 | 9 | If you obtained Edo as a pre-compiled binary package, follow these easy installation steps: 10 | 11 | 1. Copy `edo-x.y.z.jar` into a folder of your choice 12 | 2. (Optional for OS X and *nix systems) configure a shell alias like so: 13 | alias edo="java -jar /folder-of-your-choice/edo-x.y.z.jar" 14 | 3. Read the file `README.md` :) -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/Edo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo; 15 | 16 | import org.apache.logging.log4j.LogManager; 17 | import org.apache.logging.log4j.Logger; 18 | import org.entando.edo.builder.Builder; 19 | import org.entando.edo.model.EdoBean; 20 | import org.entando.edo.model.EdoBuilder; 21 | import org.entando.edo.parser.CommandlineParser; 22 | import org.entando.edo.parser.EdoInputException; 23 | 24 | public class Edo { 25 | 26 | public static Logger logger = LogManager.getLogger(Edo.class); 27 | 28 | public static void main(String[] args) { 29 | try { 30 | CommandlineParser commandlineParser = new CommandlineParser(); 31 | EdoBuilder edoBuilder = commandlineParser.generate(args); 32 | if (null == edoBuilder) return; 33 | EdoBean edoBean = edoBuilder.getBean(); 34 | if (null == edoBean) return; 35 | 36 | logger.info("Start process..."); 37 | Builder b = new Builder(); 38 | b.build(edoBuilder); 39 | logger.info("Done"); 40 | 41 | } catch (EdoInputException ex) { 42 | logger.error(ex.getMessage()); 43 | } catch (Throwable t) { 44 | logger.error("Error", t); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/builder/out/EdoReportEntry.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.builder.out; 2 | 3 | 4 | public class EdoReportEntry { 5 | 6 | private String fileName; 7 | private int lines; 8 | 9 | public String getFileName() { 10 | return fileName; 11 | } 12 | 13 | public void setFileName(String fileName) { 14 | this.fileName = fileName; 15 | } 16 | 17 | public int getLines() { 18 | return lines; 19 | } 20 | 21 | public void setLines(int lines) { 22 | this.lines = lines; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/builder/out/EdoWriter.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.builder.out; 2 | 3 | import org.entando.edo.model.EdoBuilder; 4 | 5 | public interface EdoWriter { 6 | 7 | public void onInit(EdoBuilder edoBuilder); 8 | 9 | public EdoReportEntry write(String path, String text); 10 | 11 | public void onClose(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/builder/out/FileSystemWriter.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.builder.out; 2 | 3 | import java.io.File; 4 | 5 | import org.apache.commons.io.FileUtils; 6 | import org.apache.commons.lang.StringUtils; 7 | import org.entando.edo.builder.out.exception.EdoWriterException; 8 | import org.entando.edo.model.EdoBuilder; 9 | 10 | public class FileSystemWriter implements EdoWriter { 11 | 12 | private EdoBuilder edoBuilder = null; 13 | 14 | public FileSystemWriter(EdoBuilder edoBuilder) { 15 | this.edoBuilder = edoBuilder; 16 | } 17 | 18 | @Override 19 | public void onInit(EdoBuilder builder) { 20 | edoBuilder = builder; 21 | 22 | } 23 | 24 | @Override 25 | public EdoReportEntry write(String path, String text) { 26 | try { 27 | String workingDir = edoBuilder.getBaseDir(); 28 | File file = new File(path); 29 | FileUtils.writeStringToFile(file, text, "UTF-8"); 30 | 31 | path = StringUtils.substringAfter(path, workingDir + File.separator); 32 | EdoReportEntry edoReportEntry = new EdoReportEntry(); 33 | edoReportEntry.setFileName(path); 34 | edoReportEntry.setLines(FileUtils.readLines(file).size()); 35 | return edoReportEntry; 36 | } catch (Exception e) { 37 | throw new EdoWriterException("error in write file"); 38 | } 39 | 40 | } 41 | 42 | @Override 43 | public void onClose() { 44 | // TODO Auto-generated method stub 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/builder/out/exception/EdoWriterException.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.builder.out.exception; 2 | 3 | public class EdoWriterException extends RuntimeException { 4 | 5 | public EdoWriterException() { 6 | super(); 7 | // TODO Auto-generated constructor stub 8 | } 9 | 10 | public EdoWriterException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 11 | super(message, cause, enableSuppression, writableStackTrace); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public EdoWriterException(String message, Throwable cause) { 16 | super(message, cause); 17 | // TODO Auto-generated constructor stub 18 | } 19 | 20 | public EdoWriterException(String message) { 21 | super(message); 22 | // TODO Auto-generated constructor stub 23 | } 24 | 25 | public EdoWriterException(Throwable cause) { 26 | super(cause); 27 | // TODO Auto-generated constructor stub 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/datatype/AbstractDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.datatype; 15 | 16 | public abstract class AbstractDataType { 17 | 18 | public abstract String getJavaTypeGeneric(); 19 | 20 | public abstract String getJavaType(); 21 | 22 | public abstract String getImportString(); 23 | 24 | public abstract String getExtraImportString(); 25 | 26 | public abstract String getStrutsConversionProperties(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/datatype/BigDecimalDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.datatype; 15 | 16 | 17 | public class BigDecimalDataType extends AbstractDataType { 18 | 19 | @Override 20 | public String getJavaTypeGeneric() { 21 | return "BigDecimal"; 22 | } 23 | 24 | @Override 25 | public String getJavaType() { 26 | return "BigDecimal"; 27 | } 28 | 29 | @Override 30 | public String getImportString() { 31 | return "import java.math.BigDecimal;"; 32 | } 33 | 34 | @Override 35 | public String getStrutsConversionProperties() { 36 | return null; 37 | } 38 | 39 | @Override 40 | public String getExtraImportString() { 41 | return null; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/datatype/DateDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.datatype; 15 | 16 | public class DateDataType extends AbstractDataType { 17 | 18 | @Override 19 | public String getJavaTypeGeneric() { 20 | return "Date"; 21 | } 22 | 23 | @Override 24 | public String getJavaType() { 25 | return "Date"; 26 | } 27 | 28 | @Override 29 | public String getImportString() { 30 | return "import java.util.Date;"; 31 | } 32 | 33 | @Override 34 | public String getExtraImportString() { 35 | return "import java.sql.Timestamp;"; 36 | } 37 | 38 | @Override 39 | public String getStrutsConversionProperties() { 40 | return "com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter"; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/datatype/IntegerDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.datatype; 15 | 16 | public class IntegerDataType extends AbstractDataType { 17 | 18 | @Override 19 | public String getJavaTypeGeneric() { 20 | return "Integer"; 21 | } 22 | 23 | @Override 24 | public String getJavaType() { 25 | return "int"; 26 | } 27 | 28 | @Override 29 | public String getImportString() { 30 | return null; 31 | } 32 | 33 | @Override 34 | public String getStrutsConversionProperties() { 35 | return null; 36 | } 37 | 38 | @Override 39 | public String getExtraImportString() { 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/datatype/PrimaryKeyDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.datatype; 15 | 16 | public class PrimaryKeyDataType extends IntegerDataType { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/datatype/StringDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.datatype; 15 | 16 | public class StringDataType extends AbstractDataType { 17 | 18 | @Override 19 | public String getJavaTypeGeneric() { 20 | return "String"; 21 | } 22 | 23 | @Override 24 | public String getJavaType() { 25 | return "String"; 26 | } 27 | 28 | @Override 29 | public String getImportString() { 30 | return null; 31 | } 32 | 33 | @Override 34 | public String getStrutsConversionProperties() { 35 | return null; 36 | } 37 | 38 | @Override 39 | public String getExtraImportString() { 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/EdoConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.model; 15 | 16 | import org.apache.commons.lang.StringUtils; 17 | 18 | /** 19 | * Template helper 20 | * 21 | */ 22 | public class EdoConstants { 23 | 24 | public static final String PERMISSION_DEFAULT = "superuser"; 25 | public static final String BASE_DIR_DEFAULT = System.getProperty("user.dir"); 26 | 27 | public static String getLowerCase(String s) { 28 | return s.toLowerCase(); 29 | } 30 | 31 | public static String getCapitalize(String s) { 32 | return StringUtils.capitalize(s); 33 | } 34 | 35 | public static String getUnCapitalize(String s) { 36 | return StringUtils.uncapitalize(s); 37 | } 38 | 39 | public static String toUpperCase(String s) { 40 | return s.toUpperCase(); 41 | } 42 | 43 | /** 44 | * aps 45 | * @return 46 | */ 47 | public static String getApsPackage() { 48 | return "aps"; 49 | } 50 | 51 | /** 52 | * 53 | * @return aps.system.services 54 | */ 55 | public static String getServicesPackage() { 56 | return "aps.system.services"; 57 | } 58 | 59 | public static String getRestPackage() { 60 | return "web"; 61 | } 62 | 63 | public static String getApsadminPackage() { 64 | return "apsadmin"; 65 | } 66 | 67 | /** 68 | * aps.system.init.servdb 69 | * @return 70 | */ 71 | public static String getInitPackage() { 72 | return "aps.system.init.servdb"; 73 | } 74 | 75 | public static final String FILE_NO_OVERRIDE_PREFIX = "change_me-"; 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/json/EdoAssetsConf.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.json; 2 | 3 | 4 | public class EdoAssetsConf { 5 | 6 | private boolean rest; 7 | private boolean cxf; 8 | private boolean specialWidget; 9 | private boolean internalServlet; 10 | private boolean adminConsole; 11 | private String adminConsoleProducer; 12 | 13 | public boolean isRest() { 14 | return rest; 15 | } 16 | 17 | public void setRest(boolean rest) { 18 | this.rest = rest; 19 | } 20 | 21 | public boolean isCxf() { 22 | return cxf; 23 | } 24 | 25 | public void setCxf(boolean cxf) { 26 | this.cxf = cxf; 27 | } 28 | 29 | public boolean isSpecialWidget() { 30 | return specialWidget; 31 | } 32 | 33 | public void setSpecialWidget(boolean specialWidget) { 34 | this.specialWidget = specialWidget; 35 | } 36 | 37 | public boolean isInternalServlet() { 38 | return internalServlet; 39 | } 40 | 41 | public void setInternalServlet(boolean internalServlet) { 42 | this.internalServlet = internalServlet; 43 | } 44 | 45 | public String getAdminConsoleProducer() { 46 | return adminConsoleProducer; 47 | } 48 | 49 | public void setAdminConsoleProducer(String adminConsoleProducer) { 50 | this.adminConsoleProducer = adminConsoleProducer; 51 | } 52 | 53 | public boolean isAdminConsole() { 54 | return adminConsole; 55 | } 56 | 57 | public void setAdminConsole(boolean adminConsole) { 58 | this.adminConsole = adminConsole; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/json/Field.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.json; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | 5 | import org.entando.edo.model.validation.constraints.ValidEdoDataType; 6 | 7 | public class Field { 8 | 9 | @NotEmpty(message = BeanModel.ERR_BEANMODEL_FIELD_NAME_EMPTY) 10 | private String name; 11 | 12 | 13 | @ValidEdoDataType(message = BeanModel.ERR_BEANMODEL_FIELD_TYPE_INVALID) 14 | private String type; 15 | 16 | private boolean required; 17 | 18 | private Integer length; 19 | 20 | private boolean primaryKey = false; 21 | 22 | public Field() { 23 | 24 | } 25 | 26 | public Field(String name, String type, boolean required) { 27 | this.setName(name); 28 | this.setType(type); 29 | this.setRequired(required); 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public String getType() { 41 | return type; 42 | } 43 | 44 | public void setType(String type) { 45 | this.type = type; 46 | } 47 | 48 | public boolean isRequired() { 49 | return required; 50 | } 51 | 52 | public void setRequired(boolean required) { 53 | this.required = required; 54 | } 55 | 56 | public Integer getLength() { 57 | return length; 58 | } 59 | 60 | public void setLength(Integer length) { 61 | this.length = length; 62 | } 63 | 64 | public boolean isPrimaryKey() { 65 | return primaryKey; 66 | } 67 | 68 | public void setPrimaryKey(boolean primaryKey) { 69 | this.primaryKey = primaryKey; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidBaseDir.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import javax.validation.Constraint; 8 | import javax.validation.Payload; 9 | import javax.validation.ReportAsSingleViolation; 10 | 11 | import static java.lang.annotation.ElementType.TYPE; 12 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 13 | 14 | @Documented 15 | @Constraint(validatedBy = ValidBaseDirValidator.class) 16 | @Target({TYPE}) 17 | @Retention(RUNTIME) 18 | @ReportAsSingleViolation 19 | public @interface ValidBaseDir { 20 | 21 | String message() default "{org.entando.edo.model.validation.constraints.ValidBaseDir.message}"; 22 | Class[] groups() default {}; 23 | Class[] payload() default {}; 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidBaseDirValidator.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | import org.apache.commons.lang.StringUtils; 7 | import org.entando.edo.model.json.EdoInput; 8 | 9 | public class ValidBaseDirValidator implements ConstraintValidator { 10 | 11 | @Override 12 | public boolean isValid(EdoInput value, ConstraintValidatorContext context) { 13 | if (StringUtils.isNotBlank(value.getZipDir())) { 14 | return true; 15 | } else { 16 | return StringUtils.isNotBlank(value.getBaseDir()); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidEdoClassName.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import javax.validation.Constraint; 8 | import javax.validation.Payload; 9 | import javax.validation.ReportAsSingleViolation; 10 | import javax.validation.constraints.NotEmpty; 11 | 12 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 13 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 14 | import static java.lang.annotation.ElementType.FIELD; 15 | import static java.lang.annotation.ElementType.METHOD; 16 | import static java.lang.annotation.ElementType.PARAMETER; 17 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 18 | 19 | @Documented 20 | @Constraint(validatedBy = ValidEdoClassNameValidator.class) 21 | @Target({ METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR }) 22 | @Retention(RUNTIME) 23 | @NotEmpty 24 | @ReportAsSingleViolation 25 | public @interface ValidEdoClassName { 26 | 27 | String message() default "{org.entando.edo.model.validation.constraints.ValidEdoClassName.message}"; 28 | Class[] groups() default {}; 29 | Class[] payload() default {}; 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidEdoClassNameValidator.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import java.util.regex.Matcher; 4 | import java.util.regex.Pattern; 5 | 6 | import javax.validation.ConstraintValidator; 7 | import javax.validation.ConstraintValidatorContext; 8 | 9 | public class ValidEdoClassNameValidator implements ConstraintValidator { 10 | 11 | 12 | @Override 13 | public boolean isValid(String value, ConstraintValidatorContext context) { 14 | if (value == null) { 15 | return true; 16 | } else { 17 | return isValidClassName(value); 18 | } 19 | } 20 | 21 | protected boolean isValidClassName(String arg) { 22 | Pattern pattern = Pattern.compile("([A-Z])([\\w]*)*"); 23 | Matcher matcher = pattern.matcher(arg); 24 | return matcher.matches(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidEdoDataType.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import javax.validation.Constraint; 8 | import javax.validation.Payload; 9 | import javax.validation.ReportAsSingleViolation; 10 | import javax.validation.constraints.NotEmpty; 11 | 12 | import org.entando.edo.model.json.BeanModel; 13 | 14 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 15 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 16 | import static java.lang.annotation.ElementType.FIELD; 17 | import static java.lang.annotation.ElementType.METHOD; 18 | import static java.lang.annotation.ElementType.PARAMETER; 19 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 | 21 | @Documented 22 | @Constraint(validatedBy = ValidEdoDataTypeValidator.class) 23 | @Target({ METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR }) 24 | @Retention(RUNTIME) 25 | @NotEmpty(message = BeanModel.ERR_BEANMODEL_FIELD_TYPE_EMPTY) 26 | @ReportAsSingleViolation 27 | public @interface ValidEdoDataType { 28 | 29 | String message() default "{org.entando.edo.model.validation.constraints.ValidEdoDataType.message}"; 30 | Class[] groups() default {}; 31 | Class[] payload() default {}; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidEdoDataTypeValidator.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | import org.entando.edo.datatype.DataTypeManager; 7 | 8 | public class ValidEdoDataTypeValidator implements ConstraintValidator { 9 | 10 | 11 | @Override 12 | public void initialize(ValidEdoDataType validEdoDataType) { 13 | 14 | } 15 | 16 | @Override 17 | public boolean isValid(String value, ConstraintValidatorContext context) { 18 | if (value == null) { 19 | return true; 20 | } else { 21 | return DataTypeManager.getInstance().getDataTypes().containsKey(value); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidEdoPackage.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import javax.validation.Constraint; 8 | import javax.validation.Payload; 9 | import javax.validation.ReportAsSingleViolation; 10 | import javax.validation.constraints.NotEmpty; 11 | 12 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 13 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 14 | import static java.lang.annotation.ElementType.FIELD; 15 | import static java.lang.annotation.ElementType.METHOD; 16 | import static java.lang.annotation.ElementType.PARAMETER; 17 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 18 | 19 | @Documented 20 | @Constraint(validatedBy = ValidEdoPackageValidator.class) 21 | @Target({ METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR }) 22 | @Retention(RUNTIME) 23 | @NotEmpty 24 | @ReportAsSingleViolation 25 | public @interface ValidEdoPackage { 26 | 27 | String message() default "{org.entando.edo.model.validation.constraints.ValidEdoPackage.message}"; 28 | Class[] groups() default {}; 29 | Class[] payload() default {}; 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/model/validation/constraints/ValidEdoPackageValidator.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.model.validation.constraints; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | import org.entando.edo.parser.PackageValidator; 7 | 8 | public class ValidEdoPackageValidator implements ConstraintValidator { 9 | 10 | @Override 11 | public boolean isValid(String value, ConstraintValidatorContext context) { 12 | if (value == null) { 13 | return true; 14 | } else { 15 | return PackageValidator.isValidPackageName(value); 16 | } 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/parser/EdoInputException.java: -------------------------------------------------------------------------------- 1 | package org.entando.edo.parser; 2 | 3 | 4 | public class EdoInputException extends RuntimeException { 5 | 6 | public EdoInputException() { 7 | super(); 8 | } 9 | 10 | public EdoInputException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 11 | super(message, cause, enableSuppression, writableStackTrace); 12 | } 13 | 14 | public EdoInputException(String message, Throwable cause) { 15 | super(message, cause); 16 | } 17 | 18 | public EdoInputException(String message) { 19 | super(message); 20 | } 21 | 22 | public EdoInputException(Throwable cause) { 23 | super(cause); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/parser/IAgrumentParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.parser; 15 | 16 | import org.entando.edo.model.EdoBean; 17 | 18 | public interface IAgrumentParser { 19 | 20 | public String[] parse(EdoBean edoBean, String args[]) throws Throwable; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/parser/NameParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.parser; 15 | 16 | import java.util.Arrays; 17 | import java.util.regex.Matcher; 18 | import java.util.regex.Pattern; 19 | 20 | import org.apache.logging.log4j.LogManager; 21 | import org.apache.logging.log4j.Logger; 22 | import org.entando.edo.model.EdoBean; 23 | 24 | 25 | public class NameParser implements IAgrumentParser { 26 | 27 | private static Logger _logger = LogManager.getLogger(NameParser.class); 28 | 29 | public String[] parse(EdoBean edoBean, String[] args) throws Exception { 30 | _logger.trace("input params: {}", Arrays.toString(args)); 31 | String nameArg = args[0]; 32 | 33 | boolean checkName = this.checkClassName(nameArg); 34 | if (checkName) { 35 | edoBean.setName(nameArg); 36 | _logger.info("bean name is: '{}'", edoBean.getName()); 37 | } else { 38 | _logger.error("invalid class name: '{}'", args[0]); 39 | throw new Exception("invalid class name '" + args[0] + "'"); 40 | } 41 | return Arrays.copyOfRange(args, 1, args.length); 42 | } 43 | 44 | public boolean checkClassName(String arg) { 45 | Pattern pattern = Pattern.compile("([A-Z])([\\w]*)*"); 46 | Matcher matcher = pattern.matcher(arg); 47 | return matcher.matches(); 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/parser/PackageValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.parser; 15 | 16 | import java.util.regex.Matcher; 17 | import java.util.regex.Pattern; 18 | 19 | import org.apache.commons.lang.StringUtils; 20 | 21 | public class PackageValidator { 22 | 23 | public static boolean isValidPackageName(String packageArg) { 24 | 25 | if (StringUtils.isBlank(packageArg)) return false; 26 | 27 | Pattern pattern = Pattern.compile("([a-z]\\w*)(\\.[a-z][a-z]*)*"); 28 | Matcher matcher = pattern.matcher(packageArg); 29 | return matcher.matches(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/report/ReportFileInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.report; 15 | 16 | public class ReportFileInfo { 17 | 18 | public ReportFileInfo() { 19 | 20 | } 21 | 22 | public ReportFileInfo(String path, int lines) { 23 | super(); 24 | this.path = path; 25 | this.lines = lines; 26 | } 27 | 28 | public String getPath() { 29 | return path; 30 | } 31 | public void setPath(String path) { 32 | this.path = path; 33 | } 34 | public int getLines() { 35 | return lines; 36 | } 37 | public void setLines(int lines) { 38 | this.lines = lines; 39 | } 40 | 41 | private String path; 42 | private int lines = 0; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/entando/edo/template/Render.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.template; 15 | 16 | import java.io.StringWriter; 17 | import java.util.Map; 18 | 19 | import org.apache.logging.log4j.LogManager; 20 | import org.apache.logging.log4j.Logger; 21 | import org.apache.velocity.Template; 22 | import org.apache.velocity.VelocityContext; 23 | import org.apache.velocity.app.VelocityEngine; 24 | import org.apache.velocity.runtime.RuntimeConstants; 25 | import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; 26 | 27 | 28 | public class Render { 29 | 30 | public static Logger logger = LogManager.getLogger(Render.class); 31 | 32 | public String render(String templateFileName, Map contextElements) throws Throwable { 33 | String render = null; 34 | try { 35 | VelocityEngine ve = new VelocityEngine(); 36 | ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.Log4JLogChute" ); 37 | ve.setProperty("runtime.log.logsystem.log4j.logger", "root" ); 38 | 39 | ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); 40 | ve.setProperty("classpath.resource.loader.class",ClasspathResourceLoader.class.getName()); 41 | ve.init(); 42 | 43 | Template t = ve.getTemplate(templateFileName); 44 | 45 | VelocityContext velocityContext = new VelocityContext(); 46 | if (null != contextElements && !contextElements.isEmpty()) { 47 | for (Map.Entry entry : contextElements.entrySet()) { 48 | velocityContext.put(entry.getKey(), entry.getValue()); 49 | } 50 | } 51 | StringWriter stringWriter = new StringWriter(); 52 | 53 | t.merge(velocityContext, stringWriter); 54 | 55 | 56 | stringWriter.flush(); 57 | render = stringWriter.toString(); 58 | } catch (Throwable t) { 59 | logger.error("error rendering template {}", templateFileName, t); 60 | throw t; 61 | } 62 | return render; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/templates/common/license/java_license.vm: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | -------------------------------------------------------------------------------- /src/main/resources/templates/common/report_txt.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | **************************************************************** 4 | 5 | Edo Report 6 | 7 | **************************************************************** 8 | 9 | === Command Line 10 | 11 | $builder.originalArgs 12 | 13 | 14 | 15 | === List of geneated files that MUST be merged: 16 | #set($lines = 0) 17 | #set($files = 0) 18 | #foreach( $key in $report.sortedFilesToMerge ) 19 | #set($lines = $lines+$key.lines) 20 | #set($files = $files+1) 21 | $key.path 22 | #end 23 | ---------------------------------------------------------------- 24 | Total files: ${files} 25 | Total lines: ${lines} 26 | 27 | 28 | === List of geneated files: 29 | #set($lines = 0) 30 | #set($files = 0) 31 | #foreach( $key in $report.sortedFiles ) 32 | #set($lines = $lines+$key.lines) 33 | #set($files = $files+1) 34 | $key.path 35 | #end 36 | ---------------------------------------------------------------- 37 | Total files: ${files} 38 | Total lines: ${lines} 39 | 40 | 41 | 42 | 43 | 44 | === Revert *port inserts 45 | 46 | #set( $i18keyPrep = "") 47 | #if($builder.plugin) 48 | #set( $i18keyPrep = ${builder.pluginName}+"_") 49 | #end 50 | #set( $i18keyBean = $constants.toUpperCase($bean.name)) 51 | #foreach($f in $bean.fields) 52 | #if($f.type.javaType == "Date") 53 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_${constants.toUpperCase($f.name)}_START'; 54 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_${constants.toUpperCase($f.name)}_END'; 55 | #end 56 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_${constants.toUpperCase($f.name)}'; 57 | #end 58 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_ACTIONS'; 59 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_NEW'; 60 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_EDIT'; 61 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_TRASH'; 62 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_TRASH_CONFIRM'; 63 | DELETE FROM localstrings where keycode = '${i18keyPrep}${i18keyBean}_SEARCH_${i18keyBean}'; 64 | 65 | 66 | DELETE FROM widgetcatalog where code = '#if($builder.plugin)$builder.pluginName#end${beanClass}_list_form'; 67 | DELETE FROM widgetcatalog where code = '#if($builder.plugin)$builder.pluginName#end${beanClass}'; 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/main/resources/templates/freemarker/aps/inc/frontend_input_fields.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 | 3 | " /> 4 | #elseif($f.type.javaType == "String") 5 | 6 | " /> 7 | #elseif($f.type.javaType == "int") 8 | 9 | " /> 10 | #elseif($f.type.javaType == "BigDecimal") 11 | 12 | " /> 13 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/freemarker/aps/inc/frontend_print_fields.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 | <@s.date name="#${beanVar}.${f.name}" format="dd/MM/yyyy" />#else 3 | <@s.property value="#${beanVar}.${f.name}" />#end -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/api/apiListResponseResult_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.api; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | import javax.xml.bind.annotation.XmlElement; 12 | import javax.xml.bind.annotation.XmlSeeAlso; 13 | 14 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 15 | import org.entando.entando.aps.system.services.api.model.ListResponse; 16 | 17 | @XmlSeeAlso({JAXB${beanClass}.class}) 18 | public class ${beanClass}ListResponseResult extends AbstractApiResponseResult { 19 | 20 | @XmlElement(name = "items", required = false) 21 | public ListResponse getResult() { 22 | if (this.getMainResult() instanceof Collection) { 23 | List ${beanVar}s = new ArrayList(); 24 | ${beanVar}s.addAll((Collection) this.getMainResult()); 25 | ListResponse entity = new ListResponse(${beanVar}s) {}; 26 | return entity; 27 | } 28 | return null; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/api/apiListResponse_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.api; 6 | 7 | import javax.xml.bind.annotation.XmlElement; 8 | import javax.xml.bind.annotation.XmlRootElement; 9 | 10 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponse; 11 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 12 | 13 | 14 | @XmlRootElement(name = "response") 15 | public class ${beanClass}ListResponse extends AbstractApiResponse { 16 | 17 | @Override 18 | @XmlElement(name = "result", required = true) 19 | public ${beanClass}ListResponseResult getResult() { 20 | return (${beanClass}ListResponseResult) super.getResult(); 21 | } 22 | 23 | @Override 24 | protected AbstractApiResponseResult createResponseResultInstance() { 25 | return new ${beanClass}ListResponseResult(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/api/apiResponseResult_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.api; 6 | 7 | import javax.xml.bind.annotation.XmlElement; 8 | 9 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 10 | 11 | 12 | public class ${beanClass}ResponseResult extends AbstractApiResponseResult { 13 | 14 | @Override 15 | @XmlElement(name = "$beanVar", required = false) 16 | public JAXB${beanClass} getResult() { 17 | return (JAXB${beanClass}) this.getMainResult(); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/api/apiResponse_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.api; 6 | 7 | import javax.xml.bind.annotation.XmlElement; 8 | import javax.xml.bind.annotation.XmlRootElement; 9 | 10 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponse; 11 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 12 | 13 | 14 | @XmlRootElement(name = "response") 15 | public class ${beanClass}Response extends AbstractApiResponse { 16 | 17 | @Override 18 | @XmlElement(name = "result", required = true) 19 | public ${beanClass}ResponseResult getResult() { 20 | return (${beanClass}ResponseResult) super.getResult(); 21 | } 22 | 23 | @Override 24 | protected AbstractApiResponseResult createResponseResultInstance() { 25 | return new ${beanClass}ResponseResult(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/api/jaxb-bean_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.api; 6 | 7 | $bean.getImports(false) 8 | 9 | import javax.xml.bind.annotation.XmlElement; 10 | import javax.xml.bind.annotation.XmlRootElement; 11 | import javax.xml.bind.annotation.XmlType; 12 | 13 | import ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.$beanClass; 14 | 15 | @XmlRootElement(name = "${beanVar}") 16 | @XmlType(propOrder = {#foreach ($f in $bean.fields)"${f.name}"#if(!$foreach.last), #end#end}) 17 | public class JAXB${beanClass} { 18 | 19 | public JAXB${beanClass}() { 20 | super(); 21 | } 22 | 23 | public JAXB${beanClass}(${beanClass} ${beanVar}) { 24 | #foreach ($f in $bean.fields) 25 | #set( $setter = "set$constants.getCapitalize($f.name)") 26 | #set( $getter = "get$constants.getCapitalize($f.name)") 27 | this.$setter(${beanVar}.${getter}()); 28 | #end 29 | } 30 | 31 | public ${beanClass} get${beanClass}() { 32 | ${beanClass} ${beanVar} = new ${beanClass}(); 33 | #foreach ($f in $bean.fields) 34 | #set( $setter = "set$constants.getCapitalize($f.name)") 35 | #set( $getter = "get$constants.getCapitalize($f.name)") 36 | ${beanVar}.${setter}(this.${getter}()); 37 | #end 38 | return ${beanVar}; 39 | } 40 | 41 | #foreach ($f in $bean.fields) 42 | @XmlElement(name = "${f.name}", required = true) 43 | public $f.type.getJavaType() get${constants.getCapitalize($f.name)}() { 44 | return _$f.getName(); 45 | } 46 | public void set${constants.getCapitalize($f.name)}($f.type.getJavaType() $f.getName()) { 47 | this._$f.getName() = $f.getName(); 48 | } 49 | 50 | #end 51 | 52 | #foreach ($f in $bean.fields) 53 | private $f.type.getJavaType() _$f.getName(); 54 | #end 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/init/initBean_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $daovar = "${constants.getUnCapitalize($bean.name)}DAO") 3 | #set( $beanVar = $constants.getLowerCase($bean.name)) 4 | #set( $beanClass = $bean.name) 5 | #set( $pk_type = $bean.primaryKeyField.type.javaType) 6 | #set( $pk_type_gen = $bean.primaryKeyField.type.javaTypeGeneric) 7 | #set( $pk_var = $bean.primaryKeyField.name) 8 | #set( $tableName = $bean.tableName) 9 | #parse("templates/common/license/java_license.vm") 10 | package ${builder.packageName}.${constants.initPackage}; 11 | import com.j256.ormlite.field.DataType; 12 | import com.j256.ormlite.field.DatabaseField; 13 | import com.j256.ormlite.table.DatabaseTable; 14 | #foreach ($f in $bean.fields) 15 | #if ($f.type.importString) 16 | $f.type.importString 17 | #end 18 | #end 19 | 20 | @DatabaseTable(tableName = ${beanClass}.TABLE_NAME) 21 | public class ${beanClass} { 22 | 23 | public ${beanClass}() {} 24 | 25 | #foreach($f in $bean.fields) 26 | @DatabaseField(columnName = "$constants.getLowerCase($f.name)", 27 | #if($f.type.javaType == 'int') 28 | dataType = DataType.INTEGER, 29 | #elseif($f.type.javaType == 'String' && ($f.length || $f.primaryKey)) 30 | dataType = DataType.STRING, 31 | #elseif($f.type.javaType == 'String' && !$f.length) 32 | dataType = DataType.LONG_STRING, 33 | #elseif($f.type.javaType == 'Date') 34 | dataType = DataType.DATE, 35 | #elseif($f.type.javaType == 'BigDecimal') 36 | dataType = DataType.BIG_DECIMAL_NUMERIC, 37 | #end 38 | #if($f.length)width=$f.length, #end canBeNull=#if ($f.required)false#else true#end#if($f.primaryKey), id = true#end) 39 | private $f.type.javaType _${f.name}; 40 | 41 | #end 42 | 43 | public static final String TABLE_NAME = "$tableName"; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/internalservlet/FinderFrontEndAction_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.aps.internalservlet.$constants.getLowerCase($beanVar); 6 | 7 | import ${builder.packageName}.${constants.apsadminPackage}.$constants.getLowerCase($beanVar).${beanClass}FinderAction; 8 | 9 | public class ${beanClass}FinderFrontEndAction extends ${beanClass}FinderAction { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/internalservlet/FrontEndAction_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.aps.internalservlet.$constants.getLowerCase($beanVar); 6 | 7 | import ${builder.packageName}.${constants.apsadminPackage}.$constants.getLowerCase($beanVar).${beanClass}Action; 8 | 9 | public class ${beanClass}FrontEndAction extends ${beanClass}Action { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/DaoInterface_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_type = $bean.primaryKeyField.type.javaType) 5 | #set( $pk_type_gen = $bean.primaryKeyField.type.javaTypeGeneric) 6 | #set( $pk_var = $bean.primaryKeyField.name) 7 | #parse("templates/common/license/java_license.vm") 8 | package ${builder.packageName}.${constants.servicesPackage}.$constants.getLowerCase($bean.name); 9 | 10 | import java.util.List; 11 | $bean.getImports(false) 12 | #if($bean.entandoSearcherAvailable) 13 | import com.agiletec.aps.system.common.FieldSearchFilter; 14 | #end 15 | 16 | public interface I${beanClass}DAO { 17 | 18 | #if($bean.entandoSearcherAvailable) 19 | public List<$pk_type_gen> search${beanClass}s(FieldSearchFilter[] filters); 20 | 21 | #end 22 | public ${beanClass} load${beanClass}($pk_type $pk_var); 23 | 24 | public List<$pk_type_gen> load${beanClass}s(); 25 | 26 | public void remove${beanClass}($pk_type $pk_var); 27 | 28 | public void update${beanClass}(${beanClass} $beanVar); 29 | 30 | public void insert${beanClass}(${beanClass} $beanVar); 31 | 32 | public int count${beanClass}s(FieldSearchFilter[] filters); 33 | } -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/EventObserver_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.event; 6 | 7 | import com.agiletec.aps.system.common.notify.ObserverService; 8 | 9 | public interface ${beanClass}ChangedObserver extends ObserverService { 10 | 11 | public void updateFrom${beanClass}Changed(${beanClass}ChangedEvent event); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/Event_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #parse("templates/common/license/java_license.vm") 5 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.event; 6 | 7 | import com.agiletec.aps.system.common.IManager; 8 | import com.agiletec.aps.system.common.notify.ApsEvent; 9 | import ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.${beanClass}; 10 | 11 | 12 | public class ${beanClass}ChangedEvent extends ApsEvent { 13 | 14 | @Override 15 | public void notify(IManager srv) { 16 | ((${beanClass}ChangedObserver) srv).updateFrom${beanClass}Changed(this); 17 | } 18 | 19 | @Override 20 | public Class getObserverInterface() { 21 | return ${beanClass}ChangedObserver.class; 22 | } 23 | 24 | public int getOperationCode() { 25 | return _operationCode; 26 | } 27 | public void setOperationCode(int operationCode) { 28 | this._operationCode = operationCode; 29 | } 30 | 31 | public ${beanClass} get${beanClass}() { 32 | return _$beanVar; 33 | } 34 | public void set${beanClass}(${beanClass} $beanVar) { 35 | this._$beanVar = $beanVar; 36 | } 37 | 38 | private ${beanClass} _$beanVar; 39 | private int _operationCode; 40 | 41 | public static final int INSERT_OPERATION_CODE = 1; 42 | public static final int REMOVE_OPERATION_CODE = 2; 43 | public static final int UPDATE_OPERATION_CODE = 3; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/ManagerInterface_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_type = $bean.primaryKeyField.type.javaType) 5 | #set( $pk_type_gen = $bean.primaryKeyField.type.javaTypeGeneric) 6 | #set( $pk_var = $bean.primaryKeyField.name) 7 | #parse("templates/common/license/java_license.vm") 8 | package ${builder.packageName}.${constants.servicesPackage}.$constants.getLowerCase($bean.name); 9 | 10 | import java.util.List; 11 | import com.agiletec.aps.system.exception.ApsSystemException; 12 | import com.agiletec.aps.system.common.model.dao.SearcherDaoPaginatedResult; 13 | $bean.getImports(false) 14 | #if($bean.entandoSearcherAvailable) 15 | import com.agiletec.aps.system.common.FieldSearchFilter; 16 | #end 17 | 18 | public interface I${beanClass}Manager { 19 | 20 | public ${beanClass} get${beanClass}($pk_type $pk_var) throws ApsSystemException; 21 | 22 | public List<$pk_type_gen> get${beanClass}s() throws ApsSystemException; 23 | 24 | #if($bean.entandoSearcherAvailable) 25 | public List<$pk_type_gen> search${beanClass}s(FieldSearchFilter filters[]) throws ApsSystemException; 26 | 27 | #end 28 | public void add${beanClass}($beanClass $beanVar) throws ApsSystemException; 29 | 30 | public void update${beanClass}($beanClass $beanVar) throws ApsSystemException; 31 | 32 | public void delete${beanClass}($pk_type $pk_var) throws ApsSystemException; 33 | 34 | public SearcherDaoPaginatedResult<${beanClass}> get${beanClass}s(List fieldSearchFilters) throws ApsSystemException; 35 | } -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/bean_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #parse("templates/common/license/java_license.vm") 3 | package ${builder.packageName}.${constants.servicesPackage}.$constants.getLowerCase($bean.name); 4 | 5 | $bean.getImports(false) 6 | 7 | public class $bean.name { 8 | 9 | #foreach ($f in $bean.fields) 10 | public $f.type.getJavaType() get${constants.getCapitalize($f.name)}() { 11 | return _$f.getName(); 12 | } 13 | public void set${constants.getCapitalize($f.name)}($f.type.getJavaType() $f.getName()) { 14 | this._$f.getName() = $f.getName(); 15 | } 16 | 17 | #end 18 | 19 | #foreach ($f in $bean.fields) 20 | private $f.type.getJavaType() _$f.getName(); 21 | #end 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/inc/dao_stat_by_object.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 | #if($f.required)## DATE REQUIRED 3 | Timestamp ${f.name}Timestamp = new Timestamp(${beanVar}.get${constants.getCapitalize(${f.name})}().getTime()); 4 | stat.setTimestamp(index++, ${f.name}Timestamp); 5 | #else## DATE NOT REQUIRED 6 | if(null != ${beanVar}.get${constants.getCapitalize(${f.name})}()) { 7 | Timestamp ${f.name}Timestamp = new Timestamp(${beanVar}.get${constants.getCapitalize(${f.name})}().getTime()); 8 | stat.setTimestamp(index++, ${f.name}Timestamp); 9 | } else { 10 | stat.setNull(index++, Types.DATE); 11 | } 12 | #end ## END DATE 13 | #elseif($f.type.javaType == "String") 14 | #if($f.required) ##STRING REQ 15 | stat.set${constants.getCapitalize($f.type.javaType)}(index++, ${beanVar}.get${constants.getCapitalize(${f.name})}()); 16 | #else ##STRING ! REQ 17 | if(StringUtils.isNotBlank(${beanVar}.get${constants.getCapitalize(${f.name})}())) { 18 | stat.setString(index++, ${beanVar}.get${constants.getCapitalize(${f.name})}()); 19 | } else { 20 | stat.setNull(index++, Types.VARCHAR); 21 | } 22 | #end 23 | #elseif($f.type.javaType == "BigDecimal") 24 | #if($f.required) ##STRING REQ 25 | stat.set${constants.getCapitalize($f.type.javaType)}(index++, ${beanVar}.get${constants.getCapitalize(${f.name})}()); 26 | #else ##STRING ! REQ 27 | if(null != ${beanVar}.get${constants.getCapitalize(${f.name})}()) { 28 | stat.setBigDecimal(index++, ${beanVar}.get${constants.getCapitalize(${f.name})}()); 29 | } else { 30 | stat.setNull(index++, Types.DECIMAL); 31 | } 32 | #end 33 | #elseif($f.type.javaType == "int") 34 | stat.set${constants.getCapitalize($f.type.javaType)}(index++, ${beanVar}.get${constants.getCapitalize(${f.name})}()); 35 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/inc/dao_stat_by_param.vm: -------------------------------------------------------------------------------- 1 | #if($pk_type == "Date") 2 | #if($f.required)## DATE REQUIRED 3 | Timestamp ${pk_var}Timestamp = new Timestamp(${pk_var}.getTime()); 4 | stat.setTimestamp(index++, ${pk_var}Timestamp); 5 | #else## DATE NOT REQUIRED 6 | if(null != ${pk_var}) { 7 | Timestamp ${pk_var}Timestamp = new Timestamp(${pk_var}.getTime()); 8 | stat.setTimestamp(index++, ${pk_var}Timestamp); 9 | } else { 10 | stat.setNull(index++, Types.DATE); 11 | } 12 | #end ## END DATE 13 | #elseif($pk_type == "String") 14 | #if($f.required) ##STRING REQ 15 | stat.setString(index++, ${pk_var}); 16 | #else ##STRING ! REQ 17 | if(StringUtils.isNotBlank(${pk_var})) { 18 | stat.setString(index++, ${pk_var}); 19 | } else { 20 | stat.setNull(index++, Types.VARCHAR); 21 | } 22 | #end 23 | #elseif($pk_type == "BigDecimal") 24 | #if($f.required) ##BigDecimal REQ 25 | stat.setBigDecimal(index++, ${pk_var}); 26 | #else ##STRING ! REQ 27 | if(null != ${pk_var}) { 28 | stat.setBigDecimal(index++, ${pk_var}); 29 | } else { 30 | stat.setBigDecimal(index++, Types.DECIMAL); 31 | } 32 | #end 33 | #elseif($pk_type == "int") 34 | stat.setInt(index++, ${pk_var}); 35 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/managers/inc/manager_api_imports.vm: -------------------------------------------------------------------------------- 1 | #set( $pk_type = $bean.primaryKeyField.type.javaType) 2 | import java.util.Properties; 3 | 4 | import javax.ws.rs.core.Response; 5 | import ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.api.JAXB${beanClass}; 6 | import org.entando.entando.aps.system.services.api.IApiErrorCodes; 7 | import org.entando.entando.aps.system.services.api.model.ApiException; 8 | #if($pk_type == "Date") 9 | import com.agiletec.aps.system.SystemConstants; 10 | import com.agiletec.aps.util.DateConverter; 11 | #end 12 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/services/ServiceInterface_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_type = $bean.primaryKeyField.type.javaType) 5 | #set( $pk_type_gen = $bean.primaryKeyField.type.javaTypeGeneric) 6 | #set( $pk_var = $bean.primaryKeyField.name) 7 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 8 | #parse("templates/common/license/java_license.vm") 9 | package ${builder.packageName}.${constants.servicesPackage}.$constants.getLowerCase($bean.name); 10 | 11 | import ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.model.${beanClass}Dto; 12 | import org.entando.entando.web.common.model.PagedMetadata; 13 | import org.entando.entando.web.common.model.RestListRequest; 14 | import ${builder.packageName}.${constants.restPackage}.${constants.getLowerCase($bean.name)}.model.${beanClass}Request; 15 | 16 | public interface I${beanClass}Service { 17 | 18 | public String BEAN_NAME = "${springPrep}${beanClass}Service"; 19 | 20 | public PagedMetadata<${beanClass}Dto> get${beanClass}s(RestListRequest requestList); 21 | 22 | public ${beanClass}Dto update${beanClass}(${beanClass}Request ${beanVar}Request); 23 | 24 | public ${beanClass}Dto add${beanClass}(${beanClass}Request ${beanVar}Request); 25 | 26 | public void remove${beanClass}($pk_type $pk_var); 27 | 28 | public ${beanClass}Dto get${beanClass}($pk_type $pk_var); 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/services/dto_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #parse("templates/common/license/java_license.vm") 3 | package ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.model; 4 | 5 | $bean.getImports(false) 6 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 7 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 8 | import org.entando.entando.web.common.json.JsonDateDeserializer; 9 | import org.entando.entando.web.common.json.JsonDateSerializer; 10 | 11 | public class ${bean.name}Dto { 12 | 13 | #foreach ($f in $bean.fields) 14 | #if($f.type.javaType == 'Date') 15 | @JsonSerialize(using = JsonDateSerializer.class) 16 | @JsonDeserialize(using = JsonDateDeserializer.class) 17 | #end 18 | private $f.type.getJavaType() $f.getName(); 19 | #end 20 | 21 | #foreach ($f in $bean.fields) 22 | public $f.type.getJavaType() get${constants.getCapitalize($f.name)}() { 23 | return $f.getName(); 24 | } 25 | public void set${constants.getCapitalize($f.name)}($f.type.getJavaType() $f.getName()) { 26 | this.$f.getName() = $f.getName(); 27 | } 28 | 29 | #end 30 | 31 | public static String getEntityFieldName(String dtoFieldName) { 32 | return dtoFieldName; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/web/controller_validator_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_type = $bean.primaryKeyField.type.javaType) 5 | #set( $pk_type_gen = $bean.primaryKeyField.type.javaTypeGeneric) 6 | #set( $pk_var = $bean.primaryKeyField.name) 7 | #set( $pk_varName = ${constants.getCapitalize($bean.primaryKeyField.name)}) 8 | #parse("templates/common/license/java_license.vm") 9 | package ${builder.packageName}.${constants.restPackage}.${constants.getLowerCase($bean.name)}.validator; 10 | 11 | ## $bean.getImports(false) 12 | import org.apache.commons.lang3.StringUtils; 13 | import org.entando.entando.web.common.validator.AbstractPaginationValidator; 14 | import org.springframework.stereotype.Component; 15 | import org.springframework.validation.Errors; 16 | import ${builder.packageName}.${constants.restPackage}.${constants.getLowerCase($bean.name)}.model.${beanClass}Request; 17 | 18 | 19 | @Component 20 | public class ${beanClass}Validator extends AbstractPaginationValidator { 21 | 22 | public static final String ERRCODE_URINAME_MISMATCH = "1"; 23 | public static final String ERRCODE_${constants.toUpperCase($bean.name)}_NOT_FOUND = "2" ; 24 | public static final String ERRCODE_${constants.toUpperCase($bean.name)}_ALREADY_EXISTS = "3"; 25 | 26 | 27 | @Override 28 | public boolean supports(Class paramClass) { 29 | return ${beanClass}Request.class.equals(paramClass); 30 | } 31 | 32 | @Override 33 | public void validate(Object target, Errors errors) { 34 | //${beanClass}Request request = (${beanClass}Request) target; 35 | } 36 | 37 | public void validateBodyName(String ${beanVar}${pk_varName}, ${beanClass}Request ${beanVar}Request, Errors errors) { 38 | if (!StringUtils.equals(${beanVar}${pk_varName}, String.valueOf(${beanVar}Request.get${pk_varName}()))) { 39 | errors.rejectValue("$bean.primaryKeyField.name", ERRCODE_URINAME_MISMATCH, new Object[]{${beanVar}${pk_varName}, ${beanVar}Request.get${pk_varName}()}, "${beanVar}.${bean.primaryKeyField.name}.mismatch"); 40 | } 41 | } 42 | 43 | @Override 44 | protected String getDefaultSortProperty() { 45 | return "$bean.primaryKeyField.name"; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/aps/web/dto_request_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #parse("templates/common/license/java_license.vm") 4 | package ${builder.packageName}.${constants.restPackage}.${constants.getLowerCase($bean.name)}.model; 5 | 6 | $bean.getImports(false) 7 | import javax.validation.constraints.*; 8 | import org.hibernate.validator.constraints.NotBlank; 9 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 10 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 11 | import org.entando.entando.web.common.json.JsonDateDeserializer; 12 | import org.entando.entando.web.common.json.JsonDateSerializer; 13 | 14 | public class ${bean.name}Request { 15 | 16 | #foreach ($f in $bean.fields) 17 | #if ($f.required) 18 | #if($f.type.javaType == 'String') 19 | #if($f.length) 20 | @Size(max = ${f.length}, message = "string.size.invalid") 21 | #end 22 | @NotBlank(message = "$beanVar.${f.name}.notBlank") 23 | #elseif($f.type.javaType == 'int') 24 | @NotNull(message = "$beanVar.${f.name}.notBlank") 25 | #end 26 | #end 27 | #if($f.type.javaType == 'int') 28 | private $f.type.getJavaType() $f.getName(); 29 | #else 30 | #if($f.type.javaType == 'Date') 31 | @JsonSerialize(using = JsonDateSerializer.class) 32 | @JsonDeserialize(using = JsonDateDeserializer.class) 33 | #end 34 | private $f.type.getJavaTypeGeneric() $f.getName(); 35 | #end 36 | 37 | #end 38 | 39 | #foreach ($f in $bean.fields) 40 | public $f.type.getJavaType() get${constants.getCapitalize($f.name)}() { 41 | return $f.getName(); 42 | } 43 | public void set${constants.getCapitalize($f.name)}($f.type.getJavaType() $f.getName()) { 44 | this.$f.getName() = $f.getName(); 45 | } 46 | 47 | #end 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/action-conversion_properties.vm: -------------------------------------------------------------------------------- 1 | #foreach ($f in $bean.fields) 2 | #if($f.type.strutsConversionProperties) 3 | $f.name=$f.type.strutsConversionProperties 4 | #end 5 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/action-validation_xml.vm: -------------------------------------------------------------------------------- 1 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 2 | #set( $beanClass = $bean.name) 3 | 6 | 7 | #foreach($f in $bean.fields) 8 | #if ($f.required && !$foreach.first) 9 | 10 | #if($f.type.javaType == 'String') 11 | 12 | 13 | 14 | #if($f.length) 15 | 16 | $f.length 17 | true 18 | 19 | 20 | #end 21 | #elseif($f.type.javaType == 'int') 22 | 23 | 24 | 25 | #if($f.length) 26 | 27 | $f.length 28 | 29 | 30 | #end 31 | #elseif($f.type.javaType == 'BigDecimal') 32 | 33 | 34 | 35 | 36 | #elseif($f.type.javaType == 'Date') 37 | 38 | 39 | 40 | #if($f.length) 41 | 42 | $f.length 43 | 44 | 45 | #end 46 | #end 47 | 48 | #end 49 | #end 50 | 51 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/finder-action-conversion_properties.vm: -------------------------------------------------------------------------------- 1 | #foreach ($f in $bean.searchFields) 2 | #if($f.type.strutsConversionProperties) 3 | $f.name=$f.type.strutsConversionProperties 4 | #end 5 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/package_properties.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_field = $bean.primaryKeyField) 5 | #set ($DOLLAR = "$") 6 | #if($builder.plugin) 7 | #set($label_prep="${builder.pluginName}.") 8 | #else 9 | #set($label_prep="") 10 | #end 11 | ${label_prep}title.${beanVar}Management=${beanClass}s 12 | ${label_prep}${beanVar}.label.list=${beanClass} list 13 | ${label_prep}${beanVar}.label.new=New 14 | ${label_prep}${beanVar}.label.edit=Edit 15 | ${label_prep}${beanVar}.label.delete=Delete 16 | 17 | ${label_prep}${beanVar}.message.list.empty=There are no ${beanClass}s 18 | 19 | #foreach($f in $bean.fields) 20 | #if($f.type.javaType == "Date") 21 | label.${f.name}Start=${f.name}Start Form 22 | label.${f.name}End=${f.name}End To 23 | #end 24 | label.${f.name}=$f.name 25 | #end 26 | 27 | note.delete${beanClass}.areYouSure=Are you sure you want to delete the ${beanClass} 28 | 29 | #foreach($f in $bean.fields) 30 | #if($f.type.javaType == "String" && $f.length && $f.length > 0) 31 | stringlength=${DOLLAR}{getText(fieldName)} cannot exceed ${DOLLAR}{getText(maxLength)} characters. 32 | #end 33 | #end 34 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/plugin_global_properties.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_field = $bean.primaryKeyField) 5 | #if($builder.plugin) 6 | #set($label_prep="${builder.pluginName}.") 7 | #else 8 | #set($label_prep="") 9 | #end 10 | ${builder.pluginName}.code=${builder.pluginName} 11 | ${builder.pluginName}.name=$beanClass Plugin 12 | 13 | ${label_prep}title.${beanVar}Management=${beanClass}s -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/specialwidget_action_xml.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ${springPrep}.admin.page.widget.${beanClass}.entry 17 | managePages 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | /do/Page 28 | viewTree 29 | 30 | 31 | /do/Page 32 | configure 33 | 34 | 35 | 36 | 37 | 38 | ${springPrep}.admin.page.widget.${beanClass}.entry 39 | managePages 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/specialwidget_package_properties.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_field = $bean.primaryKeyField) 5 | #if($builder.plugin) 6 | #set($label_prep="${builder.pluginName}.") 7 | #else 8 | #set($label_prep="") 9 | #end 10 | ${label_prep}title.${beanVar}Management=${beanClass}s 11 | error.defaultLangTitle.required=Choose the widget title for the language {0} 12 | 13 | 14 | label.${pk_field.name}=$pk_field.name -------------------------------------------------------------------------------- /src/main/resources/templates/java/apsadmin/struts_plugin_xml.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | 5 | 8 | 9 | 10 | 11 | #if($builder.assetsConf.specialWidget) 12 | 13 | #end 14 | 15 | #if($builder.assetsConf.adminConsole) 16 | 19 | 20 | #if($builder.assetsConf.internalServlet) 21 | 22 | #end 23 | #end 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/aps/inc/frontend_input_fields.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 | 3 | " /> 4 | #elseif($f.type.javaType == "String") 5 | 6 | " /> 7 | #elseif($f.type.javaType == "int") 8 | 9 | " /> 10 | #elseif($f.type.javaType == "BigDecimal") 11 | 12 | " /> 13 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/aps/inc/frontend_print_fields.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 | #else 3 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/aps/internalservlet/error_jsp.vm: -------------------------------------------------------------------------------- 1 |
2 |    __   _ __   _ __   ___   _ __  
3 |  /'__`\/\`'__\/\`'__\/ __`\/\`'__\
4 | /\  __/\ \ \/ \ \ \//\ \L\ \ \ \/ 
5 | \ \____\\ \_\  \ \_\\ \____/\ \_\ 
6 |  \/____/ \/_/   \/_/ \/___/  \/_/ 
7 |                                   
8 | 
9 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/aps/internalservlet/trash_jsp.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #set( $i18keyPrep = "") 6 | #if($builder.plugin) 7 | #set( $i18keyPrep = ${builder.pluginName}+"_") 8 | #end 9 | #set( $i18keyBean = $constants.toUpperCase($bean.name)) 10 | #set( $pk_field = $bean.primaryKeyField) 11 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 12 | <%@ taglib prefix="s" uri="/struts-tags" %> 13 | <%@ taglib prefix="wp" uri="/aps-core" %> 14 | <%@ taglib prefix="wpsf" uri="/apsadmin-form"%> 15 | 16 |
17 |

18 | 19 |
" method="post"> 20 | 21 |
22 |

23 |
    24 | 25 | 26 |
  • 27 |
    28 |
    29 |
30 |
31 |
32 | 33 |
34 |

35 |
    36 | 37 |
  • 38 |
    39 |
40 |
41 |
42 | 43 |

44 | 45 | 46 |

47 | 48 |
49 |

50 | ? 51 |

52 | 53 |

54 | 55 | 56 | 57 | 58 |

59 |
60 | 61 | 62 |
63 |
-------------------------------------------------------------------------------- /src/main/resources/templates/jsp/aps/widgets/widget.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #set( $componentCode = "${builder.projectName}_${beanVar}") 5 | #set ( $d = "$") 6 | #set ( $br_o = "{") 7 | #set ( $br_c = "}") 8 | #set( $pk = $bean.primaryKeyField) 9 | #set( $i18keyPrep = "") 10 | #if($builder.plugin) 11 | #set( $i18keyPrep = ${builder.pluginName}+"_") 12 | #end 13 | #set( $i18keyBean = $constants.toUpperCase($bean.name)) 14 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 15 | <%@ taglib prefix="wp" uri="/aps-core"%> 16 | <%@ taglib prefix="#if($builder.plugin)$builder.pluginName#else$componentCode#end" uri="/#if($builder.plugin)$builder.pluginName#else$componentCode#end-core"%> 17 | 18 | <#if($builder.plugin)$builder.pluginName#else$componentCode#end:${beanVar} var="${beanVar}" /> 19 |
20 | 21 | 22 |

:

23 |
    24 |
  • 25 | #foreach ($f in $bean.fields) 26 | #if(!$foreach.first) 27 | :
    28 | #end 29 | #end 30 |
  • 31 |
32 |
33 | 34 |
35 |

36 |
37 |
38 |
39 |
-------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/entry_extras_jsp.vm: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/inc/s_property.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 | #else 3 | #end -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/inc/search_form_input_field.vm: -------------------------------------------------------------------------------- 1 | #if($f.type.javaType == "Date") 2 |
3 | 6 |
7 | 11 |
12 |
13 | #elseif($f.type.javaType == "String") 14 |
15 | 18 |
19 | 23 |
24 |
25 | #elseif($f.type.javaType == "int") 26 |
27 | 30 |
31 | 35 |
36 |
37 | #elseif($f.type.javaType == "BigDecimal") 38 |
39 | 42 |
43 | 47 |
48 |
49 | #end 50 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/list_extras_jsp.vm: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/plugin_submenu_jsp.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_field = $bean.primaryKeyField) 5 | #if($builder.plugin) 6 | #set($label_prep="${builder.pluginName}.") 7 | #else 8 | #set($label_prep="") 9 | #end 10 | <%@ taglib prefix="s" uri="/struts-tags" %> 11 | <%@ taglib prefix="wp" uri="/aps-core" %> 12 | 13 | 14 |
  • " >
  • 15 |
    16 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/trash_extras_jsp.vm: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/templates/jsp/apsadmin/trash_jsp.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $pk_field = $bean.primaryKeyField) 5 | #if($builder.plugin) 6 | #set($label_prep="${builder.pluginName}.") 7 | #else 8 | #set($label_prep="") 9 | #end 10 | <%@ taglib prefix="s" uri="/struts-tags" %> 11 | <%@ taglib prefix="wpsa" uri="/apsadmin-core" %> 12 | <%@ taglib prefix="wpsf" uri="/apsadmin-form" %> 13 | 14 |

    15 | 16 | "> / 17 | 18 | 19 | 20 | 21 |

    22 | 23 |
    24 | 25 | 26 |

    27 | 28 | 29 |

    30 |
    31 |

    32 | 33 | ? 34 |

    35 |
    36 | 37 | 38 | 39 | 40 | " class="btn btn-link">: 41 |
    42 |
    43 |
    44 | 45 |
    46 | -------------------------------------------------------------------------------- /src/main/resources/templates/resources/component/component_xml.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getLowerCase($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #set( $tableName = $bean.tableName) 6 | 7 | 8 | #if($builder.plugin)$builder.pluginName#else${builder.projectName}#end 9 | ${beanClass} 10 | 11 | 12 | 13 | ${builder.packageName}.${constants.initPackage}.$beanClass 14 | 15 | 16 | 17 | 18 | 19 | #if($builder.plugin) 20 | classpath:sql/plugins/${bean.getEdoBuilder().getPluginName()}/port_data_production.sql 21 | #else 22 | classpath:sql/misc/${builder.projectName}/port_data_production.sql 23 | #end 24 | 25 | 26 | #if($builder.plugin) 27 | classpath:sql/plugins/${builder.pluginName}/serv_data_production.sql 28 | #else 29 | classpath:sql/misc/${builder.projectName}/serv_data_production.sql 30 | #end 31 | 32 | 33 | 34 | 35 | 36 | 37 | #if($builder.plugin) 38 | classpath:sql/plugins/${bean.getEdoBuilder().getPluginName()}/port_data_test.sql 39 | #else 40 | classpath:sql/misc/${builder.projectName}/port_data_test.sql 41 | #end 42 | 43 | 44 | #if($builder.plugin) 45 | classpath:sql/plugins/${bean.getEdoBuilder().getPluginName()}/serv_data_test.sql 46 | #else 47 | classpath:sql/misc/${builder.projectName}/serv_data_test.sql 48 | #end 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/templates/resources/spring/manager/managers_xml.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getLowerCase($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $package = "${builder.packageName}.${constants.servicesPackage}.${beanVar}") 5 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 6 | #set( $daoName = "$constants.getUnCapitalize($beanClass)DAO") 7 | #set( $managerName = "$constants.getUnCapitalize($beanClass)Manager") 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | #if($builder.assetsConf.rest) 27 | 28 | 29 | 30 | 31 | #end 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/templates/resources/sql/port_data_test_sql.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/main/resources/templates/resources/sql/port_data_test_sql.vm -------------------------------------------------------------------------------- /src/main/resources/templates/resources/sql/serv_data_production_sql.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/main/resources/templates/resources/sql/serv_data_production_sql.vm -------------------------------------------------------------------------------- /src/main/resources/templates/resources/sql/serv_data_test_sql.vm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/main/resources/templates/resources/sql/serv_data_test_sql.vm -------------------------------------------------------------------------------- /src/main/resources/templates/shortcuts/shortcuts_xml.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #if($builder.plugin) 6 | #set($menusec="plugins") 7 | #else 8 | #set($menusec="components") 9 | #end 10 | 11 | 12 | 13 | ${beanClass} list 14 | 15 | 16 | 17 | 18 | /do/${builder.springBeanPreposition}/${beanClass} 19 | list 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/templates/test/java/ConfigTestUtils_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #parse("templates/common/license/java_license.vm") 6 | package ${builder.packageName}; 7 | 8 | import org.apache.commons.lang.ArrayUtils; 9 | 10 | import com.agiletec.ConfigTestUtils; 11 | 12 | public class ${constants.getCapitalize($builder.springBeanPreposition)}ConfigTestUtils extends ConfigTestUtils { 13 | 14 | @Override 15 | protected String[] getSpringConfigFilePaths() { 16 | String[] baseFiles = super.getSpringConfigFilePaths(); 17 | 18 | //TODO EDIT THIS 19 | #if($builder.plugin) 20 | String[] filePaths = new String[0]; 21 | #else 22 | String[] filePaths = new String[2]; 23 | filePaths[0] = "classpath*:spring/${builder.projectName}/aps/**/**.xml "; 24 | filePaths[1] = "classpath*:spring/${builder.projectName}/**/**.xml"; 25 | #end 26 | String[] newFiles = (String[]) ArrayUtils.addAll(baseFiles, filePaths); 27 | return newFiles; 28 | } 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/templates/test/java/aps/ApsBaseTestCase_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #parse("templates/common/license/java_license.vm") 6 | package ${builder.packageName}.${constants.apsPackage}; 7 | 8 | 9 | import ${builder.packageName}.${constants.getCapitalize($builder.springBeanPreposition)}ConfigTestUtils; 10 | 11 | import com.agiletec.ConfigTestUtils; 12 | import com.agiletec.aps.BaseTestCase; 13 | 14 | public class ${constants.getCapitalize($builder.springBeanPreposition)}BaseTestCase extends BaseTestCase { 15 | 16 | @Override 17 | protected ConfigTestUtils getConfigUtils() { 18 | return new ${constants.getCapitalize($builder.springBeanPreposition)}ConfigTestUtils(); 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/templates/test/java/aps/TestManager_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #parse("templates/common/license/java_license.vm") 6 | package ${builder.packageName}.${constants.servicesPackage}; 7 | 8 | import ${builder.packageName}.${constants.apsPackage}.${constants.getCapitalize($builder.springBeanPreposition)}BaseTestCase; 9 | import ${builder.packageName}.${constants.servicesPackage}.${constants.getLowerCase($bean.name)}.I${beanClass}Manager; 10 | 11 | public class Test${beanClass}Manager extends ${constants.getCapitalize($builder.springBeanPreposition)}BaseTestCase { 12 | 13 | @Override 14 | protected void setUp() throws Exception { 15 | super.setUp(); 16 | this.init(); 17 | } 18 | 19 | public void testGet${beanClass}() { 20 | //TODO complete test 21 | assertNotNull(this._${beanVar}Manager); 22 | } 23 | 24 | public void testGet${beanClass}s() { 25 | //TODO complete test 26 | assertNotNull(this._${beanVar}Manager); 27 | } 28 | 29 | public void testSearch${beanClass}s() { 30 | //TODO complete test 31 | assertNotNull(this._${beanVar}Manager); 32 | } 33 | 34 | public void testAdd${beanClass}() { 35 | //TODO complete test 36 | assertNotNull(this._${beanVar}Manager); 37 | } 38 | 39 | public void testUpdate${beanClass}() { 40 | //TODO complete test 41 | assertNotNull(this._${beanVar}Manager); 42 | } 43 | 44 | public void testDelete${beanClass}() { 45 | //TODO complete test 46 | assertNotNull(this._${beanVar}Manager); 47 | } 48 | 49 | private void init() { 50 | //TODO add the spring bean id as constant 51 | this._${beanVar}Manager = (I${beanClass}Manager) this.getService("${springPrep}${beanClass}Manager"); 52 | } 53 | 54 | private I${beanClass}Manager _${beanVar}Manager; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/main/resources/templates/test/java/apsadmin/ApsAdminBaseTestCase_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #parse("templates/common/license/java_license.vm") 6 | package ${builder.packageName}.${constants.apsadminPackage}; 7 | 8 | import java.util.Properties; 9 | 10 | import com.agiletec.ConfigTestUtils; 11 | import com.agiletec.apsadmin.ApsAdminBaseTestCase; 12 | import ${builder.packageName}.${constants.getCapitalize($builder.springBeanPreposition)}ConfigTestUtils; 13 | 14 | public class ${constants.getCapitalize($builder.springBeanPreposition)}ApsAdminBaseTestCase extends ApsAdminBaseTestCase { 15 | 16 | @Override 17 | protected ConfigTestUtils getConfigUtils() { 18 | return new ${constants.getCapitalize($builder.springBeanPreposition)}ConfigTestUtils(); 19 | } 20 | 21 | protected void setInitParameters(Properties params) { 22 | params.setProperty("config", 23 | "struts-default.xml," + 24 | "struts-plugin.xml," + 25 | "struts.xml," + 26 | "entando-struts-plugin.xml," + 27 | "japs-struts-plugin.xml," + 28 | CUSTOM_STRUTS_PLUGIN); 29 | } 30 | 31 | // TODO Edit this constant before running your junit test 32 | private static final String CUSTOM_STRUTS_PLUGIN = "change_me-${builder.springBeanPreposition}-struts-plugin.xml"; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/templates/test/java/apsadmin/TestAction_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #parse("templates/common/license/java_license.vm") 6 | package ${builder.packageName}.${constants.apsadminPackage}.$constants.getLowerCase($beanVar); 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import ${builder.packageName}.${constants.apsadminPackage}.${constants.getCapitalize($builder.springBeanPreposition)}ApsAdminBaseTestCase; 11 | import com.opensymphony.xwork2.Action; 12 | 13 | public class Test${beanClass}Action extends ${constants.getCapitalize($builder.springBeanPreposition)}ApsAdminBaseTestCase { 14 | 15 | public void testNew() throws Throwable { 16 | //TODO complete test 17 | Map params = new HashMap(); 18 | String result = this.executeAction("new", params); 19 | assertEquals(Action.SUCCESS, result); 20 | } 21 | 22 | public void testEdit() throws Throwable { 23 | //TODO complete test 24 | Map params = new HashMap(); 25 | String result = this.executeAction("edit", params); 26 | assertEquals(Action.INPUT, result); 27 | } 28 | 29 | public void testSave() throws Throwable { 30 | //TODO complete test 31 | Map params = new HashMap(); 32 | String result = this.executeAction("save", params); 33 | assertEquals(Action.INPUT, result); 34 | } 35 | 36 | public void testTrash() throws Throwable { 37 | //TODO complete test 38 | Map params = new HashMap(); 39 | String result = this.executeAction("trash", params); 40 | assertEquals(Action.INPUT, result); 41 | } 42 | 43 | public void testDelete() throws Throwable { 44 | //TODO complete test 45 | Map params = new HashMap(); 46 | String result = this.executeAction("delete", params); 47 | assertEquals(Action.SUCCESS, result); 48 | } 49 | 50 | 51 | private String executeAction(String action, Map params) throws Throwable { 52 | this.setUserOnSession("admin"); 53 | this.initAction(NS, action); 54 | if (null != params) { 55 | this.addParameters(params); 56 | } 57 | String result = this.executeAction(); 58 | return result; 59 | } 60 | 61 | private static final String NS = "/do/${builder.springBeanPreposition}/${beanClass}"; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/resources/templates/test/java/apsadmin/TestFinderAction_java.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 3 | #set( $beanClass = $bean.name) 4 | #set( $springPrep = $constants.getLowerCase($builder.springBeanPreposition)) 5 | #parse("templates/common/license/java_license.vm") 6 | package ${builder.packageName}.${constants.apsadminPackage}.$constants.getLowerCase($beanVar); 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import ${builder.packageName}.${constants.apsadminPackage}.${constants.getCapitalize($builder.springBeanPreposition)}ApsAdminBaseTestCase; 11 | import com.opensymphony.xwork2.Action; 12 | 13 | public class Test${beanClass}FinderAction extends ${constants.getCapitalize($builder.springBeanPreposition)}ApsAdminBaseTestCase { 14 | 15 | public void testList() throws Throwable { 16 | String result = this.executeAction("list", null); 17 | assertEquals(Action.SUCCESS, result); 18 | } 19 | 20 | public void testSearch() throws Throwable { 21 | //TODO complete test 22 | Map params = new HashMap(); 23 | String result = this.executeAction("search", params); 24 | assertEquals(Action.SUCCESS, result); 25 | } 26 | 27 | private String executeAction(String action, Map params) throws Throwable { 28 | this.setUserOnSession("admin"); 29 | this.initAction(NS, action); 30 | if (null != params) { 31 | this.addParameters(params); 32 | } 33 | String result = this.executeAction(); 34 | return result; 35 | } 36 | 37 | private static final String NS = "/do/${builder.springBeanPreposition}/${beanClass}"; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/templates/tld/aps-core_tld.vm: -------------------------------------------------------------------------------- 1 | #set( $builder = $bean.edoBuilder) 2 | #set( $beanClass = $bean.name) 3 | #set( $beanVar = $constants.getUnCapitalize($bean.name)) 4 | #set( $componentCode = "${builder.projectName}_${beanVar}") 5 | 6 | 7 | 8 | "#if($builder.plugin)$builder.pluginName#else$componentCode#end core tag library" 9 | 2.2 10 | #if($builder.plugin)$builder.pluginName#else$componentCode#end 11 | /#if($builder.plugin)$builder.pluginName#else$componentCode#end-core 12 | 13 | 14 | Loads and returns the list of the ${beanClass}s available in the system. 15 | ${beanVar}s 16 | ${builder.packageName}.${constants.apsPackage}.tags.${beanClass}ListTag 17 | empty 18 | 19 | The name of the variable setted in the pagecontext. 20 | var 21 | true 22 | true 23 | 24 | 25 | 26 | 27 | Loads and returns an ${beanClass} given a key. 28 | ${beanVar} 29 | ${builder.packageName}.${constants.apsPackage}.tags.${beanClass}Tag 30 | empty 31 | 32 | Identifier of the ${beanClass} to load 33 | key 34 | false 35 | true 36 | 37 | 38 | The name of the variable setted in the pagecontext. 39 | var 40 | true 41 | true 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/java/org/entando/edo/AllTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo; 15 | 16 | import org.entando.edo.parser.TestFieldsParser; 17 | import org.entando.edo.parser.TestNameParser; 18 | import org.entando.edo.parser.TestPackageValidator; 19 | import org.entando.edo.report.TestReport; 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | @RunWith(Suite.class) 24 | @Suite.SuiteClasses({ 25 | // TestBuilder.class, 26 | // TestBuilderNoPlugin.class, 27 | // TestEdoBean.class, 28 | //TestCommandlineParser.class, 29 | TestFieldsParser.class, 30 | TestNameParser.class, 31 | TestPackageValidator.class, 32 | 33 | TestReport.class 34 | 35 | }) 36 | public class AllTests { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/entando/edo/mock/builder/MockBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.mock.builder; 15 | 16 | import java.io.File; 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | import org.apache.commons.io.FilenameUtils; 21 | import org.apache.commons.lang.StringUtils; 22 | import org.entando.edo.builder.Builder; 23 | import org.entando.edo.model.EdoConstants; 24 | import org.entando.edo.report.Report; 25 | 26 | 27 | public class MockBuilder extends Builder { 28 | 29 | protected void writeFile(String baseDir, String path, String text) { 30 | try { 31 | Report report = Report.getInstance(); 32 | String workingDir = baseDir; 33 | //TODO 34 | this.getContents().put(path, text); 35 | int lines = -1;//FileUtils.readLines(file).size(); 36 | path = StringUtils.substringAfter(path, workingDir + File.separator); 37 | 38 | if (FilenameUtils.getBaseName(path).startsWith(EdoConstants.FILE_NO_OVERRIDE_PREFIX)) { 39 | report.addFileToMerge(path, lines); 40 | } else { 41 | report.addFile(path, lines); 42 | } 43 | } catch (Throwable t) { 44 | logger.error("error!", t); 45 | t.printStackTrace(); 46 | } 47 | } 48 | 49 | public String getContent(String key) { 50 | return this.getContents().get(key); 51 | } 52 | 53 | public Map getContents() { 54 | return contents; 55 | } 56 | public void setContents(Map contents) { 57 | this.contents = contents; 58 | } 59 | 60 | private Map contents = new HashMap(); 61 | } 62 | -------------------------------------------------------------------------------- /src/test/java/org/entando/edo/parser/TestNameParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.parser; 15 | 16 | import junit.framework.TestCase; 17 | 18 | public class TestNameParser extends TestCase { 19 | 20 | public void testNameParam() throws Exception { 21 | NameParser nameParser = new NameParser(); 22 | String args = "xxx"; 23 | boolean bool = nameParser.checkClassName(args); 24 | assertFalse(bool); 25 | 26 | args = "xxx.yyy"; 27 | bool = nameParser.checkClassName(args); 28 | assertFalse(bool); 29 | 30 | args = "1Xxx"; 31 | bool = nameParser.checkClassName(args); 32 | assertFalse(bool); 33 | 34 | args = "xxx-"; 35 | bool = nameParser.checkClassName(args); 36 | assertFalse(bool); 37 | 38 | args = "xXX"; 39 | bool = nameParser.checkClassName(args); 40 | assertFalse(bool); 41 | 42 | args = "xxx"; 43 | bool = nameParser.checkClassName(args); 44 | assertFalse(bool); 45 | args = "Xxx"; 46 | bool = nameParser.checkClassName(args); 47 | assertTrue(bool); 48 | 49 | args = "XxxYxx"; 50 | bool = nameParser.checkClassName(args); 51 | assertTrue(bool); 52 | 53 | args = "Xxx-Yxx"; 54 | bool = nameParser.checkClassName(args); 55 | assertFalse(bool); 56 | 57 | args = "Xxx1Yxx"; 58 | bool = nameParser.checkClassName(args); 59 | assertTrue(bool); 60 | 61 | args = "Xxx1 Yxx"; 62 | bool = nameParser.checkClassName(args); 63 | assertFalse(bool); 64 | 65 | args = "Xxx1Yxx0"; 66 | bool = nameParser.checkClassName(args); 67 | assertTrue(bool); 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/test/java/org/entando/edo/parser/TestPackageValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.parser; 15 | 16 | import junit.framework.TestCase; 17 | 18 | public class TestPackageValidator extends TestCase { 19 | 20 | public void testPackageParam() throws Exception { 21 | String args = "xxx"; 22 | boolean bool = PackageValidator.isValidPackageName(args); 23 | assertTrue(bool); 24 | 25 | args = "xxx.yyy"; 26 | bool = PackageValidator.isValidPackageName(args); 27 | assertTrue(bool); 28 | 29 | args = "Xxx.yyy"; 30 | bool = PackageValidator.isValidPackageName(args); 31 | assertFalse(bool); 32 | 33 | args = "xxx.Yyy"; 34 | bool = PackageValidator.isValidPackageName(args); 35 | assertFalse(bool); 36 | 37 | args = "xXX.yYY"; 38 | bool = PackageValidator.isValidPackageName(args); 39 | assertFalse(bool); 40 | 41 | args = "xxx."; 42 | bool = PackageValidator.isValidPackageName(args); 43 | assertFalse(bool); 44 | args = "xxx.yyy."; 45 | bool = PackageValidator.isValidPackageName(args); 46 | assertFalse(bool); 47 | 48 | args = "xxx.yyy.XXXX.xx"; 49 | bool = PackageValidator.isValidPackageName(args); 50 | assertFalse(bool); 51 | 52 | args = "org.entando.entando.plugins.jpZZZZoOOObie"; 53 | bool = PackageValidator.isValidPackageName(args); 54 | assertFalse(bool); 55 | 56 | 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/test/java/org/entando/edo/report/TestReport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. 3 | * 4 | * This library is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU Lesser General Public License as published by the Free 6 | * Software Foundation; either version 2.1 of the License, or (at your option) 7 | * any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | * details. 13 | */ 14 | package org.entando.edo.report; 15 | 16 | import java.lang.reflect.Field; 17 | 18 | import junit.framework.Assert; 19 | 20 | import org.junit.Before; 21 | import org.junit.Test; 22 | 23 | 24 | public class TestReport { 25 | 26 | @Before 27 | public void resetSingleton() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { 28 | Field instance = Report.class.getDeclaredField("obj"); 29 | instance.setAccessible(true); 30 | instance.set(null, null); 31 | } 32 | 33 | @Test 34 | public void testReport() throws Exception { 35 | Report report = Report.getInstance(); 36 | report.addFile("10"); 37 | report.addFile("20"); 38 | report.addFileToMerge("a"); 39 | Report report2 = Report.getInstance(); 40 | Assert.assertEquals(report, report2); 41 | report2.addFile("30"); 42 | report2.addFileToMerge("b"); 43 | report2.addFileToMerge("c"); 44 | Report report3 = Report.getInstance(); 45 | Assert.assertEquals(report3, report2); 46 | Assert.assertEquals(3, report3.getFiles().size()); 47 | Assert.assertEquals(3, report3.getFilesToMerge().size()); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/internalservlet/cat/CatFinderFrontEndAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.internalservlet.cat; 7 | 8 | import com.myportal.apsadmin.cat.CatFinderAction; 9 | 10 | public class CatFinderFrontEndAction extends CatFinderAction { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/internalservlet/cat/CatFrontEndAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.internalservlet.cat; 7 | 8 | import com.myportal.apsadmin.cat.CatAction; 9 | 10 | public class CatFrontEndAction extends CatAction { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/init/servdb/Cat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.init.servdb; 7 | import com.j256.ormlite.field.DataType; 8 | import com.j256.ormlite.field.DatabaseField; 9 | import com.j256.ormlite.table.DatabaseTable; 10 | import java.math.BigDecimal; 11 | import java.util.Date; 12 | 13 | @DatabaseTable(tableName = Cat.TABLE_NAME) 14 | public class Cat { 15 | 16 | public Cat() {} 17 | 18 | @DatabaseField(columnName = "id", 19 | dataType = DataType.INTEGER, 20 | canBeNull=false, id = true) 21 | private int _id; 22 | 23 | @DatabaseField(columnName = "name", 24 | dataType = DataType.STRING, 25 | width=8, canBeNull=false) 26 | private String _name; 27 | 28 | @DatabaseField(columnName = "age", 29 | dataType = DataType.INTEGER, 30 | canBeNull= true) 31 | private int _age; 32 | 33 | @DatabaseField(columnName = "weight", 34 | dataType = DataType.BIG_DECIMAL_NUMERIC, 35 | canBeNull= true) 36 | private BigDecimal _weight; 37 | 38 | @DatabaseField(columnName = "createdat", 39 | dataType = DataType.DATE, 40 | canBeNull= true) 41 | private Date _createdat; 42 | 43 | 44 | public static final String TABLE_NAME = "cat"; 45 | } 46 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/Cat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat; 7 | 8 | import java.util.Date; 9 | import java.math.BigDecimal; 10 | 11 | public class Cat { 12 | 13 | public int getId() { 14 | return _id; 15 | } 16 | public void setId(int id) { 17 | this._id = id; 18 | } 19 | 20 | public String getName() { 21 | return _name; 22 | } 23 | public void setName(String name) { 24 | this._name = name; 25 | } 26 | 27 | public int getAge() { 28 | return _age; 29 | } 30 | public void setAge(int age) { 31 | this._age = age; 32 | } 33 | 34 | public BigDecimal getWeight() { 35 | return _weight; 36 | } 37 | public void setWeight(BigDecimal weight) { 38 | this._weight = weight; 39 | } 40 | 41 | public Date getCreatedat() { 42 | return _createdat; 43 | } 44 | public void setCreatedat(Date createdat) { 45 | this._createdat = createdat; 46 | } 47 | 48 | 49 | private int _id; 50 | private String _name; 51 | private int _age; 52 | private BigDecimal _weight; 53 | private Date _createdat; 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/ICatDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat; 7 | 8 | import java.util.List; 9 | import java.util.Date; 10 | import java.math.BigDecimal; 11 | import com.agiletec.aps.system.common.FieldSearchFilter; 12 | 13 | public interface ICatDAO { 14 | 15 | public List searchCats(FieldSearchFilter[] filters); 16 | 17 | public Cat loadCat(int id); 18 | 19 | public List loadCats(); 20 | 21 | public void removeCat(int id); 22 | 23 | public void updateCat(Cat cat); 24 | 25 | public void insertCat(Cat cat); 26 | 27 | 28 | } -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/ICatManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat; 7 | 8 | import java.util.List; 9 | import com.agiletec.aps.system.exception.ApsSystemException; 10 | import java.util.Date; 11 | import java.math.BigDecimal; 12 | import com.agiletec.aps.system.common.FieldSearchFilter; 13 | 14 | public interface ICatManager { 15 | 16 | public Cat getCat(int id) throws ApsSystemException; 17 | 18 | public List getCats() throws ApsSystemException; 19 | 20 | public List searchCats(FieldSearchFilter filters[]) throws ApsSystemException; 21 | 22 | public void addCat(Cat cat) throws ApsSystemException; 23 | 24 | public void updateCat(Cat cat) throws ApsSystemException; 25 | 26 | public void deleteCat(int id) throws ApsSystemException; 27 | 28 | } -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/api/CatListResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.api; 7 | 8 | import javax.xml.bind.annotation.XmlElement; 9 | import javax.xml.bind.annotation.XmlRootElement; 10 | 11 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponse; 12 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 13 | 14 | 15 | @XmlRootElement(name = "response") 16 | public class CatListResponse extends AbstractApiResponse { 17 | 18 | @Override 19 | @XmlElement(name = "result", required = true) 20 | public CatListResponseResult getResult() { 21 | return (CatListResponseResult) super.getResult(); 22 | } 23 | 24 | @Override 25 | protected AbstractApiResponseResult createResponseResultInstance() { 26 | return new CatListResponseResult(); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/api/CatListResponseResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.api; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collection; 10 | import java.util.List; 11 | 12 | import javax.xml.bind.annotation.XmlElement; 13 | import javax.xml.bind.annotation.XmlSeeAlso; 14 | 15 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 16 | import org.entando.entando.aps.system.services.api.model.ListResponse; 17 | 18 | @XmlSeeAlso({JAXBCat.class}) 19 | public class CatListResponseResult extends AbstractApiResponseResult { 20 | 21 | @XmlElement(name = "items", required = false) 22 | public ListResponse getResult() { 23 | if (this.getMainResult() instanceof Collection) { 24 | List cats = new ArrayList(); 25 | cats.addAll((Collection) this.getMainResult()); 26 | ListResponse entity = new ListResponse(cats) {}; 27 | return entity; 28 | } 29 | return null; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/api/CatResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.api; 7 | 8 | import javax.xml.bind.annotation.XmlElement; 9 | import javax.xml.bind.annotation.XmlRootElement; 10 | 11 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponse; 12 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 13 | 14 | 15 | @XmlRootElement(name = "response") 16 | public class CatResponse extends AbstractApiResponse { 17 | 18 | @Override 19 | @XmlElement(name = "result", required = true) 20 | public CatResponseResult getResult() { 21 | return (CatResponseResult) super.getResult(); 22 | } 23 | 24 | @Override 25 | protected AbstractApiResponseResult createResponseResultInstance() { 26 | return new CatResponseResult(); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/api/CatResponseResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.api; 7 | 8 | import javax.xml.bind.annotation.XmlElement; 9 | 10 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 11 | 12 | 13 | public class CatResponseResult extends AbstractApiResponseResult { 14 | 15 | @Override 16 | @XmlElement(name = "cat", required = false) 17 | public JAXBCat getResult() { 18 | return (JAXBCat) this.getMainResult(); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/api/JAXBCat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.api; 7 | 8 | import java.util.Date; 9 | import java.math.BigDecimal; 10 | 11 | import javax.xml.bind.annotation.XmlElement; 12 | import javax.xml.bind.annotation.XmlRootElement; 13 | import javax.xml.bind.annotation.XmlType; 14 | 15 | import com.myportal.aps.system.services.cat.Cat; 16 | 17 | @XmlRootElement(name = "cat") 18 | @XmlType(propOrder = {"id", "name", "age", "weight", "createdat"}) 19 | public class JAXBCat { 20 | 21 | public JAXBCat() { 22 | super(); 23 | } 24 | 25 | public JAXBCat(Cat cat) { 26 | this.setId(cat.getId()); 27 | this.setName(cat.getName()); 28 | this.setAge(cat.getAge()); 29 | this.setWeight(cat.getWeight()); 30 | this.setCreatedat(cat.getCreatedat()); 31 | } 32 | 33 | public Cat getCat() { 34 | Cat cat = new Cat(); 35 | cat.setId(this.getId()); 36 | cat.setName(this.getName()); 37 | cat.setAge(this.getAge()); 38 | cat.setWeight(this.getWeight()); 39 | cat.setCreatedat(this.getCreatedat()); 40 | return cat; 41 | } 42 | 43 | @XmlElement(name = "id", required = true) 44 | public int getId() { 45 | return _id; 46 | } 47 | public void setId(int id) { 48 | this._id = id; 49 | } 50 | 51 | @XmlElement(name = "name", required = true) 52 | public String getName() { 53 | return _name; 54 | } 55 | public void setName(String name) { 56 | this._name = name; 57 | } 58 | 59 | @XmlElement(name = "age", required = true) 60 | public int getAge() { 61 | return _age; 62 | } 63 | public void setAge(int age) { 64 | this._age = age; 65 | } 66 | 67 | @XmlElement(name = "weight", required = true) 68 | public BigDecimal getWeight() { 69 | return _weight; 70 | } 71 | public void setWeight(BigDecimal weight) { 72 | this._weight = weight; 73 | } 74 | 75 | @XmlElement(name = "createdat", required = true) 76 | public Date getCreatedat() { 77 | return _createdat; 78 | } 79 | public void setCreatedat(Date createdat) { 80 | this._createdat = createdat; 81 | } 82 | 83 | 84 | private int _id; 85 | private String _name; 86 | private int _age; 87 | private BigDecimal _weight; 88 | private Date _createdat; 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/event/CatChangedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.event; 7 | 8 | import com.agiletec.aps.system.common.IManager; 9 | import com.agiletec.aps.system.common.notify.ApsEvent; 10 | import com.myportal.aps.system.services.cat.Cat; 11 | 12 | 13 | public class CatChangedEvent extends ApsEvent { 14 | 15 | @Override 16 | public void notify(IManager srv) { 17 | ((CatChangedObserver) srv).updateFromCatChanged(this); 18 | } 19 | 20 | @Override 21 | public Class getObserverInterface() { 22 | return CatChangedObserver.class; 23 | } 24 | 25 | public int getOperationCode() { 26 | return _operationCode; 27 | } 28 | public void setOperationCode(int operationCode) { 29 | this._operationCode = operationCode; 30 | } 31 | 32 | public Cat getCat() { 33 | return _cat; 34 | } 35 | public void setCat(Cat cat) { 36 | this._cat = cat; 37 | } 38 | 39 | private Cat _cat; 40 | private int _operationCode; 41 | 42 | public static final int INSERT_OPERATION_CODE = 1; 43 | public static final int REMOVE_OPERATION_CODE = 2; 44 | public static final int UPDATE_OPERATION_CODE = 3; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/system/services/cat/event/CatChangedObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services.cat.event; 7 | 8 | import com.agiletec.aps.system.common.notify.ObserverService; 9 | 10 | public interface CatChangedObserver extends ObserverService { 11 | 12 | public void updateFromCatChanged(CatChangedEvent event); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/aps/tags/CatListTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.tags; 7 | 8 | import java.util.List; 9 | 10 | import javax.servlet.ServletRequest; 11 | import javax.servlet.jsp.JspException; 12 | import javax.servlet.jsp.tagext.TagSupport; 13 | import com.agiletec.aps.system.RequestContext; 14 | import org.slf4j.Logger; 15 | import org.slf4j.LoggerFactory; 16 | import com.agiletec.aps.util.ApsWebApplicationUtils; 17 | import com.myportal.aps.system.services.cat.ICatManager; 18 | 19 | public class CatListTag extends TagSupport { 20 | 21 | private static final Logger _logger = LoggerFactory.getLogger(CatListTag.class); 22 | 23 | @Override 24 | public int doStartTag() throws JspException { 25 | ServletRequest request = this.pageContext.getRequest(); 26 | ICatManager catManager = (ICatManager) ApsWebApplicationUtils.getBean("sandboxCatManager", this.pageContext); 27 | RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX); 28 | try { 29 | /* 30 | Widget widget = this.extractWidget(reqCtx); 31 | ApsProperties widgetConfig = widget.getConfig(); 32 | */ 33 | List list = catManager.getCats(); 34 | this.pageContext.setAttribute(this.getVar(), list); 35 | } catch (Throwable t) { 36 | _logger.error("Error in doStartTag", t); 37 | throw new JspException("Error in CatListTag doStartTag", t); 38 | } 39 | return super.doStartTag(); 40 | } 41 | 42 | /* 43 | private Widget extractWidget(RequestContext reqCtx) { 44 | Widget widget = null; 45 | widget = (Widget) reqCtx.getExtraParam((SystemConstants.EXTRAPAR_CURRENT_WIDGET)); 46 | return widget; 47 | } 48 | 49 | protected String extractWidgetParameter(String parameterName, ApsProperties widgetConfig, RequestContext reqCtx) { 50 | return (String) widgetConfig.get(parameterName); 51 | } 52 | */ 53 | @Override 54 | public int doEndTag() throws JspException { 55 | this.release(); 56 | return super.doEndTag(); 57 | } 58 | 59 | @Override 60 | public void release() { 61 | super.release(); 62 | this.setVar(null); 63 | } 64 | 65 | public String getVar() { 66 | return _var; 67 | } 68 | public void setVar(String var) { 69 | this._var = var; 70 | } 71 | 72 | private String _var; 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/cat/CatAction-conversion.properties: -------------------------------------------------------------------------------- 1 | createdat=com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter 2 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/cat/CatAction-validation.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 8 11 | true 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/cat/CatFinderAction-conversion.properties: -------------------------------------------------------------------------------- 1 | createdatStart=com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter 2 | createdatEnd=com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter 3 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/cat/package_en.properties: -------------------------------------------------------------------------------- 1 | title.catManagement=Cats 2 | cat.label.list=Cat list 3 | cat.label.new=New 4 | cat.label.edit=Edit 5 | cat.label.delete=Delete 6 | 7 | cat.message.list.empty=There are no Cats 8 | 9 | label.id=id 10 | label.name=name 11 | label.age=age 12 | label.weight=weight 13 | label.createdatStart=createdatStart Form 14 | label.createdatEnd=createdatEnd To 15 | label.createdat=createdat 16 | 17 | note.deleteCat.areYouSure=Are you sure you want to delete the Cat 18 | 19 | stringlength=${getText(fieldName)} cannot exceed ${getText(maxLength)} characters. 20 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/cat/package_it.properties: -------------------------------------------------------------------------------- 1 | title.catManagement=Cats 2 | cat.label.list=Cat list 3 | cat.label.new=New 4 | cat.label.edit=Edit 5 | cat.label.delete=Delete 6 | 7 | cat.message.list.empty=There are no Cats 8 | 9 | label.id=id 10 | label.name=name 11 | label.age=age 12 | label.weight=weight 13 | label.createdatStart=createdatStart Form 14 | label.createdatEnd=createdatEnd To 15 | label.createdat=createdat 16 | 17 | note.deleteCat.areYouSure=Are you sure you want to delete the Cat 18 | 19 | stringlength=${getText(fieldName)} cannot exceed ${getText(maxLength)} characters. 20 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/portal/specialwidget/cat/CatConfigAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.apsadmin.portal.specialwidget.cat; 7 | 8 | import java.util.List; 9 | import org.apache.commons.lang3.StringUtils; 10 | import com.agiletec.aps.system.services.lang.Lang; 11 | import com.agiletec.apsadmin.portal.specialwidget.SimpleWidgetConfigAction; 12 | import com.myportal.aps.system.services.cat.ICatManager; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | public class CatConfigAction extends SimpleWidgetConfigAction { 17 | 18 | private static final Logger _logger = LoggerFactory.getLogger(CatConfigAction.class); 19 | 20 | protected String extractInitConfig() { 21 | String result = super.extractInitConfig(); 22 | String id = this.getWidget().getConfig().getProperty("id"); 23 | if (StringUtils.isNotBlank(id)) { 24 | this.setId(new Integer(id)); 25 | } 26 | return result; 27 | } 28 | 29 | public List getCatsId() { 30 | try { 31 | List cats = this.getCatManager().searchCats(null); 32 | return cats; 33 | } catch (Throwable t) { 34 | _logger.error("error in getCatsId", t); 35 | throw new RuntimeException("Error getting cats list", t); 36 | } 37 | } 38 | 39 | public int getId() { 40 | return _id; 41 | } 42 | public void setId(int id) { 43 | this._id = id; 44 | } 45 | 46 | protected ICatManager getCatManager() { 47 | return _catManager; 48 | } 49 | public void setCatManager(ICatManager catManager) { 50 | this._catManager = catManager; 51 | } 52 | 53 | private int _id; 54 | private ICatManager _catManager; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/portal/specialwidget/cat/catSpecialWidget.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | sandbox.admin.page.widget.Cat.entry 13 | managePages 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | /do/Page 24 | viewTree 25 | 26 | 27 | /do/Page 28 | configure 29 | 30 | 31 | 32 | 33 | 34 | sandbox.admin.page.widget.Cat.entry 35 | managePages 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/portal/specialwidget/cat/package_en.properties: -------------------------------------------------------------------------------- 1 | title.catManagement=Cats 2 | error.defaultLangTitle.required=Choose the widget title for the language {0} 3 | 4 | 5 | label.id=id -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/java/com/myportal/apsadmin/portal/specialwidget/cat/package_it.properties: -------------------------------------------------------------------------------- 1 | title.catManagement=Cats 2 | error.defaultLangTitle.required=Choose the widget title for the language {0} 3 | 4 | 5 | label.id=id -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/api/sandbox/aps/apiMethods.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Return the cat list 5 | sandbox 6 | 7 | Return the cats list 8 | 9 | com.myportal.aps.system.services.cat.api.CatListResponse 10 | 14 | 15 | 16 | 17 | 18 | The cat 19 | sandbox 20 | 21 | Return a cat by id 22 | 23 | com.myportal.aps.system.services.cat.api.CatResponse 24 | 25 | 26 | The id of the cat to return 27 | 28 | 29 | 30 | 31 | Add a cat 32 | 33 | com.myportal.aps.system.services.cat.api.JAXBCat 34 | 35 | 36 | Update a cat 37 | 38 | com.myportal.aps.system.services.cat.api.JAXBCat 39 | 40 | 41 | Delete a cat by id 42 | 43 | 44 | 45 | The id of the cat to delete 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/component/sandbox/component.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sandbox 4 | Cat 5 | 6 | 7 | 8 | com.myportal.aps.system.init.servdb.Cat 9 | 10 | 11 | 12 | 13 | 14 | classpath:sql/misc/sandbox/port_data_production.sql 15 | 16 | 17 | classpath:sql/misc/sandbox/serv_data_production.sql 18 | 19 | 20 | 21 | 22 | 23 | 24 | classpath:sql/misc/sandbox/port_data_test.sql 25 | 26 | 27 | classpath:sql/misc/sandbox/serv_data_test.sql 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/entando-struts-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/shortcuts/sandbox/apsadmin/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Cat list 5 | 6 | 7 | 8 | 9 | /do/sandbox/Cat 10 | list 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/spring/aps/managers/sandboxCatManagersConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/spring/apsadmin/sandboxCatActionsConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/resources/sql/misc/sandbox/serv_data_production.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/test/outcomes/noplugin_simple_1/src/main/resources/sql/misc/sandbox/serv_data_production.sql -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/tld/sandbox/sandbox-core.tld: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | "sandbox_cat core tag library" 5 | 2.2 6 | sandbox_cat 7 | /sandbox_cat-core 8 | 9 | 10 | Loads and returns the list of the Cats available in the system. 11 | cats 12 | com.myportal.aps.tags.CatListTag 13 | empty 14 | 15 | The name of the variable setted in the pagecontext. 16 | var 17 | true 18 | true 19 | 20 | 21 | 22 | 23 | Loads and returns an Cat given a key. 24 | cat 25 | com.myportal.aps.tags.CatTag 26 | empty 27 | 28 | Identifier of the Cat to load 29 | key 30 | false 31 | true 32 | 33 | 34 | The name of the variable setted in the pagecontext. 35 | var 36 | true 37 | true 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/aps/jsp/internalservlet/cat/frontend-cat-error.jsp: -------------------------------------------------------------------------------- 1 |
    2 |    __   _ __   _ __   ___   _ __  
    3 |  /'__`\/\`'__\/\`'__\/ __`\/\`'__\
    4 | /\  __/\ \ \/ \ \ \//\ \L\ \ \ \/ 
    5 | \ \____\\ \_\  \ \_\\ \____/\ \_\ 
    6 |  \/____/ \/_/   \/_/ \/___/  \/_/ 
    7 |                                   
    8 | 
    9 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/aps/jsp/internalservlet/cat/frontend-cat-trash.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | <%@ taglib prefix="wp" uri="/aps-core" %> 4 | <%@ taglib prefix="wpsf" uri="/apsadmin-form"%> 5 | 6 |
    7 |

    8 | 9 |
    " method="post"> 10 | 11 |
    12 |

    13 |
      14 | 15 | 16 |
    • 17 |
      18 |
      19 |
    20 |
    21 |
    22 | 23 |
    24 |

    25 |
      26 | 27 |
    • 28 |
      29 |
    30 |
    31 |
    32 | 33 |

    34 | 35 | 36 |

    37 | 38 |
    39 |

    40 | ? 41 |

    42 | 43 |

    44 | 45 | 46 | 47 | 48 |

    49 |
    50 | 51 | 52 |
    53 |
    -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/aps/jsp/widgets/Cat.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 | <%@ taglib prefix="wp" uri="/aps-core"%> 3 | <%@ taglib prefix="sandbox_cat" uri="/sandbox_cat-core"%> 4 | 5 | 6 |
    7 | 8 | 9 |

    :

    10 |
      11 |
    • 12 | :
      13 | :
      14 | :
      15 | :
      16 |
    • 17 |
    18 |
    19 | 20 |
    21 |

    22 |
    23 |
    24 |
    25 |
    -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/sandbox/apsadmin/jsp/cat/cat-trash.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="s" uri="/struts-tags" %> 2 | <%@ taglib prefix="wpsa" uri="/apsadmin-core" %> 3 | <%@ taglib prefix="wpsf" uri="/apsadmin-form" %> 4 | 5 |

    6 | 7 | "> / 8 | 9 | 10 | 11 | 12 |

    13 | 14 |
    15 | 16 | 17 |

    18 | 19 | 20 |

    21 |
    22 |

    23 | 24 | ? 25 |

    26 |
    27 | 28 | 29 | 30 | 31 | " class="btn btn-link">: 32 |
    33 |
    34 |
    35 | 36 |
    37 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/sandbox/apsadmin/jsp/common/layouts/assets-more/cat-entry-extras.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/sandbox/apsadmin/jsp/common/layouts/assets-more/cat-list-extras.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/sandbox/apsadmin/jsp/common/layouts/assets-more/cat-trash-extras.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/main/webapp/WEB-INF/sandbox/apsadmin/sandbox-tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/java/com/myportal/SandboxConfigTestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal; 7 | 8 | import org.apache.commons.lang.ArrayUtils; 9 | 10 | import com.agiletec.ConfigTestUtils; 11 | 12 | public class SandboxConfigTestUtils extends ConfigTestUtils { 13 | 14 | @Override 15 | protected String[] getSpringConfigFilePaths() { 16 | String[] baseFiles = super.getSpringConfigFilePaths(); 17 | 18 | //TODO EDIT THIS 19 | String[] filePaths = new String[2]; 20 | filePaths[0] = "classpath*:spring/sandbox/aps/**/**.xml "; 21 | filePaths[1] = "classpath*:spring/sandbox/**/**.xml"; 22 | String[] newFiles = (String[]) ArrayUtils.addAll(baseFiles, filePaths); 23 | return newFiles; 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/java/com/myportal/aps/SandboxBaseTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps; 7 | 8 | 9 | import com.myportal.SandboxConfigTestUtils; 10 | 11 | import com.agiletec.ConfigTestUtils; 12 | import com.agiletec.aps.BaseTestCase; 13 | 14 | public class SandboxBaseTestCase extends BaseTestCase { 15 | 16 | @Override 17 | protected ConfigTestUtils getConfigUtils() { 18 | return new SandboxConfigTestUtils(); 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/java/com/myportal/aps/system/services/TestCatManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.aps.system.services; 7 | 8 | import com.myportal.aps.SandboxBaseTestCase; 9 | import com.myportal.aps.system.services.cat.ICatManager; 10 | 11 | public class TestCatManager extends SandboxBaseTestCase { 12 | 13 | @Override 14 | protected void setUp() throws Exception { 15 | super.setUp(); 16 | this.init(); 17 | } 18 | 19 | public void testGetCat() { 20 | //TODO complete test 21 | assertNotNull(this._catManager); 22 | } 23 | 24 | public void testGetCats() { 25 | //TODO complete test 26 | assertNotNull(this._catManager); 27 | } 28 | 29 | public void testSearchCats() { 30 | //TODO complete test 31 | assertNotNull(this._catManager); 32 | } 33 | 34 | public void testAddCat() { 35 | //TODO complete test 36 | assertNotNull(this._catManager); 37 | } 38 | 39 | public void testUpdateCat() { 40 | //TODO complete test 41 | assertNotNull(this._catManager); 42 | } 43 | 44 | public void testDeleteCat() { 45 | //TODO complete test 46 | assertNotNull(this._catManager); 47 | } 48 | 49 | private void init() { 50 | //TODO add the spring bean id as constant 51 | this._catManager = (ICatManager) this.getService("sandboxCatManager"); 52 | } 53 | 54 | private ICatManager _catManager; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/java/com/myportal/apsadmin/SandboxApsAdminBaseTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.apsadmin; 7 | 8 | import java.util.Properties; 9 | 10 | import com.agiletec.ConfigTestUtils; 11 | import com.agiletec.apsadmin.ApsAdminBaseTestCase; 12 | import com.myportal.SandboxConfigTestUtils; 13 | 14 | public class SandboxApsAdminBaseTestCase extends ApsAdminBaseTestCase { 15 | 16 | @Override 17 | protected ConfigTestUtils getConfigUtils() { 18 | return new SandboxConfigTestUtils(); 19 | } 20 | 21 | protected void setInitParameters(Properties params) { 22 | params.setProperty("config", 23 | "struts-default.xml," + 24 | "struts-plugin.xml," + 25 | "struts.xml," + 26 | "entando-struts-plugin.xml," + 27 | "japs-struts-plugin.xml," + 28 | CUSTOM_STRUTS_PLUGIN); 29 | } 30 | 31 | // TODO Edit this constant before running your junit test 32 | private static final String CUSTOM_STRUTS_PLUGIN = "change_me-sandbox-struts-plugin.xml"; 33 | } 34 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/java/com/myportal/apsadmin/cat/TestCatAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.apsadmin.cat; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import com.myportal.apsadmin.SandboxApsAdminBaseTestCase; 11 | import com.opensymphony.xwork2.Action; 12 | 13 | public class TestCatAction extends SandboxApsAdminBaseTestCase { 14 | 15 | public void testNew() throws Throwable { 16 | //TODO complete test 17 | Map params = new HashMap(); 18 | String result = this.executeAction("new", params); 19 | assertEquals(Action.SUCCESS, result); 20 | } 21 | 22 | public void testEdit() throws Throwable { 23 | //TODO complete test 24 | Map params = new HashMap(); 25 | String result = this.executeAction("edit", params); 26 | assertEquals(Action.INPUT, result); 27 | } 28 | 29 | public void testSave() throws Throwable { 30 | //TODO complete test 31 | Map params = new HashMap(); 32 | String result = this.executeAction("save", params); 33 | assertEquals(Action.INPUT, result); 34 | } 35 | 36 | public void testTrash() throws Throwable { 37 | //TODO complete test 38 | Map params = new HashMap(); 39 | String result = this.executeAction("trash", params); 40 | assertEquals(Action.INPUT, result); 41 | } 42 | 43 | public void testDelete() throws Throwable { 44 | //TODO complete test 45 | Map params = new HashMap(); 46 | String result = this.executeAction("delete", params); 47 | assertEquals(Action.SUCCESS, result); 48 | } 49 | 50 | 51 | private String executeAction(String action, Map params) throws Throwable { 52 | this.setUserOnSession("admin"); 53 | this.initAction(NS, action); 54 | if (null != params) { 55 | this.addParameters(params); 56 | } 57 | String result = this.executeAction(); 58 | return result; 59 | } 60 | 61 | private static final String NS = "/do/sandbox/Cat"; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/java/com/myportal/apsadmin/cat/TestCatFinderAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package com.myportal.apsadmin.cat; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import com.myportal.apsadmin.SandboxApsAdminBaseTestCase; 11 | import com.opensymphony.xwork2.Action; 12 | 13 | public class TestCatFinderAction extends SandboxApsAdminBaseTestCase { 14 | 15 | public void testList() throws Throwable { 16 | String result = this.executeAction("list", null); 17 | assertEquals(Action.SUCCESS, result); 18 | } 19 | 20 | public void testSearch() throws Throwable { 21 | //TODO complete test 22 | Map params = new HashMap(); 23 | String result = this.executeAction("search", params); 24 | assertEquals(Action.SUCCESS, result); 25 | } 26 | 27 | private String executeAction(String action, Map params) throws Throwable { 28 | this.setUserOnSession("admin"); 29 | this.initAction(NS, action); 30 | if (null != params) { 31 | this.addParameters(params); 32 | } 33 | String result = this.executeAction(); 34 | return result; 35 | } 36 | 37 | private static final String NS = "/do/sandbox/Cat"; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/resources/sql/misc/sandbox/port_data_test.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/test/outcomes/noplugin_simple_1/src/test/resources/sql/misc/sandbox/port_data_test.sql -------------------------------------------------------------------------------- /src/test/outcomes/noplugin_simple_1/src/test/resources/sql/misc/sandbox/serv_data_test.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/test/outcomes/noplugin_simple_1/src/test/resources/sql/misc/sandbox/serv_data_test.sql -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/internalservlet/cat/CatFinderFrontEndAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.internalservlet.cat; 7 | 8 | import org.entando.entando.plugins.jppet.apsadmin.cat.CatFinderAction; 9 | 10 | public class CatFinderFrontEndAction extends CatFinderAction { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/internalservlet/cat/CatFrontEndAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.internalservlet.cat; 7 | 8 | import org.entando.entando.plugins.jppet.apsadmin.cat.CatAction; 9 | 10 | public class CatFrontEndAction extends CatAction { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/init/servdb/Cat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.init.servdb; 7 | import com.j256.ormlite.field.DataType; 8 | import com.j256.ormlite.field.DatabaseField; 9 | import com.j256.ormlite.table.DatabaseTable; 10 | import java.math.BigDecimal; 11 | import java.util.Date; 12 | 13 | @DatabaseTable(tableName = Cat.TABLE_NAME) 14 | public class Cat { 15 | 16 | public Cat() {} 17 | 18 | @DatabaseField(columnName = "id", 19 | dataType = DataType.INTEGER, 20 | canBeNull=false, id = true) 21 | private int _id; 22 | 23 | @DatabaseField(columnName = "name", 24 | dataType = DataType.STRING, 25 | width=8, canBeNull=false) 26 | private String _name; 27 | 28 | @DatabaseField(columnName = "age", 29 | dataType = DataType.INTEGER, 30 | canBeNull= true) 31 | private int _age; 32 | 33 | @DatabaseField(columnName = "weight", 34 | dataType = DataType.BIG_DECIMAL_NUMERIC, 35 | canBeNull= true) 36 | private BigDecimal _weight; 37 | 38 | @DatabaseField(columnName = "createdat", 39 | dataType = DataType.DATE, 40 | canBeNull= true) 41 | private Date _createdat; 42 | 43 | 44 | public static final String TABLE_NAME = "jppet_cat"; 45 | } 46 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/Cat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat; 7 | 8 | import java.util.Date; 9 | import java.math.BigDecimal; 10 | 11 | public class Cat { 12 | 13 | public int getId() { 14 | return _id; 15 | } 16 | public void setId(int id) { 17 | this._id = id; 18 | } 19 | 20 | public String getName() { 21 | return _name; 22 | } 23 | public void setName(String name) { 24 | this._name = name; 25 | } 26 | 27 | public int getAge() { 28 | return _age; 29 | } 30 | public void setAge(int age) { 31 | this._age = age; 32 | } 33 | 34 | public BigDecimal getWeight() { 35 | return _weight; 36 | } 37 | public void setWeight(BigDecimal weight) { 38 | this._weight = weight; 39 | } 40 | 41 | public Date getCreatedat() { 42 | return _createdat; 43 | } 44 | public void setCreatedat(Date createdat) { 45 | this._createdat = createdat; 46 | } 47 | 48 | 49 | private int _id; 50 | private String _name; 51 | private int _age; 52 | private BigDecimal _weight; 53 | private Date _createdat; 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/ICatDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat; 7 | 8 | import java.util.List; 9 | import java.util.Date; 10 | import java.math.BigDecimal; 11 | import com.agiletec.aps.system.common.FieldSearchFilter; 12 | 13 | public interface ICatDAO { 14 | 15 | public List searchCats(FieldSearchFilter[] filters); 16 | 17 | public Cat loadCat(int id); 18 | 19 | public List loadCats(); 20 | 21 | public void removeCat(int id); 22 | 23 | public void updateCat(Cat cat); 24 | 25 | public void insertCat(Cat cat); 26 | 27 | 28 | } -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/ICatManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat; 7 | 8 | import java.util.List; 9 | import com.agiletec.aps.system.exception.ApsSystemException; 10 | import java.util.Date; 11 | import java.math.BigDecimal; 12 | import com.agiletec.aps.system.common.FieldSearchFilter; 13 | 14 | public interface ICatManager { 15 | 16 | public Cat getCat(int id) throws ApsSystemException; 17 | 18 | public List getCats() throws ApsSystemException; 19 | 20 | public List searchCats(FieldSearchFilter filters[]) throws ApsSystemException; 21 | 22 | public void addCat(Cat cat) throws ApsSystemException; 23 | 24 | public void updateCat(Cat cat) throws ApsSystemException; 25 | 26 | public void deleteCat(int id) throws ApsSystemException; 27 | 28 | } -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/api/CatListResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.api; 7 | 8 | import javax.xml.bind.annotation.XmlElement; 9 | import javax.xml.bind.annotation.XmlRootElement; 10 | 11 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponse; 12 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 13 | 14 | 15 | @XmlRootElement(name = "response") 16 | public class CatListResponse extends AbstractApiResponse { 17 | 18 | @Override 19 | @XmlElement(name = "result", required = true) 20 | public CatListResponseResult getResult() { 21 | return (CatListResponseResult) super.getResult(); 22 | } 23 | 24 | @Override 25 | protected AbstractApiResponseResult createResponseResultInstance() { 26 | return new CatListResponseResult(); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/api/CatListResponseResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.api; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collection; 10 | import java.util.List; 11 | 12 | import javax.xml.bind.annotation.XmlElement; 13 | import javax.xml.bind.annotation.XmlSeeAlso; 14 | 15 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 16 | import org.entando.entando.aps.system.services.api.model.ListResponse; 17 | 18 | @XmlSeeAlso({JAXBCat.class}) 19 | public class CatListResponseResult extends AbstractApiResponseResult { 20 | 21 | @XmlElement(name = "items", required = false) 22 | public ListResponse getResult() { 23 | if (this.getMainResult() instanceof Collection) { 24 | List cats = new ArrayList(); 25 | cats.addAll((Collection) this.getMainResult()); 26 | ListResponse entity = new ListResponse(cats) {}; 27 | return entity; 28 | } 29 | return null; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/api/CatResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.api; 7 | 8 | import javax.xml.bind.annotation.XmlElement; 9 | import javax.xml.bind.annotation.XmlRootElement; 10 | 11 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponse; 12 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 13 | 14 | 15 | @XmlRootElement(name = "response") 16 | public class CatResponse extends AbstractApiResponse { 17 | 18 | @Override 19 | @XmlElement(name = "result", required = true) 20 | public CatResponseResult getResult() { 21 | return (CatResponseResult) super.getResult(); 22 | } 23 | 24 | @Override 25 | protected AbstractApiResponseResult createResponseResultInstance() { 26 | return new CatResponseResult(); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/api/CatResponseResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.api; 7 | 8 | import javax.xml.bind.annotation.XmlElement; 9 | 10 | import org.entando.entando.aps.system.services.api.model.AbstractApiResponseResult; 11 | 12 | 13 | public class CatResponseResult extends AbstractApiResponseResult { 14 | 15 | @Override 16 | @XmlElement(name = "cat", required = false) 17 | public JAXBCat getResult() { 18 | return (JAXBCat) this.getMainResult(); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/api/JAXBCat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.api; 7 | 8 | import java.util.Date; 9 | import java.math.BigDecimal; 10 | 11 | import javax.xml.bind.annotation.XmlElement; 12 | import javax.xml.bind.annotation.XmlRootElement; 13 | import javax.xml.bind.annotation.XmlType; 14 | 15 | import org.entando.entando.plugins.jppet.aps.system.services.cat.Cat; 16 | 17 | @XmlRootElement(name = "cat") 18 | @XmlType(propOrder = {"id", "name", "age", "weight", "createdat"}) 19 | public class JAXBCat { 20 | 21 | public JAXBCat() { 22 | super(); 23 | } 24 | 25 | public JAXBCat(Cat cat) { 26 | this.setId(cat.getId()); 27 | this.setName(cat.getName()); 28 | this.setAge(cat.getAge()); 29 | this.setWeight(cat.getWeight()); 30 | this.setCreatedat(cat.getCreatedat()); 31 | } 32 | 33 | public Cat getCat() { 34 | Cat cat = new Cat(); 35 | cat.setId(this.getId()); 36 | cat.setName(this.getName()); 37 | cat.setAge(this.getAge()); 38 | cat.setWeight(this.getWeight()); 39 | cat.setCreatedat(this.getCreatedat()); 40 | return cat; 41 | } 42 | 43 | @XmlElement(name = "id", required = true) 44 | public int getId() { 45 | return _id; 46 | } 47 | public void setId(int id) { 48 | this._id = id; 49 | } 50 | 51 | @XmlElement(name = "name", required = true) 52 | public String getName() { 53 | return _name; 54 | } 55 | public void setName(String name) { 56 | this._name = name; 57 | } 58 | 59 | @XmlElement(name = "age", required = true) 60 | public int getAge() { 61 | return _age; 62 | } 63 | public void setAge(int age) { 64 | this._age = age; 65 | } 66 | 67 | @XmlElement(name = "weight", required = true) 68 | public BigDecimal getWeight() { 69 | return _weight; 70 | } 71 | public void setWeight(BigDecimal weight) { 72 | this._weight = weight; 73 | } 74 | 75 | @XmlElement(name = "createdat", required = true) 76 | public Date getCreatedat() { 77 | return _createdat; 78 | } 79 | public void setCreatedat(Date createdat) { 80 | this._createdat = createdat; 81 | } 82 | 83 | 84 | private int _id; 85 | private String _name; 86 | private int _age; 87 | private BigDecimal _weight; 88 | private Date _createdat; 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/event/CatChangedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.event; 7 | 8 | import com.agiletec.aps.system.common.IManager; 9 | import com.agiletec.aps.system.common.notify.ApsEvent; 10 | import org.entando.entando.plugins.jppet.aps.system.services.cat.Cat; 11 | 12 | 13 | public class CatChangedEvent extends ApsEvent { 14 | 15 | @Override 16 | public void notify(IManager srv) { 17 | ((CatChangedObserver) srv).updateFromCatChanged(this); 18 | } 19 | 20 | @Override 21 | public Class getObserverInterface() { 22 | return CatChangedObserver.class; 23 | } 24 | 25 | public int getOperationCode() { 26 | return _operationCode; 27 | } 28 | public void setOperationCode(int operationCode) { 29 | this._operationCode = operationCode; 30 | } 31 | 32 | public Cat getCat() { 33 | return _cat; 34 | } 35 | public void setCat(Cat cat) { 36 | this._cat = cat; 37 | } 38 | 39 | private Cat _cat; 40 | private int _operationCode; 41 | 42 | public static final int INSERT_OPERATION_CODE = 1; 43 | public static final int REMOVE_OPERATION_CODE = 2; 44 | public static final int UPDATE_OPERATION_CODE = 3; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/system/services/cat/event/CatChangedObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services.cat.event; 7 | 8 | import com.agiletec.aps.system.common.notify.ObserverService; 9 | 10 | public interface CatChangedObserver extends ObserverService { 11 | 12 | public void updateFromCatChanged(CatChangedEvent event); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/aps/tags/CatListTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.tags; 7 | 8 | import java.util.List; 9 | 10 | import javax.servlet.ServletRequest; 11 | import javax.servlet.jsp.JspException; 12 | import javax.servlet.jsp.tagext.TagSupport; 13 | import com.agiletec.aps.system.RequestContext; 14 | import org.slf4j.Logger; 15 | import org.slf4j.LoggerFactory; 16 | import com.agiletec.aps.util.ApsWebApplicationUtils; 17 | import org.entando.entando.plugins.jppet.aps.system.services.cat.ICatManager; 18 | 19 | public class CatListTag extends TagSupport { 20 | 21 | private static final Logger _logger = LoggerFactory.getLogger(CatListTag.class); 22 | 23 | @Override 24 | public int doStartTag() throws JspException { 25 | ServletRequest request = this.pageContext.getRequest(); 26 | ICatManager catManager = (ICatManager) ApsWebApplicationUtils.getBean("jppetCatManager", this.pageContext); 27 | RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX); 28 | try { 29 | /* 30 | Widget widget = this.extractWidget(reqCtx); 31 | ApsProperties widgetConfig = widget.getConfig(); 32 | */ 33 | List list = catManager.getCats(); 34 | this.pageContext.setAttribute(this.getVar(), list); 35 | } catch (Throwable t) { 36 | _logger.error("Error in doStartTag", t); 37 | throw new JspException("Error in CatListTag doStartTag", t); 38 | } 39 | return super.doStartTag(); 40 | } 41 | 42 | /* 43 | private Widget extractWidget(RequestContext reqCtx) { 44 | Widget widget = null; 45 | widget = (Widget) reqCtx.getExtraParam((SystemConstants.EXTRAPAR_CURRENT_WIDGET)); 46 | return widget; 47 | } 48 | 49 | protected String extractWidgetParameter(String parameterName, ApsProperties widgetConfig, RequestContext reqCtx) { 50 | return (String) widgetConfig.get(parameterName); 51 | } 52 | */ 53 | @Override 54 | public int doEndTag() throws JspException { 55 | this.release(); 56 | return super.doEndTag(); 57 | } 58 | 59 | @Override 60 | public void release() { 61 | super.release(); 62 | this.setVar(null); 63 | } 64 | 65 | public String getVar() { 66 | return _var; 67 | } 68 | public void setVar(String var) { 69 | this._var = var; 70 | } 71 | 72 | private String _var; 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/cat/CatAction-conversion.properties: -------------------------------------------------------------------------------- 1 | createdat=com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter 2 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/cat/CatAction-validation.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 8 11 | true 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/cat/CatFinderAction-conversion.properties: -------------------------------------------------------------------------------- 1 | createdatStart=com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter 2 | createdatEnd=com.agiletec.apsadmin.system.conversion.ApsDateTypeConverter 3 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/cat/package_en.properties: -------------------------------------------------------------------------------- 1 | jppet.title.catManagement=Cats 2 | jppet.cat.label.list=Cat list 3 | jppet.cat.label.new=New 4 | jppet.cat.label.edit=Edit 5 | jppet.cat.label.delete=Delete 6 | 7 | jppet.cat.message.list.empty=There are no Cats 8 | 9 | label.id=id 10 | label.name=name 11 | label.age=age 12 | label.weight=weight 13 | label.createdatStart=createdatStart Form 14 | label.createdatEnd=createdatEnd To 15 | label.createdat=createdat 16 | 17 | note.deleteCat.areYouSure=Are you sure you want to delete the Cat 18 | 19 | stringlength=${getText(fieldName)} cannot exceed ${getText(maxLength)} characters. 20 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/cat/package_it.properties: -------------------------------------------------------------------------------- 1 | jppet.title.catManagement=Cats 2 | jppet.cat.label.list=Cat list 3 | jppet.cat.label.new=New 4 | jppet.cat.label.edit=Edit 5 | jppet.cat.label.delete=Delete 6 | 7 | jppet.cat.message.list.empty=There are no Cats 8 | 9 | label.id=id 10 | label.name=name 11 | label.age=age 12 | label.weight=weight 13 | label.createdatStart=createdatStart Form 14 | label.createdatEnd=createdatEnd To 15 | label.createdat=createdat 16 | 17 | note.deleteCat.areYouSure=Are you sure you want to delete the Cat 18 | 19 | stringlength=${getText(fieldName)} cannot exceed ${getText(maxLength)} characters. 20 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/global-messages_en.properties: -------------------------------------------------------------------------------- 1 | jppet.code=jppet 2 | jppet.name=Cat Plugin 3 | 4 | jppet.title.catManagement=Cats -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/global-messages_it.properties: -------------------------------------------------------------------------------- 1 | jppet.code=jppet 2 | jppet.name=Cat Plugin 3 | 4 | jppet.title.catManagement=Cats -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/portal/specialwidget/cat/CatConfigAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.apsadmin.portal.specialwidget.cat; 7 | 8 | import java.util.List; 9 | import org.apache.commons.lang3.StringUtils; 10 | import com.agiletec.aps.system.services.lang.Lang; 11 | import com.agiletec.apsadmin.portal.specialwidget.SimpleWidgetConfigAction; 12 | import org.entando.entando.plugins.jppet.aps.system.services.cat.ICatManager; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | public class CatConfigAction extends SimpleWidgetConfigAction { 17 | 18 | private static final Logger _logger = LoggerFactory.getLogger(CatConfigAction.class); 19 | 20 | protected String extractInitConfig() { 21 | String result = super.extractInitConfig(); 22 | String id = this.getWidget().getConfig().getProperty("id"); 23 | if (StringUtils.isNotBlank(id)) { 24 | this.setId(new Integer(id)); 25 | } 26 | return result; 27 | } 28 | 29 | public List getCatsId() { 30 | try { 31 | List cats = this.getCatManager().searchCats(null); 32 | return cats; 33 | } catch (Throwable t) { 34 | _logger.error("error in getCatsId", t); 35 | throw new RuntimeException("Error getting cats list", t); 36 | } 37 | } 38 | 39 | public int getId() { 40 | return _id; 41 | } 42 | public void setId(int id) { 43 | this._id = id; 44 | } 45 | 46 | protected ICatManager getCatManager() { 47 | return _catManager; 48 | } 49 | public void setCatManager(ICatManager catManager) { 50 | this._catManager = catManager; 51 | } 52 | 53 | private int _id; 54 | private ICatManager _catManager; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/portal/specialwidget/cat/catSpecialWidget.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | jppet.admin.page.widget.Cat.entry 13 | managePages 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | /do/Page 24 | viewTree 25 | 26 | 27 | /do/Page 28 | configure 29 | 30 | 31 | 32 | 33 | 34 | jppet.admin.page.widget.Cat.entry 35 | managePages 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/portal/specialwidget/cat/package_en.properties: -------------------------------------------------------------------------------- 1 | jppet.title.catManagement=Cats 2 | error.defaultLangTitle.required=Choose the widget title for the language {0} 3 | 4 | 5 | label.id=id -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/java/org/entando/entando/plugins/jppet/apsadmin/portal/specialwidget/cat/package_it.properties: -------------------------------------------------------------------------------- 1 | jppet.title.catManagement=Cats 2 | error.defaultLangTitle.required=Choose the widget title for the language {0} 3 | 4 | 5 | label.id=id -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/resources/component/plugins/jppet/component.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | jppet 4 | Cat 5 | 6 | 7 | 8 | org.entando.entando.plugins.jppet.aps.system.init.servdb.Cat 9 | 10 | 11 | 12 | 13 | 14 | classpath:sql/plugins/jppet/port_data_production.sql 15 | 16 | 17 | classpath:sql/plugins/jppet/serv_data_production.sql 18 | 19 | 20 | 21 | 22 | 23 | 24 | classpath:sql/plugins/jppet/port_data_test.sql 25 | 26 | 27 | classpath:sql/plugins/jppet/serv_data_test.sql 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/resources/entando-struts-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/resources/shortcuts/plugins/jppet/apsadmin/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Cat list 5 | 6 | 7 | 8 | 9 | /do/jppet/Cat 10 | list 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/resources/spring/plugins/jppet/aps/managers/jppetCatManagersConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/resources/spring/plugins/jppet/apsadmin/jppetCatActionsConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | /WEB-INF/plugins/jppet/apsadmin/jsp/common/layouts/subMenu.jsp 10 | 11 | 12 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/resources/sql/plugins/jppet/serv_data_production.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/test/outcomes/simple_1/src/main/resources/sql/plugins/jppet/serv_data_production.sql -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/tld/plugins/jppet/jppet-core.tld: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | "jppet core tag library" 5 | 2.2 6 | jppet 7 | /jppet-core 8 | 9 | 10 | Loads and returns the list of the Cats available in the system. 11 | cats 12 | org.entando.entando.plugins.jppet.aps.tags.CatListTag 13 | empty 14 | 15 | The name of the variable setted in the pagecontext. 16 | var 17 | true 18 | true 19 | 20 | 21 | 22 | 23 | Loads and returns an Cat given a key. 24 | cat 25 | org.entando.entando.plugins.jppet.aps.tags.CatTag 26 | empty 27 | 28 | Identifier of the Cat to load 29 | key 30 | false 31 | true 32 | 33 | 34 | The name of the variable setted in the pagecontext. 35 | var 36 | true 37 | true 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/aps/jsp/internalservlet/cat/frontend-cat-error.jsp: -------------------------------------------------------------------------------- 1 |
    2 |    __   _ __   _ __   ___   _ __  
    3 |  /'__`\/\`'__\/\`'__\/ __`\/\`'__\
    4 | /\  __/\ \ \/ \ \ \//\ \L\ \ \ \/ 
    5 | \ \____\\ \_\  \ \_\\ \____/\ \_\ 
    6 |  \/____/ \/_/   \/_/ \/___/  \/_/ 
    7 |                                   
    8 | 
    9 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/aps/jsp/internalservlet/cat/frontend-cat-trash.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | <%@ taglib prefix="wp" uri="/aps-core" %> 4 | <%@ taglib prefix="wpsf" uri="/apsadmin-form"%> 5 | 6 |
    7 |

    8 | 9 |
    " method="post"> 10 | 11 |
    12 |

    13 |
      14 | 15 | 16 |
    • 17 |
      18 |
      19 |
    20 |
    21 |
    22 | 23 |
    24 |

    25 |
      26 | 27 |
    • 28 |
      29 |
    30 |
    31 |
    32 | 33 |

    34 | 35 | 36 |

    37 | 38 |
    39 |

    40 | ? 41 |

    42 | 43 |

    44 | 45 | 46 | 47 | 48 |

    49 |
    50 | 51 | 52 |
    53 |
    -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/aps/jsp/widgets/jppetCat.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 | <%@ taglib prefix="wp" uri="/aps-core"%> 3 | <%@ taglib prefix="jppet" uri="/jppet-core"%> 4 | 5 | 6 |
    7 | 8 | 9 |

    :

    10 |
      11 |
    • 12 | :
      13 | :
      14 | :
      15 | :
      16 |
    • 17 |
    18 |
    19 | 20 |
    21 |

    22 |
    23 |
    24 |
    25 |
    -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/apsadmin/jppet-tiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/apsadmin/jsp/cat/cat-trash.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="s" uri="/struts-tags" %> 2 | <%@ taglib prefix="wpsa" uri="/apsadmin-core" %> 3 | <%@ taglib prefix="wpsf" uri="/apsadmin-form" %> 4 | 5 |

    6 | 7 | "> / 8 | 9 | 10 | 11 | 12 |

    13 | 14 |
    15 | 16 | 17 |

    18 | 19 | 20 |

    21 |
    22 |

    23 | 24 | ? 25 |

    26 |
    27 | 28 | 29 | 30 | 31 | " class="btn btn-link">: 32 |
    33 |
    34 |
    35 | 36 |
    37 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/apsadmin/jsp/common/layouts/assets-more/cat-entry-extras.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/apsadmin/jsp/common/layouts/assets-more/cat-list-extras.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/apsadmin/jsp/common/layouts/assets-more/cat-trash-extras.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="wp" uri="/aps-core" %> 2 | <%@ taglib prefix="s" uri="/struts-tags" %> 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/main/webapp/WEB-INF/plugins/jppet/apsadmin/jsp/common/layouts/subMenu.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="s" uri="/struts-tags" %> 2 | <%@ taglib prefix="wp" uri="/aps-core" %> 3 | 4 | 5 |
  • " >
  • 6 |
    7 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/java/org/entando/entando/plugins/jppet/JppetConfigTestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet; 7 | 8 | import org.apache.commons.lang.ArrayUtils; 9 | 10 | import com.agiletec.ConfigTestUtils; 11 | 12 | public class JppetConfigTestUtils extends ConfigTestUtils { 13 | 14 | @Override 15 | protected String[] getSpringConfigFilePaths() { 16 | String[] baseFiles = super.getSpringConfigFilePaths(); 17 | 18 | //TODO EDIT THIS 19 | String[] filePaths = new String[0]; 20 | String[] newFiles = (String[]) ArrayUtils.addAll(baseFiles, filePaths); 21 | return newFiles; 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/java/org/entando/entando/plugins/jppet/aps/JppetBaseTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps; 7 | 8 | 9 | import org.entando.entando.plugins.jppet.JppetConfigTestUtils; 10 | 11 | import com.agiletec.ConfigTestUtils; 12 | import com.agiletec.aps.BaseTestCase; 13 | 14 | public class JppetBaseTestCase extends BaseTestCase { 15 | 16 | @Override 17 | protected ConfigTestUtils getConfigUtils() { 18 | return new JppetConfigTestUtils(); 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/java/org/entando/entando/plugins/jppet/aps/system/services/TestCatManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.aps.system.services; 7 | 8 | import org.entando.entando.plugins.jppet.aps.JppetBaseTestCase; 9 | import org.entando.entando.plugins.jppet.aps.system.services.cat.ICatManager; 10 | 11 | public class TestCatManager extends JppetBaseTestCase { 12 | 13 | @Override 14 | protected void setUp() throws Exception { 15 | super.setUp(); 16 | this.init(); 17 | } 18 | 19 | public void testGetCat() { 20 | //TODO complete test 21 | assertNotNull(this._catManager); 22 | } 23 | 24 | public void testGetCats() { 25 | //TODO complete test 26 | assertNotNull(this._catManager); 27 | } 28 | 29 | public void testSearchCats() { 30 | //TODO complete test 31 | assertNotNull(this._catManager); 32 | } 33 | 34 | public void testAddCat() { 35 | //TODO complete test 36 | assertNotNull(this._catManager); 37 | } 38 | 39 | public void testUpdateCat() { 40 | //TODO complete test 41 | assertNotNull(this._catManager); 42 | } 43 | 44 | public void testDeleteCat() { 45 | //TODO complete test 46 | assertNotNull(this._catManager); 47 | } 48 | 49 | private void init() { 50 | //TODO add the spring bean id as constant 51 | this._catManager = (ICatManager) this.getService("jppetCatManager"); 52 | } 53 | 54 | private ICatManager _catManager; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/java/org/entando/entando/plugins/jppet/apsadmin/JppetApsAdminBaseTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.apsadmin; 7 | 8 | import java.util.Properties; 9 | 10 | import com.agiletec.ConfigTestUtils; 11 | import com.agiletec.apsadmin.ApsAdminBaseTestCase; 12 | import org.entando.entando.plugins.jppet.JppetConfigTestUtils; 13 | 14 | public class JppetApsAdminBaseTestCase extends ApsAdminBaseTestCase { 15 | 16 | @Override 17 | protected ConfigTestUtils getConfigUtils() { 18 | return new JppetConfigTestUtils(); 19 | } 20 | 21 | protected void setInitParameters(Properties params) { 22 | params.setProperty("config", 23 | "struts-default.xml," + 24 | "struts-plugin.xml," + 25 | "struts.xml," + 26 | "entando-struts-plugin.xml," + 27 | "japs-struts-plugin.xml," + 28 | CUSTOM_STRUTS_PLUGIN); 29 | } 30 | 31 | // TODO Edit this constant before running your junit test 32 | private static final String CUSTOM_STRUTS_PLUGIN = "change_me-jppet-struts-plugin.xml"; 33 | } 34 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/java/org/entando/entando/plugins/jppet/apsadmin/cat/TestCatAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.apsadmin.cat; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import org.entando.entando.plugins.jppet.apsadmin.JppetApsAdminBaseTestCase; 11 | import com.opensymphony.xwork2.Action; 12 | 13 | public class TestCatAction extends JppetApsAdminBaseTestCase { 14 | 15 | public void testNew() throws Throwable { 16 | //TODO complete test 17 | Map params = new HashMap(); 18 | String result = this.executeAction("new", params); 19 | assertEquals(Action.SUCCESS, result); 20 | } 21 | 22 | public void testEdit() throws Throwable { 23 | //TODO complete test 24 | Map params = new HashMap(); 25 | String result = this.executeAction("edit", params); 26 | assertEquals(Action.INPUT, result); 27 | } 28 | 29 | public void testSave() throws Throwable { 30 | //TODO complete test 31 | Map params = new HashMap(); 32 | String result = this.executeAction("save", params); 33 | assertEquals(Action.INPUT, result); 34 | } 35 | 36 | public void testTrash() throws Throwable { 37 | //TODO complete test 38 | Map params = new HashMap(); 39 | String result = this.executeAction("trash", params); 40 | assertEquals(Action.INPUT, result); 41 | } 42 | 43 | public void testDelete() throws Throwable { 44 | //TODO complete test 45 | Map params = new HashMap(); 46 | String result = this.executeAction("delete", params); 47 | assertEquals(Action.SUCCESS, result); 48 | } 49 | 50 | 51 | private String executeAction(String action, Map params) throws Throwable { 52 | this.setUserOnSession("admin"); 53 | this.initAction(NS, action); 54 | if (null != params) { 55 | this.addParameters(params); 56 | } 57 | String result = this.executeAction(); 58 | return result; 59 | } 60 | 61 | private static final String NS = "/do/jppet/Cat"; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/java/org/entando/entando/plugins/jppet/apsadmin/cat/TestCatFinderAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * 4 | * 5 | */ 6 | package org.entando.entando.plugins.jppet.apsadmin.cat; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import org.entando.entando.plugins.jppet.apsadmin.JppetApsAdminBaseTestCase; 11 | import com.opensymphony.xwork2.Action; 12 | 13 | public class TestCatFinderAction extends JppetApsAdminBaseTestCase { 14 | 15 | public void testList() throws Throwable { 16 | String result = this.executeAction("list", null); 17 | assertEquals(Action.SUCCESS, result); 18 | } 19 | 20 | public void testSearch() throws Throwable { 21 | //TODO complete test 22 | Map params = new HashMap(); 23 | String result = this.executeAction("search", params); 24 | assertEquals(Action.SUCCESS, result); 25 | } 26 | 27 | private String executeAction(String action, Map params) throws Throwable { 28 | this.setUserOnSession("admin"); 29 | this.initAction(NS, action); 30 | if (null != params) { 31 | this.addParameters(params); 32 | } 33 | String result = this.executeAction(); 34 | return result; 35 | } 36 | 37 | private static final String NS = "/do/jppet/Cat"; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/resources/sql/plugins/jppet/port_data_test.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/test/outcomes/simple_1/src/test/resources/sql/plugins/jppet/port_data_test.sql -------------------------------------------------------------------------------- /src/test/outcomes/simple_1/src/test/resources/sql/plugins/jppet/serv_data_test.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/entando/component-generator/64a595a45aff97b222afacbe189073bfc302c32f/src/test/outcomes/simple_1/src/test/resources/sql/plugins/jppet/serv_data_test.sql -------------------------------------------------------------------------------- /src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | --------------------------------------------------------------------------------