jruby_activiti 1.2.5 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.ruby-version +1 -1
- data/CHANGELOG +6 -0
- data/Jarfile +5 -0
- data/Jarfile.lock +52 -13
- data/README.md +21 -9
- data/java/build.md +3 -0
- data/java/mapping.md +20 -0
- data/java/pom.xml +30 -0
- data/java/src/main/java/jrubyactiviti/Modeler.java +95 -0
- data/java/src/main/java/jrubyactiviti/ProcessDiagram.java +491 -0
- data/java/src/main/java/jrubyactiviti/ProcessInstanceHighlights.java +237 -0
- data/java/src/main/java/jrubyactiviti/StencilsetResource.java +16 -0
- data/java/src/main/resources/stencilset.json +1339 -0
- data/jruby_activiti.gemspec +3 -2
- data/lib/generators/jruby_activiti/install_generator.rb +4 -0
- data/lib/jar/jrubyactiviti-2.0.jar +0 -0
- data/lib/jruby_activiti/version.rb +1 -1
- data/lib/jruby_activiti/web.rb +81 -0
- data/lib/jruby_activiti.rb +28 -20
- data/test/{base_test.rb → activiti_test.rb} +1 -3
- data/test/instance_hights_test.rb +18 -0
- data/test/modeler_test.rb +35 -0
- data/test/process_diagram_test.rb +33 -0
- data/test/resources/model_init_editor_source.json +1 -0
- data/test/resources/model_json_xml.json +278 -0
- data/test/resources/model_svg_xml.xml +66 -0
- data/test/stencilset_test.rb +7 -0
- data/test/test_helper.rb +2 -0
- data/web/public/diagram-viewer/images/bg.png +0 -0
- data/web/public/diagram-viewer/images/breadcrumbs.png +0 -0
- data/web/public/diagram-viewer/images/checker-bg.png +0 -0
- data/web/public/diagram-viewer/images/deployer/blue/message_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/business_rule.png +0 -0
- data/web/public/diagram-viewer/images/deployer/error_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/error_throw.png +0 -0
- data/web/public/diagram-viewer/images/deployer/manual.png +0 -0
- data/web/public/diagram-viewer/images/deployer/message_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/message_throw.png +0 -0
- data/web/public/diagram-viewer/images/deployer/receive.png +0 -0
- data/web/public/diagram-viewer/images/deployer/script.png +0 -0
- data/web/public/diagram-viewer/images/deployer/send.png +0 -0
- data/web/public/diagram-viewer/images/deployer/service.png +0 -0
- data/web/public/diagram-viewer/images/deployer/signal_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/signal_throw.png +0 -0
- data/web/public/diagram-viewer/images/deployer/timer.png +0 -0
- data/web/public/diagram-viewer/images/deployer/user.png +0 -0
- data/web/public/diagram-viewer/index.html +130 -0
- data/web/public/diagram-viewer/js/ActivitiRest.js +74 -0
- data/web/public/diagram-viewer/js/ActivityImpl.js +1 -0
- data/web/public/diagram-viewer/js/Color.js +603 -0
- data/web/public/diagram-viewer/js/LineBreakMeasurer.js +270 -0
- data/web/public/diagram-viewer/js/Polyline.js +387 -0
- data/web/public/diagram-viewer/js/ProcessDiagramCanvas.js +2172 -0
- data/web/public/diagram-viewer/js/ProcessDiagramGenerator.js +1087 -0
- data/web/public/diagram-viewer/js/jquery/jquery.asyncqueue.js +125 -0
- data/web/public/diagram-viewer/js/jquery/jquery.js +9266 -0
- data/web/public/diagram-viewer/js/jquery/jquery.progressbar.js +131 -0
- data/web/public/diagram-viewer/js/jstools.js +23 -0
- data/web/public/diagram-viewer/js/raphael.2.1.1.js +10 -0
- data/web/public/diagram-viewer/js/raphael.js +10 -0
- data/web/public/diagram-viewer/js/raphael_uncompressed.js +5815 -0
- data/web/public/diagram-viewer/js/textlayout.js +441 -0
- data/web/public/diagram-viewer/style.css +1 -0
- data/web/public/editor-app/app-cfg.js +25 -0
- data/web/public/editor-app/app.js +432 -0
- data/web/public/editor-app/configuration/properties/assignment-display-template.html +4 -0
- data/web/public/editor-app/configuration/properties/assignment-popup.html +44 -0
- data/web/public/editor-app/configuration/properties/assignment-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/boolean-property-template.html +4 -0
- data/web/public/editor-app/configuration/properties/condition-expression-display-template.html +2 -0
- data/web/public/editor-app/configuration/properties/condition-expression-popup.html +29 -0
- data/web/public/editor-app/configuration/properties/condition-expression-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/default-value-display-template.html +4 -0
- data/web/public/editor-app/configuration/properties/event-listeners-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/event-listeners-popup.html +115 -0
- data/web/public/editor-app/configuration/properties/event-listeners-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/execution-listeners-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/execution-listeners-popup.html +101 -0
- data/web/public/editor-app/configuration/properties/execution-listeners-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/feedback-popup.html +17 -0
- data/web/public/editor-app/configuration/properties/fields-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/fields-popup.html +61 -0
- data/web/public/editor-app/configuration/properties/fields-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/form-properties-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/form-properties-popup.html +93 -0
- data/web/public/editor-app/configuration/properties/form-properties-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/in-parameters-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/in-parameters-popup.html +53 -0
- data/web/public/editor-app/configuration/properties/in-parameters-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/message-definitions-display-template.html +2 -0
- data/web/public/editor-app/configuration/properties/message-definitions-popup.html +50 -0
- data/web/public/editor-app/configuration/properties/message-definitions-write-template.html +3 -0
- data/web/public/editor-app/configuration/properties/message-property-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/multiinstance-property-write-template.html +8 -0
- data/web/public/editor-app/configuration/properties/out-parameters-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/out-parameters-popup.html +53 -0
- data/web/public/editor-app/configuration/properties/out-parameters-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/sequenceflow-order-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/sequenceflow-order-popup.html +47 -0
- data/web/public/editor-app/configuration/properties/sequenceflow-order-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/signal-definitions-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/signal-definitions-popup.html +58 -0
- data/web/public/editor-app/configuration/properties/signal-definitions-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/signal-property-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/string-property-write-mode-template.html +8 -0
- data/web/public/editor-app/configuration/properties/subprocess-reference-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/subprocess-reference-popup.html +43 -0
- data/web/public/editor-app/configuration/properties/subprocess-reference-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/task-listeners-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/task-listeners-popup.html +102 -0
- data/web/public/editor-app/configuration/properties/task-listeners-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/text-popup.html +17 -0
- data/web/public/editor-app/configuration/properties/text-property-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties-assignment-controller.js +150 -0
- data/web/public/editor-app/configuration/properties-condition-expression-controller.js +58 -0
- data/web/public/editor-app/configuration/properties-custom-controllers.js +18 -0
- data/web/public/editor-app/configuration/properties-default-controllers.js +115 -0
- data/web/public/editor-app/configuration/properties-event-listeners-controller.js +266 -0
- data/web/public/editor-app/configuration/properties-execution-listeners-controller.js +326 -0
- data/web/public/editor-app/configuration/properties-fields-controller.js +192 -0
- data/web/public/editor-app/configuration/properties-form-properties-controller.js +192 -0
- data/web/public/editor-app/configuration/properties-in-parameters-controller.js +158 -0
- data/web/public/editor-app/configuration/properties-message-definitions-controller.js +137 -0
- data/web/public/editor-app/configuration/properties-message-scope-controller.js +48 -0
- data/web/public/editor-app/configuration/properties-multiinstance-controller.js +34 -0
- data/web/public/editor-app/configuration/properties-out-parameters-controller.js +158 -0
- data/web/public/editor-app/configuration/properties-sequenceflow-order-controller.js +130 -0
- data/web/public/editor-app/configuration/properties-signal-definitions-controller.js +136 -0
- data/web/public/editor-app/configuration/properties-signal-scope-controller.js +47 -0
- data/web/public/editor-app/configuration/properties-task-listeners-controller.js +325 -0
- data/web/public/editor-app/configuration/properties.js +99 -0
- data/web/public/editor-app/configuration/toolbar-custom-actions.js +18 -0
- data/web/public/editor-app/configuration/toolbar-default-actions.js +429 -0
- data/web/public/editor-app/configuration/toolbar.js +175 -0
- data/web/public/editor-app/configuration/url-config.js +34 -0
- data/web/public/editor-app/css/style-common.css +1518 -0
- data/web/public/editor-app/css/style-editor.css +639 -0
- data/web/public/editor-app/css/style.css +471 -0
- data/web/public/editor-app/editor/css/editor.css +202 -0
- data/web/public/editor-app/editor/i18n/translation_de.js +383 -0
- data/web/public/editor-app/editor/i18n/translation_en_us.js +423 -0
- data/web/public/editor-app/editor/i18n/translation_signavio_de.js +106 -0
- data/web/public/editor-app/editor/i18n/translation_signavio_en_us.js +108 -0
- data/web/public/editor-app/editor/oryx.debug.js +24510 -0
- data/web/public/editor-app/editor/oryx.js +30 -0
- data/web/public/editor-app/editor-config.js +32 -0
- data/web/public/editor-app/editor-controller.js +65 -0
- data/web/public/editor-app/editor-utils.js +135 -0
- data/web/public/editor-app/editor.html +136 -0
- data/web/public/editor-app/eventbus.js +133 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.eot +0 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.svg +43 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.ttf +0 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.woff +0 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.eot +0 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.svg +229 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.woff +0 -0
- data/web/public/editor-app/header-controller.js +31 -0
- data/web/public/editor-app/i18n/en.json +286 -0
- data/web/public/editor-app/images/bpmn-error.png +0 -0
- data/web/public/editor-app/images/bpmn-warning.png +0 -0
- data/web/public/editor-app/images/datadefinition.png +0 -0
- data/web/public/editor-app/images/delete.png +0 -0
- data/web/public/editor-app/images/loading.gif +0 -0
- data/web/public/editor-app/images/logo-2x.png +0 -0
- data/web/public/editor-app/images/logo.png +0 -0
- data/web/public/editor-app/images/nw-handle-dark.gif +0 -0
- data/web/public/editor-app/images/se-handle-dark.gif +0 -0
- data/web/public/editor-app/images/shapemenu_highlight.png +0 -0
- data/web/public/editor-app/images/wrench.png +0 -0
- data/web/public/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js +8 -0
- data/web/public/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-dragdrop.min-1.0.3.js +9 -0
- data/web/public/editor-app/libs/angular-dragdrop_1.0.7/angular-dragdrop.min.js +29 -0
- data/web/public/editor-app/libs/angular-mocks_1.2.13/angular-mocks.js +2136 -0
- data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.js +596 -0
- data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.min.js +13 -0
- data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.js +921 -0
- data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.min.js +14 -0
- data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.js +625 -0
- data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js +14 -0
- data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-scroll_0.5.7/angular-scroll.min.js +1 -0
- data/web/public/editor-app/libs/angular-strap_2.0.5/angular-strap.min.js +9 -0
- data/web/public/editor-app/libs/angular-strap_2.0.5/angular-strap.tpl.min.js +8 -0
- data/web/public/editor-app/libs/angular-translate-loader-static-files/.bower.json +19 -0
- data/web/public/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js +31 -0
- data/web/public/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js +6 -0
- data/web/public/editor-app/libs/angular-translate-storage-cookie/.bower.json +20 -0
- data/web/public/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.js +19 -0
- data/web/public/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.min.js +6 -0
- data/web/public/editor-app/libs/angular-translate_2.4.2/angular-translate.js +960 -0
- data/web/public/editor-app/libs/angular-translate_2.4.2/angular-translate.min.js +6 -0
- data/web/public/editor-app/libs/angular_1.2.13/angular-animate.min.js +27 -0
- data/web/public/editor-app/libs/angular_1.2.13/angular.min.js +204 -0
- data/web/public/editor-app/libs/bootstrap-daterangepicker_1.3.7/daterangepicker-bs3.css +267 -0
- data/web/public/editor-app/libs/bootstrap-daterangepicker_1.3.7/daterangepicker.js +1026 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.css +347 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.css.map +1 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.min.css +7 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.css +5785 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.css.map +1 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.min.css +7 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.eot +0 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.svg +229 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.woff +0 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/js/bootstrap.js +1951 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/js/bootstrap.min.js +6 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/.bower.json +14 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/.gitignore +2 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/CHANGES +93 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/CONTRIBUTORS.md +25 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/LICENSE +19 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/README.md +161 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.js +444 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.map +1 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.min.js +4 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.js +1314 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.map +1 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.min.js +4 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/package.json +34 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h-kill.js +64 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h-matchers.js +34 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h.js +3 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/index.html +64 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/index.min.html +63 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine-html.js +190 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine.css +166 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine.js +2477 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine_favicon.png +0 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/json2.js +478 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-array.js +1223 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-date.js +152 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-function.js +147 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-number.js +14 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-object.js +181 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-string.js +204 -0
- data/web/public/editor-app/libs/jquery-ui-1.10.3.custom.min.js +6 -0
- data/web/public/editor-app/libs/jquery.autogrow-textarea.js +61 -0
- data/web/public/editor-app/libs/jquery_1.11.0/jquery.js +9789 -0
- data/web/public/editor-app/libs/jquery_1.11.0/jquery.min.js +4 -0
- data/web/public/editor-app/libs/jquery_1.11.0/jquery.min.map +1 -0
- data/web/public/editor-app/libs/json3_3.2.6/LICENSE +20 -0
- data/web/public/editor-app/libs/json3_3.2.6/lib/json3.js +861 -0
- data/web/public/editor-app/libs/json3_3.2.6/lib/json3.min.js +18 -0
- data/web/public/editor-app/libs/momentjs_2.5.1/momentjs.min.js +6 -0
- data/web/public/editor-app/libs/mousetrap-1.4.5.min.js +9 -0
- data/web/public/editor-app/libs/ng-grid-2.0.7-min.js +2 -0
- data/web/public/editor-app/libs/ng-grid-2.0.7.min.css +1 -0
- data/web/public/editor-app/libs/path_parser.js +30 -0
- data/web/public/editor-app/libs/prototype-1.5.1.js +3272 -0
- data/web/public/editor-app/libs/ui-utils.min-0.0.4.js +7 -0
- data/web/public/editor-app/partials/root-stencil-item-template.html +11 -0
- data/web/public/editor-app/partials/stencil-item-template.html +27 -0
- data/web/public/editor-app/plugins.xml +58 -0
- data/web/public/editor-app/popups/icon-template.html +3 -0
- data/web/public/editor-app/popups/save-model.html +41 -0
- data/web/public/editor-app/popups/select-shape.html +20 -0
- data/web/public/editor-app/popups/unsaved-changes.html +22 -0
- data/web/public/editor-app/select-shape-controller.js +314 -0
- data/web/public/editor-app/stencil-controller.js +1421 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.collapsed.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/expanded.subprocess.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.business.rule.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.camel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.manual.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.mule.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.receive.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.script.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.send.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.service.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.shell.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.user.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/subprocess.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/task.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/artifact/text.annotation.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/cancel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/compensation.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/error.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/message.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/signal.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/timer.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/association.undirected.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/association.unidirectional.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/messageflow.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/sequenceflow.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/dataobject/data.store.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/diagram.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/cancel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/error.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/none.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/terminate.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/eventbased.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/exclusive.databased.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/inclusive.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/parallel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/error.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/message.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/none.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/signal.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/timer.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/swimlane/lane.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/swimlane/pool.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/throwing/none.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/throwing/signal.png +0 -0
- data/web/public/editor-app/toolbar-controller.js +162 -0
- data/web/public/modeler.html +140 -0
- data/web/views/models/index.erb +32 -0
- data/web/views/models/new.erb +15 -0
- metadata +334 -10
@@ -0,0 +1,326 @@
|
|
1
|
+
/*
|
2
|
+
* Activiti Modeler component part of the Activiti project
|
3
|
+
* Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved.
|
4
|
+
*
|
5
|
+
* This library is free software; you can redistribute it and/or
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
7
|
+
* License as published by the Free Software Foundation; either
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
* Lesser General Public License for more details.
|
14
|
+
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
16
|
+
* License along with this library; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
*/
|
19
|
+
|
20
|
+
/*
|
21
|
+
* Execution listeners
|
22
|
+
*/
|
23
|
+
|
24
|
+
var KisBpmExecutionListenersCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) {
|
25
|
+
|
26
|
+
// Config for the modal window
|
27
|
+
var opts = {
|
28
|
+
template: 'editor-app/configuration/properties/execution-listeners-popup.html?version=' + Date.now(),
|
29
|
+
scope: $scope
|
30
|
+
};
|
31
|
+
|
32
|
+
// Open the dialog
|
33
|
+
$modal(opts);
|
34
|
+
}];
|
35
|
+
|
36
|
+
var KisBpmExecutionListenersPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) {
|
37
|
+
|
38
|
+
// Put json representing form properties on scope
|
39
|
+
if ($scope.property.value !== undefined && $scope.property.value !== null
|
40
|
+
&& $scope.property.value.executionListeners !== undefined
|
41
|
+
&& $scope.property.value.executionListeners !== null) {
|
42
|
+
|
43
|
+
if ($scope.property.value.executionListeners.constructor == String)
|
44
|
+
{
|
45
|
+
$scope.executionListeners = JSON.parse($scope.property.value.executionListeners);
|
46
|
+
}
|
47
|
+
else
|
48
|
+
{
|
49
|
+
// Note that we clone the json object rather then setting it directly,
|
50
|
+
// this to cope with the fact that the user can click the cancel button and no changes should have happened
|
51
|
+
$scope.executionListeners = angular.copy($scope.property.value.executionListeners);
|
52
|
+
}
|
53
|
+
|
54
|
+
for (var i = 0; i < $scope.executionListeners.length; i++)
|
55
|
+
{
|
56
|
+
var executionListener = $scope.executionListeners[i];
|
57
|
+
if (executionListener.className !== undefined && executionListener.className !== '')
|
58
|
+
{
|
59
|
+
executionListener.implementation = executionListener.className;
|
60
|
+
}
|
61
|
+
else if (executionListener.expression !== undefined && executionListener.expression !== '')
|
62
|
+
{
|
63
|
+
executionListener.implementation = executionListener.expression;
|
64
|
+
}
|
65
|
+
else if (executionListener.delegateExpression !== undefined && executionListener.delegateExpression !== '')
|
66
|
+
{
|
67
|
+
executionListener.implementation = executionListener.delegateExpression;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
} else {
|
71
|
+
$scope.executionListeners = [];
|
72
|
+
}
|
73
|
+
|
74
|
+
// Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough)
|
75
|
+
$scope.selectedListeners = [];
|
76
|
+
$scope.selectedFields = [];
|
77
|
+
$scope.translationsRetrieved = false;
|
78
|
+
|
79
|
+
$scope.labels = {};
|
80
|
+
|
81
|
+
var eventPromise = $translate('PROPERTY.EXECUTIONLISTENERS.EVENT');
|
82
|
+
var implementationPromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.IMPLEMENTATION');
|
83
|
+
var namePromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME');
|
84
|
+
|
85
|
+
$q.all([eventPromise, implementationPromise, namePromise]).then(function(results) {
|
86
|
+
$scope.labels.eventLabel = results[0];
|
87
|
+
$scope.labels.implementationLabel = results[1];
|
88
|
+
$scope.labels.nameLabel = results[2];
|
89
|
+
$scope.translationsRetrieved = true;
|
90
|
+
|
91
|
+
// Config for grid
|
92
|
+
$scope.gridOptions = {
|
93
|
+
data: 'executionListeners',
|
94
|
+
enableRowReordering: true,
|
95
|
+
headerRowHeight: 28,
|
96
|
+
multiSelect: false,
|
97
|
+
keepLastSelected : false,
|
98
|
+
selectedItems: $scope.selectedListeners,
|
99
|
+
afterSelectionChange: function (rowItem, event) {
|
100
|
+
$scope.selectedFields.length = 0;
|
101
|
+
if ($scope.selectedListeners.length > 0)
|
102
|
+
{
|
103
|
+
var fields = $scope.selectedListeners[0].fields;
|
104
|
+
if (fields !== undefined && fields !== null)
|
105
|
+
{
|
106
|
+
for (var i = 0; i < fields.length; i++)
|
107
|
+
{
|
108
|
+
var field = fields[i];
|
109
|
+
if (field.stringValue !== undefined && field.stringValue !== '')
|
110
|
+
{
|
111
|
+
field.implementation = field.stringValue;
|
112
|
+
}
|
113
|
+
else if (field.expression !== undefined && field.expression !== '')
|
114
|
+
{
|
115
|
+
field.implementation = field.expression;
|
116
|
+
}
|
117
|
+
else if (field.string !== undefined && field.string !== '')
|
118
|
+
{
|
119
|
+
field.implementation = field.string;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
},
|
125
|
+
columnDefs: [{ field: 'event', displayName: $scope.labels.eventLabel },
|
126
|
+
{ field: 'implementation', displayName: $scope.labels.implementationLabel }]
|
127
|
+
};
|
128
|
+
|
129
|
+
// Config for field grid
|
130
|
+
$scope.gridFieldOptions = {
|
131
|
+
data: 'selectedListeners[0].fields',
|
132
|
+
enableRowReordering: true,
|
133
|
+
headerRowHeight: 28,
|
134
|
+
multiSelect: false,
|
135
|
+
keepLastSelected : false,
|
136
|
+
selectedItems: $scope.selectedFields,
|
137
|
+
columnDefs: [{ field: 'name', displayName: $scope.labels.nameLabel },
|
138
|
+
{ field: 'implementation', displayName: $scope.labels.implementationLabel}]
|
139
|
+
};
|
140
|
+
});
|
141
|
+
|
142
|
+
$scope.listenerDetailsChanged = function() {
|
143
|
+
if ($scope.selectedListeners[0].className !== '')
|
144
|
+
{
|
145
|
+
$scope.selectedListeners[0].implementation = $scope.selectedListeners[0].className;
|
146
|
+
}
|
147
|
+
else if ($scope.selectedListeners[0].expression !== '')
|
148
|
+
{
|
149
|
+
$scope.selectedListeners[0].implementation = $scope.selectedListeners[0].expression;
|
150
|
+
}
|
151
|
+
else if ($scope.selectedListeners[0].delegateExpression !== '')
|
152
|
+
{
|
153
|
+
$scope.selectedListeners[0].implementation = $scope.selectedListeners[0].delegateExpression;
|
154
|
+
}
|
155
|
+
else
|
156
|
+
{
|
157
|
+
$scope.selectedListeners[0].implementation = '';
|
158
|
+
}
|
159
|
+
};
|
160
|
+
|
161
|
+
// Click handler for add button
|
162
|
+
$scope.addNewListener = function() {
|
163
|
+
$scope.executionListeners.push({ event : 'start',
|
164
|
+
implementation : '',
|
165
|
+
className : '',
|
166
|
+
expression: '',
|
167
|
+
delegateExpression: ''});
|
168
|
+
};
|
169
|
+
|
170
|
+
// Click handler for remove button
|
171
|
+
$scope.removeListener = function() {
|
172
|
+
if ($scope.selectedListeners.length > 0) {
|
173
|
+
var index = $scope.executionListeners.indexOf($scope.selectedListeners[0]);
|
174
|
+
$scope.gridOptions.selectItem(index, false);
|
175
|
+
$scope.executionListeners.splice(index, 1);
|
176
|
+
|
177
|
+
$scope.selectedListeners.length = 0;
|
178
|
+
if (index < $scope.executionListeners.length) {
|
179
|
+
$scope.gridOptions.selectItem(index + 1, true);
|
180
|
+
} else if ($scope.executionListeners.length > 0) {
|
181
|
+
$scope.gridOptions.selectItem(index - 1, true);
|
182
|
+
}
|
183
|
+
}
|
184
|
+
};
|
185
|
+
|
186
|
+
// Click handler for up button
|
187
|
+
$scope.moveListenerUp = function() {
|
188
|
+
if ($scope.selectedListeners.length > 0) {
|
189
|
+
var index = $scope.executionListeners.indexOf($scope.selectedListeners[0]);
|
190
|
+
if (index != 0) { // If it's the first, no moving up of course
|
191
|
+
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
|
192
|
+
var temp = $scope.executionListeners[index];
|
193
|
+
$scope.executionListeners.splice(index, 1);
|
194
|
+
$timeout(function(){
|
195
|
+
$scope.executionListeners.splice(index + -1, 0, temp);
|
196
|
+
}, 100);
|
197
|
+
|
198
|
+
}
|
199
|
+
}
|
200
|
+
};
|
201
|
+
|
202
|
+
// Click handler for down button
|
203
|
+
$scope.moveListenerDown = function() {
|
204
|
+
if ($scope.selectedListeners.length > 0) {
|
205
|
+
var index = $scope.executionListeners.indexOf($scope.selectedListeners[0]);
|
206
|
+
if (index != $scope.executionListeners.length - 1) { // If it's the last element, no moving down of course
|
207
|
+
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
|
208
|
+
var temp = $scope.executionListeners[index];
|
209
|
+
$scope.executionListeners.splice(index, 1);
|
210
|
+
$timeout(function(){
|
211
|
+
$scope.executionListeners.splice(index + 1, 0, temp);
|
212
|
+
}, 100);
|
213
|
+
|
214
|
+
}
|
215
|
+
}
|
216
|
+
};
|
217
|
+
|
218
|
+
$scope.fieldDetailsChanged = function() {
|
219
|
+
if ($scope.selectedFields[0].stringValue !== '')
|
220
|
+
{
|
221
|
+
$scope.selectedFields[0].implementation = $scope.selectedFields[0].stringValue;
|
222
|
+
}
|
223
|
+
else if ($scope.selectedFields[0].expression !== '')
|
224
|
+
{
|
225
|
+
$scope.selectedFields[0].implementation = $scope.selectedFields[0].expression;
|
226
|
+
}
|
227
|
+
else if ($scope.selectedFields[0].string !== '')
|
228
|
+
{
|
229
|
+
$scope.selectedFields[0].implementation = $scope.selectedFields[0].string;
|
230
|
+
}
|
231
|
+
else
|
232
|
+
{
|
233
|
+
$scope.selectedFields[0].implementation = '';
|
234
|
+
}
|
235
|
+
};
|
236
|
+
|
237
|
+
// Click handler for add button
|
238
|
+
$scope.addNewField = function() {
|
239
|
+
if ($scope.selectedListeners.length > 0)
|
240
|
+
{
|
241
|
+
if ($scope.selectedListeners[0].fields == undefined)
|
242
|
+
{
|
243
|
+
$scope.selectedListeners[0].fields = [];
|
244
|
+
}
|
245
|
+
$scope.selectedListeners[0].fields.push({ name : 'fieldName',
|
246
|
+
implementation : '',
|
247
|
+
stringValue : '',
|
248
|
+
expression: '',
|
249
|
+
string: ''});
|
250
|
+
}
|
251
|
+
};
|
252
|
+
|
253
|
+
// Click handler for remove button
|
254
|
+
$scope.removeField = function() {
|
255
|
+
if ($scope.selectedFields.length > 0) {
|
256
|
+
var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]);
|
257
|
+
$scope.gridFieldOptions.selectItem(index, false);
|
258
|
+
$scope.selectedListeners[0].fields.splice(index, 1);
|
259
|
+
|
260
|
+
$scope.selectedFields.length = 0;
|
261
|
+
if (index < $scope.selectedListeners[0].fields.length) {
|
262
|
+
$scope.gridFieldOptions.selectItem(index + 1, true);
|
263
|
+
} else if ($scope.selectedListeners[0].fields.length > 0) {
|
264
|
+
$scope.gridFieldOptions.selectItem(index - 1, true);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
};
|
268
|
+
|
269
|
+
// Click handler for up button
|
270
|
+
$scope.moveFieldUp = function() {
|
271
|
+
if ($scope.selectedFields.length > 0) {
|
272
|
+
var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]);
|
273
|
+
if (index != 0) { // If it's the first, no moving up of course
|
274
|
+
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
|
275
|
+
var temp = $scope.selectedListeners[0].fields[index];
|
276
|
+
$scope.selectedListeners[0].fields.splice(index, 1);
|
277
|
+
$timeout(function(){
|
278
|
+
$scope.selectedListeners[0].fields.splice(index + -1, 0, temp);
|
279
|
+
}, 100);
|
280
|
+
|
281
|
+
}
|
282
|
+
}
|
283
|
+
};
|
284
|
+
|
285
|
+
// Click handler for down button
|
286
|
+
$scope.moveFieldDown = function() {
|
287
|
+
if ($scope.selectedFields.length > 0) {
|
288
|
+
var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]);
|
289
|
+
if (index != $scope.selectedListeners[0].fields.length - 1) { // If it's the last element, no moving down of course
|
290
|
+
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
|
291
|
+
var temp = $scope.selectedListeners[0].fields[index];
|
292
|
+
$scope.selectedListeners[0].fields.splice(index, 1);
|
293
|
+
$timeout(function(){
|
294
|
+
$scope.selectedListeners[0].fields.splice(index + 1, 0, temp);
|
295
|
+
}, 100);
|
296
|
+
|
297
|
+
}
|
298
|
+
}
|
299
|
+
};
|
300
|
+
|
301
|
+
// Click handler for save button
|
302
|
+
$scope.save = function() {
|
303
|
+
|
304
|
+
if ($scope.executionListeners.length > 0) {
|
305
|
+
$scope.property.value = {};
|
306
|
+
$scope.property.value.executionListeners = $scope.executionListeners;
|
307
|
+
} else {
|
308
|
+
$scope.property.value = null;
|
309
|
+
}
|
310
|
+
|
311
|
+
$scope.updatePropertyInModel($scope.property);
|
312
|
+
$scope.close();
|
313
|
+
};
|
314
|
+
|
315
|
+
$scope.cancel = function() {
|
316
|
+
$scope.$hide();
|
317
|
+
$scope.property.mode = 'read';
|
318
|
+
};
|
319
|
+
|
320
|
+
// Close button handler
|
321
|
+
$scope.close = function() {
|
322
|
+
$scope.$hide();
|
323
|
+
$scope.property.mode = 'read';
|
324
|
+
};
|
325
|
+
|
326
|
+
}];
|
@@ -0,0 +1,192 @@
|
|
1
|
+
/*
|
2
|
+
* Activiti Modeler component part of the Activiti project
|
3
|
+
* Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved.
|
4
|
+
*
|
5
|
+
* This library is free software; you can redistribute it and/or
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
7
|
+
* License as published by the Free Software Foundation; either
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
* Lesser General Public License for more details.
|
14
|
+
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
16
|
+
* License along with this library; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
*/
|
19
|
+
|
20
|
+
/*
|
21
|
+
* Task listeners
|
22
|
+
*/
|
23
|
+
|
24
|
+
var KisBpmFieldsCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) {
|
25
|
+
|
26
|
+
// Config for the modal window
|
27
|
+
var opts = {
|
28
|
+
template: 'editor-app/configuration/properties/fields-popup.html',
|
29
|
+
scope: $scope
|
30
|
+
};
|
31
|
+
|
32
|
+
// Open the dialog
|
33
|
+
$modal(opts);
|
34
|
+
}];
|
35
|
+
|
36
|
+
var KisBpmFieldsPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) {
|
37
|
+
|
38
|
+
// Put json representing form properties on scope
|
39
|
+
if ($scope.property.value !== undefined && $scope.property.value !== null
|
40
|
+
&& $scope.property.value.fields !== undefined
|
41
|
+
&& $scope.property.value.fields !== null) {
|
42
|
+
// Note that we clone the json object rather then setting it directly,
|
43
|
+
// this to cope with the fact that the user can click the cancel button and no changes should have happened
|
44
|
+
$scope.fields = angular.copy($scope.property.value.fields);
|
45
|
+
|
46
|
+
for (var i = 0; i < $scope.fields.length; i++)
|
47
|
+
{
|
48
|
+
var field = $scope.fields[i];
|
49
|
+
if (field.stringValue !== undefined && field.stringValue !== '')
|
50
|
+
{
|
51
|
+
field.implementation = field.stringValue;
|
52
|
+
}
|
53
|
+
else if (field.expression !== undefined && field.expression !== '')
|
54
|
+
{
|
55
|
+
field.implementation = field.expression;
|
56
|
+
}
|
57
|
+
else if (field.string !== undefined && field.string !== '')
|
58
|
+
{
|
59
|
+
field.implementation = field.string;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
} else {
|
64
|
+
$scope.fields = [];
|
65
|
+
}
|
66
|
+
|
67
|
+
// Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough)
|
68
|
+
$scope.selectedFields = [];
|
69
|
+
$scope.translationsRetrieved = false;
|
70
|
+
$scope.labels = {};
|
71
|
+
|
72
|
+
var namePromise = $translate('PROPERTY.FIELDS.NAME');
|
73
|
+
var implementationPromise = $translate('PROPERTY.FIELDS.IMPLEMENTATION');
|
74
|
+
|
75
|
+
$q.all([namePromise, implementationPromise]).then(function(results) {
|
76
|
+
$scope.labels.nameLabel = results[0];
|
77
|
+
$scope.labels.implementationLabel = results[1];
|
78
|
+
$scope.translationsRetrieved = true;
|
79
|
+
|
80
|
+
// Config for grid
|
81
|
+
$scope.gridOptions = {
|
82
|
+
data: 'fields',
|
83
|
+
enableRowReordering: true,
|
84
|
+
headerRowHeight: 28,
|
85
|
+
multiSelect: false,
|
86
|
+
keepLastSelected: false,
|
87
|
+
selectedItems: $scope.selectedFields,
|
88
|
+
columnDefs: [{field: 'name', displayName: $scope.labels.nameLabel},
|
89
|
+
{field: 'implementation', displayName: $scope.labels.implementationLabel}]
|
90
|
+
};
|
91
|
+
});
|
92
|
+
|
93
|
+
$scope.fieldDetailsChanged = function() {
|
94
|
+
if ($scope.selectedFields[0].stringValue != '')
|
95
|
+
{
|
96
|
+
$scope.selectedFields[0].implementation = $scope.selectedFields[0].stringValue;
|
97
|
+
}
|
98
|
+
else if ($scope.selectedFields[0].expression != '')
|
99
|
+
{
|
100
|
+
$scope.selectedFields[0].implementation = $scope.selectedFields[0].expression;
|
101
|
+
}
|
102
|
+
else if ($scope.selectedFields[0].string != '')
|
103
|
+
{
|
104
|
+
$scope.selectedFields[0].implementation = $scope.selectedFields[0].string;
|
105
|
+
}
|
106
|
+
else
|
107
|
+
{
|
108
|
+
$scope.selectedFields[0].implementation = '';
|
109
|
+
}
|
110
|
+
};
|
111
|
+
|
112
|
+
// Click handler for add button
|
113
|
+
$scope.addNewField = function() {
|
114
|
+
$scope.fields.push({ name : 'fieldName',
|
115
|
+
implementation : '',
|
116
|
+
stringValue : '',
|
117
|
+
expression: '',
|
118
|
+
string: ''});
|
119
|
+
};
|
120
|
+
|
121
|
+
// Click handler for remove button
|
122
|
+
$scope.removeField = function() {
|
123
|
+
if ($scope.selectedFields.length > 0) {
|
124
|
+
var index = $scope.fields.indexOf($scope.selectedFields[0]);
|
125
|
+
$scope.gridOptions.selectItem(index, false);
|
126
|
+
$scope.fields.splice(index, 1);
|
127
|
+
|
128
|
+
$scope.selectedFields.length = 0;
|
129
|
+
if (index < $scope.fields.length) {
|
130
|
+
$scope.gridOptions.selectItem(index + 1, true);
|
131
|
+
} else if ($scope.fields.length > 0) {
|
132
|
+
$scope.gridOptions.selectItem(index - 1, true);
|
133
|
+
}
|
134
|
+
}
|
135
|
+
};
|
136
|
+
|
137
|
+
// Click handler for up button
|
138
|
+
$scope.moveFieldUp = function() {
|
139
|
+
if ($scope.selectedFields.length > 0) {
|
140
|
+
var index = $scope.fields.indexOf($scope.selectedFields[0]);
|
141
|
+
if (index != 0) { // If it's the first, no moving up of course
|
142
|
+
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
|
143
|
+
var temp = $scope.fields[index];
|
144
|
+
$scope.fields.splice(index, 1);
|
145
|
+
$timeout(function(){
|
146
|
+
$scope.fields.splice(index + -1, 0, temp);
|
147
|
+
}, 100);
|
148
|
+
|
149
|
+
}
|
150
|
+
}
|
151
|
+
};
|
152
|
+
|
153
|
+
// Click handler for down button
|
154
|
+
$scope.moveFieldDown = function() {
|
155
|
+
if ($scope.selectedFields.length > 0) {
|
156
|
+
var index = $scope.fields.indexOf($scope.selectedFields[0]);
|
157
|
+
if (index != $scope.fields.length - 1) { // If it's the last element, no moving down of course
|
158
|
+
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
|
159
|
+
var temp = $scope.fields[index];
|
160
|
+
$scope.fields.splice(index, 1);
|
161
|
+
$timeout(function(){
|
162
|
+
$scope.fields.splice(index + 1, 0, temp);
|
163
|
+
}, 100);
|
164
|
+
|
165
|
+
}
|
166
|
+
}
|
167
|
+
};
|
168
|
+
|
169
|
+
// Click handler for save button
|
170
|
+
$scope.save = function() {
|
171
|
+
|
172
|
+
if ($scope.fields.length > 0) {
|
173
|
+
$scope.property.value = {};
|
174
|
+
$scope.property.value.fields = $scope.fields;
|
175
|
+
} else {
|
176
|
+
$scope.property.value = null;
|
177
|
+
}
|
178
|
+
|
179
|
+
$scope.updatePropertyInModel($scope.property);
|
180
|
+
$scope.close();
|
181
|
+
};
|
182
|
+
|
183
|
+
$scope.cancel = function() {
|
184
|
+
$scope.close();
|
185
|
+
};
|
186
|
+
|
187
|
+
// Close button handler
|
188
|
+
$scope.close = function() {
|
189
|
+
$scope.property.mode = 'read';
|
190
|
+
$scope.$hide();
|
191
|
+
};
|
192
|
+
}];
|