@cronapp/templates 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/$global/components/js/datasource.js +1472 -0
- package/$global/data-layer/BASICDAO.ftl +146 -0
- package/$global/data-layer/BUSINESS.ftl +284 -0
- package/$global/data-layer/DAO.ftl +138 -0
- package/$global/data-layer/ENTITIES.ftl +165 -0
- package/$global/data-layer/REST.ftl +333 -0
- package/$global/data-layer/RESTAPPLICATION.ftl +22 -0
- package/$global/data-layer/REST_EXCEPTION.ftl +106 -0
- package/$global/data-layer/REST_SERVICE.ftl +11 -0
- package/$global/data-layer/SESSIONMANAGER.ftl +292 -0
- package/$global/data-layer/TEST.ftl +9 -0
- package/$global/data-layer/cloud/CloudFactory.ftl +27 -0
- package/$global/data-layer/cloud/CloudManager.ftl +73 -0
- package/$global/data-layer/cloud/CloudService.ftl +14 -0
- package/$global/data-layer/cloud/DropboxService.ftl +81 -0
- package/$global/data-layer/cloud/FileObject.ftl +47 -0
- package/$global/data-layer/cloud/template.properties +8 -0
- package/$global/data-layer/dropbox/DROPBOX_CONSTANTS.ftl +1 -0
- package/$global/data-layer/dropbox/DROPBOX_DELETE.ftl +1 -0
- package/$global/data-layer/dropbox/DROPBOX_GET.ftl +1 -0
- package/$global/data-layer/dropbox/DROPBOX_LIST.ftl +1 -0
- package/$global/data-layer/dropbox/DROPBOX_POST.ftl +19 -0
- package/$global/data-layer/dropbox/DROPBOX_PUT.ftl +20 -0
- package/$global/data-layer/template.properties +9 -0
- package/$global/js/directives.js +162 -0
- package/$global/reports/commons/ReportFront.ftl +76 -0
- package/$global/reports/frontend/parameters.controller.ftl +70 -0
- package/$global/reports/frontend/reports.controller.ftl +63 -0
- package/$global/reports/frontend/reports.parameters.ftl +25 -0
- package/$global/reports/frontend/reports.service.ftl +39 -0
- package/$global/reports/frontend/templates/BOOLEAN.parameter.ftl +4 -0
- package/$global/reports/frontend/templates/DATE.parameter.ftl +4 -0
- package/$global/reports/frontend/templates/DOUBLE.parameter.ftl +4 -0
- package/$global/reports/frontend/templates/FLOAT.parameter.ftl +4 -0
- package/$global/reports/frontend/templates/INTEGER.parameter.ftl +4 -0
- package/$global/reports/frontend/templates/LONG.parameter.ftl +4 -0
- package/$global/reports/frontend/templates/STRING.parameter.ftl +4 -0
- package/README.md +2 -0
- package/file/blockly/EmptyBlockly/__Name__.blockly.ftl +20 -0
- package/file/blockly/EmptyBlockly/blockly.png +0 -0
- package/file/blockly/EmptyBlockly/blockly_client.png +0 -0
- package/file/blockly/EmptyBlockly/blockly_server.png +0 -0
- package/file/blockly/EmptyBlockly/template.properties +8 -0
- package/file/blockly/EmptyBlockly/template_pt_BR.properties +6 -0
- package/file/blockly/JavaBlockly/__ClassName__.java.ftl +32 -0
- package/file/blockly/JavaBlockly/java.svg +15 -0
- package/file/blockly/JavaBlockly/template.properties +9 -0
- package/file/blockly/JavaBlockly/template_pt_BR.properties +5 -0
- package/file/blockly/JavaScriptBlockly/__ClassName__.blockly.js.ftl +16 -0
- package/file/blockly/JavaScriptBlockly/javascript.svg +28 -0
- package/file/blockly/JavaScriptBlockly/template.properties +9 -0
- package/file/blockly/JavaScriptBlockly/template_pt_BR.properties +5 -0
- package/file/blockly/blockly.png +0 -0
- package/file/blockly/blockly_client.png +0 -0
- package/file/blockly/blockly_server.png +0 -0
- package/file/blockly/group.properties +5 -0
- package/file/components.json/EmptyCrudHtml/__FileName__.components.json.ftl +41 -0
- package/file/components.json/EmptyCrudHtml/__FileName__.template.html.ftl +1 -0
- package/file/components.json/EmptyCrudHtml/components.json.png +0 -0
- package/file/components.json/EmptyCrudHtml/template.properties +36 -0
- package/file/components.json/EmptyCrudHtml/template_pt_BR.properties +36 -0
- package/file/components.json/components.json.png +0 -0
- package/file/components.json/group.properties +5 -0
- package/file/crud/angular_crud_view/__FileName__.view.html.ftl +432 -0
- package/file/crud/angular_crud_view/crud-web.png +0 -0
- package/file/crud/angular_crud_view/template.properties +8 -0
- package/file/crud/angular_crud_view/template_en_US.properties +2 -0
- package/file/crud/angular_view/__FileName__.view.html.ftl +70 -0
- package/file/crud/angular_view/list-web.png +0 -0
- package/file/crud/angular_view/project.svg +39 -0
- package/file/crud/angular_view/template.properties +10 -0
- package/file/crud/angular_view/template_en_US.properties +2 -0
- package/file/crud/group.properties +6 -0
- package/file/crud/phonegap_crud_view/__FileName__.view.html.ftl +308 -0
- package/file/crud/phonegap_crud_view/crud-mobile.png +0 -0
- package/file/crud/phonegap_crud_view/project.svg +24 -0
- package/file/crud/phonegap_crud_view/template.properties +9 -0
- package/file/crud/phonegap_crud_view/template_en_US.properties +2 -0
- package/file/crud/phonegap_view/__FileName__.view.html.ftl +74 -0
- package/file/crud/phonegap_view/list-mobile.png +0 -0
- package/file/crud/phonegap_view/project.svg +24 -0
- package/file/crud/phonegap_view/template.properties +11 -0
- package/file/crud/phonegap_view/template_en_US.properties +2 -0
- package/file/crud/view.html.png +0 -0
- package/file/html/EmptyHtml/__FileName__.html.ftl +0 -0
- package/file/html/EmptyHtml/html.png +0 -0
- package/file/html/EmptyHtml/template.properties +4 -0
- package/file/html/EmptyHtml/template_pt_BR.properties +4 -0
- package/file/html/group.properties +4 -0
- package/file/html/html.png +0 -0
- package/file/java/Cronapi/__ClassName__.java.ftl +26 -0
- package/file/java/Cronapi/cronapi.png +0 -0
- package/file/java/Cronapi/template.properties +15 -0
- package/file/java/Cronapi/template_pt_BR.properties +15 -0
- package/file/java/EmptyClass/__ClassName__.java.ftl +23 -0
- package/file/java/EmptyClass/java.png +0 -0
- package/file/java/EmptyClass/template.properties +5 -0
- package/file/java/EmptyClass/template_pt_BR.properties +5 -0
- package/file/java/EnumClass/__EnumName__.java.ftl +18 -0
- package/file/java/EnumClass/java.png +0 -0
- package/file/java/EnumClass/template.properties +5 -0
- package/file/java/EnumClass/template_pt_BR.properties +5 -0
- package/file/java/InterfaceClass/__InterfaceName__.java.ftl +25 -0
- package/file/java/InterfaceClass/java.png +0 -0
- package/file/java/InterfaceClass/template.properties +5 -0
- package/file/java/InterfaceClass/template_pt_BR.properties +5 -0
- package/file/java/JUnitSuiteTestClass/__ClassName__.java.ftl +26 -0
- package/file/java/JUnitSuiteTestClass/junit.png +0 -0
- package/file/java/JUnitSuiteTestClass/template.properties +11 -0
- package/file/java/JUnitSuiteTestClass/template_pt_BR.properties +11 -0
- package/file/java/JUnitTestClass/__ClassName__.java.ftl +42 -0
- package/file/java/JUnitTestClass/junit.png +0 -0
- package/file/java/JUnitTestClass/template.properties +11 -0
- package/file/java/JUnitTestClass/template_pt_BR.properties +11 -0
- package/file/java/group.properties +4 -0
- package/file/java/java.png +0 -0
- package/file/jrxml/EmptyReport/__FileName__.jrxml.ftl +33 -0
- package/file/jrxml/EmptyReport/jrxml.png +0 -0
- package/file/jrxml/EmptyReport/template.properties +6 -0
- package/file/jrxml/EmptyReport/template_pt_BR.properties +6 -0
- package/file/jrxml/TabularReport/__FileName__.jrxml.ftl +27 -0
- package/file/jrxml/TabularReport/jrxml.png +0 -0
- package/file/jrxml/TabularReport/template.properties +11 -0
- package/file/jrxml/TabularReport/template_pt_BR.properties +11 -0
- package/file/jrxml/group.properties +4 -0
- package/file/jrxml/jrxml.png +0 -0
- package/file/js/Cronapi/__FileName__.cronapi.js.ftl +24 -0
- package/file/js/Cronapi/blockly_client.png +0 -0
- package/file/js/Cronapi/template.properties +18 -0
- package/file/js/Cronapi/template_pt_BR.properties +15 -0
- package/file/js/EmptyJs/__FileName__.js.ftl +0 -0
- package/file/js/EmptyJs/js.png +0 -0
- package/file/js/EmptyJs/template.properties +5 -0
- package/file/js/EmptyJs/template_pt_BR.properties +5 -0
- package/file/js/group.properties +4 -0
- package/file/js/js.png +0 -0
- package/file/others/css/CssHelloWorld/__FileName__.css.ftl +3 -0
- package/file/others/css/CssHelloWorld/css.png +0 -0
- package/file/others/css/CssHelloWorld/template.properties +5 -0
- package/file/others/css/CssHelloWorld/template_pt_BR.properties +5 -0
- package/file/others/css/CssVazio/__FileName__.css.ftl +0 -0
- package/file/others/css/CssVazio/css.png +0 -0
- package/file/others/css/CssVazio/template.properties +5 -0
- package/file/others/css/CssVazio/template_pt_BR.properties +5 -0
- package/file/others/group.properties +5 -0
- package/file/others/group_en_US.properties +5 -0
- package/file/others/js/__FileName__.js.ftl +0 -0
- package/file/others/js/js.png +0 -0
- package/file/others/js/template.properties +5 -0
- package/file/others/js/template_pt_BR.properties +5 -0
- package/file/others/jsp/__FileName__.jsp.ftl +12 -0
- package/file/others/jsp/jsp.png +0 -0
- package/file/others/jsp/template.properties +5 -0
- package/file/others/jsp/template_pt_BR.properties +5 -0
- package/file/others/properties/__FileName__.properties.ftl +0 -0
- package/file/others/properties/properties.png +0 -0
- package/file/others/properties/template.properties +5 -0
- package/file/others/properties/template_pt_BR.properties +5 -0
- package/file/others/raml/__FileName__.raml.ftl +12 -0
- package/file/others/raml/raml.png +0 -0
- package/file/others/raml/template.properties +5 -0
- package/file/others/raml/template_pt_BR.properties +5 -0
- package/file/others/scheduler.umlcd/__FileName__.umlcd.ftl +397 -0
- package/file/others/scheduler.umlcd/template.properties +5 -0
- package/file/others/scheduler.umlcd/template_pt_BR.properties +5 -0
- package/file/others/scheduler.umlcd/umlcd.png +0 -0
- package/file/others/txt/__FileName__.txt.ftl +0 -0
- package/file/others/txt/template.properties +5 -0
- package/file/others/txt/template_en_US.properties +5 -0
- package/file/others/txt/txt.png +0 -0
- package/file/others/umlcd/__FileName__.umlcd.ftl +0 -0
- package/file/others/umlcd/template.properties +5 -0
- package/file/others/umlcd/template_pt_BR.properties +5 -0
- package/file/others/umlcd/umlcd.png +0 -0
- package/file/others/unknown.png +0 -0
- package/file/others/xml/__FileName__.xml.ftl +0 -0
- package/file/others/xml/template.properties +5 -0
- package/file/others/xml/template_pt_BR.properties +5 -0
- package/file/others/xml/xml.png +0 -0
- package/file/others/yaml/__FileName__.yaml.ftl +29 -0
- package/file/others/yaml/template.properties +5 -0
- package/file/others/yaml/template_pt_BR.properties +5 -0
- package/file/others/yaml/yaml.png +0 -0
- package/file/tm/EmptyMenu/__FileName__.xml.ftl +14 -0
- package/file/tm/EmptyMenu/template.properties +4 -0
- package/file/tm/EmptyMenu/tm.png +0 -0
- package/file/tm/group.properties +6 -0
- package/file/tm/tm.png +0 -0
- package/file/tp/EmptyPage/__FileName__.xml.ftl +12 -0
- package/file/tp/EmptyPage/template.properties +4 -0
- package/file/tp/EmptyPage/tp.png +0 -0
- package/file/tp/PageHelloWorld/__FileName__.xml.ftl +18 -0
- package/file/tp/PageHelloWorld/template.properties +4 -0
- package/file/tp/PageHelloWorld/tp.png +0 -0
- package/file/tp/group.properties +6 -0
- package/file/tp/tp.png +0 -0
- package/file/view.html/EmptyCrudHtml/__FileName__.view.html.ftl +69 -0
- package/file/view.html/EmptyCrudHtml/template.properties +7 -0
- package/file/view.html/EmptyCrudHtml/template_pt_BR.properties +4 -0
- package/file/view.html/EmptyCrudHtml/view.html.png +0 -0
- package/file/view.html/EmptyIonicViewHtml/__FileName__.view.html.ftl +4 -0
- package/file/view.html/EmptyIonicViewHtml/template.properties +10 -0
- package/file/view.html/EmptyIonicViewHtml/template_pt_BR.properties +3 -0
- package/file/view.html/EmptyIonicViewHtml/view.html.png +0 -0
- package/file/view.html/EmptyViewHtml/__FileName__.view.html.ftl +0 -0
- package/file/view.html/EmptyViewHtml/template.properties +10 -0
- package/file/view.html/EmptyViewHtml/template_pt_BR.properties +3 -0
- package/file/view.html/EmptyViewHtml/view.html.png +0 -0
- package/file/view.html/HeaderIonicViewHtml/__FileName__.view.html.ftl +13 -0
- package/file/view.html/HeaderIonicViewHtml/template.properties +10 -0
- package/file/view.html/HeaderIonicViewHtml/template_pt_BR.properties +3 -0
- package/file/view.html/HeaderIonicViewHtml/view.html.png +0 -0
- package/file/view.html/Login1ViewHtml/__FileName__.view.html.ftl +193 -0
- package/file/view.html/Login1ViewHtml/login1.png +0 -0
- package/file/view.html/Login1ViewHtml/template.properties +10 -0
- package/file/view.html/Login1ViewHtml/template_pt_BR.properties +2 -0
- package/file/view.html/Login2ViewHtml/__FileName__.view.html.ftl +200 -0
- package/file/view.html/Login2ViewHtml/login2.png +0 -0
- package/file/view.html/Login2ViewHtml/template.properties +10 -0
- package/file/view.html/Login2ViewHtml/template_pt_BR.properties +2 -0
- package/file/view.html/Signup1ViewHtml/__FileName__.view.html.ftl +87 -0
- package/file/view.html/Signup1ViewHtml/signup1.png +0 -0
- package/file/view.html/Signup1ViewHtml/template.properties +10 -0
- package/file/view.html/Signup1ViewHtml/template_pt_BR.properties +2 -0
- package/file/view.html/Signup2ViewHtml/__FileName__.view.html.ftl +90 -0
- package/file/view.html/Signup2ViewHtml/signup2.png +0 -0
- package/file/view.html/Signup2ViewHtml/template.properties +10 -0
- package/file/view.html/Signup2ViewHtml/template_pt_BR.properties +2 -0
- package/file/view.html/group.properties +6 -0
- package/file/view.html/view.html.png +0 -0
- package/package.json +5 -0
- package/project/C/Aplicacao Vazia/cfg/jaas.config +5 -0
- package/project/C/Aplicacao Vazia/cfg/techne.template.config.xml +26 -0
- package/project/C/Aplicacao Vazia/cfg/techne.template.xml +6 -0
- package/project/C/Aplicacao Vazia/config/context.xml.ftl +66 -0
- package/project/C/Aplicacao Vazia/data/techne/template/crodata/classes.xml +13 -0
- package/project/C/Aplicacao Vazia/data/techne/template/crodata/menu/modules.xml +14 -0
- package/project/C/Aplicacao Vazia/data/techne/template/crodata/trans/module/index.xml +15 -0
- package/project/C/Aplicacao Vazia/db/README.md +1 -0
- package/project/C/Aplicacao Vazia/pom.xml +34 -0
- package/project/C/Aplicacao Vazia/project.png +0 -0
- package/project/C/Aplicacao Vazia/src/template/security/TemplateSecurityConnection.java +130 -0
- package/project/C/Aplicacao Vazia/template.properties +8 -0
- package/project/C/Aplicacao com CRUD/cfg/jaas.config +5 -0
- package/project/C/Aplicacao com CRUD/cfg/techne.template.config.xml +26 -0
- package/project/C/Aplicacao com CRUD/cfg/techne.template.xml +6 -0
- package/project/C/Aplicacao com CRUD/config/context.xml.ftl +66 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/block/tb.ftl +9 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/classes.xml +13 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/menu/modules.xml +14 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/trans/module/checkbox.xml +156 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/trans/module/dropDownSelect.xml +113 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/trans/module/gridPanelSelect.xml +99 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/trans/module/index.xml +40 -0
- package/project/C/Aplicacao com CRUD/data/techne/template/crodata/trans/module/recordpanel.xml +239 -0
- package/project/C/Aplicacao com CRUD/db/README.md +1 -0
- package/project/C/Aplicacao com CRUD/db/sql/template/org/h2/Driver/2_tables.sql +309 -0
- package/project/C/Aplicacao com CRUD/pom.xml +85 -0
- package/project/C/Aplicacao com CRUD/project.png +0 -0
- package/project/C/Aplicacao com CRUD/src/template/security/TemplateSecurityConnection.java +130 -0
- package/project/C/Aplicacao com CRUD/template.properties +9 -0
- package/project/C/cronos/cfg/jaas.config +5 -0
- package/project/C/cronos/cfg/techne.template.config.xml +26 -0
- package/project/C/cronos/cfg/techne.template.xml +6 -0
- package/project/C/cronos/config/context.xml.ftl +66 -0
- package/project/C/cronos/data/techne/template/crodata/block/tb.ftl +9 -0
- package/project/C/cronos/data/techne/template/crodata/classes.xml +13 -0
- package/project/C/cronos/data/techne/template/crodata/menu/modules.xml +14 -0
- package/project/C/cronos/data/techne/template/crodata/trans/module/gridPanelMasterDetail.xml +72 -0
- package/project/C/cronos/data/techne/template/crodata/trans/module/gridPanelSelect.xml +99 -0
- package/project/C/cronos/data/techne/template/crodata/trans/module/hello.xml +15 -0
- package/project/C/cronos/data/techne/template/crodata/trans/module/recordPanelMasterCheckBox.xml +190 -0
- package/project/C/cronos/db/README.md +1 -0
- package/project/C/cronos/pom.xml +34 -0
- package/project/C/cronos/project.png +0 -0
- package/project/C/cronos/scripts/sql/aplicacao/org/h2/Driver/2_tables.sql +309 -0
- package/project/C/cronos/src/template/security/TemplateSecurityConnection.java +130 -0
- package/project/C/cronos/template.properties +8 -0
- package/project/C/cronos.png +0 -0
- package/project/C/group.properties +5 -0
- package/project/D/dotnet-zero/project.png +0 -0
- package/project/D/dotnet-zero/template.properties +5 -0
- package/project/D/dotnet-zero/template_en_US.properties +2 -0
- package/project/D/dotnet.png +0 -0
- package/project/D/group.properties +4 -0
- package/project/G/blockly-client-api/project.svg +63 -0
- package/project/G/blockly-client-api/src/main/mobileapp/www/js/cronapi/__FileName__.cronapi.js.ftl +24 -0
- package/project/G/blockly-client-api/src/main/webapp/js/cronapi/__FileName__.cronapi.js.ftl +24 -0
- package/project/G/blockly-client-api/template.properties +15 -0
- package/project/G/blockly-client-api/template.properties._template.ftl +5 -0
- package/project/G/blockly-client-api/template_en.properties._template.ftl +1 -0
- package/project/G/blockly-client-api/template_pt.properties +13 -0
- package/project/G/blockly-client-api/template_pt.properties._template.ftl +1 -0
- package/project/G/blockly-server-api/pom.xml.ftl +63 -0
- package/project/G/blockly-server-api/project.svg +34 -0
- package/project/G/blockly-server-api/src/main/java/cronapi/__ClassName__.java.ftl +24 -0
- package/project/G/blockly-server-api/template.properties +17 -0
- package/project/G/blockly-server-api/template.properties._template.ftl +1 -0
- package/project/G/blockly-server-api/template_en.properties._template.ftl +1 -0
- package/project/G/blockly-server-api/template_pt.properties +14 -0
- package/project/G/blockly-server-api/template_pt.properties._template.ftl +1 -0
- package/project/G/gluonsoft.png +0 -0
- package/project/G/group.properties +4 -0
- package/project/G/visual-component/project.svg +166 -0
- package/project/G/visual-component/src/main/mobileapp/www/components/__WidgetId__.components.json.ftl +22 -0
- package/project/G/visual-component/src/main/mobileapp/www/components/templates/__WidgetId__.template.html.ftl +4 -0
- package/project/G/visual-component/src/main/mobileapp/www/js/__WidgetId__.js +4 -0
- package/project/G/visual-component/src/main/webapp/components/__WidgetId__.components.json.ftl +22 -0
- package/project/G/visual-component/src/main/webapp/components/templates/__WidgetId__.template.html.ftl +4 -0
- package/project/G/visual-component/src/main/webapp/js/__WidgetId__.js +4 -0
- package/project/G/visual-component/template.properties +9 -0
- package/project/G/visual-component/template.properties._template.ftl +5 -0
- package/project/G/visual-component/template_en.properties._template.ftl +1 -0
- package/project/G/visual-component/template_pt.properties +4 -0
- package/project/G/visual-component/template_pt.properties._template.ftl +1 -0
- package/project/J/group.properties +4 -0
- package/project/J/java.png +0 -0
- package/project/J/servlet/.gitignore.ftl +25 -0
- package/project/J/servlet/.vscode/launch.json +1 -0
- package/project/J/servlet/README.md +3 -0
- package/project/J/servlet/pom.xml +70 -0
- package/project/J/servlet/project.svg +1 -0
- package/project/J/servlet/src/main/webapp/index.jsp +5 -0
- package/project/J/servlet/template.properties +6 -0
- package/project/J/servlet/template_en_US.properties +2 -0
- package/project/J/spring-boot/.gitignore.ftl +25 -0
- package/project/J/spring-boot/.vscode/launch.json +1 -0
- package/project/J/spring-boot/README.md +3 -0
- package/project/J/spring-boot/mvnw +225 -0
- package/project/J/spring-boot/mvnw.cmd +143 -0
- package/project/J/spring-boot/pom.xml +50 -0
- package/project/J/spring-boot/project.png +0 -0
- package/project/J/spring-boot/project.svg +1 -0
- package/project/J/spring-boot/src/main/java/com/mycompany/helloworld/HelloWorldApplication.java +12 -0
- package/project/J/spring-boot/src/main/resources/application.properties +0 -0
- package/project/J/spring-boot/src/main/resources/static/static.txt +0 -0
- package/project/J/spring-boot/src/main/resources/templates/templates.txt +0 -0
- package/project/J/spring-boot/template.properties +6 -0
- package/project/J/spring-boot/template_en_US.properties +2 -0
- package/project/M/cronapp-rad-project-mobile-cordova/.gitignore.ftl +28 -0
- package/project/M/cronapp-rad-project-mobile-cordova/README.md +24 -0
- package/project/M/cronapp-rad-project-mobile-cordova/__copydata.ftl +29 -0
- package/project/M/cronapp-rad-project-mobile-cordova/__linksInherit +6 -0
- package/project/M/cronapp-rad-project-mobile-cordova/project.svg +1 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/__copydata.ftl +18 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/__linksInherit +14 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/java/__copydata.ftl +3 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/java/__linksInherit +10 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/java/social.properties +14 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/.gitignore.ftl +3 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/certs/README.md +5 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/config.xml.ftl +110 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/hooks/README.md +23 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/network_security_config.xml +4 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/package.json.ftl +12 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/README.md +29 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-hdpi-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-hdpi-notification-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-ldpi-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-ldpi-notification-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-mdpi-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-mdpi-notification-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-web-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-xhdpi-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-xhdpi-notification-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-xxhdpi-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-xxhdpi-notification-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-xxxhdpi-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/drawable-xxxhdpi-notification-icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/icon-36-hdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/android/icon-48-hdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-1024.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-20.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-24@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-27.5@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-40.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-40@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-40@3x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-44@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-50.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-50@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-60.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-60@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-60@3x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-72.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-72@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-76.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-76@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-83.5@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-86@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-98@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-small.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-small@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon-small@3x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon/ios/icon@2x.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/notification_icon.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-hdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-hdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-ldpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-ldpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-mdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-mdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-xhdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-xhdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-xxhdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-land-xxxhdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-hdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-hdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-ldpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-ldpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-mdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-mdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-xhdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-xhdpi.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-xxhdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/android/drawable-port-xxxhdpi-screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-2436h.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-568h@2x~iphone.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-667h.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-736h.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Landscape-2436h.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Landscape-736h.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Landscape@2x~ipad.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Landscape@~ipadpro.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Landscape~ipad.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Portrait@2x~ipad.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Portrait@~ipadpro.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default-Portrait~ipad.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~ipad~anyany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~ipad~comany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~iphone.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~iphone~anyany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~iphone~comany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~iphone~comcom.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@2x~universal~anyany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@3x~iphone~anyany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@3x~iphone~anycom.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default@3x~iphone~comany.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/Default~iphone.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/ipx-landscape.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen/ios/ipx-portrait.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/res/screen.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/__copydata.ftl +12 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/.bowerrc +4 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/README.md +32 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/bower.json +30 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/bowerscripts/clean_dependencies.js +3 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/bowerscripts/package-lock.json +187 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/bowerscripts/package.json +14 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/cordova.js +1863 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/cordova_plugins.js +9 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/css/app.css +4 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/favicon.ico +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/i18n/locale_en_us.json +166 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/i18n/locale_pt_br.json +166 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/img/nophoto.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/img/user.png +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/index.html.ftl +76 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/ChangePassword.blockly +44 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/ChangePassword.blockly.js +56 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/Home.blockly +12 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/Home.blockly.js +13 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/Login.blockly +42 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/Login.blockly.js +25 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/UserControl.blockly +129 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/blockly/auth/UserControl.blockly.js +64 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/events.js +0 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/js/index.js +48 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/error/403.view.html +7 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/error/404.view.html +7 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/logged/home.view.html +20 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/logged/menu.view.html +61 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/logged/user.view.html +74 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/login.view.html.ftl +44 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/public/home.view.html +19 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/public/menu.view.html +15 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/public/reset-password-email.view.html +28 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/public/reset-password.view.html +29 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-autenticacao/views/public/signup.view.html +36 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/__linksInherit +10 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/js/blockly/auth/Home.blockly +12 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/js/blockly/auth/Home.blockly.js +13 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/views/error/403.view.html +7 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/views/error/404.view.html +7 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/views/public/home.view.html +22 -0
- package/project/M/cronapp-rad-project-mobile-cordova/src/main/mobileapp/www/www-sem-autenticacao/views/public/menu.view.html +15 -0
- package/project/M/cronapp-rad-project-mobile-cordova/template.properties +129 -0
- package/project/M/cronapp-rad-project-mobile-cordova/template_en_US.properties +29 -0
- package/project/M/cronapp-rad-project-mobile-cordova/template_pt_BR.properties +28 -0
- package/project/M/group.properties +5 -0
- package/project/M/mobile.png +0 -0
- package/project/N/group.properties +4 -0
- package/project/N/nodejs-express/.vscode/launch.json +14 -0
- package/project/N/nodejs-express/app.js +44 -0
- package/project/N/nodejs-express/bin/www +90 -0
- package/project/N/nodejs-express/package-lock.json +928 -0
- package/project/N/nodejs-express/package.json +16 -0
- package/project/N/nodejs-express/project.png +0 -0
- package/project/N/nodejs-express/project.svg +1 -0
- package/project/N/nodejs-express/public/stylesheets/style.css +8 -0
- package/project/N/nodejs-express/routes/index.js +9 -0
- package/project/N/nodejs-express/routes/users.js +9 -0
- package/project/N/nodejs-express/template.properties +6 -0
- package/project/N/nodejs-express/template_en_US.properties +2 -0
- package/project/N/nodejs-express/views/error.pug +6 -0
- package/project/N/nodejs-express/views/index.pug +5 -0
- package/project/N/nodejs-express/views/layout.pug +7 -0
- package/project/N/nodejs.png +0 -0
- package/project/P/django/.vscode/launch.json +21 -0
- package/project/P/django/cronapp/settings.py +121 -0
- package/project/P/django/cronapp/urls.py +21 -0
- package/project/P/django/cronapp/wsgi.py +16 -0
- package/project/P/django/manage.py +19 -0
- package/project/P/django/project.svg +48 -0
- package/project/P/django/requirements.txt +6 -0
- package/project/P/django/template.properties +5 -0
- package/project/P/django/template_en_US.properties +2 -0
- package/project/P/flask/.vscode/launch.json +24 -0
- package/project/P/flask/main.py +14 -0
- package/project/P/flask/project.svg +45 -0
- package/project/P/flask/requirements.txt +6 -0
- package/project/P/flask/template.properties +5 -0
- package/project/P/flask/template_en_US.properties +2 -0
- package/project/P/group.properties +4 -0
- package/project/P/python.png +0 -0
- package/project/P/scientific/.vscode/launch.json +15 -0
- package/project/P/scientific/README.md +0 -0
- package/project/P/scientific/main.py +27 -0
- package/project/P/scientific/project.png +0 -0
- package/project/P/scientific/project.svg +48 -0
- package/project/P/scientific/requirements.txt +2 -0
- package/project/P/scientific/template.properties +5 -0
- package/project/P/scientific/template_en_US.properties +2 -0
- package/project/W/cronapp-rad-project/.dockerignore +5 -0
- package/project/W/cronapp-rad-project/.gitignore.ftl +28 -0
- package/project/W/cronapp-rad-project/Dockerfile +26 -0
- package/project/W/cronapp-rad-project/Jenkinsfile +43 -0
- package/project/W/cronapp-rad-project/README.md +24 -0
- package/project/W/cronapp-rad-project/__copydata.ftl +22 -0
- package/project/W/cronapp-rad-project/config/__copydata.ftl +5 -0
- package/project/W/cronapp-rad-project/config/app.config.ftl +17 -0
- package/project/W/cronapp-rad-project/config/context.xml.ftl +27 -0
- package/project/W/cronapp-rad-project/config/test/Tests.side +59 -0
- package/project/W/cronapp-rad-project/diagram/__copydata.ftl +11 -0
- package/project/W/cronapp-rad-project/diagram/app.umlcd +4493 -0
- package/project/W/cronapp-rad-project/diagram/app.umlcd.ftl +1000 -0
- package/project/W/cronapp-rad-project/diagram/domain.umlcd +10596 -0
- package/project/W/cronapp-rad-project/docs/architecture/architecture.html +50 -0
- package/project/W/cronapp-rad-project/docs/architecture/img/layers.png +0 -0
- package/project/W/cronapp-rad-project/docs/login.prototype +24 -0
- package/project/W/cronapp-rad-project/pom.xml.ftl +236 -0
- package/project/W/cronapp-rad-project/project.svg +1 -0
- package/project/W/cronapp-rad-project/spring-boot.png +0 -0
- package/project/W/cronapp-rad-project/src/__copydata.ftl +7 -0
- package/project/W/cronapp-rad-project/src/main/__copydata.ftl +18 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/__copydata.ftl +7 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/customQuery.json.ftl +2192 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/__copydata.ftl +23 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/appUserManager.datasource.json +96 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/auditlogcleanup.datasource.json +103 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/auditlogquery.datasource.json +104 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/auth.datasource.json +120 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/device.datasource.json +96 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/keyManager.datasource.json +126 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/roleManager.datasource.json +255 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/roleSecurableManager.datasource.json +127 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/roleSecurables.datasource.json +158 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/roles.datasource.json +143 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/securableManager.datasource.json +127 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/securableViews.datasource.json +186 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/securables.datasource.json +134 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/userManager.datasource.json +271 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/userRoleManager.datasource.json +127 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/userSecurableManager.datasource.json +127 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/datasources/userSecurables.datasource.json +135 -0
- package/project/W/cronapp-rad-project/src/main/java/META-INF/persistence.xml.ftl +41 -0
- package/project/W/cronapp-rad-project/src/main/java/SpringBootMain.java.ftl +48 -0
- package/project/W/cronapp-rad-project/src/main/java/__copydata.ftl +26 -0
- package/project/W/cronapp-rad-project/src/main/java/app/AppConfiguration.java.ftl +66 -0
- package/project/W/cronapp-rad-project/src/main/java/app/__copydata.ftl +25 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/ApplicationDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/ApplicationUserDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/AuditLogDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/DeviceDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/LoginDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/RoleDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/RoleSecurableDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/SecurableDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/UserDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/UserRoleDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/UserSecurableDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/ViewDAO.java +24 -0
- package/project/W/cronapp-rad-project/src/main/java/app/dao/__copydata.ftl +34 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/Application.java +111 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/ApplicationUser.java +139 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/AuditLog.java +399 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/Device.java +241 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/Login.java +190 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/Role.java +218 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/RoleSecurable.java +139 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/Securable.java +139 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/User.java +565 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/UserRole.java +139 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/UserSecurable.java +139 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/View.java +375 -0
- package/project/W/cronapp-rad-project/src/main/java/app/entity/__copydata.ftl +34 -0
- package/project/W/cronapp-rad-project/src/main/java/app/populate.json.ftl +976 -0
- package/project/W/cronapp-rad-project/src/main/java/auth/permission/SecurityPermission.java.ftl +56 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/Application.blockly +12 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/Application.java +30 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/RoleManager.blockly +60 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/RoleManager.java +61 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/UserControl.blockly +90 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/UserControl.java +55 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/UserManager.blockly +79 -0
- package/project/W/cronapp-rad-project/src/main/java/blockly/UserManager.java +76 -0
- package/project/W/cronapp-rad-project/src/main/java/i18n/Messages.java +31 -0
- package/project/W/cronapp-rad-project/src/main/java/i18n/Messages_en_US.properties +56 -0
- package/project/W/cronapp-rad-project/src/main/java/i18n/Messages_pt_BR.properties +57 -0
- package/project/W/cronapp-rad-project/src/main/java/i18n/translate.string.ftl +1 -0
- package/project/W/cronapp-rad-project/src/main/java/social.properties +14 -0
- package/project/W/cronapp-rad-project/src/main/resources/application.properties +25 -0
- package/project/W/cronapp-rad-project/src/main/resources/templates/reset-password.ftlh +113 -0
- package/project/W/cronapp-rad-project/src/main/resources/templates/reset-password_pt_BR.ftlh +114 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/.bowerrc +4 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/bower.json +30 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/bowerscripts/clean_dependencies.js +3 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/bowerscripts/package-lock.json +187 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/bowerscripts/package.json +14 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/cronapp.json +1 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/css/app.css.ftl +0 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/i18n/locale_en_us.json +182 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/i18n/locale_pt_br.json +182 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/index.html.ftl +97 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/blockly/MutualAuth.blockly +21 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/blockly/MutualAuth.blockly.js +38 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/blockly/UserControl.blockly +129 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/blockly/UserControl.blockly.js +63 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/blockly/privacy/Cookies.blockly +417 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/blockly/privacy/Cookies.blockly.js +129 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/custom.controllers.js +11 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/customModules.js +1 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/js/events.js +0 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/admin/__copydata.ftl +3 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/admin/auditlog.search.view.html +95 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/admin/role.view.html +99 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/admin/user.view.html +130 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/error/403.view.html +13 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/error/404.view.html +13 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/logged/__copydata.ftl +1 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/logged/home.view.html.ftl +99 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/logged/home2.view.html.ftl +162 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/login.view.html.ftl +195 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/public/home.view.html.ftl +25 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/public/privacy/cookies.view.html +75 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/public/reset-password.view.html.ftl +30 -0
- package/project/W/cronapp-rad-project/src/main/webapp-autenticacao/webapp/views/public/signup.view.html +65 -0
- package/project/W/cronapp-rad-project/src/main/webapp-sem-autenticacao/webapp/__linksInherit +3 -0
- package/project/W/cronapp-rad-project/src/main/webapp-sem-autenticacao/webapp/cronapp.json +1 -0
- package/project/W/cronapp-rad-project/src/main/webapp-sem-autenticacao/webapp/index.html.ftl +84 -0
- package/project/W/cronapp-rad-project/src/main/webapp-sem-autenticacao/webapp/views/__linksInherit +1 -0
- package/project/W/cronapp-rad-project/src/main/webapp-sem-autenticacao/webapp/views/home.view.html.ftl +39 -0
- package/project/W/cronapp-rad-project/template.properties +116 -0
- package/project/W/cronapp-rad-project/template_en_US.properties +32 -0
- package/project/W/cronapp-rad-project/template_pt_BR.properties +32 -0
- package/project/W/group.properties +5 -0
- package/project/W/web.png +0 -0
- package/templates/low-code/aquamarine.png +0 -0
- package/templates/low-code/cerulean.png +0 -0
- package/templates/low-code/cosmo.png +0 -0
- package/templates/low-code/cyborg.png +0 -0
- package/templates/low-code/darkly.png +0 -0
- package/templates/low-code/data-layer/BUSINESS.ftl +340 -0
- package/templates/low-code/data-layer/DAO.ftl +46 -0
- package/templates/low-code/data-layer/ENTITIES.ftl +349 -0
- package/templates/low-code/data-layer/ENTITIESPK.ftl +119 -0
- package/templates/low-code/data-layer/Job.java.ftl +59 -0
- package/templates/low-code/data-layer/REST.ftl +359 -0
- package/templates/low-code/data-layer/RESTAPPLICATION.ftl +76 -0
- package/templates/low-code/data-layer/RESTWebService.ftl +106 -0
- package/templates/low-code/data-layer/RESTWebServicePageExample.ftl +64 -0
- package/templates/low-code/data-layer/SecurityPermission.java.ftl +43 -0
- package/templates/low-code/data-layer/SpringBootMain.java.ftl +44 -0
- package/templates/low-code/data-layer/TEST.ftl +9 -0
- package/templates/low-code/data-layer/dropbox/DROPBOX_CONSTANTS.ftl +1 -0
- package/templates/low-code/data-layer/dropbox/DROPBOX_DELETE.ftl +1 -0
- package/templates/low-code/data-layer/dropbox/DROPBOX_GET.ftl +1 -0
- package/templates/low-code/data-layer/dropbox/DROPBOX_LIST.ftl +1 -0
- package/templates/low-code/data-layer/dropbox/DROPBOX_POST.ftl +20 -0
- package/templates/low-code/data-layer/dropbox/DROPBOX_PUT.ftl +21 -0
- package/templates/low-code/data-layer/template.properties +58 -0
- package/templates/low-code/dsgov.png +0 -0
- package/templates/low-code/flatly.png +0 -0
- package/templates/low-code/fuse.png +0 -0
- package/templates/low-code/journal.png +0 -0
- package/templates/low-code/lumen.png +0 -0
- package/templates/low-code/material.png +0 -0
- package/templates/low-code/paper.png +0 -0
- package/templates/low-code/readable.png +0 -0
- package/templates/low-code/sandstone.png +0 -0
- package/templates/low-code/simplex.png +0 -0
- package/templates/low-code/slate.png +0 -0
- package/templates/low-code/spacelab.png +0 -0
- package/templates/low-code/superhero.png +0 -0
- package/templates/low-code/united.png +0 -0
- package/templates/low-code/yeti.png +0 -0
- package/user/.code/User/keybindings.json +3 -0
- package/user/.code/User/settings.json +6 -0
|
@@ -0,0 +1,1472 @@
|
|
|
1
|
+
angular.module('datasourcejs', [])
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Global factory responsible for managing all datasets
|
|
5
|
+
*/
|
|
6
|
+
.factory('DatasetManager', ['$http', '$q', '$timeout', '$rootScope', '$window', 'Notification', function($http, $q, $timeout, $rootScope, $window, Notification) {
|
|
7
|
+
// Global dataset List
|
|
8
|
+
this.datasets = {};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Class representing a single dataset
|
|
12
|
+
*/
|
|
13
|
+
var DataSet = function(name, scope) {
|
|
14
|
+
|
|
15
|
+
var NO_IMAGE_UPLOAD = "data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjEyOHB4IiBoZWlnaHQ9IjEyOHB4IiB2aWV3Qm94PSIwIDAgNDQuNTAyIDQ0LjUwMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDQuNTAyIDQ0LjUwMjsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnPgoJCTxwYXRoIGQ9Ik05Ljg2MiwzNS42MzhoMjQuNzc5YzAtNS41NDYtMy44NjMtMTAuMjAzLTkuMTEzLTExLjYwNGMyLjc1LTEuMjQ4LDQuNjY4LTQuMDEzLDQuNjY4LTcuMjI5ICAgIGMwLTQuMzg4LTMuNTU5LTcuOTQyLTcuOTQyLTcuOTQyYy00LjM4NywwLTcuOTQzLDMuNTU3LTcuOTQzLDcuOTQyYzAsMy4yMTksMS45MTYsNS45OCw0LjY2OCw3LjIyOSAgICBDMTMuNzI1LDI1LjQzNSw5Ljg2MiwzMC4wOTIsOS44NjIsMzUuNjM4eiIgZmlsbD0iIzkxOTE5MSIvPgoJCTxwYXRoIGQ9Ik0xLjUsMTQuMTY5YzAuODI4LDAsMS41LTAuNjcyLDEuNS0xLjVWNC4zMzNoOC4zMzZjMC44MjgsMCwxLjUtMC42NzIsMS41LTEuNWMwLTAuODI4LTAuNjcyLTEuNS0xLjUtMS41SDIuNzc1ICAgIEMxLjI0NCwxLjMzMywwLDIuNTc3LDAsNC4xMDh2OC41NjFDMCwxMy40OTcsMC42NywxNC4xNjksMS41LDE0LjE2OXoiIGZpbGw9IiM5MTkxOTEiLz4KCQk8cGF0aCBkPSJNNDEuNzI3LDEuMzMzaC04LjU2MmMtMC44MjcsMC0xLjUsMC42NzItMS41LDEuNWMwLDAuODI4LDAuNjczLDEuNSwxLjUsMS41aDguMzM2djguMzM2YzAsMC44MjgsMC42NzMsMS41LDEuNSwxLjUgICAgczEuNS0wLjY3MiwxLjUtMS41di04LjU2QzQ0LjUwMiwyLjU3OSw0My4yNTYsMS4zMzMsNDEuNzI3LDEuMzMzeiIgZmlsbD0iIzkxOTE5MSIvPgoJCTxwYXRoIGQ9Ik00My4wMDIsMzAuMzMzYy0wLjgyOCwwLTEuNSwwLjY3Mi0xLjUsMS41djguMzM2aC04LjMzNmMtMC44MjgsMC0xLjUsMC42NzItMS41LDEuNXMwLjY3MiwxLjUsMS41LDEuNWg4LjU2ICAgIGMxLjUzLDAsMi43NzYtMS4yNDYsMi43NzYtMi43NzZ2LTguNTZDNDQuNTAyLDMxLjAwNSw0My44MywzMC4zMzMsNDMuMDAyLDMwLjMzM3oiIGZpbGw9IiM5MTkxOTEiLz4KCQk8cGF0aCBkPSJNMTEuMzM2LDQwLjE2OUgzdi04LjMzNmMwLTAuODI4LTAuNjcyLTEuNS0xLjUtMS41Yy0wLjgzLDAtMS41LDAuNjcyLTEuNSwxLjV2OC41NmMwLDEuNTMsMS4yNDQsMi43NzYsMi43NzUsMi43NzZoOC41NjEgICAgYzAuODI4LDAsMS41LTAuNjcyLDEuNS0xLjVTMTIuMTY1LDQwLjE2OSwxMS4zMzYsNDAuMTY5eiIgZmlsbD0iIzkxOTE5MSIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=";
|
|
16
|
+
|
|
17
|
+
var NO_FILE_UPLOAD = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNTQ4LjE3NiA1NDguMTc2IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1NDguMTc2IDU0OC4xNzY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNNTI0LjMyNiwyOTcuMzUyYy0xNS44OTYtMTkuODktMzYuMjEtMzIuNzgyLTYwLjk1OS0zOC42ODRjNy44MS0xMS44LDExLjcwNC0yNC45MzQsMTEuNzA0LTM5LjM5OSAgIGMwLTIwLjE3Ny03LjEzOS0zNy40MDEtMjEuNDA5LTUxLjY3OGMtMTQuMjczLTE0LjI3Mi0zMS40OTgtMjEuNDExLTUxLjY3NS0yMS40MTFjLTE4LjA4MywwLTMzLjg3OSw1LjkwMS00Ny4zOSwxNy43MDMgICBjLTExLjIyNS0yNy40MS0yOS4xNzEtNDkuMzkzLTUzLjgxNy02NS45NWMtMjQuNjQ2LTE2LjU2Mi01MS44MTgtMjQuODQyLTgxLjUxNC0yNC44NDJjLTQwLjM0OSwwLTc0LjgwMiwxNC4yNzktMTAzLjM1Myw0Mi44MyAgIGMtMjguNTUzLDI4LjU0NC00Mi44MjUsNjIuOTk5LTQyLjgyNSwxMDMuMzUxYzAsMi40NzQsMC4xOTEsNi41NjcsMC41NzEsMTIuMjc1Yy0yMi40NTksMTAuNDY5LTQwLjM0OSwyNi4xNzEtNTMuNjc2LDQ3LjEwNiAgIEM2LjY2MSwyOTkuNTk0LDAsMzIyLjQzLDAsMzQ3LjE3OWMwLDM1LjIxNCwxMi41MTcsNjUuMzI5LDM3LjU0NCw5MC4zNThjMjUuMDI4LDI1LjAzNyw1NS4xNSwzNy41NDgsOTAuMzYyLDM3LjU0OGgzMTAuNjM2ICAgYzMwLjI1OSwwLDU2LjA5Ni0xMC43MTEsNzcuNTEyLTMyLjEyYzIxLjQxMy0yMS40MDksMzIuMTIxLTQ3LjI0NiwzMi4xMjEtNzcuNTE2QzU0OC4xNzIsMzM5Ljk0NCw1NDAuMjIzLDMxNy4yNDgsNTI0LjMyNiwyOTcuMzUyICAgeiBNMzYyLjcyOSwyODkuNjQ4Yy0xLjgxMywxLjgwNC0zLjk0OSwyLjcwNy02LjQyLDIuNzA3aC02My45NTN2MTAwLjUwMmMwLDIuNDcxLTAuOTAzLDQuNjEzLTIuNzExLDYuNDIgICBjLTEuODEzLDEuODEzLTMuOTQ5LDIuNzExLTYuNDIsMi43MTFoLTU0LjgyNmMtMi40NzQsMC00LjYxNS0wLjg5Ny02LjQyMy0yLjcxMWMtMS44MDQtMS44MDctMi43MTItMy45NDktMi43MTItNi40MlYyOTIuMzU1ICAgSDE1NS4zMWMtMi42NjIsMC00Ljg1My0wLjg1NS02LjU2My0yLjU2M2MtMS43MTMtMS43MTQtMi41NjgtMy45MDQtMi41NjgtNi41NjZjMC0yLjI4NiwwLjk1LTQuNTcyLDIuODUyLTYuODU1bDEwMC4yMTMtMTAwLjIxICAgYzEuNzEzLTEuNzE0LDMuOTAzLTIuNTcsNi41NjctMi41N2MyLjY2NiwwLDQuODU2LDAuODU2LDYuNTY3LDIuNTdsMTAwLjQ5OSwxMDAuNDk1YzEuNzE0LDEuNzEyLDIuNTYyLDMuOTAxLDIuNTYyLDYuNTcxICAgQzM2NS40MzgsMjg1LjY5NiwzNjQuNTM1LDI4Ny44NDUsMzYyLjcyOSwyODkuNjQ4eiIgZmlsbD0iI2NlY2VjZSIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=";
|
|
18
|
+
|
|
19
|
+
// Publiic members
|
|
20
|
+
this.Notification = Notification;
|
|
21
|
+
this.$scope = scope;
|
|
22
|
+
this.noImageUpload = NO_IMAGE_UPLOAD;
|
|
23
|
+
this.noFileUpload = NO_FILE_UPLOAD;
|
|
24
|
+
|
|
25
|
+
this.$apply = function(fc) {
|
|
26
|
+
scope.$apply(fc);
|
|
27
|
+
}.bind(scope);
|
|
28
|
+
|
|
29
|
+
this.data = [];
|
|
30
|
+
this.name = name;
|
|
31
|
+
this.keys = [];
|
|
32
|
+
this.enabled = true;
|
|
33
|
+
this.endpoint = null;
|
|
34
|
+
this.active = {};
|
|
35
|
+
this.inserting = false;
|
|
36
|
+
this.editing = false;
|
|
37
|
+
this.fetchSize = 2;
|
|
38
|
+
this.observers = [];
|
|
39
|
+
this.rowsPerPage = null;
|
|
40
|
+
this.append = true;
|
|
41
|
+
this.headers = null;
|
|
42
|
+
this._activeValues = null;
|
|
43
|
+
this.errorMessage = "";
|
|
44
|
+
this.onError = null;
|
|
45
|
+
this.links = null;
|
|
46
|
+
this.loadedFinish = null;
|
|
47
|
+
this.lastFilterParsed = null;
|
|
48
|
+
|
|
49
|
+
// Private members
|
|
50
|
+
var cursor = 0;
|
|
51
|
+
var service = null;
|
|
52
|
+
var _savedProps;
|
|
53
|
+
var hasMoreResults = false;
|
|
54
|
+
var busy = false;
|
|
55
|
+
var loaded = false;
|
|
56
|
+
var _self = this;
|
|
57
|
+
var unregisterDataWatch = null;
|
|
58
|
+
var dependentBufferLazyPostData = null; //TRM
|
|
59
|
+
var lastAction = null; //TRM
|
|
60
|
+
var dependentData = null; //TRM
|
|
61
|
+
|
|
62
|
+
// Public methods
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Initialize a single datasource
|
|
66
|
+
*/
|
|
67
|
+
this.init = function() {
|
|
68
|
+
|
|
69
|
+
var dsScope = this;
|
|
70
|
+
|
|
71
|
+
// Get the service resource
|
|
72
|
+
service = {
|
|
73
|
+
save: function(object) {
|
|
74
|
+
return this.call(_self.entity, "POST", object, true);
|
|
75
|
+
},
|
|
76
|
+
update: function(url, object) {
|
|
77
|
+
return this.call(url, "PUT", object);
|
|
78
|
+
},
|
|
79
|
+
remove: function(url) {
|
|
80
|
+
return this.call(url, "DELETE", null, true);
|
|
81
|
+
},
|
|
82
|
+
call: function(url, verb, object, applyScope) {
|
|
83
|
+
var _callback;
|
|
84
|
+
busy = true;
|
|
85
|
+
url = url.replace('/specificSearch','');
|
|
86
|
+
url = url.replace('/generalSearch','');
|
|
87
|
+
|
|
88
|
+
// Get an ajax promise
|
|
89
|
+
this.$promise = $http({
|
|
90
|
+
method: verb,
|
|
91
|
+
url: (window.hostApp || "") + url,
|
|
92
|
+
data : (object) ? JSON.stringify(object) : null,
|
|
93
|
+
headers: _self.headers
|
|
94
|
+
}).success(function(data, status, headers, config) {
|
|
95
|
+
busy = false;
|
|
96
|
+
if(_callback) _callback(data);
|
|
97
|
+
}).error(function(data, status, headers, config) {
|
|
98
|
+
busy = false;
|
|
99
|
+
_self.handleError(data);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
this.$promise.then = function(callback) {
|
|
103
|
+
_callback = callback;
|
|
104
|
+
}
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Check if the datasource is waiting for any request response
|
|
111
|
+
*/
|
|
112
|
+
this.isBusy = function() {
|
|
113
|
+
return busy;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Check if the datasource was loaded by service
|
|
118
|
+
*/
|
|
119
|
+
this.isLoaded = function() {
|
|
120
|
+
return loaded;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
this.toString = function() {
|
|
124
|
+
return "[Datasource]"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.handleAfterCallBack = function(callBackFunction) {
|
|
128
|
+
if (callBackFunction) {
|
|
129
|
+
try {
|
|
130
|
+
var indexFunc = callBackFunction.indexOf('(') == -1 ? callBackFunction.length : callBackFunction.indexOf('(');
|
|
131
|
+
var func = eval(callBackFunction.substring(0, indexFunc));
|
|
132
|
+
var isFunc = typeof(func) === 'function';
|
|
133
|
+
if (isFunc) func.call(this, this);
|
|
134
|
+
} catch (e) {
|
|
135
|
+
this.handleError(e);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this.handleBeforeCallBack = function(callBackFunction) {
|
|
141
|
+
var isValid = true;
|
|
142
|
+
if (callBackFunction) {
|
|
143
|
+
try {
|
|
144
|
+
var indexFunc = callBackFunction.indexOf('(') == -1 ? callBackFunction.length : callBackFunction.indexOf('(');
|
|
145
|
+
var func = eval(callBackFunction.substring(0, indexFunc));
|
|
146
|
+
var isFunc = typeof(func) === 'function';
|
|
147
|
+
if (isFunc) func.call(this, this.active);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
isValid = false;
|
|
150
|
+
this.handleError(e);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return isValid;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Error Handler function
|
|
158
|
+
*/
|
|
159
|
+
this.handleError = function(data) {
|
|
160
|
+
console.log(data);
|
|
161
|
+
|
|
162
|
+
var error = "";
|
|
163
|
+
|
|
164
|
+
if (data) {
|
|
165
|
+
if (Object.prototype.toString.call(data) === "[object String]") {
|
|
166
|
+
error = data;
|
|
167
|
+
} else {
|
|
168
|
+
var errorMsg = (data.msg || data.desc || data.message || data.error || data.responseText);
|
|
169
|
+
if (errorMsg) {
|
|
170
|
+
error = errorMsg;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (!error) {
|
|
176
|
+
error = this.defaultNotSpecifiedErrorMessage;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
var regex = /<h1>(.*)<\/h1>/gmi;
|
|
180
|
+
result = regex.exec(error);
|
|
181
|
+
|
|
182
|
+
if (result && result.length >= 2) {
|
|
183
|
+
error = result[1];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
this.errorMessage = error;
|
|
187
|
+
|
|
188
|
+
if (this.onError && this.onError != '') {
|
|
189
|
+
if (typeof(this.onError) === 'string') {
|
|
190
|
+
try {
|
|
191
|
+
var indexFunc = this.onError.indexOf('(') == -1 ? this.onError.length : this.onError.indexOf('(');
|
|
192
|
+
var func = eval(this.onError.substring(0, indexFunc));
|
|
193
|
+
if (typeof(func) === 'function') {
|
|
194
|
+
this.onError = func;
|
|
195
|
+
}
|
|
196
|
+
} catch (e) {
|
|
197
|
+
isValid = false;
|
|
198
|
+
Notification.error(e);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
this.onError = function(error) {
|
|
203
|
+
Notification.error(error);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
this.onError.call(this, error);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Start watching for changes in activeRow to notify observers
|
|
211
|
+
if (this.observers && this.observers.length > 0) {
|
|
212
|
+
$rootScope.$watch(function() {
|
|
213
|
+
return this.active;
|
|
214
|
+
}.bind(this), function(activeRow) {
|
|
215
|
+
if (activeRow) {
|
|
216
|
+
this.notifyObservers(activeRow);
|
|
217
|
+
}
|
|
218
|
+
}.bind(this), true);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
//Public methods
|
|
223
|
+
|
|
224
|
+
this.setFile = function($file, object, field) {
|
|
225
|
+
if ($file && $file.$error === 'pattern') {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if ($file) {
|
|
229
|
+
toBase64($file, function(base64Data) {
|
|
230
|
+
this.$apply = function(value) {
|
|
231
|
+
object[field] = value;
|
|
232
|
+
scope.$apply(object);
|
|
233
|
+
}.bind(scope);
|
|
234
|
+
this.$apply(base64Data);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
this.downloadFile = function(field, keys) {
|
|
240
|
+
if (keys === undefined)
|
|
241
|
+
return;
|
|
242
|
+
var url = (window.hostApp || "") + this.entity + "/download/" + field;
|
|
243
|
+
for (var index = 0; index < keys.length; index++) {
|
|
244
|
+
url += "/" + keys[index];
|
|
245
|
+
}
|
|
246
|
+
var req = {
|
|
247
|
+
url: url,
|
|
248
|
+
method: 'GET',
|
|
249
|
+
responseType: 'arraybuffer'
|
|
250
|
+
};
|
|
251
|
+
$http(req).then(function(result) {
|
|
252
|
+
var blob = new Blob([result.data], {
|
|
253
|
+
type: 'application/*'
|
|
254
|
+
});
|
|
255
|
+
$window.open(URL.createObjectURL(blob));
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
function toBase64(file, cb) {
|
|
260
|
+
var fileReader = new FileReader();
|
|
261
|
+
fileReader.readAsDataURL(file);
|
|
262
|
+
fileReader.onload = function(e) {
|
|
263
|
+
var base64Data = e.target.result.substr(e.target.result.indexOf('base64,') + 'base64,'.length);
|
|
264
|
+
cb(base64Data);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
this.openImage = function(data) {
|
|
269
|
+
$window.open('data:image/png;base64,' + data, '_blank', 'height=300,width=400');
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
this.byteSize = function(base64String) {
|
|
273
|
+
if (!angular.isString(base64String)) {
|
|
274
|
+
return '';
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function endsWith(suffix, str) {
|
|
278
|
+
return str.indexOf(suffix, str.length - suffix.length) !== -1;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function paddingSize(base64String) {
|
|
282
|
+
if (endsWith('==', base64String)) {
|
|
283
|
+
return 2;
|
|
284
|
+
}
|
|
285
|
+
if (endsWith('=', base64String)) {
|
|
286
|
+
return 1;
|
|
287
|
+
}
|
|
288
|
+
return 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function size(base64String) {
|
|
292
|
+
return base64String.length / 4 * 3 - paddingSize(base64String);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function formatAsBytes(size) {
|
|
296
|
+
return size.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ') + ' bytes';
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return formatAsBytes(size(base64String));
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Append a new value to the end of this dataset.
|
|
304
|
+
*/
|
|
305
|
+
this.insert = function(obj, callback) {
|
|
306
|
+
if (this.handleBeforeCallBack(this.onBeforeCreate)) {
|
|
307
|
+
//Check if contains dependentBy, if contains, only store in data TRM
|
|
308
|
+
if (this.dependentLazyPost && this.dependentLazyPostField && (eval(this.dependentLazyPost).inserting || eval(this.dependentLazyPost).editing)) {
|
|
309
|
+
var random = Math.floor(Math.random() * 9999) + 1;
|
|
310
|
+
obj.tempBufferId = random;
|
|
311
|
+
|
|
312
|
+
if (callback)
|
|
313
|
+
callback(obj);
|
|
314
|
+
|
|
315
|
+
if (!this.dependentBufferLazyPostData)
|
|
316
|
+
this.dependentBufferLazyPostData = [];
|
|
317
|
+
|
|
318
|
+
this.dependentBufferLazyPostData.push(obj);
|
|
319
|
+
} else {
|
|
320
|
+
service.save(obj).$promise.then(callback);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
//Public methods
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Append a datasource to be notify when has a post or cancel
|
|
329
|
+
*/
|
|
330
|
+
this.addDependentData = function(obj) {
|
|
331
|
+
if (!this.dependentData)
|
|
332
|
+
this.dependentData = [];
|
|
333
|
+
this.dependentData.push(obj);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
//TRM
|
|
337
|
+
this.storeAndResetDependentBuffer = function(action) {
|
|
338
|
+
var thisContextDataSet = this;
|
|
339
|
+
if (action == 'post' && thisContextDataSet.dependentBufferLazyPostData) {
|
|
340
|
+
|
|
341
|
+
$(thisContextDataSet.dependentBufferLazyPostData).each(function() {
|
|
342
|
+
this[thisContextDataSet.dependentLazyPostField] = eval(thisContextDataSet.dependentLazyPost).active;
|
|
343
|
+
|
|
344
|
+
if (thisContextDataSet.entity.indexOf('//') > -1) {
|
|
345
|
+
var keyObj = getKeyValues(eval(thisContextDataSet.dependentLazyPost).active);
|
|
346
|
+
var suffixPath = '';
|
|
347
|
+
for (var key in keyObj) {
|
|
348
|
+
if (keyObj.hasOwnProperty(key)) {
|
|
349
|
+
suffixPath += '/' + keyObj[key];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
suffixPath += '/';
|
|
353
|
+
thisContextDataSet.entity = thisContextDataSet.entity.replace('//', suffixPath);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
thisContextDataSet.insert(this);
|
|
357
|
+
});
|
|
358
|
+
busy = false;
|
|
359
|
+
this.editing = false;
|
|
360
|
+
this.inserting = false;
|
|
361
|
+
} else {
|
|
362
|
+
var indexObj = 0;
|
|
363
|
+
while (indexObj > -1) {
|
|
364
|
+
indexObj = -1;
|
|
365
|
+
for (var i = 0; i < thisContextDataSet.data.length; i++) {
|
|
366
|
+
if (thisContextDataSet.data[i].tempBufferId) {
|
|
367
|
+
indexObj = i;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (indexObj > -1)
|
|
372
|
+
thisContextDataSet.data.splice(indexObj, 1);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
thisContextDataSet.dependentBufferLazyPostData = null;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
//TRM
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Find object in list by tempBufferId
|
|
383
|
+
*/
|
|
384
|
+
this.getIndexOfListTempBuffer = function(list, obj) {
|
|
385
|
+
var indexObj = -1;
|
|
386
|
+
for (var i = 0; i < list.length; i++) {
|
|
387
|
+
if (list[i].tempBufferId && obj.tempBufferId && list[i].tempBufferId == obj.tempBufferId) {
|
|
388
|
+
indexObj = i;
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return indexObj;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Uptade a value into this dataset by using the dataset key to compare the objects.
|
|
397
|
+
*/
|
|
398
|
+
this.update = function(obj, callback) {
|
|
399
|
+
|
|
400
|
+
// Get the keys values
|
|
401
|
+
var keyObj = getKeyValues(obj);
|
|
402
|
+
|
|
403
|
+
//TRM
|
|
404
|
+
if (this.dependentBufferLazyPostData && obj.tempBufferId) {
|
|
405
|
+
var indexObj = this.getIndexOfListTempBuffer(this.dependentBufferLazyPostData, obj);
|
|
406
|
+
|
|
407
|
+
if (indexObj > -1) {
|
|
408
|
+
this.dependentBufferLazyPostData.splice(indexObj, 1);
|
|
409
|
+
this.dependentBufferLazyPostData.push(obj);
|
|
410
|
+
indexObj = this.getIndexOfListTempBuffer(this.data, obj);
|
|
411
|
+
this.data.splice(indexObj, 1);
|
|
412
|
+
//this.data.push(obj);
|
|
413
|
+
this.data.splice(indexObj, 0, obj);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
var url = this.entity;
|
|
419
|
+
|
|
420
|
+
var suffixPath = "";
|
|
421
|
+
for (var key in keyObj) {
|
|
422
|
+
if (keyObj.hasOwnProperty(key)) {
|
|
423
|
+
suffixPath += "/" + keyObj[key];
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (!this.dependentLazyPost)
|
|
428
|
+
url = url + suffixPath;
|
|
429
|
+
|
|
430
|
+
if (this.handleBeforeCallBack(this.onBeforeUpdate)) {
|
|
431
|
+
service.update(url, obj).$promise.then(callback);
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Valid if required field is valid
|
|
437
|
+
*/
|
|
438
|
+
this.missingRequiredField = function() {
|
|
439
|
+
return $('[required][ng-model*="' + this.name + '."]').hasClass('ng-invalid-required') || $('[required][ng-model*="' + this.name + '."]').hasClass('ng-invalid') ||
|
|
440
|
+
$('[required][ng-model*="' + this.name + '."]').hasClass('ng-empty');
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Valid is other validations like email, date and so on
|
|
445
|
+
*/
|
|
446
|
+
this.hasInvalidField = function() {
|
|
447
|
+
return $('input[ng-model*="' + this.name + '."]:invalid').size() > 0;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Insert or update based on the the datasource state
|
|
452
|
+
*/
|
|
453
|
+
this.post = function() {
|
|
454
|
+
|
|
455
|
+
if (this.missingRequiredField())
|
|
456
|
+
return;
|
|
457
|
+
|
|
458
|
+
if (this.hasInvalidField())
|
|
459
|
+
return;
|
|
460
|
+
|
|
461
|
+
this.lastAction = "post"; //TRM
|
|
462
|
+
|
|
463
|
+
busy = true;
|
|
464
|
+
|
|
465
|
+
if (this.inserting) {
|
|
466
|
+
// Make a new request to persist the new item
|
|
467
|
+
this.insert(this.active, function(obj) {
|
|
468
|
+
// In case of success add the new inserted value at
|
|
469
|
+
// the end of the array
|
|
470
|
+
this.data.push(obj);
|
|
471
|
+
// The new object is now the active
|
|
472
|
+
this.active = obj;
|
|
473
|
+
this.handleAfterCallBack(this.onAfterCreate);
|
|
474
|
+
this.onBackNomalState();
|
|
475
|
+
|
|
476
|
+
if (this.dependentData) {
|
|
477
|
+
$(this.dependentData).each(function() {
|
|
478
|
+
this.storeAndResetDependentBuffer('post');
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
}.bind(this));
|
|
483
|
+
|
|
484
|
+
} else if (this.editing) {
|
|
485
|
+
// Make a new request to update the modified item
|
|
486
|
+
this.update(this.active, function(obj) {
|
|
487
|
+
// Get the list of keys
|
|
488
|
+
var keyObj = getKeyValues(obj);
|
|
489
|
+
|
|
490
|
+
// For each row data
|
|
491
|
+
this.data.forEach(function(currentRow) {
|
|
492
|
+
// Iterate all keys checking if the
|
|
493
|
+
// current object match with the
|
|
494
|
+
// extracted key values
|
|
495
|
+
var found;
|
|
496
|
+
for (var key in keyObj) {
|
|
497
|
+
if (currentRow[key] && currentRow[key] === keyObj[key]) {
|
|
498
|
+
found = true;
|
|
499
|
+
} else {
|
|
500
|
+
found = false;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if (found) {
|
|
505
|
+
this.copy(obj, currentRow);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
this.handleAfterCallBack(this.onAfterUpdate);
|
|
509
|
+
}.bind(this));
|
|
510
|
+
|
|
511
|
+
this.onBackNomalState();
|
|
512
|
+
|
|
513
|
+
if (this.dependentData) {
|
|
514
|
+
$(this.dependentData).each(function() {
|
|
515
|
+
this.storeAndResetDependentBuffer('post');
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
}.bind(this));
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
// Set this datasource back to the normal state
|
|
524
|
+
this.onBackNomalState = function() {
|
|
525
|
+
busy = false;
|
|
526
|
+
this.editing = false;
|
|
527
|
+
this.inserting = false;
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Cancel the editing or inserting state
|
|
532
|
+
*/
|
|
533
|
+
this.cancel = function() {
|
|
534
|
+
if (this.inserting) {
|
|
535
|
+
if (cursor >= 0)
|
|
536
|
+
this.active = this.data[cursor];
|
|
537
|
+
else
|
|
538
|
+
this.active = {};
|
|
539
|
+
}
|
|
540
|
+
if (this.editing) {
|
|
541
|
+
this.active = this.lastActive;
|
|
542
|
+
}
|
|
543
|
+
this.onBackNomalState();
|
|
544
|
+
this.lastAction = "cancel"; //TRM
|
|
545
|
+
if (this.dependentData) {
|
|
546
|
+
$(this.dependentData).each(function() {
|
|
547
|
+
this.storeAndResetDependentBuffer();
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Put the datasource into the inserting state
|
|
554
|
+
*/
|
|
555
|
+
this.startInserting = function() {
|
|
556
|
+
this.inserting = true;
|
|
557
|
+
this.active = {};
|
|
558
|
+
if (this.onStartInserting) {
|
|
559
|
+
this.onStartInserting();
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Put the datasource into the editing state
|
|
565
|
+
*/
|
|
566
|
+
this.startEditing = function(item) {
|
|
567
|
+
if (item) {
|
|
568
|
+
this.active = this.copy(item);
|
|
569
|
+
this.lastActive = item;
|
|
570
|
+
} else {
|
|
571
|
+
this.lastActive = this.active;
|
|
572
|
+
this.active = this.copy(this.active);
|
|
573
|
+
}
|
|
574
|
+
this.editing = true;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Remove an object from this dataset by using the given id.
|
|
579
|
+
* the objects
|
|
580
|
+
*/
|
|
581
|
+
this.remove = function(object, callback) {
|
|
582
|
+
|
|
583
|
+
busy = true;
|
|
584
|
+
|
|
585
|
+
var _remove = function(object, callback) {
|
|
586
|
+
if (!object) {
|
|
587
|
+
object = this.active;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
var keyObj = getKeyValues(object);
|
|
591
|
+
|
|
592
|
+
//TRM
|
|
593
|
+
if (this.dependentBufferLazyPostData) {
|
|
594
|
+
if (this.dependentBufferLazyPostData.indexOf(object) > -1) {
|
|
595
|
+
var indexObj = this.dependentBufferLazyPostData.indexOf(object);
|
|
596
|
+
this.dependentBufferLazyPostData.splice(indexObj, 1);
|
|
597
|
+
indexObj = this.data.indexOf(object);
|
|
598
|
+
if (indexObj > -1)
|
|
599
|
+
this.data.splice(indexObj, 1);
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
var suffixPath = "";
|
|
605
|
+
for (var key in keyObj) {
|
|
606
|
+
if (keyObj.hasOwnProperty(key)) {
|
|
607
|
+
suffixPath += "/" + keyObj[key];
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
callback = callback || function() {
|
|
612
|
+
// For each row data
|
|
613
|
+
for (var i = 0; i < this.data.length; i++) {
|
|
614
|
+
// Iterate all keys checking if the
|
|
615
|
+
// current object match with the same
|
|
616
|
+
// vey values
|
|
617
|
+
// Check all keys
|
|
618
|
+
var found;
|
|
619
|
+
for (var key in keyObj) {
|
|
620
|
+
if (keyObj.hasOwnProperty(key)) {
|
|
621
|
+
if (this.data[i][key] && this.data[i][key] === keyObj[key]) {
|
|
622
|
+
found = true;
|
|
623
|
+
} else {
|
|
624
|
+
// There's a difference between the current object
|
|
625
|
+
// and the key values extracted from the object
|
|
626
|
+
// that we want to remove
|
|
627
|
+
found = false;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if (found) {
|
|
633
|
+
// If it's the object we're loking for
|
|
634
|
+
// remove it from the array
|
|
635
|
+
this.data.splice(i, 1)
|
|
636
|
+
this.active = (i > 0) ? this.data[i - 1] : null;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
this.onBackNomalState();
|
|
640
|
+
}
|
|
641
|
+
this.handleAfterCallBack(this.onAfterDelete);
|
|
642
|
+
}.bind(this)
|
|
643
|
+
|
|
644
|
+
if (this.handleBeforeCallBack(this.onBeforeDelete)) {
|
|
645
|
+
service.remove(this.entity + suffixPath).$promise.then(callback);
|
|
646
|
+
}
|
|
647
|
+
}.bind(this);
|
|
648
|
+
|
|
649
|
+
if (this.deleteMessage && this.deleteMessage.length > 0) {
|
|
650
|
+
if (confirm(this.deleteMessage)) {
|
|
651
|
+
_remove(object, callback);
|
|
652
|
+
} else {
|
|
653
|
+
this.filter();
|
|
654
|
+
}
|
|
655
|
+
} else {
|
|
656
|
+
_remove(object, callback);
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Get the object keys values from the datasource keylist
|
|
662
|
+
* PRIVATE FUNCTION
|
|
663
|
+
*/
|
|
664
|
+
var getKeyValues = function(rowData) {
|
|
665
|
+
var keys = this.keys;
|
|
666
|
+
|
|
667
|
+
var keyValues = {};
|
|
668
|
+
for (var i = 0; i < this.keys.length; i++) {
|
|
669
|
+
var key = this.keys[i];
|
|
670
|
+
var rowKey = rowData[key];
|
|
671
|
+
if(rowKey) {
|
|
672
|
+
keyValues[key] = rowData[key];
|
|
673
|
+
} else {
|
|
674
|
+
/*
|
|
675
|
+
[Arthemus]
|
|
676
|
+
Supondo que a chave da entidade é também uma FK (JoinColumn), deve-se buscar o sub-atributo desse objeto.
|
|
677
|
+
|
|
678
|
+
Ex:
|
|
679
|
+
key = 'object_id'
|
|
680
|
+
complexKey = [object, id]
|
|
681
|
+
*/
|
|
682
|
+
var complexKey = key.split("_");
|
|
683
|
+
for (var j = 0; j < complexKey.length; j++) {
|
|
684
|
+
var field = complexKey[j];
|
|
685
|
+
var _instance = rowData[field];
|
|
686
|
+
if(_instance) {
|
|
687
|
+
var _attribute = complexKey[j + 1];
|
|
688
|
+
if(_attribute) {
|
|
689
|
+
var realKey = _instance[_attribute];
|
|
690
|
+
if(realKey)
|
|
691
|
+
keyValues[field] = realKey;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return keyValues;
|
|
699
|
+
}.bind(this);
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Check if two objects are equals by comparing their keys PRIVATE FUNCTION.
|
|
703
|
+
*/
|
|
704
|
+
var objectIsEquals = function(object1, object2) {
|
|
705
|
+
var keys1 = getKeyValues(object1);
|
|
706
|
+
var keys2 = getKeyValues(object2);
|
|
707
|
+
for (var key in keys1) {
|
|
708
|
+
if (keys1.hasOwnProperty(key)) {
|
|
709
|
+
if (!keys2.hasOwnProperty(key)) return false;
|
|
710
|
+
if (keys1[key] !== keys2[key]) return false;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return true;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Check if the object has more itens to iterate
|
|
718
|
+
*/
|
|
719
|
+
this.hasNext = function() {
|
|
720
|
+
return this.data && (cursor < this.data.length - 1);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Check if the cursor is not at the beginning of the datasource
|
|
725
|
+
*/
|
|
726
|
+
this.hasPrevious = function() {
|
|
727
|
+
return this.data && (cursor > 0);
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Check if the object has more itens to iterate
|
|
732
|
+
*/
|
|
733
|
+
this.order = function(order) {
|
|
734
|
+
_savedProps.order = order;
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Get the values of the active row as an array.
|
|
739
|
+
* This method will ignore any keys and only return the values
|
|
740
|
+
*/
|
|
741
|
+
this.getActiveValues = function() {
|
|
742
|
+
if (this.active && !this._activeValues) {
|
|
743
|
+
$rootScope.$watch(function(scope) {
|
|
744
|
+
return this.active;
|
|
745
|
+
}.bind(this),
|
|
746
|
+
function(newValue, oldValue) {
|
|
747
|
+
this._activeValues = this.getRowValues(this.active);
|
|
748
|
+
}.bind(this), true);
|
|
749
|
+
}
|
|
750
|
+
return this._activeValues;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
this.__defineGetter__('activeValues', function() {
|
|
754
|
+
return _self.getActiveValues();
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Get the values of the given row
|
|
759
|
+
*/
|
|
760
|
+
this.getRowValues = function(rowData) {
|
|
761
|
+
var arr = [];
|
|
762
|
+
for (var i in rowData) {
|
|
763
|
+
if (rowData.hasOwnProperty(i)) {
|
|
764
|
+
arr.push(rowData[i]);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return arr;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Get the current item moving the cursor to the next element
|
|
772
|
+
*/
|
|
773
|
+
this.next = function() {
|
|
774
|
+
if (!this.hasNext()) {
|
|
775
|
+
this.nextPage();
|
|
776
|
+
}
|
|
777
|
+
this.active = this.copy(this.data[++cursor], {});
|
|
778
|
+
return this.active;
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Try to fetch the previous page
|
|
783
|
+
*/
|
|
784
|
+
this.nextPage = function() {
|
|
785
|
+
if (!this.hasNextPage()) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
if (this.apiVersion == 1) {
|
|
789
|
+
this.offset = parseInt(this.offset) + parseInt(this.rowsPerPage);
|
|
790
|
+
} else {
|
|
791
|
+
this.offset = parseInt(this.offset) + 1;
|
|
792
|
+
}
|
|
793
|
+
this.fetch(_savedProps, {
|
|
794
|
+
success: function(data) {
|
|
795
|
+
if (!data || data.length < parseInt(this.rowsPerPage)) {
|
|
796
|
+
if (this.apiVersion == 1) {
|
|
797
|
+
this.offset = parseInt(this.offset) - this.data.length;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}, true);
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Try to fetch the previous page
|
|
806
|
+
*/
|
|
807
|
+
this.prevPage = function() {
|
|
808
|
+
if (!this.append && !this.preppend) {
|
|
809
|
+
this.offset = parseInt(this.offset) - this.data.length;
|
|
810
|
+
|
|
811
|
+
if (this.offset < 0) {
|
|
812
|
+
this.offset = 0;
|
|
813
|
+
} else if (this.offset >= 0) {
|
|
814
|
+
this.fetch(_savedProps, {
|
|
815
|
+
success: function(data) {
|
|
816
|
+
if (!data || data.length === 0) {
|
|
817
|
+
this.offset = 0;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}, true);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Check if has more pages
|
|
827
|
+
*/
|
|
828
|
+
this.hasNextPage = function() {
|
|
829
|
+
return hasMoreResults && (this.rowsPerPage != -1);
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Check if has previews pages
|
|
834
|
+
*/
|
|
835
|
+
this.hasPrevPage = function() {
|
|
836
|
+
return this.offset > 0 && !this.append && !this.prepend;
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Get the previous item
|
|
841
|
+
*/
|
|
842
|
+
this.previous = function() {
|
|
843
|
+
if (!this.hasPrevious()) throw "Dataset Overflor Error";
|
|
844
|
+
this.active = this.copy(this.data[--cursor], {});
|
|
845
|
+
return this.active;
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Moves the cursor to the specified item
|
|
850
|
+
*/
|
|
851
|
+
this.goTo = function(rowId) {
|
|
852
|
+
for (var i = 0; i < this.data.length; i++) {
|
|
853
|
+
if (this.data[i][this.key] === rowId) {
|
|
854
|
+
cursor = i;
|
|
855
|
+
this.active = this.copy(this.data[cursor], {});
|
|
856
|
+
return this.active;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Get the current cursor index
|
|
863
|
+
*/
|
|
864
|
+
this.getCursor = function() {
|
|
865
|
+
return cursor;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* filter dataset by URL
|
|
870
|
+
*/
|
|
871
|
+
this.filter = function(url) {
|
|
872
|
+
var oldoffset = this.offset;
|
|
873
|
+
this.offset = 0;
|
|
874
|
+
this.fetch({
|
|
875
|
+
path: url
|
|
876
|
+
}, {
|
|
877
|
+
beforeFill: function(oldData) {
|
|
878
|
+
this.cleanup();
|
|
879
|
+
},
|
|
880
|
+
error: function(error) {
|
|
881
|
+
this.offset = oldoffset;
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* refresh dataset by URL and queryParams,
|
|
888
|
+
*/
|
|
889
|
+
this.refresh = function(query, url, minChar) {
|
|
890
|
+
this.cleanup();
|
|
891
|
+
if (minChar === undefined) {
|
|
892
|
+
minChar = 0;
|
|
893
|
+
}
|
|
894
|
+
if (query.length >= minChar) {
|
|
895
|
+
this.filter(url + "/" + query);
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Cleanup datasource
|
|
901
|
+
*/
|
|
902
|
+
this.cleanup = function() {
|
|
903
|
+
this.offset = 0;
|
|
904
|
+
this.data.length = 0;
|
|
905
|
+
this.cursor = -1;
|
|
906
|
+
this.active = {};
|
|
907
|
+
hasMoreResults = false;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Get the current row data
|
|
912
|
+
*/
|
|
913
|
+
this.current = function() {
|
|
914
|
+
return this.active || this.data[0];
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
this.getLink = function(rel) {
|
|
918
|
+
if (this.links) {
|
|
919
|
+
for (var i = 0; i < this.links.length; i++) {
|
|
920
|
+
if (this.links[i].rel == rel) {
|
|
921
|
+
return this.links[i].href;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Fetch all data from the server
|
|
929
|
+
*/
|
|
930
|
+
this.fetch = function(properties, callbacksObj, isNextOrPrev) {
|
|
931
|
+
|
|
932
|
+
// Ignore any call if the datasource is busy (fetching another request)
|
|
933
|
+
if (this.busy) return;
|
|
934
|
+
|
|
935
|
+
//Ignore call witouth ids if not http:// or https://
|
|
936
|
+
if (this.entity.indexOf('//') > -1 && this.entity.indexOf('://') < 0 ) return;
|
|
937
|
+
|
|
938
|
+
if (!this.enabled) {
|
|
939
|
+
this.cleanup();
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
var props = properties || {};
|
|
944
|
+
var callbacks = callbacksObj || {};
|
|
945
|
+
|
|
946
|
+
// Adjust property parameters and the endpoint url
|
|
947
|
+
props.params = props.params || {};
|
|
948
|
+
var resourceURL = (window.hostApp || "") + this.entity + (props.path || this.lastFilterParsed || "");
|
|
949
|
+
|
|
950
|
+
//Check request, if is dependentLazyPost, break old request
|
|
951
|
+
if (this.dependentLazyPost) {
|
|
952
|
+
if (eval(this.dependentLazyPost).active) {
|
|
953
|
+
var checkRequestId = '';
|
|
954
|
+
var keyDependentLazyPost = getKeyValues(eval(this.dependentLazyPost).active);
|
|
955
|
+
for (var key in keyDependentLazyPost) {
|
|
956
|
+
checkRequestId = keyDependentLazyPost[key]
|
|
957
|
+
break;
|
|
958
|
+
}
|
|
959
|
+
if (checkRequestId && checkRequestId.length > 0)
|
|
960
|
+
if (resourceURL.indexOf(checkRequestId) == -1)
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
// Set Limit and offset
|
|
966
|
+
if (this.rowsPerPage > 0) {
|
|
967
|
+
if (this.apiVersion == 1) {
|
|
968
|
+
props.params.limit = this.rowsPerPage;
|
|
969
|
+
props.params.offset = this.offset;
|
|
970
|
+
} else {
|
|
971
|
+
props.params.size = this.rowsPerPage;
|
|
972
|
+
props.params.page = this.offset;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
// Stop auto post for awhile
|
|
977
|
+
this.stopAutoPost();
|
|
978
|
+
|
|
979
|
+
// Store the last configuration for late use
|
|
980
|
+
_savedProps = props;
|
|
981
|
+
|
|
982
|
+
// Make the datasource busy
|
|
983
|
+
busy = true;
|
|
984
|
+
|
|
985
|
+
// Get an ajax promise
|
|
986
|
+
this.$promise = $http({
|
|
987
|
+
method: "GET",
|
|
988
|
+
url: resourceURL,
|
|
989
|
+
params: props.params,
|
|
990
|
+
headers: this.headers
|
|
991
|
+
}).success(function(data, status, headers, config) {
|
|
992
|
+
busy = false;
|
|
993
|
+
sucessHandler(data)
|
|
994
|
+
}.bind(this)).error(function(data, status, headers, config) {
|
|
995
|
+
busy = false;
|
|
996
|
+
this.handleError(data);
|
|
997
|
+
if (callbacks.error) callbacks.error.call(this, data);
|
|
998
|
+
}.bind(this));
|
|
999
|
+
|
|
1000
|
+
// Success Handler
|
|
1001
|
+
var sucessHandler = function(data) {
|
|
1002
|
+
if (this.entity.indexOf('//') > -1 && this.entity.indexOf('://') < 0)
|
|
1003
|
+
data = [];
|
|
1004
|
+
if (data) {
|
|
1005
|
+
if (Object.prototype.toString.call(data) !== '[object Array]') {
|
|
1006
|
+
if (data && data.links && Object.prototype.toString.call(data.content) === '[object Array]') {
|
|
1007
|
+
this.links = data.links;
|
|
1008
|
+
data = data.content;
|
|
1009
|
+
} else {
|
|
1010
|
+
data = [data];
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
} else {
|
|
1014
|
+
data = [];
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// Call the before fill callback
|
|
1018
|
+
if (callbacks.beforeFill) callbacks.beforeFill.apply(this, this.data);
|
|
1019
|
+
|
|
1020
|
+
if (isNextOrPrev) {
|
|
1021
|
+
// If prepend property was set.
|
|
1022
|
+
// Add the new data before the old one
|
|
1023
|
+
if (this.prepend) Array.prototype.unshift.apply(this.data, data);
|
|
1024
|
+
|
|
1025
|
+
// If append property was set.
|
|
1026
|
+
// Add the new data after the old one
|
|
1027
|
+
if (this.append) Array.prototype.push.apply(this.data, data);
|
|
1028
|
+
|
|
1029
|
+
// When neither nor preppend was set
|
|
1030
|
+
// Just replace the current data
|
|
1031
|
+
if (!this.prepend && !this.append) {
|
|
1032
|
+
Array.prototype.push.apply(this.data, data);
|
|
1033
|
+
if (this.data.length > 0) {
|
|
1034
|
+
this.active = data[0];
|
|
1035
|
+
cursor = 0;
|
|
1036
|
+
} else {
|
|
1037
|
+
this.active = {};
|
|
1038
|
+
cursor = -1;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
} else {
|
|
1042
|
+
this.cleanup();
|
|
1043
|
+
Array.prototype.push.apply(this.data, data);
|
|
1044
|
+
if (this.data.length > 0) {
|
|
1045
|
+
this.active = data[0];
|
|
1046
|
+
cursor = 0;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
if (callbacks.success) callbacks.success.call(this, data);
|
|
1051
|
+
|
|
1052
|
+
hasMoreResults = (data.length >= this.rowsPerPage);
|
|
1053
|
+
|
|
1054
|
+
if (this.apiVersion == 2) {
|
|
1055
|
+
hasMoreResults = this.getLink("next") != null;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/*
|
|
1059
|
+
* Register a watcher for data
|
|
1060
|
+
* if the autopost property was set
|
|
1061
|
+
* It means that any change on dataset items will
|
|
1062
|
+
* generate a new request on the server
|
|
1063
|
+
*/
|
|
1064
|
+
if (this.autoPost) {
|
|
1065
|
+
this.startAutoPost();
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
loaded = true;
|
|
1069
|
+
this.loadedFinish = true;
|
|
1070
|
+
this.handleAfterCallBack(this.onAfterFill);
|
|
1071
|
+
var thisDatasourceName = this.name;
|
|
1072
|
+
$('datasource').each(function(idx, elem){
|
|
1073
|
+
var dependentBy = null;
|
|
1074
|
+
var dependent = eval(elem.getAttribute('name'));
|
|
1075
|
+
if(elem.getAttribute('dependent-by') !== "" && elem.getAttribute('dependent-by') != null){
|
|
1076
|
+
try{
|
|
1077
|
+
dependentBy = JSON.parse(elem.getAttribute('dependent-by'));
|
|
1078
|
+
}catch(ex){
|
|
1079
|
+
dependentBy = eval(elem.getAttribute('dependent-by'));
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
if(dependentBy){
|
|
1083
|
+
if(dependentBy.name == thisDatasourceName){
|
|
1084
|
+
if(!dependent.filterURL)
|
|
1085
|
+
eval(dependent.name).fetch();
|
|
1086
|
+
//if has filter, the filter observer will be called
|
|
1087
|
+
}
|
|
1088
|
+
}else{
|
|
1089
|
+
console.log('O dependente '+elem.getAttribute('dependent-by')+' do pai '+thisDatasourceName+' ainda não existe.')
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
}.bind(this);
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Asynchronously notify observers
|
|
1098
|
+
*/
|
|
1099
|
+
this.notifyObservers = function() {
|
|
1100
|
+
for (var key in this.observers) {
|
|
1101
|
+
if (this.observers.hasOwnProperty(key)) {
|
|
1102
|
+
var dataset = this.observers[key];
|
|
1103
|
+
$timeout(function() {
|
|
1104
|
+
dataset.notify.call(dataset, this.active);
|
|
1105
|
+
}.bind(this), 1);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
this.notify = function(activeRow) {
|
|
1111
|
+
if (activeRow) {
|
|
1112
|
+
// Parse the filter using regex
|
|
1113
|
+
// to identify {params}
|
|
1114
|
+
var filter = this.watchFilter;
|
|
1115
|
+
var pattern = /\{([A-z][A-z|0-9]*)\}/gim;
|
|
1116
|
+
|
|
1117
|
+
// replace all params found by the
|
|
1118
|
+
// respectiveValues in activeRow
|
|
1119
|
+
filter = filter.replace(pattern, function(a, b) {
|
|
1120
|
+
return activeRow.hasOwnProperty(b) ? activeRow[b] : "";
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
this.fetch({
|
|
1124
|
+
params: {
|
|
1125
|
+
q: filter
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
this.addObserver = function(observer) {
|
|
1132
|
+
this.observers.push(observer);
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* Clone a JSON Object
|
|
1137
|
+
*/
|
|
1138
|
+
this.copy = function(from, to) {
|
|
1139
|
+
if (from === null || Object.prototype.toString.call(from) !== '[object Object]')
|
|
1140
|
+
return from;
|
|
1141
|
+
|
|
1142
|
+
to = to || {};
|
|
1143
|
+
|
|
1144
|
+
for (var key in from) {
|
|
1145
|
+
if (from.hasOwnProperty(key) && key.indexOf('$') == -1) {
|
|
1146
|
+
to[key] = this.copy(from[key]);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
return to;
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Used to monitore the this datasource data for change (insertion and deletion)
|
|
1155
|
+
*/
|
|
1156
|
+
this.startAutoPost = function() {
|
|
1157
|
+
unregisterDataWatch = $rootScope.$watch(function() {
|
|
1158
|
+
return this.data;
|
|
1159
|
+
}.bind(this), function(newData, oldData) {
|
|
1160
|
+
|
|
1161
|
+
if (!this.enabled) {
|
|
1162
|
+
unregisterDataWatch();
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// Get the difference between both arrays
|
|
1167
|
+
var difSize = newData.length - oldData.length;
|
|
1168
|
+
|
|
1169
|
+
if (difSize > 0) {
|
|
1170
|
+
// If the value is positive
|
|
1171
|
+
// Some item was added
|
|
1172
|
+
for (var i = 1; i <= difSize; i++) {
|
|
1173
|
+
// Make a new request
|
|
1174
|
+
this.insert(newData[newData.length - i], function() {});
|
|
1175
|
+
}
|
|
1176
|
+
} else if (difSize < 0) {
|
|
1177
|
+
// If it is negative
|
|
1178
|
+
// Some item was removed
|
|
1179
|
+
var removedItems = oldData.filter(function(oldItem) {
|
|
1180
|
+
return newData.filter(function(newItem) {
|
|
1181
|
+
return objectIsEquals(oldItem, newItem);
|
|
1182
|
+
}).length == 0;
|
|
1183
|
+
});
|
|
1184
|
+
|
|
1185
|
+
for (var i = 0; i < removedItems.length; i++) {
|
|
1186
|
+
this.remove(removedItems[i], function() {});
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}.bind(this));
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Unregister the data watcher
|
|
1194
|
+
*/
|
|
1195
|
+
this.stopAutoPost = function() {
|
|
1196
|
+
// Unregister any defined watcher on data variable
|
|
1197
|
+
if (unregisterDataWatch) {
|
|
1198
|
+
unregisterDataWatch();
|
|
1199
|
+
unregisterDataWatch = undefined;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
this.hasDataBuffered = function() {
|
|
1204
|
+
if (this.dependentBufferLazyPostData && this.dependentBufferLazyPostData.length > 0)
|
|
1205
|
+
return true;
|
|
1206
|
+
else
|
|
1207
|
+
return false;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
this.init();
|
|
1211
|
+
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Dataset Manager Methods
|
|
1216
|
+
*/
|
|
1217
|
+
this.storeDataset = function(dataset) {
|
|
1218
|
+
this.datasets[dataset.name] = dataset;
|
|
1219
|
+
},
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* Initialize a new dataset
|
|
1223
|
+
*/
|
|
1224
|
+
this.initDataset = function(props, scope) {
|
|
1225
|
+
|
|
1226
|
+
var endpoint = (props.endpoint) ? props.endpoint : "";
|
|
1227
|
+
var dts = new DataSet(props.name, scope);
|
|
1228
|
+
var defaultApiVersion = 1;
|
|
1229
|
+
|
|
1230
|
+
dts.entity = props.entity;
|
|
1231
|
+
if (app && app.config && app.config.datasourceApiVersion) {
|
|
1232
|
+
defaultApiVersion = app.config.datasourceApiVersion;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
dts.apiVersion = props.apiVersion ? parseInt(props.apiVersion) : defaultApiVersion;
|
|
1236
|
+
dts.keys = (props.keys && props.keys.length > 0) ? props.keys.split(",") : [];
|
|
1237
|
+
dts.rowsPerPage = props.rowsPerPage ? props.rowsPerPage : 100; // Default 100 rows per page
|
|
1238
|
+
dts.append = props.append;
|
|
1239
|
+
dts.prepend = props.prepend;
|
|
1240
|
+
dts.endpoint = props.endpoint;
|
|
1241
|
+
dts.filterURL = props.filterURL;
|
|
1242
|
+
dts.autoPost = props.autoPost;
|
|
1243
|
+
dts.deleteMessage = props.deleteMessage;
|
|
1244
|
+
dts.enabled = props.enabled;
|
|
1245
|
+
dts.offset = (props.offset) ? props.offset : 0; // Default offset is 0
|
|
1246
|
+
dts.onError = props.onError;
|
|
1247
|
+
dts.defaultNotSpecifiedErrorMessage = props.defaultNotSpecifiedErrorMessage;
|
|
1248
|
+
dts.onAfterFill = props.onAfterFill;
|
|
1249
|
+
dts.onBeforeCreate = props.onBeforeCreate;
|
|
1250
|
+
dts.onAfterCreate = props.onAfterCreate;
|
|
1251
|
+
dts.onBeforeUpdate = props.onBeforeUpdate;
|
|
1252
|
+
dts.onAfterUpdate = props.onAfterUpdate;
|
|
1253
|
+
dts.onBeforeDelete = props.onBeforeDelete;
|
|
1254
|
+
dts.onAfterDelete = props.onAfterDelete;
|
|
1255
|
+
dts.dependentBy = props.dependentBy;
|
|
1256
|
+
|
|
1257
|
+
if (props.dependentLazyPost && props.dependentLazyPost.length > 0) {
|
|
1258
|
+
dts.dependentLazyPost = props.dependentLazyPost;
|
|
1259
|
+
eval(dts.dependentLazyPost).addDependentData(dts);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
dts.dependentLazyPostField = props.dependentLazyPostField; //TRM
|
|
1263
|
+
|
|
1264
|
+
// Check for headers
|
|
1265
|
+
if (props.headers && props.headers.length > 0) {
|
|
1266
|
+
dts.headers = {};
|
|
1267
|
+
var headers = props.headers.trim().split(";");
|
|
1268
|
+
var header;
|
|
1269
|
+
for (var i = 0; i < headers.length; i++) {
|
|
1270
|
+
header = headers[i].split(":");
|
|
1271
|
+
if (header.length === 2) {
|
|
1272
|
+
dts.headers[header[0]] = header[1];
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
this.storeDataset(dts);
|
|
1278
|
+
dts.allowFetch = true;
|
|
1279
|
+
|
|
1280
|
+
if (dts.dependentBy && dts.dependentBy !== "" && dts.dependentBy.trim() !== "" ) {
|
|
1281
|
+
dts.allowFetch = false;
|
|
1282
|
+
|
|
1283
|
+
//if dependentBy was loaded, the filter in this ds not will be changed and the filter observer not will be called
|
|
1284
|
+
var dependentBy = null;
|
|
1285
|
+
try{
|
|
1286
|
+
dependentBy = JSON.parse(dependentBy);
|
|
1287
|
+
}catch(ex){
|
|
1288
|
+
dependentBy = eval(dependentBy);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
if(dependentBy && dependentBy.loadedFinish)
|
|
1292
|
+
dts.allowFetch = true;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
if (!props.lazy && dts.allowFetch && (Object.prototype.toString.call(props.watch) !== "[object String]") && !props.filterURL) {
|
|
1296
|
+
// Query string object
|
|
1297
|
+
var queryObj = {};
|
|
1298
|
+
|
|
1299
|
+
// Fill the dataset
|
|
1300
|
+
dts.fetch({
|
|
1301
|
+
params: queryObj
|
|
1302
|
+
}, {
|
|
1303
|
+
success: function(data) {
|
|
1304
|
+
if (data && data.length > 0) {
|
|
1305
|
+
this.active = data[0];
|
|
1306
|
+
this.cursor = 0;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
if (props.lazy && props.autoPost) {
|
|
1313
|
+
dts.startAutoPost();
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
if (props.watch && Object.prototype.toString.call(props.watch) === "[object String]") {
|
|
1317
|
+
this.registerObserver(props.watch, dts);
|
|
1318
|
+
dts.watchFilter = props.watchFilter;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
// Filter the dataset if the filter property was set
|
|
1322
|
+
if (props.filterURL && props.filterURL.length > 0 && dts.allowFetch) {
|
|
1323
|
+
dts.filter(props.filterURL);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// Add this instance into the root scope
|
|
1327
|
+
// This will expose the dataset name as a
|
|
1328
|
+
// global variable
|
|
1329
|
+
$rootScope[dts.name] = dts;
|
|
1330
|
+
window[dts.name] = dts;
|
|
1331
|
+
|
|
1332
|
+
return dts;
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Register a dataset as an observer to another one
|
|
1337
|
+
*/
|
|
1338
|
+
this.registerObserver = function(targetName, dataset) {
|
|
1339
|
+
this.datasets[targetName].addObserver(dataset);
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
return this;
|
|
1343
|
+
}])
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Cronus Dataset Directive
|
|
1347
|
+
*/
|
|
1348
|
+
.directive('datasource', ['DatasetManager', '$timeout', '$parse', 'Notification', '$translate', '$location', function(DatasetManager, $timeout, $parse, Notification, $translate, $location) {
|
|
1349
|
+
return {
|
|
1350
|
+
restrict: 'E',
|
|
1351
|
+
scope: true,
|
|
1352
|
+
template: '',
|
|
1353
|
+
link: function(scope, element, attrs) {
|
|
1354
|
+
var init = function() {
|
|
1355
|
+
|
|
1356
|
+
//Add in header the path from the request was executed
|
|
1357
|
+
var originPath = "origin-path:" + $location.path();
|
|
1358
|
+
if (attrs.headers === undefined || attrs.headers === null) {
|
|
1359
|
+
attrs.headers = originPath;
|
|
1360
|
+
} else {
|
|
1361
|
+
attrs.headers = attrs.headers.concat(";", originPath);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
var props = {
|
|
1365
|
+
name: attrs.name,
|
|
1366
|
+
entity: attrs.entity,
|
|
1367
|
+
apiVersion: attrs.apiVersion,
|
|
1368
|
+
enabled: (attrs.hasOwnProperty('enabled')) ? (attrs.enabled === "true") : true,
|
|
1369
|
+
keys: attrs.keys,
|
|
1370
|
+
endpoint: attrs.endpoint,
|
|
1371
|
+
lazy: (attrs.hasOwnProperty('lazy') && attrs.lazy === "") || attrs.lazy === "true",
|
|
1372
|
+
append: !attrs.hasOwnProperty('append') || attrs.append === "true",
|
|
1373
|
+
prepend: (attrs.hasOwnProperty('prepend') && attrs.prepend === "") || attrs.prepend === "true",
|
|
1374
|
+
watch: attrs.watch,
|
|
1375
|
+
rowsPerPage: attrs.rowsPerPage,
|
|
1376
|
+
offset: attrs.offset,
|
|
1377
|
+
filterURL: attrs.filter,
|
|
1378
|
+
watchFilter: attrs.watchFilter,
|
|
1379
|
+
deleteMessage: attrs.deleteMessage || attrs.deleteMessage === "" ? attrs.deleteMessage : $translate.instant('General.RemoveData'),
|
|
1380
|
+
headers: attrs.headers,
|
|
1381
|
+
autoPost: (attrs.hasOwnProperty('autoPost') && attrs.autoPost === "") || attrs.autoPost === "true",
|
|
1382
|
+
onError: attrs.onError,
|
|
1383
|
+
onAfterFill: attrs.onAfterFill,
|
|
1384
|
+
onBeforeCreate: attrs.onBeforeCreate,
|
|
1385
|
+
onAfterCreate: attrs.onAfterCreate,
|
|
1386
|
+
onBeforeUpdate: attrs.onBeforeUpdate,
|
|
1387
|
+
onAfterUpdate: attrs.onAfterUpdate,
|
|
1388
|
+
onBeforeDelete: attrs.onBeforeDelete,
|
|
1389
|
+
onAfterDelete: attrs.onAfterDelete,
|
|
1390
|
+
defaultNotSpecifiedErrorMessage: $translate.instant('General.ErrorNotSpecified'),
|
|
1391
|
+
dependentBy: attrs.dependentBy,
|
|
1392
|
+
dependentLazyPost: attrs.dependentLazyPost, //TRM
|
|
1393
|
+
dependentLazyPostField: attrs.dependentLazyPostField, //TRM
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
var firstLoad = {
|
|
1397
|
+
filter: true,
|
|
1398
|
+
entity: true,
|
|
1399
|
+
enabled: true
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
var datasource = DatasetManager.initDataset(props, scope);
|
|
1403
|
+
var timeoutPromise;
|
|
1404
|
+
|
|
1405
|
+
attrs.$observe('filter', function(value) {
|
|
1406
|
+
if (!firstLoad.filter) {
|
|
1407
|
+
// Stop the pending timeout
|
|
1408
|
+
$timeout.cancel(timeoutPromise);
|
|
1409
|
+
|
|
1410
|
+
// Start a timeout
|
|
1411
|
+
timeoutPromise = $timeout(function() {
|
|
1412
|
+
datasource.filter(value);
|
|
1413
|
+
datasource.lastFilterParsed = value;
|
|
1414
|
+
}, 200);
|
|
1415
|
+
} else {
|
|
1416
|
+
$timeout(function() {
|
|
1417
|
+
firstLoad.filter = false;
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
});
|
|
1421
|
+
|
|
1422
|
+
attrs.$observe('enabled', function(value) {
|
|
1423
|
+
if (!firstLoad.enabled) {
|
|
1424
|
+
datasource.enabled = (value === "true");
|
|
1425
|
+
datasource.fetch({
|
|
1426
|
+
params: {}
|
|
1427
|
+
});
|
|
1428
|
+
} else {
|
|
1429
|
+
$timeout(function() {
|
|
1430
|
+
firstLoad.enabled = false;
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
|
|
1435
|
+
attrs.$observe('entity', function(value) {
|
|
1436
|
+
datasource.entity = value;
|
|
1437
|
+
if (!firstLoad.entity) {
|
|
1438
|
+
// Only fetch if it's not the first load
|
|
1439
|
+
datasource.fetch({
|
|
1440
|
+
params: {}
|
|
1441
|
+
});
|
|
1442
|
+
} else {
|
|
1443
|
+
$timeout(function() {
|
|
1444
|
+
firstLoad.entity = false;
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
});
|
|
1448
|
+
|
|
1449
|
+
};
|
|
1450
|
+
init();
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
}])
|
|
1454
|
+
|
|
1455
|
+
.directive('crnDatasource', ['DatasetManager', '$parse', '$rootScope', function(DatasetManager, $parse, $rootScope) {
|
|
1456
|
+
return {
|
|
1457
|
+
restrict: 'A',
|
|
1458
|
+
scope: true,
|
|
1459
|
+
link: function(scope, element, attrs) {
|
|
1460
|
+
scope.data = DatasetManager.datasets;
|
|
1461
|
+
if (scope.data[attrs.crnDatasource]) {
|
|
1462
|
+
scope.datasource = scope.data[attrs.crnDatasource];
|
|
1463
|
+
} else {
|
|
1464
|
+
scope.datasource = {};
|
|
1465
|
+
scope.datasource.data = $parse(attrs.crnDatasource)(scope);
|
|
1466
|
+
}
|
|
1467
|
+
scope.$on('$destroy', function() {
|
|
1468
|
+
delete $rootScope[attrs.crnDatasource];
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
}]);
|