├── db ├── mysql │ ├── .gitignore │ ├── image │ │ ├── Dockerfile │ │ └── init.sql │ └── docker-compose.yml ├── postgresql │ ├── .gitignore │ ├── image │ │ ├── Dockerfile │ │ └── init.sh │ └── docker-compose.yml └── test │ ├── mysql │ └── init.sql │ └── postgresql │ └── init.sql ├── src ├── main │ ├── resources │ │ ├── logback.properties │ │ ├── jdbc.properties.example │ │ ├── security.properties.example │ │ ├── odk-security-settings.xml │ │ └── odk-common-security-settings.xml │ ├── webapp │ │ ├── robots.txt │ │ ├── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── context.xml │ │ ├── res │ │ │ └── OpenDataKit.cer │ │ ├── images │ │ │ ├── help_dialog_on.jpg │ │ │ ├── help_dialog_off.jpg │ │ │ ├── map.png │ │ │ ├── map.psd │ │ │ ├── red_x.png │ │ │ ├── bar_chart.png │ │ │ ├── bar_chart.psd │ │ │ ├── enketo.ico │ │ │ ├── odk_color.png │ │ │ ├── odk_color.psd │ │ │ ├── pie_chart.png │ │ │ ├── pie_chart.psd │ │ │ ├── playicon.png │ │ │ ├── red_x.psd │ │ │ ├── tabCorners.png │ │ │ ├── blue_up_arrow.png │ │ │ ├── blue_up_arrow.psd │ │ │ ├── green_check.png │ │ │ ├── green_check.psd │ │ │ ├── help_book_icon.png │ │ │ ├── help_icon_off.png │ │ │ ├── help_icon_on.png │ │ │ ├── mostly_opaque.png │ │ │ ├── mostly_opaque.psd │ │ │ ├── odk_aggregate.png │ │ │ ├── odk_aggregate.psd │ │ │ ├── tabCorners.psd │ │ │ ├── yellow_plus.png │ │ │ ├── yellow_plus.psd │ │ │ ├── green_right_arrow.png │ │ │ └── green_right_arrow.psd │ │ ├── favicon.ico │ │ ├── odk_color.png │ │ ├── javascript │ │ │ ├── main.js │ │ │ └── upload_control.js │ │ ├── stylesheets │ │ │ ├── upload.css │ │ │ └── table.css │ │ ├── index.html │ │ ├── logout.html │ │ ├── access-denied.html │ │ └── over-quota.html │ └── java │ │ └── org │ │ └── opendatakit │ │ ├── common │ │ ├── web │ │ │ ├── Web.gwt.xml │ │ │ └── client │ │ │ │ ├── UIEnabledPredicate.java │ │ │ │ ├── UIVisiblePredicate.java │ │ │ │ ├── BooleanValidationPredicate.java │ │ │ │ └── StringValidationPredicate.java │ │ ├── persistence │ │ │ ├── Persistence.gwt.xml │ │ │ ├── ITaskLockType.java │ │ │ ├── TaskLock.java │ │ │ ├── exception │ │ │ │ ├── ODKEntityPersistException.java │ │ │ │ └── ODKOverQuotaException.java │ │ │ └── Query.java │ │ ├── security │ │ │ ├── Security.gwt.xml │ │ │ ├── spring │ │ │ │ ├── SpringInternals.java │ │ │ │ ├── AggregateUserSaltSource.java │ │ │ │ ├── RetryWithDefinedEntryPoint.java │ │ │ │ └── DigestAuthenticationFilter.java │ │ │ ├── SecurityUtils.java │ │ │ ├── client │ │ │ │ ├── security │ │ │ │ │ ├── SecurityServiceAsync.java │ │ │ │ │ └── admin │ │ │ │ │ │ └── SecurityAdminServiceAsync.java │ │ │ │ └── exception │ │ │ │ │ └── AccessDeniedException.java │ │ │ ├── SecurityBeanDefs.java │ │ │ ├── User.java │ │ │ └── UserService.java │ │ ├── utils │ │ │ ├── WebStartup.java │ │ │ ├── Utils.gwt.xml │ │ │ ├── GwtShims.java │ │ │ ├── LocaleUtils.java │ │ │ └── OutOfBandUserFetcher.java │ │ └── datamodel │ │ │ └── ODKEnumeratedElementException.java │ │ └── aggregate │ │ ├── constants │ │ ├── common │ │ │ ├── GmePhotoHostType.java │ │ │ ├── BinaryOption.java │ │ │ ├── HelpSliderConsts.java │ │ │ ├── UIDisplayType.java │ │ │ ├── GeoPointConsts.java │ │ │ ├── FormElementNamespace.java │ │ │ ├── RowOrCol.java │ │ │ ├── OperationalStatus.java │ │ │ ├── ExportType.java │ │ │ ├── PreferencesConsts.java │ │ │ ├── Tabs.java │ │ │ ├── FilterOperation.java │ │ │ ├── FormActionStatusTimestamp.java │ │ │ ├── ChartType.java │ │ │ ├── ExternalServiceType.java │ │ │ └── FormActionStatus.java │ │ ├── externalservice │ │ │ ├── JsonServerType.java │ │ │ └── ExternalServiceConsts.java │ │ ├── format │ │ │ └── FormatConsts.java │ │ └── BeanDefs.java │ │ ├── util │ │ └── DateTimeUtils.java │ │ ├── client │ │ ├── widgets │ │ │ ├── EnumListBox.java │ │ │ ├── HelpDialogsToggleButton.java │ │ │ ├── AggregateTextBox.java │ │ │ ├── HelpBookToggleButton.java │ │ │ ├── AggregateListBox.java │ │ │ ├── ClosePopupButton.java │ │ │ ├── AggregateButton.java │ │ │ └── RepeatViewButton.java │ │ ├── popups │ │ │ ├── KmlSelectionGeneration.java │ │ │ ├── EnketoRedirectErrorPopup.java │ │ │ └── AbstractPopupBase.java │ │ ├── SubTabInterface.java │ │ ├── preferences │ │ │ ├── PreferenceServiceAsync.java │ │ │ └── PreferenceService.java │ │ ├── handlers │ │ │ ├── RefreshOpenHandler.java │ │ │ ├── RefreshCloseHandler.java │ │ │ └── RefreshSelectionHandler.java │ │ ├── filter │ │ │ ├── FilterServiceAsync.java │ │ │ ├── FilterService.java │ │ │ └── FilterSet.java │ │ ├── AggregateSubTabBase.java │ │ ├── submission │ │ │ ├── SubmissionServiceAsync.java │ │ │ ├── SubmissionUI.java │ │ │ └── SubmissionService.java │ │ ├── SubmissionTabUI.java │ │ ├── ManageTabUI.java │ │ ├── AdminTabUI.java │ │ ├── table │ │ │ ├── AuditCSVPopupClickHandler.java │ │ │ └── BinaryPopupClickHandler.java │ │ ├── form │ │ │ ├── GeopointElementList.java │ │ │ ├── MediaFileSummary.java │ │ │ ├── KmlOptionSetting.java │ │ │ └── FormServiceAsync.java │ │ ├── LayoutUtils.java │ │ ├── exception │ │ │ └── FormNotAvailableException.java │ │ └── externalserv │ │ │ └── ServicesAdminServiceAsync.java │ │ ├── TriFunction.java │ │ ├── submission │ │ ├── SubmissionVisitor.java │ │ ├── SubmissionRepeat.java │ │ ├── SubmissionElement.java │ │ ├── SubmissionField.java │ │ └── type │ │ │ └── jr │ │ │ └── JRTime.java │ │ ├── HttpUtils.java │ │ ├── AggregateStartupImpl.java │ │ ├── exception │ │ ├── ODKFormSubmissionsDisabledException.java │ │ ├── ODKFormNotFoundException.java │ │ ├── ODKExternalServiceCredentialsException.java │ │ ├── ODKParseException.java │ │ ├── ODKFormAlreadyExistsException.java │ │ ├── ODKConversionException.java │ │ └── ODKExternalServiceException.java │ │ ├── format │ │ ├── header │ │ │ └── HeaderFormatter.java │ │ ├── RepeatCallbackFormatter.java │ │ └── SubmissionFormatter.java │ │ ├── task │ │ ├── CsvGenerator.java │ │ └── JsonFileGenerator.java │ │ ├── datamodel │ │ └── FormElementModelVisitor.java │ │ ├── parser │ │ └── Name.java │ │ └── server │ │ └── GeopointHeaderIncludes.java └── test │ └── java │ └── org │ └── opendatakit │ └── common │ ├── testing │ └── ICommonTestSetup.java │ └── persistence │ └── TestRow.java ├── settings.gradle ├── packer ├── scripts │ ├── ansible.sh │ ├── systemd.sh │ ├── sudoers.sh │ ├── update.sh │ ├── sshd.sh │ ├── virtualbox.sh │ ├── networking.sh │ ├── vagrant.sh │ ├── vmware.sh │ ├── minimize.sh │ └── cleanup.sh ├── ansible │ ├── ansible.cfg │ ├── roles │ │ ├── aggregate │ │ │ ├── files │ │ │ │ ├── aggregate-update-issue.sh │ │ │ │ ├── init.sql │ │ │ │ └── aggregate-report-ips.sh │ │ │ └── tasks │ │ │ │ └── main.yml │ │ ├── postgresql │ │ │ └── tasks │ │ │ │ └── main.yml │ │ ├── unattended-upgrades │ │ │ └── tasks │ │ │ │ └── main.yml │ │ └── tomcat │ │ │ ├── tasks │ │ │ └── main.yml │ │ │ └── files │ │ │ └── server.xml │ └── playbook.yml └── Vagrantfile ├── common.gradle ├── cloud-config └── virtualbox │ ├── .gitignore │ └── README.md ├── installer ├── project │ ├── files │ │ ├── LICENSE.txt │ │ ├── sqljdbc_6.0 │ │ │ ├── license.txt │ │ │ ├── sqljdbc41.jar │ │ │ ├── sqljdbc42.jar │ │ │ ├── auth │ │ │ │ ├── x64 │ │ │ │ │ └── sqljdbc_auth.dll │ │ │ │ └── x86 │ │ │ │ │ └── sqljdbc_auth.dll │ │ │ └── install.txt │ │ ├── logo.png │ │ ├── leftSide.png │ │ ├── opendatakit.ico │ │ ├── opendatakit.png │ │ └── mf │ │ │ └── META-INF │ │ │ └── MANIFEST.MF │ └── buildWar.xml └── README.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── libs ├── gwt-google-maps-v3-1.0.1.jar └── gwt-visualization-1.1.2.jar ├── docker └── Dockerfile ├── .gitignore ├── .gitattributes ├── docker-compose ├── initdb │ └── init.sh └── docker-compose.yml ├── gradle.properties.example ├── .github ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE.md └── docs ├── README.md └── build-the-installer-app.md /db/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | datadir 2 | -------------------------------------------------------------------------------- /db/postgresql/.gitignore: -------------------------------------------------------------------------------- 1 | pgdata 2 | -------------------------------------------------------------------------------- /src/main/resources/logback.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'aggregate' -------------------------------------------------------------------------------- /src/main/webapp/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / -------------------------------------------------------------------------------- /src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /packer/scripts/ansible.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | apt-get install ansible -y -------------------------------------------------------------------------------- /common.gradle: -------------------------------------------------------------------------------- 1 | task explodedWar(type: Copy) { 2 | into "$buildDir/exploded" 3 | with war 4 | } -------------------------------------------------------------------------------- /db/mysql/image/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mysql:5.7 2 | 3 | ADD init.sql /docker-entrypoint-initdb.d/init.sql -------------------------------------------------------------------------------- /cloud-config/virtualbox/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.raw 3 | *.vdi 4 | *.war 5 | *.tar.gz 6 | cloud-config.yml 7 | -------------------------------------------------------------------------------- /db/postgresql/image/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:9.6 2 | 3 | ADD init.sh /docker-entrypoint-initdb.d/init.sh -------------------------------------------------------------------------------- /packer/ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | retry_files_enabled = False 3 | 4 | [ssh_connection] 5 | pipelining=True 6 | -------------------------------------------------------------------------------- /installer/project/files/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeForAfrica/aggregate/master/installer/project/files/LICENSE.txt -------------------------------------------------------------------------------- /src/main/webapp/res/OpenDataKit.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeForAfrica/aggregate/master/src/main/webapp/res/OpenDataKit.cer -------------------------------------------------------------------------------- /packer/ansible/roles/aggregate/files/aggregate-update-issue.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | /usr/local/bin/aggregate-report-ips > /etc/issue -------------------------------------------------------------------------------- /src/main/webapp/images/help_dialog_on.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeForAfrica/aggregate/master/src/main/webapp/images/help_dialog_on.jpg -------------------------------------------------------------------------------- /packer/scripts/systemd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751636 4 | apt-get install libpam-systemd 5 | -------------------------------------------------------------------------------- /src/main/webapp/images/help_dialog_off.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeForAfrica/aggregate/master/src/main/webapp/images/help_dialog_off.jpg -------------------------------------------------------------------------------- /db/postgresql/docker-compose.yml: -------------------------------------------------------------------------------- 1 | db: 2 | build: image 3 | volumes: 4 | - ./pgdata:/var/lib/postgresql/data 5 | ports: 6 | - 5432:5432 7 | -------------------------------------------------------------------------------- /installer/project/files/sqljdbc_6.0/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeForAfrica/aggregate/master/installer/project/files/sqljdbc_6.0/license.txt -------------------------------------------------------------------------------- /installer/project/files/logo.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b66b1b38274e0a43a464f11aff04e6526b800e5ac3fa2d697ae462850d3d8ff7 3 | size 3088 4 | -------------------------------------------------------------------------------- /src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e41bb717d73852bfbabdc2b15061259d749d826baa16caf78431410f0ec3bcb6 3 | size 370070 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/map.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e05a76837988733e9071fcdfa31a3bfd1be7516e4ce61ec08865536333c9fd1 3 | size 3416 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/map.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e8d428fd113944b531dd2a7b1c02d1529933266753ec01fb47de6972437ec480 3 | size 33836 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/red_x.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4a606a8758f2a248bc759d985b087fafe0f61fd4646ee8e8a975c30ac957af03 3 | size 3154 4 | -------------------------------------------------------------------------------- /src/main/webapp/odk_color.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1965136c7be26d5bbc2291b5f0d482f150cc4bbc050627bc05d45fcabb2203a0 3 | size 8424 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c536e519e65a4bb787e071c6a90d23bd219c9d409a2123db649d3684acbf3ae7 3 | size 54712 4 | -------------------------------------------------------------------------------- /installer/project/files/leftSide.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc2746e4b38e672a1b6ffa7ea807220ae401cdbd43cd7dda9115018f8f78bce8 3 | size 39531 4 | -------------------------------------------------------------------------------- /libs/gwt-google-maps-v3-1.0.1.jar: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88f4580ccbc14e294b60d67b8aa4b8891f1e295d301f695382130c6ce049b794 3 | size 424996 4 | -------------------------------------------------------------------------------- /libs/gwt-visualization-1.1.2.jar: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8eee0d66760577d858c7bce95f377666a249e7bd7a5571cbfa9981f603e0b74c 3 | size 247451 4 | -------------------------------------------------------------------------------- /src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/webapp/images/bar_chart.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3c566d6e4e037f3f9f87dbad1a3c82a58a74d5b5c4e4fd15e60976320b5fcdde 3 | size 2867 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/bar_chart.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1beb8a10ec0613217fae09cddb0119ef1d2fedd6e834c4c8531ec9cd8b5e9950 3 | size 34278 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/enketo.ico: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88feb9b374449d1bc0b91ae6f3908060736b780c6b5822152252ee703c34b728 3 | size 42166 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/odk_color.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f6ae4a587c1c0d2bfd21bfcb6b5607e1b1bec45aeca37015df7ef1cf4752aa64 3 | size 5011 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/odk_color.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2ea61bee5b62cd74fadad94e99a58cfc3ff07a6224aadc6b51b599d5f4e58bb0 3 | size 44043 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/pie_chart.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:99b11838d61da7080036a359178e788913bde2bc5a37c69fa7e5181bd86e4868 3 | size 3136 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/pie_chart.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9031888c1705fde2d9c444461c6e98d489b2e0558c5e1695b5e81c1437ddf9ce 3 | size 31339 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/playicon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f70d015546dc02635bf804d7b1e6493811dffbeeb519863d91141393865fea9 3 | size 2256 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/red_x.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ad3e947593db8525451f0b21fbc6ed334e406c47de4c75ad117027ae981593df 3 | size 26761 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/tabCorners.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6c73f755670ef0a24ae97f62a64fed91ad0359e1bc30aa7c3afe5d240f9a93a2 3 | size 386 4 | -------------------------------------------------------------------------------- /installer/project/files/opendatakit.ico: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5342e4e9706f5f15821f830e39bec230a423e1a340272f2eb5268883c764313a 3 | size 370070 4 | -------------------------------------------------------------------------------- /installer/project/files/opendatakit.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:366c34d6b5827738efe45313425fe52a660adb0091c6c6a2d588afd4af308dd4 3 | size 14860 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/blue_up_arrow.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41714c1872d9ecca5a33e2d9b463790951f38ab44ea6ed4f1582d6a82c7e30ce 3 | size 3048 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/blue_up_arrow.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41df305e9d4d9a0962ec8afb99b63612cbc57d562e2b353586e354ddefda1554 3 | size 26666 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/green_check.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d421517fbed70851014ab10962fb1819cb9f8b5fd25e02aacbc9b510356ec735 3 | size 3226 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/green_check.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fbf32731c40d4b4eb23ec112e4926846741857e8175365274d1b3b15300c2c06 3 | size 28885 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/help_book_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:00630c07fba15a5d1a4dfec0d7c66a4e230c35cfaa5791d740f2eba4eebe8dcf 3 | size 1593 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/help_icon_off.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b851a3664cf35942a8fac5f92fec0c05a03332af20e29a8695efbd071732045a 3 | size 672 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/help_icon_on.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2a239ef674ee390a5efd550be40e6b6da7e39a228c5b12fe3e3b2b2eafe20c88 3 | size 961 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/mostly_opaque.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bd61bad03dc7d566c4fd0c9ae7eaf42f2f7ebae9b158abf9d0eef2a981730412 3 | size 2793 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/mostly_opaque.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5ae96b6716bdbeeebf3f88774b7417dd76494f9c2967cf263afa814f30c2cf66 3 | size 23518 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/odk_aggregate.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fa13df607bce9fdb9ce1361fe4e91fc405b349cb02b7cb10f57576eeefefe53f 3 | size 4400 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/odk_aggregate.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cd4ea353b029f2a5a7f0fb372f739d4abd4dc767a9140dad072ac3ea489a146a 3 | size 167958 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/tabCorners.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c601475c4958048251c93c4439dedccba4587470bc9738a2342657c8ce5db3c8 3 | size 43529 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/yellow_plus.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79c711cd46ed3c01f10aaba0202f35639d8112dfde04b24d2a1736dbce882a12 3 | size 2905 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/yellow_plus.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5ae2b49a9bb4550a1c9e5983194aaf6cb1894ecd212945a3d88dedbf7cd48af4 3 | size 27802 4 | -------------------------------------------------------------------------------- /installer/project/files/mf/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Archiver-Version: Plexus Archiver 3 | Created-By: Apache Maven 4 | Built-By: user 5 | Build-Jdk: 1.6.0_24 6 | 7 | -------------------------------------------------------------------------------- /src/main/webapp/images/green_right_arrow.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:906548e016c955483b4d472cf1a883e18d4961da9632b5c0c19b4d4c89655ddb 3 | size 3117 4 | -------------------------------------------------------------------------------- /src/main/webapp/images/green_right_arrow.psd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d6e98fc4e0ddf84b395292a22acc285cb67acbddce0f6151072f55e92e5c0313 3 | size 27181 4 | -------------------------------------------------------------------------------- /installer/project/files/sqljdbc_6.0/sqljdbc41.jar: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e69315528dac493898c2f6c177cec6695c53df79566c4356ad6373dfa561bbcd 3 | size 892839 4 | -------------------------------------------------------------------------------- /installer/project/files/sqljdbc_6.0/sqljdbc42.jar: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8fe2cc2e34839e05eb9de47481b892aeb15260b50d59a8071994bc09b285ecbe 3 | size 891084 4 | -------------------------------------------------------------------------------- /packer/ansible/roles/postgresql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: install packages 4 | apt: 5 | pkg: '{{ item }}' 6 | install_recommends: no 7 | with_items: 8 | - postgresql 9 | -------------------------------------------------------------------------------- /db/mysql/image/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE aggregate; 2 | CREATE USER aggregate@'%' IDENTIFIED BY 'aggregate'; 3 | GRANT ALL ON aggregate.* TO aggregate@'%' IDENTIFIED BY 'aggregate'; 4 | FLUSH PRIVILEGES; 5 | -------------------------------------------------------------------------------- /db/test/mysql/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE aggregate; 2 | CREATE USER aggregate@'%' IDENTIFIED BY 'aggregate'; 3 | GRANT ALL ON aggregate.* TO aggregate@'%' IDENTIFIED BY 'aggregate'; 4 | FLUSH PRIVILEGES; 5 | -------------------------------------------------------------------------------- /installer/project/files/sqljdbc_6.0/auth/x64/sqljdbc_auth.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc276090b757e6ce7e7562518dc90efb4b89badd06d6e03286d3c732ae7d48da 3 | size 310120 4 | -------------------------------------------------------------------------------- /installer/project/files/sqljdbc_6.0/auth/x86/sqljdbc_auth.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2521671df0b402e81a3321ae9d3c113ed22edda268b19784ccfac20c297283e7 3 | size 261480 4 | -------------------------------------------------------------------------------- /packer/ansible/playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | become: yes 5 | gather_facts: yes 6 | 7 | roles: 8 | - tomcat 9 | - postgresql 10 | - aggregate 11 | - unattended-upgrades -------------------------------------------------------------------------------- /db/mysql/docker-compose.yml: -------------------------------------------------------------------------------- 1 | db: 2 | build: image 3 | volumes: 4 | - ./datadir:/var/lib/mysql 5 | ports: 6 | - 3306:3306 7 | restart: always 8 | environment: 9 | MYSQL_ROOT_PASSWORD: aggregate 10 | -------------------------------------------------------------------------------- /packer/ansible/roles/unattended-upgrades/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: install 4 | apt: 5 | pkg: unattended-upgrades 6 | state: installed 7 | 8 | - name: run security-updates 9 | command: unattended-upgrades -v -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tomcat:8.0-jre8-alpine 2 | RUN rm -rf /usr/local/tomcat/webapps 3 | COPY webapps /usr/local/tomcat/webapps 4 | COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh 5 | 6 | ENTRYPOINT ["docker-entrypoint.sh"] -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip 6 | -------------------------------------------------------------------------------- /src/main/resources/jdbc.properties.example: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=org.postgresql.Driver 2 | jdbc.resourceName=jdbc/aggregate 3 | jdbc.url=jdbc:postgresql://127.0.0.1/aggregate?autoDeserialize=true 4 | jdbc.username=aggregate 5 | jdbc.password=aggregate 6 | jdbc.schema=aggregate 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | out 4 | target 5 | build 6 | war 7 | .gradle 8 | logs 9 | .settings 10 | gradle.properties 11 | jdbc.properties 12 | security.properties 13 | odk-settings.xml 14 | packer/build/* 15 | packer/packer 16 | packer/packer_cache 17 | .vagrant 18 | *.iso 19 | -------------------------------------------------------------------------------- /db/test/postgresql/init.sql: -------------------------------------------------------------------------------- 1 | CREATE USER aggregate WITH PASSWORD 'aggregate'; 2 | CREATE DATABASE aggregate WITH OWNER aggregate; 3 | GRANT ALL PRIVILEGES ON DATABASE aggregate TO aggregate; 4 | \connect aggregate; 5 | CREATE SCHEMA aggregate; 6 | ALTER SCHEMA aggregate OWNER TO aggregate; 7 | GRANT ALL PRIVILEGES ON SCHEMA aggregate TO aggregate; 8 | -------------------------------------------------------------------------------- /packer/ansible/roles/aggregate/files/init.sql: -------------------------------------------------------------------------------- 1 | CREATE USER aggregate WITH PASSWORD 'aggregate'; 2 | CREATE DATABASE aggregate WITH OWNER aggregate; 3 | GRANT ALL PRIVILEGES ON DATABASE aggregate TO aggregate; 4 | \connect aggregate; 5 | CREATE SCHEMA aggregate; 6 | ALTER SCHEMA aggregate OWNER TO aggregate; 7 | GRANT ALL PRIVILEGES ON SCHEMA aggregate TO aggregate; 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.bin filter=lfs diff=lfs merge=lfs -text 2 | *.dll filter=lfs diff=lfs merge=lfs -text 3 | *.gwt-log filter=lfs diff=lfs merge=lfs -text 4 | *.ico filter=lfs diff=lfs merge=lfs -text 5 | *.jar filter=lfs diff=lfs merge=lfs -text 6 | *.png filter=lfs diff=lfs merge=lfs -text 7 | *.psd filter=lfs diff=lfs merge=lfs -text 8 | *.zip filter=lfs diff=lfs merge=lfs -text 9 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/web/Web.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/persistence/Persistence.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/webapp/javascript/main.js: -------------------------------------------------------------------------------- 1 | var contentLoaded = false; 2 | 3 | // Runs after gwt is finished putting elements on the page 4 | function gwtContentLoaded() { 5 | // Set up window resize handler and call it. 6 | contentLoaded = true; 7 | } 8 | 9 | 10 | //Runs before gwt is finished putting elements on the page 11 | function gwtBeforeContentLoaded() { 12 | // Set up window resize handler 13 | $(window).resize(onWindowResize); 14 | } 15 | -------------------------------------------------------------------------------- /db/postgresql/image/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL 5 | CREATE USER aggregate WITH PASSWORD 'aggregate'; 6 | CREATE DATABASE aggregate WITH OWNER aggregate; 7 | GRANT ALL PRIVILEGES ON DATABASE aggregate TO aggregate; 8 | \connect aggregate; 9 | CREATE SCHEMA aggregate; 10 | ALTER SCHEMA aggregate OWNER TO aggregate; 11 | GRANT ALL PRIVILEGES ON SCHEMA aggregate TO aggregate; 12 | EOSQL 13 | -------------------------------------------------------------------------------- /docker-compose/initdb/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL 5 | CREATE USER aggregate WITH PASSWORD 'aggregate'; 6 | CREATE DATABASE aggregate WITH OWNER aggregate; 7 | GRANT ALL PRIVILEGES ON DATABASE aggregate TO aggregate; 8 | \connect aggregate; 9 | CREATE SCHEMA aggregate; 10 | ALTER SCHEMA aggregate OWNER TO aggregate; 11 | GRANT ALL PRIVILEGES ON SCHEMA aggregate TO aggregate; 12 | EOSQL 13 | -------------------------------------------------------------------------------- /gradle.properties.example: -------------------------------------------------------------------------------- 1 | #Uncomment the line that corresponds to your computer's operating system 2 | #packerZip=https://releases.hashicorp.com/packer/1.3.4/packer_1.3.4_linux_amd64.zip 3 | #packerZip=https://releases.hashicorp.com/packer/1.3.4/packer_1.3.4_windows_amd64.zip 4 | #packerZip=https://releases.hashicorp.com/packer/1.3.4/packer_1.3.4_darwin_amd64.zip 5 | 6 | #Uncomment and set the path to the installBuilder installation directory 7 | #installBuilderHome=/opt/installbuilder-18.10.0 8 | -------------------------------------------------------------------------------- /src/main/resources/security.properties.example: -------------------------------------------------------------------------------- 1 | security.server.deviceAuthentication=digest 2 | security.server.secureChannelType=REQUIRES_INSECURE_CHANNEL 3 | security.server.channelType=REQUIRES_INSECURE_CHANNEL 4 | security.server.forceHttpsLinks=false 5 | security.server.hostname= 6 | security.server.port=8080 7 | security.server.securePort=8443 8 | security.server.superUserUsername=administrator 9 | security.server.realm.realmString=ODK Aggregate 10 | security.server.checkHostnames=true 11 | -------------------------------------------------------------------------------- /packer/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | 6 | config.vm.box = "debian/stretch64" 7 | config.vm.network "private_network", ip: "192.168.255.11" 8 | 9 | config.vm.synced_folder '.', '/vagrant', disabled: true 10 | config.nfs.functional = false 11 | 12 | config.vm.provision "ansible" do |ansible| 13 | ansible.playbook = "ansible/playbook.yml" 14 | ansible.config_file = "ansible/ansible.cfg" 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /packer/scripts/sudoers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | # Only add the secure path line if it is not already present - Debian 7 4 | # includes it by default. 5 | grep -q 'secure_path' /etc/sudoers \ 6 | || sed -i -e '/Defaults\s\+env_reset/a Defaults\tsecure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' /etc/sudoers; 7 | 8 | # Set up password-less sudo for the vagrant user 9 | echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant; 10 | chmod 440 /etc/sudoers.d/99_vagrant; 11 | -------------------------------------------------------------------------------- /packer/scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | arch="`uname -r | sed 's/^.*[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-[0-9]\{1,2\}\)-//'`" 4 | 5 | apt-get update; 6 | 7 | apt-get -y upgrade linux-image-$arch; 8 | apt-get -y install linux-headers-`uname -r`; 9 | 10 | if [ -d /etc/init ]; then 11 | # update package index on boot 12 | cat </etc/init/refresh-apt.conf; 13 | description "update package index" 14 | start on networking 15 | task 16 | exec /usr/bin/apt-get update 17 | EOF 18 | fi 19 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Closes # 2 | 3 | #### What has been done to verify that this works as intended? 4 | 5 | #### Why is this the best possible solution? Were any other approaches considered? 6 | 7 | #### Are there any risks to merging this code? If so, what are they? 8 | 9 | #### Do we need any specific form for testing your changes? If so, please attach one 10 | 11 | #### Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below. -------------------------------------------------------------------------------- /src/main/webapp/stylesheets/upload.css: -------------------------------------------------------------------------------- 1 | @CHARSET "ISO-8859-1"; 2 | 3 | * { 4 | margin: 0px; 5 | padding: 0px; 6 | } 7 | 8 | h1 { 9 | color: #07115A; 10 | font-size: 20px; 11 | font-weight: bold; 12 | margin-bottom: 20px; 13 | } 14 | 15 | h1, p { 16 | font-family: 'Arial Unicode MS', Arial, sans-serif; 17 | } 18 | 19 | #uploadTable { 20 | margin-top: 20px; 21 | margin-bottom: 20px; 22 | } 23 | 24 | #uploadTable1 { 25 | margin-top: 20px; 26 | margin-bottom: 20px; 27 | } 28 | 29 | #uploadTable2 { 30 | margin-top: 20px; 31 | margin-bottom: 20px; 32 | } 33 | -------------------------------------------------------------------------------- /docker-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | db: 4 | image: postgres:9.6-alpine 5 | ports: 6 | - 5432:5432 7 | volumes: 8 | - ./initdb:/docker-entrypoint-initdb.d 9 | - ./pgdata:/var/lib/postgresql/data 10 | 11 | wait_for_db: 12 | image: dadarek/wait-for-dependencies 13 | depends_on: 14 | - db 15 | command: db:5432 16 | 17 | tomcat8: 18 | depends_on: 19 | - wait_for_db 20 | image: tomcat:alpine 21 | ports: 22 | - 8080:8080 23 | volumes: 24 | - ./webapps:/usr/local/tomcat/webapps -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # ODK Aggregate extended topics 2 | 3 | **Configuration** 4 | - [Configuration files](aggregate-config.md) 5 | - [Supported database configurations](database-configurations.md) 6 | 7 | **Build workflow** 8 | - [Build the Installer app](build-the-installer-app.md) 9 | - [Build and run a Docker image](build-and-run-a-docker-image.md) 10 | - [Build and run with Docker Compose](build-and-run-with-docker-compose.md) 11 | - [Build and run a Virtual Machine](build-and-run-a-virtual-machine.md) 12 | 13 | **Deployment** 14 | - [Cloud-Config setups](../cloud-config/README.md) 15 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/GmePhotoHostType.java: -------------------------------------------------------------------------------- 1 | package org.opendatakit.aggregate.constants.common; 2 | 3 | import java.io.Serializable; 4 | 5 | public enum GmePhotoHostType implements Serializable { 6 | GOOGLE_DRIVE("Google Drive"), 7 | AGGREGATE("ODK Aggregate"); 8 | 9 | private String serviceName; 10 | 11 | private GmePhotoHostType() { 12 | // GWT 13 | } 14 | 15 | private GmePhotoHostType(String name) { 16 | serviceName = name; 17 | } 18 | 19 | public String toString() { 20 | return serviceName; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/odk-security-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packer/scripts/sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | SSHD_CONFIG="/etc/ssh/sshd_config" 4 | 5 | # ensure that there is a trailing newline before attempting to concatenate 6 | sed -i -e '$a\' "$SSHD_CONFIG" 7 | 8 | USEDNS="UseDNS no" 9 | if grep -q -E "^[[:space:]]*UseDNS" "$SSHD_CONFIG"; then 10 | sed -i "s/^\s*UseDNS.*/${USEDNS}/" "$SSHD_CONFIG" 11 | else 12 | echo "$USEDNS" >>"$SSHD_CONFIG" 13 | fi 14 | 15 | GSSAPI="GSSAPIAuthentication no" 16 | if grep -q -E "^[[:space:]]*GSSAPIAuthentication" "$SSHD_CONFIG"; then 17 | sed -i "s/^\s*GSSAPIAuthentication.*/${GSSAPI}/" "$SSHD_CONFIG" 18 | else 19 | echo "$GSSAPI" >>"$SSHD_CONFIG" 20 | fi 21 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/Security.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packer/scripts/virtualbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | # set a default HOME_DIR environment variable if not set 4 | HOME_DIR="${HOME_DIR:-/home/vagrant}"; 5 | 6 | case "$PACKER_BUILDER_TYPE" in 7 | virtualbox-iso|virtualbox-ovf) 8 | VER="`cat $HOME_DIR/.vbox_version`"; 9 | ISO="VBoxGuestAdditions_$VER.iso"; 10 | mkdir -p /tmp/vbox; 11 | mount -o loop $HOME_DIR/$ISO /tmp/vbox; 12 | sh /tmp/vbox/VBoxLinuxAdditions.run \ 13 | || echo "VBoxLinuxAdditions.run exited $? and is suppressed." \ 14 | "For more read https://www.virtualbox.org/ticket/12479"; 15 | umount /tmp/vbox; 16 | rm -rf /tmp/vbox; 17 | rm -f $HOME_DIR/*.iso; 18 | ;; 19 | esac 20 | -------------------------------------------------------------------------------- /packer/scripts/networking.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | debian_version="`lsb_release -r | awk '{print $2}'`"; 4 | major_version="`echo $debian_version | awk -F. '{print $1}'`"; 5 | 6 | 7 | if [ "$major_version" -le "8" ]; then 8 | echo "Disabling automatic udev rules for network interfaces in Debian" 9 | # Disable automatic udev rules for network interfaces in Ubuntu, 10 | # source: http://6.ptmc.org/164/ 11 | rm -f /etc/udev/rules.d/70-persistent-net.rules; 12 | mkdir -p /etc/udev/rules.d/70-persistent-net.rules; 13 | rm -f /lib/udev/rules.d/75-persistent-net-generator.rules; 14 | rm -rf /dev/.udev/ /var/lib/dhcp/*; 15 | fi 16 | 17 | # Adding a 2 sec delay to the interface up, to make the dhclient happy 18 | echo "pre-up sleep 2" >> /etc/network/interfaces 19 | -------------------------------------------------------------------------------- /src/main/webapp/javascript/upload_control.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Clear the media file input field. 3 | * 4 | * @param fieldId 5 | */ 6 | function clearMediaInputField(fieldId) { 7 | var field = document.getElementById(fieldId); 8 | if ( field != null ) { 9 | field.value = ''; 10 | if ( field.value != '') { 11 | /* must be IE */ 12 | var id = field.getAttribute('id'); 13 | var size = field.getAttribute('size'); 14 | var name = field.getAttribute('name'); 15 | var replacement = document.createElement("input"); 16 | replacement.setAttribute("id", id); 17 | replacement.setAttribute("size", size); 18 | replacement.setAttribute("name", name); 19 | replacement.setAttribute("type", "file"); 20 | field.parentNode.replaceChild(replacement, field); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packer/scripts/vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | # set a default HOME_DIR environment variable if not set 4 | HOME_DIR="${HOME_DIR:-/home/vagrant}"; 5 | 6 | pubkey_url="https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub"; 7 | mkdir -p $HOME_DIR/.ssh; 8 | if command -v wget >/dev/null 2>&1; then 9 | wget --no-check-certificate "$pubkey_url" -O $HOME_DIR/.ssh/authorized_keys; 10 | elif command -v curl >/dev/null 2>&1; then 11 | curl --insecure --location "$pubkey_url" > $HOME_DIR/.ssh/authorized_keys; 12 | elif command -v fetch >/dev/null 2>&1; then 13 | fetch -am -o $HOME_DIR/.ssh/authorized_keys "$pubkey_url"; 14 | else 15 | echo "Cannot download vagrant public key"; 16 | exit 1; 17 | fi 18 | chown -R vagrant $HOME_DIR/.ssh; 19 | chmod -R go-rwsx $HOME_DIR/.ssh; 20 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/util/DateTimeUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.util; 18 | 19 | public class DateTimeUtils { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/EnumListBox.java: -------------------------------------------------------------------------------- 1 | package org.opendatakit.aggregate.client.widgets; 2 | 3 | public final class EnumListBox> extends AggregateListBox { 4 | 5 | public EnumListBox(T[] values, String tooltipText, String helpBalloonTxt) { 6 | super(tooltipText, false, helpBalloonTxt); 7 | 8 | if (values == null) { 9 | return; 10 | } 11 | 12 | // populate values 13 | for (T val : values) { 14 | addItem(val.toString(), val.name()); 15 | } 16 | } 17 | 18 | public String getSelectedValue() { 19 | int selectedIndex = getSelectedIndex(); 20 | if (selectedIndex > -1) { 21 | String value = getValue(selectedIndex); 22 | return value; 23 | } else { 24 | return null; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/BinaryOption.java: -------------------------------------------------------------------------------- 1 | package org.opendatakit.aggregate.constants.common; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Enum of how binary data should be handled. Used when configuring aggregate's 7 | * external services connections. 8 | * 9 | * @author wbrunette@gmail.com 10 | * @author mitchellsundt@gmail.com 11 | */ 12 | public enum BinaryOption implements Serializable { 13 | PROVIDE_LINKS("Links(URLs) to Media"), 14 | EMBED_BINARY("Embed the Media Binary"); 15 | 16 | private String descriptionOfOption; 17 | 18 | private BinaryOption() { 19 | // GWT 20 | } 21 | 22 | private BinaryOption(String desc) { 23 | descriptionOfOption = desc; 24 | } 25 | 26 | public String toString() { 27 | return descriptionOfOption; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/TriFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate; 18 | 19 | @FunctionalInterface 20 | public interface TriFunction { 21 | W apply(T t, U u, V v); 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/org/opendatakit/common/testing/ICommonTestSetup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.testing; 18 | 19 | public interface ICommonTestSetup { 20 | public void setup(); 21 | } 22 | -------------------------------------------------------------------------------- /packer/ansible/roles/tomcat/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: install packages 4 | apt: 5 | pkg: '{{ item }}' 6 | install_recommends: no 7 | with_items: 8 | - tomcat8 9 | - authbind 10 | - libservlet3.1-java 11 | 12 | - name: copy server.xml 13 | copy: 14 | src: server.xml 15 | dest: /etc/tomcat8/server.xml 16 | group: tomcat8 17 | mode: 0640 18 | 19 | - name: copy server.xml.original 20 | copy: 21 | src: server.xml.original 22 | dest: /etc/tomcat8/server.xml.original 23 | group: tomcat8 24 | mode: 0640 25 | 26 | - name: copy tomcat8 27 | copy: 28 | src: tomcat8 29 | dest: /etc/default/tomcat8 30 | mode: 0644 31 | 32 | - name: configure authbind 33 | file: 34 | path: '/etc/authbind/byport/{{ item }}' 35 | state: touch 36 | owner: tomcat8 37 | mode: 0744 38 | with_items: 39 | - 80 40 | - 443 -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/submission/SubmissionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.submission; 17 | 18 | public interface SubmissionVisitor { 19 | 20 | boolean traverse(SubmissionElement element); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/utils/WebStartup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.utils; 17 | 18 | import org.opendatakit.common.web.CallingContext; 19 | 20 | public interface WebStartup { 21 | void doStartupAction(CallingContext bootstrapCc); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/HelpSliderConsts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | public interface HelpSliderConsts { 20 | public String getTitle(); 21 | 22 | public String getContent(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/popups/KmlSelectionGeneration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.popups; 18 | 19 | import org.opendatakit.aggregate.client.form.KmlSelection; 20 | 21 | interface KmlSelectionGeneration { 22 | KmlSelection generateKmlSelection(); 23 | } 24 | -------------------------------------------------------------------------------- /packer/scripts/vmware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | # set a default HOME_DIR environment variable if not set 4 | HOME_DIR="${HOME_DIR:-/home/vagrant}"; 5 | 6 | case "$PACKER_BUILDER_TYPE" in 7 | vmware-iso|vmware-vmx) 8 | mkdir -p /tmp/vmware; 9 | mkdir -p /tmp/vmware-archive; 10 | mount -o loop $HOME_DIR/linux.iso /tmp/vmware; 11 | 12 | TOOLS_PATH="`ls /tmp/vmware/VMwareTools-*.tar.gz`"; 13 | VER="`echo "${TOOLS_PATH}" | cut -f2 -d'-'`"; 14 | MAJ_VER="`echo ${VER} | cut -d '.' -f 1`"; 15 | 16 | echo "VMware Tools Version: $VER"; 17 | 18 | tar xzf ${TOOLS_PATH} -C /tmp/vmware-archive; 19 | if [ "${MAJ_VER}" -lt "10" ]; then 20 | /tmp/vmware-archive/vmware-tools-distrib/vmware-install.pl --default; 21 | else 22 | /tmp/vmware-archive/vmware-tools-distrib/vmware-install.pl --force-install; 23 | fi 24 | umount /tmp/vmware; 25 | rm -rf /tmp/vmware; 26 | rm -rf /tmp/vmware-archive; 27 | rm -f $HOME_DIR/*.iso; 28 | ;; 29 | esac 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/SubTabInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client; 18 | 19 | import org.opendatakit.aggregate.constants.common.HelpSliderConsts; 20 | 21 | public interface SubTabInterface { 22 | boolean canLeave(); 23 | 24 | void update(); 25 | 26 | HelpSliderConsts[] getHelpSliderContent(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/UIDisplayType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | 22 | public enum UIDisplayType implements Serializable { 23 | TEXT, 24 | BINARY, 25 | REPEAT; 26 | 27 | private UIDisplayType() { 28 | // GWT 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/webapp/stylesheets/table.css: -------------------------------------------------------------------------------- 1 | .evenTableRow td { 2 | background-color: #dfdfdf; 3 | } 4 | .dataTable .dataLeft { 5 | text-align: left; 6 | } 7 | .dataTable .dataRight { 8 | text-align: right; 9 | } 10 | .dataTable td { 11 | padding: 0px 1px 0px 1px; 12 | text-align: center; 13 | } 14 | .titleBar td { 15 | padding-left: 6px; 16 | padding-right: 6px; 17 | text-align: center; 18 | background: #07115A; 19 | color: #a1abff; 20 | font-weight: bold; 21 | } 22 | .dataTable { 23 | border-collapse: collapse; 24 | border-width: 1px; 25 | border-style: solid; 26 | border-color: #07115A; 27 | } 28 | 29 | .exportTable td { 30 | padding: 3px 10px 3px 10px; 31 | text-align: center; 32 | } 33 | 34 | .disabledTableRow td { 35 | color: #B0B0B0; 36 | background-color: #F8F8F8; 37 | } 38 | 39 | .enabledTableRow td { 40 | color: #000000; 41 | background-color: #ffffff; 42 | } 43 | 44 | .tableList { 45 | border-collapse: collapse; 46 | border-width: 1px; 47 | border-style: solid; 48 | border-color: #07115A; 49 | width:100%; 50 | } 51 | -------------------------------------------------------------------------------- /packer/ansible/roles/aggregate/files/aggregate-report-ips.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | propsFile=/var/lib/tomcat8/webapps/ROOT/WEB-INF/classes/security.properties 4 | rawHostname=$(grep hostname ${propsFile} | awk '{split($0,a,"="); print a[2]}') 5 | hostname=${rawHostname:-localhost} 6 | httpPort=$(grep port ${propsFile} | awk '{split($0,a,"="); print a[2]}') 7 | version=$(cat /usr/local/bin/aggregate-version) 8 | ips=$(hostname -I) 9 | 10 | echo "> Welcome to ODK Aggregate VM $version" 11 | echo "> 1. Open the web browser on your computer" 12 | if [ ${httpPort} = "80" ]; then 13 | echo "> 2. Go to http://${hostname}" 14 | else 15 | echo "> 2. Go to http://${hostname}:${httpPort}" 16 | fi 17 | echo "> 3. Sign in with the Aggregate password" 18 | echo "> Need help? Go to https://docs.opendatakit.org/aggregate-vm" 19 | echo "" 20 | 21 | if [ ! -z ${ips} ]; then 22 | echo "> If the above URL does not work, try connecting to these IP addresses instead" 23 | echo "${ips}" | while IFS= read -r line ; do echo "> - ${line}"; done 24 | echo "" 25 | fi 26 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/utils/Utils.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/spring/SpringInternals.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.security.spring; 18 | 19 | /** 20 | * Miscellaneous things that tightly couple our implementation to Spring frameworks. 21 | * 22 | * @author mitchellsundt@gmail.com 23 | */ 24 | public class SpringInternals { 25 | 26 | public static final String SAVED_REQUEST = "SPRING_SECURITY_SAVED_REQUEST"; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/odk-common-security-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | classpath:jdbc.properties 12 | classpath:security.properties 13 | classpath:logging.properties 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/HttpUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate; 18 | 19 | import javax.servlet.http.HttpServletResponse; 20 | 21 | public class HttpUtils { 22 | public static void redirect(HttpServletResponse resp, String url) { 23 | // Can't use resp.sendRedirect() because it messes up 24 | // the domain and ports when Aggregate is running behind a proxy 25 | resp.setStatus(302); 26 | resp.setHeader("Location", url); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/AggregateStartupImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate; 17 | 18 | import org.opendatakit.common.utils.WebStartup; 19 | import org.opendatakit.common.web.CallingContext; 20 | 21 | public class AggregateStartupImpl implements WebStartup { 22 | 23 | public AggregateStartupImpl() { 24 | } 25 | 26 | @Override 27 | public void doStartupAction(CallingContext bootstrapCc) { 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /packer/scripts/minimize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | case "$PACKER_BUILDER_TYPE" in 4 | qemu) exit 0 ;; 5 | esac 6 | 7 | # Whiteout root 8 | count=$(df --sync -kP / | tail -n1 | awk -F ' ' '{print $4}') 9 | count=$(($count-1)) 10 | dd if=/dev/zero of=/tmp/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; 11 | rm /tmp/whitespace 12 | 13 | # Whiteout /boot 14 | count=$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}') 15 | count=$(($count-1)) 16 | dd if=/dev/zero of=/boot/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; 17 | rm /boot/whitespace 18 | 19 | set +e 20 | swapuuid="`/sbin/blkid -o value -l -s UUID -t TYPE=swap`"; 21 | case "$?" in 22 | 2|0) ;; 23 | *) exit 1 ;; 24 | esac 25 | set -e 26 | 27 | if [ "x${swapuuid}" != "x" ]; then 28 | # Whiteout the swap partition to reduce box size 29 | # Swap is disabled till reboot 30 | swappart="`readlink -f /dev/disk/by-uuid/$swapuuid`"; 31 | /sbin/swapoff "$swappart"; 32 | dd if=/dev/zero of="$swappart" bs=1M || echo "dd exit code $? is suppressed"; 33 | /sbin/mkswap -U "$swapuuid" "$swappart"; 34 | fi 35 | 36 | sync; 37 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/utils/GwtShims.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.utils; 18 | 19 | import com.google.gwt.i18n.client.DateTimeFormat; 20 | import java.util.Date; 21 | 22 | public class GwtShims { 23 | public static String gwtFormatDateHuman(Date date) { 24 | return DateTimeFormat.getFormat("MMM dd, yyyy").format(date); 25 | } 26 | 27 | public static String gwtFormatDateTimeHuman(Date date) { 28 | return DateTimeFormat.getFormat("MMM dd, yyyy HH:mm:ss a").format(date); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/preferences/PreferenceServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.preferences; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | 21 | public interface PreferenceServiceAsync { 22 | 23 | void getPreferences(AsyncCallback callback); 24 | 25 | void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions, AsyncCallback callback); 26 | 27 | void getVersioNote(AsyncCallback callback); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKFormSubmissionsDisabledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.exception; 19 | 20 | /** 21 | * Exception for the case that a form already exists with the ODK specified 22 | * 23 | * @author wbrunette@gmail.com 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class ODKFormSubmissionsDisabledException extends Exception { 27 | public ODKFormSubmissionsDisabledException() { 28 | super(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/handlers/RefreshOpenHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.handlers; 18 | 19 | import com.google.gwt.event.logical.shared.OpenEvent; 20 | import com.google.gwt.event.logical.shared.OpenHandler; 21 | import org.opendatakit.aggregate.client.AggregateUI; 22 | 23 | public class RefreshOpenHandler implements OpenHandler { 24 | @Override 25 | public void onOpen(OpenEvent event) { 26 | AggregateUI.resize(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKFormNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.exception; 19 | 20 | /** 21 | * Exception for the case that a form was not able to be found with the 22 | * corresponding ODK ID 23 | * 24 | * @author wbrunette@gmail.com 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public class ODKFormNotFoundException extends Exception { 28 | public ODKFormNotFoundException(Throwable cause) { 29 | super(cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/filter/FilterServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.filter; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | 21 | public interface FilterServiceAsync { 22 | 23 | void updateFilterGroup(FilterGroup group, AsyncCallback callback); 24 | 25 | void deleteFilterGroup(FilterGroup group, AsyncCallback callback); 26 | 27 | void getFilterSet(String formId, AsyncCallback callback); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/handlers/RefreshCloseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.handlers; 18 | 19 | import com.google.gwt.event.logical.shared.CloseEvent; 20 | import com.google.gwt.event.logical.shared.CloseHandler; 21 | import org.opendatakit.aggregate.client.AggregateUI; 22 | 23 | public class RefreshCloseHandler implements CloseHandler { 24 | @Override 25 | public void onClose(CloseEvent event) { 26 | AggregateUI.resize(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKExternalServiceCredentialsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.exception; 18 | 19 | /** 20 | * @author wbrunette@gmail.com 21 | * @author mitchellsundt@gmail.com 22 | */ 23 | public class ODKExternalServiceCredentialsException extends ODKExternalServiceException { 24 | public ODKExternalServiceCredentialsException(String message) { 25 | super(message); 26 | } 27 | 28 | public ODKExternalServiceCredentialsException(Throwable cause) { 29 | super(cause); 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/SecurityUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security; 17 | 18 | /** 19 | * Helpful utilities used by presentation layer and security services layers. 20 | * 21 | * @author mitchellsundt@gmail.com 22 | */ 23 | public final class SecurityUtils { 24 | public static final String USERNAME_COLON = "username:"; 25 | public static final String MAILTO_COLON = "mailto:"; 26 | public static final String AT_SIGN = "@"; 27 | 28 | private SecurityUtils() { 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/AggregateSubTabBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client; 18 | 19 | import com.google.gwt.user.client.ui.FlowPanel; 20 | import org.opendatakit.aggregate.constants.common.HelpSliderConsts; 21 | 22 | public abstract class AggregateSubTabBase extends FlowPanel implements SubTabInterface { 23 | 24 | public abstract boolean canLeave(); 25 | 26 | public abstract void update(); 27 | 28 | public HelpSliderConsts[] getHelpSliderContent() { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/handlers/RefreshSelectionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.handlers; 18 | 19 | import com.google.gwt.event.logical.shared.SelectionEvent; 20 | import com.google.gwt.event.logical.shared.SelectionHandler; 21 | import org.opendatakit.aggregate.client.AggregateUI; 22 | 23 | public class RefreshSelectionHandler implements SelectionHandler { 24 | @Override 25 | public void onSelection(SelectionEvent event) { 26 | AggregateUI.resize(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/GeoPointConsts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | public class GeoPointConsts { 20 | 21 | // GEOPOINT structured field has the following ordinal interpretations... 22 | public static final int GEOPOINT_LATITUDE_ORDINAL_NUMBER = 1; 23 | public static final int GEOPOINT_LONGITUDE_ORDINAL_NUMBER = 2; 24 | public static final int GEOPOINT_ALTITUDE_ORDINAL_NUMBER = 3; 25 | public static final int GEOPOINT_ACCURACY_ORDINAL_NUMBER = 4; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/persistence/ITaskLockType.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 University of Washington 3 |

4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | in compliance with the License. You may obtain a copy of the License at 6 |

7 | http://www.apache.org/licenses/LICENSE-2.0 8 |

9 | Unless required by applicable law or agreed to in writing, software distributed under the License 10 | is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | or implied. See the License for the specific language governing permissions and limitations under 12 | the License. 13 | */ 14 | package org.opendatakit.common.persistence; 15 | 16 | /** 17 | * Interface defining the methods that a TaskLockType must implement. 18 | * Enums defining the tasks for an application should implement this interface. 19 | * 20 | * @author mitchellsundt@gmail.com 21 | * @author wbrunette@gmail.com 22 | */ 23 | public interface ITaskLockType { 24 | 25 | public String getName(); 26 | 27 | public long getLockExpirationTimeout(); 28 | 29 | public long getMinSettleTime(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.exception; 19 | 20 | /** 21 | * Exception for the case a parsing problem occurs 22 | * 23 | * @author wbrunette@gmail.com 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class ODKParseException extends Exception { 27 | public ODKParseException(String message) { 28 | super(message); 29 | } 30 | 31 | public ODKParseException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/web/client/UIEnabledPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.web.client; 18 | 19 | /** 20 | * Interface passed to ValidatingTextInputCell and other classes 21 | * to determine whether or not the input element should be 22 | * disabled. If the predicate returns false, element input is disabled. 23 | * 24 | * @param type of the backing object for the row containing the cell. 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public interface UIEnabledPredicate { 28 | boolean isEnabled(T info); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/web/client/UIVisiblePredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.web.client; 18 | 19 | /** 20 | * Interface passed to ValidatingTextInputCell and other classes 21 | * to determine whether or not the input element should be 22 | * visible. If the predicate returns false, the element is not visible. 23 | * 24 | * @param type of the backing object for the row containing the cell. 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public interface UIVisiblePredicate { 28 | boolean isVisible(T key); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/externalservice/JsonServerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.constants.externalservice; 19 | 20 | /** 21 | * @author wbrunette@gmail.com 22 | * @author mitchellsundt@gmail.com 23 | */ 24 | public enum JsonServerType { 25 | STRING("string"), 26 | NUMBER("number"), 27 | GPS("gps"), 28 | CONTENT_TYPE("content_type"), 29 | DATE("date"); 30 | 31 | private String jsonServerType; 32 | 33 | private JsonServerType(String value) { 34 | jsonServerType = value; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /installer/README.md: -------------------------------------------------------------------------------- 1 | # ODK Aggregate installer build source files 2 | 3 | This folder contains the installer build source files. 4 | 5 | ## dummyApp 6 | 7 | This folder contains a dummyApp used to remove existing default and background instances from GAE before uploading the new ones. 8 | 9 | ## installBuilder 10 | 11 | This folder contains the InstallBuilder project base. 12 | 13 | ## platforms 14 | 15 | This folder contains configuration files for all the platforms and environments we can support. 16 | 17 | ## ear.zip 18 | 19 | This package contains the EAR structure of the AppEngine app. 20 | 21 | ## gae.zip 22 | 23 | This package contains various tools used to deploy to Google AppEngine. 24 | 25 | This package includes the ODK Aggregate AppEngine updater application's JAR file, which is maintained in the [Aggregate Components repo](https://github.com/opendatakit/aggregate-components). 26 | 27 | ## legaremoval.zip 28 | 29 | This package contains tools to remove legacy apps from AppEngine. 30 | 31 | ## other.zip 32 | 33 | This package contains other required tools and conf files for the installer project. 34 | 35 | ## sqljdbc_6.0.zip 36 | 37 | This package contains the Microsoft SQLServer JDBC driver the installer uses when deploying on Tomcat and SQLServer. -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKFormAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.exception; 19 | 20 | /** 21 | * Exception for the case that a form already exists with the ODK specified 22 | * 23 | * @author wbrunette@gmail.com 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class ODKFormAlreadyExistsException extends Exception { 27 | public ODKFormAlreadyExistsException() { 28 | super(); 29 | } 30 | 31 | public ODKFormAlreadyExistsException(String message) { 32 | super(message); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/persistence/TaskLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.persistence; 17 | 18 | import org.opendatakit.common.persistence.exception.ODKTaskLockException; 19 | 20 | /** 21 | * @author wbrunette@gmail.com 22 | * @author mitchellsundt@gmail.com 23 | */ 24 | public interface TaskLock { 25 | 26 | boolean obtainLock(String lockId, String formId, ITaskLockType taskType); 27 | 28 | boolean renewLock(String lockId, String formId, ITaskLockType taskType); 29 | 30 | boolean releaseLock(String lockId, String formId, ITaskLockType taskType) throws ODKTaskLockException; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/client/security/SecurityServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.security.client.security; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | import org.opendatakit.common.security.client.RealmSecurityInfo; 21 | import org.opendatakit.common.security.client.UserSecurityInfo; 22 | 23 | public interface SecurityServiceAsync { 24 | 25 | void getUserInfo(AsyncCallback callback); 26 | 27 | void getRealmInfo(String xsrfString, 28 | AsyncCallback callback); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/FormElementNamespace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.constants.common; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * Form Element Model components come in 2 flavors. 22 | * METADATA -- uiVersion, version, instanceID, submissionDateTime, isComplete. 23 | * VALUES -- data within the form submission itself. 24 | * 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public enum FormElementNamespace implements Serializable { 28 | METADATA, 29 | VALUES; 30 | 31 | private FormElementNamespace() { 32 | // GWT 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/submission/SubmissionServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.submission; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | import org.opendatakit.aggregate.client.filter.FilterGroup; 21 | 22 | public interface SubmissionServiceAsync { 23 | 24 | void getSubmissions(FilterGroup filter, AsyncCallback callback); 25 | 26 | void getRepeatSubmissions(String keyString, AsyncCallback callback); 27 | 28 | void getSubmissionAuditCSV(String keyString, AsyncCallback async); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKConversionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.exception; 19 | 20 | /** 21 | * Exception for problems taking data from a submission and converting 22 | * the data to be stored in the data store 23 | * 24 | * @author wbrunette@gmail.com 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public class ODKConversionException extends Exception { 28 | public ODKConversionException(String message) { 29 | super(message); 30 | } 31 | 32 | public ODKConversionException(Throwable cause) { 33 | super(cause); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/web/client/BooleanValidationPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.web.client; 18 | 19 | /** 20 | * Interface passed to UIEnabledValidatingCheckboxCell 21 | * to validate the prospective value before allowing the UI to 22 | * update to that value. If the predicate returns false, no 23 | * value change occurs. 24 | * 25 | * @param type of the backing object for the row containing the cell. 26 | * @author mitchellsundt@gmail.com 27 | */ 28 | public interface BooleanValidationPredicate { 29 | public boolean isValid(boolean prospectiveValue, T key); 30 | } 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 14 | 15 | #### Software and hardware versions 16 | Windows/Linux/macOS, Aggregate v1.x.x, Java vx.x.x, ... 17 | 18 | #### Problem description 19 | 20 | #### Steps to reproduce the problem 21 | 22 | #### Expected behavior 23 | 24 | #### Other information 25 | Things you tried, stack traces, related issues, suggestions on how to fix it... 26 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/web/client/StringValidationPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.web.client; 18 | 19 | /** 20 | * Interface passed to ValidatingTextInputCell and other classes 21 | * to validate the prospective value before allowing the UI to 22 | * update to that value. If the predicate returns false, no 23 | * value change occurs. 24 | * 25 | * @param type of the backing object for the row containing the cell. 26 | * @author mitchellsundt@gmail.com 27 | */ 28 | public interface StringValidationPredicate { 29 | public boolean isValid(String prospectiveValue, T key); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/RowOrCol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * This enum defines whether it is a row filter or column filter. 23 | */ 24 | public enum RowOrCol implements Serializable { 25 | ROW("Rows"), COLUMN("Columns"); 26 | 27 | private String displayText; 28 | 29 | private RowOrCol() { 30 | // GWT 31 | } 32 | 33 | private RowOrCol(String display) { 34 | displayText = display; 35 | } 36 | 37 | public String toString() { 38 | return displayText; 39 | } 40 | 41 | }; 42 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/format/header/HeaderFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.format.header; 17 | 18 | import java.util.List; 19 | import org.opendatakit.aggregate.datamodel.FormElementModel; 20 | import org.opendatakit.aggregate.datamodel.FormElementModel.ElementType; 21 | import org.opendatakit.aggregate.form.IForm; 22 | 23 | /** 24 | * @author wbrunette@gmail.com 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public interface HeaderFormatter { 28 | public List generateHeaders(IForm form, FormElementModel rootGroup, List propertyNames); 29 | 30 | public List getHeaderTypes(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/SecurityBeanDefs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security; 17 | 18 | /** 19 | * Static class defining bean names that must be in sync with the names in 20 | *

WEB-INF/applicationContext-security.xml
. 21 | * 22 | * @author mitchellsundt@gmail.com 23 | */ 24 | public final class SecurityBeanDefs { 25 | public static final String BASIC_AUTH_PASSWORD_ENCODER = "basicAuthenticationMessageDigestPasswordEncoder"; 26 | public static final String ROLE_HIERARCHY_MANAGER = "hierarchicalRoleRelationships"; 27 | 28 | private SecurityBeanDefs() { 29 | } 30 | 31 | ; 32 | } 33 | -------------------------------------------------------------------------------- /installer/project/files/sqljdbc_6.0/install.txt: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | Microsoft JDBC Driver 6.0 for SQL Server 3 | 4 | 5 | INTRODUCTION 6 | ------------ 7 | These are instructions for unpacking the sqljdbc__enu.exe and the 8 | sqljdbc__enu.tar.gz. 9 | 10 | 11 | WINDOWS 12 | ------- 13 | 1. Read the license.txt file. Downloading and using the Microsoft JDBC Driver 6.0 for SQL Server signifies acceptance of this license. 14 | 15 | 2. Download the sqljdbc__enu.exe to a temporary directory. 16 | 17 | 3. Run sqljdbc__enu.exe 18 | 19 | 4. Enter an install directory when prompted; it is recommended that you unpack 20 | this zip file in %ProgramFiles% with the default directory: 21 | 22 | Microsoft JDBC DRIVER 6.0 for SQL Server 23 | 24 | 25 | UNIX 26 | ---- 27 | 1. Read the license.txt file. Downloading and using the Microsoft JDBC Driver 6.0 for SQL Server signifies acceptance of this license. 28 | 29 | 2. Download the sqljdbc__enu.tar.gz to a temporary directory. 30 | 31 | 3. To unpack the zipped tar, navigate to the directory where you want the 32 | driver unpacked and type: 33 | 34 | gzip -d sqljdbc__enu.tar.gz 35 | 36 | 4. To unpack the tar, move it to the directory where you want the driver 37 | installed and type: 38 | 39 | tar -xf sqljdbc__enu.tar 40 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/exception/ODKExternalServiceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.exception; 18 | 19 | /** 20 | * @author wbrunette@gmail.com 21 | * @author mitchellsundt@gmail.com 22 | */ 23 | public class ODKExternalServiceException extends Exception { 24 | public ODKExternalServiceException() { 25 | super(); 26 | } 27 | 28 | public ODKExternalServiceException(String message) { 29 | super(message); 30 | } 31 | 32 | public ODKExternalServiceException(String message, Throwable cause) { 33 | super(message, cause); 34 | } 35 | 36 | public ODKExternalServiceException(Throwable cause) { 37 | super(cause); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/OperationalStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | 22 | /** 23 | * ACTIVE_PAUSE and ACTIVE_RETRY were added because we wanted to be able to not slow down the watch dog schedule for a single exception 24 | * 25 | * @author wbrunette@gmail.com 26 | */ 27 | public enum OperationalStatus implements Serializable { 28 | ESTABLISHED, 29 | ACTIVE, 30 | ACTIVE_PAUSE, 31 | ACTIVE_RETRY, 32 | PAUSED, 33 | COMPLETED, 34 | ABANDONED, 35 | BAD_CREDENTIALS; 36 | 37 | private OperationalStatus() { 38 | // GWT 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/spring/AggregateUserSaltSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security.spring; 17 | 18 | import org.springframework.security.authentication.dao.SaltSource; 19 | import org.springframework.security.core.userdetails.UserDetails; 20 | 21 | /** 22 | * Fetches the salt used for the Basic Authentication password computation. 23 | * 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class AggregateUserSaltSource implements SaltSource { 27 | 28 | @Override 29 | public Object getSalt(UserDetails userDetail) { 30 | AggregateUser user = (AggregateUser) userDetail; 31 | return user.getSalt(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/ExportType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | 22 | public enum ExportType implements Serializable { 23 | CSV("CSV file"), 24 | KML("KML file"), 25 | JSONFILE("JSON file"); 26 | 27 | private String displayText; 28 | 29 | private ExportType() { 30 | // GWT 31 | } 32 | 33 | private ExportType(String display) { 34 | displayText = display; 35 | } 36 | 37 | public String getDisplayText() { 38 | return displayText; 39 | } 40 | 41 | public String toString() { 42 | return displayText; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/externalservice/ExternalServiceConsts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.constants.externalservice; 17 | 18 | /** 19 | * @author wbrunette@gmail.com 20 | * @author mitchellsundt@gmail.com 21 | */ 22 | public final class ExternalServiceConsts { 23 | 24 | public static final String EXT_SERV_ADDRESS = "ServiceAddr"; 25 | public static final String ODK_PERMANENT_ACCESS_WARNING = "NOTE: A selection of 'CONTINUOUS' means ODK Aggregate will maintian permanent access to the spreadsheet"; 26 | public static final String CREATE_EXTERNAL_SERVICE_BUTTON_LABEL = "Create Connection To External Service"; 27 | public static final String FSC_URI_PARAM = "fscUri"; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/SubmissionTabUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client; 18 | 19 | import org.opendatakit.aggregate.constants.common.SubTabs; 20 | import org.opendatakit.aggregate.constants.common.Tabs; 21 | 22 | public class SubmissionTabUI extends AggregateTabBase { 23 | 24 | public SubmissionTabUI(AggregateUI baseUI) { 25 | super(); 26 | 27 | // build the UI 28 | addSubTab(new FilterSubTab(), SubTabs.FILTER); 29 | addSubTab(new ExportSubTab(), SubTabs.EXPORT); 30 | 31 | // register handler to manage tab selection change (and selecting our tab) 32 | registerClickHandlers(Tabs.SUBMISSIONS, baseUI); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/format/RepeatCallbackFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.format; 17 | 18 | import java.util.List; 19 | import org.opendatakit.aggregate.datamodel.FormElementModel; 20 | import org.opendatakit.aggregate.submission.SubmissionSet; 21 | import org.opendatakit.common.persistence.exception.ODKDatastoreException; 22 | import org.opendatakit.common.web.CallingContext; 23 | 24 | /** 25 | * @author wbrunette@gmail.com 26 | * @author mitchellsundt@gmail.com 27 | */ 28 | public interface RepeatCallbackFormatter { 29 | public void processRepeatedSubmssionSetsIntoRow(List repeats, FormElementModel repeatElement, Row row, CallingContext cc) throws ODKDatastoreException; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Redirecting to forms page 7 | 8 | 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 |
Awaiting Redirect
23 | If you are not redirected, please click . If the server has not been accessed recently, this may take a few moments. 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/webapp/logout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Log out of Aggregate 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Close your browser to Log Out
16 |

If you signed in using an Aggregate password, then you must close 17 | all your browser windows and must quit or exit your browser program to log off. 18 | The browser retains your username and password until it is terminated.

19 |

If you signed in using Google (currently disabled), then the server has 20 | logged you off, and you do not need to close your browser.

21 |

Have a nice day!

22 |

Click here to return to home page.

23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/PreferencesConsts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | 20 | public enum PreferencesConsts implements HelpSliderConsts { 21 | GOOGLE("Google API Credentials", "These credentials are used when publishing into Google services."), 22 | ENKETO("Enketo Credentials", "These credentials are used for Enketo webforms integration."); 23 | private String title; 24 | private String content; 25 | 26 | private PreferencesConsts(String titleString, String contentString) { 27 | title = titleString; 28 | content = contentString; 29 | } 30 | 31 | public String getTitle() { 32 | return title; 33 | } 34 | 35 | public String getContent() { 36 | return content; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/ManageTabUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client; 18 | 19 | import org.opendatakit.aggregate.constants.common.SubTabs; 20 | import org.opendatakit.aggregate.constants.common.Tabs; 21 | 22 | public class ManageTabUI extends AggregateTabBase { 23 | 24 | public ManageTabUI(AggregateUI baseUI) { 25 | super(); 26 | 27 | // build the UI 28 | addSubTab(new FormsSubTab(baseUI), SubTabs.FORMS); 29 | addSubTab(new PublishSubTab(), SubTabs.PUBLISH); 30 | addSubTab(new SubmissionAdminSubTab(), SubTabs.SUBMISSION_ADMIN); 31 | 32 | // register handler to manage tab selection change (and selecting our tab) 33 | registerClickHandlers(Tabs.MANAGEMENT, baseUI); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security; 17 | 18 | /** 19 | * Minimal features of a user. Note that the security permissions granted a 20 | * user are not defined here. That is a security aspect that doesn't get 21 | * exposed to the application layer. 22 | * 23 | * @author wbrunette@gmail.com 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public interface User { 27 | String ANONYMOUS_USER = "anonymousUser"; 28 | String ANONYMOUS_USER_NICKNAME = "Anonymous Access"; 29 | 30 | String DAEMON_USER = "aggregate.opendatakit.org:web-service"; 31 | String DAEMON_USER_NICKNAME = "Background Task Account"; 32 | 33 | String getUriUser(); 34 | 35 | boolean isAnonymous(); 36 | 37 | boolean isRegistered(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/AdminTabUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client; 18 | 19 | import org.opendatakit.aggregate.constants.common.SubTabs; 20 | import org.opendatakit.aggregate.constants.common.Tabs; 21 | 22 | public class AdminTabUI extends AggregateTabBase { 23 | 24 | public AdminTabUI(AggregateUI baseUI) { 25 | super(); 26 | 27 | // build the UI 28 | PermissionsSubTab permissionsSubTab = new PermissionsSubTab(); 29 | addSubTab(permissionsSubTab, SubTabs.PERMISSIONS); 30 | addSubTab(new PreferencesSubTab(), SubTabs.PREFERENCES); 31 | 32 | // register handler to manage tab selection change (and selecting our tab) 33 | registerClickHandlers(Tabs.ADMIN, baseUI); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/Tabs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | public enum Tabs implements Serializable { 22 | SUBMISSIONS("Submissions", "submissions"), 23 | MANAGEMENT("Form Management", "management"), 24 | ADMIN("Site Admin", "admin"); 25 | 26 | private String tabLabel; 27 | private String hashString; 28 | 29 | private Tabs() { 30 | // GWT 31 | } 32 | 33 | private Tabs(String label, String hash) { 34 | tabLabel = label; 35 | hashString = hash; 36 | } 37 | 38 | public String getTabLabel() { 39 | return tabLabel; 40 | } 41 | 42 | public String getHashString() { 43 | return hashString; 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/utils/LocaleUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.utils; 18 | 19 | import java.util.Locale; 20 | import java.util.function.Supplier; 21 | 22 | public final class LocaleUtils { 23 | private LocaleUtils() { 24 | // Prevent construction of this class 25 | } 26 | 27 | public synchronized static T withLocale(Locale locale, Supplier supplier) { 28 | Locale backup = Locale.getDefault(); 29 | Locale.setDefault(locale); 30 | T t = supplier.get(); 31 | Locale.setDefault(backup); 32 | return t; 33 | } 34 | 35 | public synchronized static void withLocale(Locale locale, Runnable supplier) { 36 | Locale backup = Locale.getDefault(); 37 | Locale.setDefault(locale); 38 | supplier.run(); 39 | Locale.setDefault(backup); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/task/CsvGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * Copyright (C) 2018 Nafundi 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | package org.opendatakit.aggregate.task; 18 | 19 | import org.opendatakit.aggregate.constants.BeanDefs; 20 | import org.opendatakit.aggregate.form.IForm; 21 | import org.opendatakit.aggregate.submission.SubmissionKey; 22 | import org.opendatakit.common.web.CallingContext; 23 | 24 | public class CsvGenerator { 25 | public void createCsvTask(IForm form, SubmissionKey persistentResultsKey, long attemptCount, CallingContext cc) { 26 | Watchdog wd = (Watchdog) cc.getBean(BeanDefs.WATCHDOG); 27 | CsvWorkerImpl worker = new CsvWorkerImpl(form, persistentResultsKey, attemptCount, wd.getCallingContext()); 28 | AggregrateThreadExecutor.getAggregateThreadExecutor().execute(worker::generateCsv); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/FilterOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * This enum defines the different filter operations which the Query can have. 23 | */ 24 | public enum FilterOperation implements Serializable { 25 | EQUAL("equals"), 26 | NOT_EQUAL("doesn't equal"), 27 | GREATER_THAN(">"), 28 | GREATER_THAN_OR_EQUAL(">="), 29 | LESS_THAN("<"), 30 | LESS_THAN_OR_EQUAL("<="); 31 | 32 | private String displayText; 33 | 34 | private FilterOperation() { 35 | // GWT 36 | } 37 | 38 | private FilterOperation(String display) { 39 | displayText = display; 40 | } 41 | 42 | public String toString() { 43 | return displayText; 44 | } 45 | }; -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/format/SubmissionFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.format; 17 | 18 | import java.util.List; 19 | import org.opendatakit.aggregate.submission.Submission; 20 | import org.opendatakit.common.persistence.exception.ODKDatastoreException; 21 | import org.opendatakit.common.web.CallingContext; 22 | 23 | /** 24 | * @author wbrunette@gmail.com 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public interface SubmissionFormatter { 28 | void beforeProcessSubmissions(CallingContext cc); 29 | 30 | void processSubmissions(List submissions, CallingContext cc) throws ODKDatastoreException; 31 | 32 | void processSubmissionSegment(List submissions, CallingContext cc) throws ODKDatastoreException; 33 | 34 | void afterProcessSubmissions(CallingContext cc); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/datamodel/FormElementModelVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.datamodel; 17 | 18 | import org.opendatakit.common.web.CallingContext; 19 | 20 | /** 21 | * Visitor interface for the {@link FormElementModel#depthFirstTraversal } 22 | * method. 23 | * 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public interface FormElementModelVisitor { 27 | 28 | boolean traverse(FormElementModel element, CallingContext cc); 29 | 30 | boolean enter(FormElementModel element, CallingContext cc); 31 | 32 | boolean descendIntoRepeat(FormElementModel element, int ordinal, CallingContext cc); 33 | 34 | void ascendFromRepeat(FormElementModel element, int ordinal, CallingContext cc); 35 | 36 | void leave(FormElementModel element, CallingContext cc); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/task/JsonFileGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 University of Washington 3 | * Copyright (C) 2018 Nafundi 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.task; 19 | 20 | import org.opendatakit.aggregate.constants.BeanDefs; 21 | import org.opendatakit.aggregate.form.IForm; 22 | import org.opendatakit.aggregate.submission.SubmissionKey; 23 | import org.opendatakit.common.web.CallingContext; 24 | 25 | public class JsonFileGenerator { 26 | public void createJsonFileTask(IForm form, SubmissionKey persistentResultsKey, long attemptCount, CallingContext cc) { 27 | Watchdog wd = (Watchdog) cc.getBean(BeanDefs.WATCHDOG); 28 | JsonFileWorkerImpl worker = new JsonFileWorkerImpl(form, persistentResultsKey, attemptCount, wd.getCallingContext()); 29 | AggregrateThreadExecutor.getAggregateThreadExecutor().execute(worker::generateJsonFile); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/webapp/access-denied.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Access denied 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Access Denied
16 |

You do not have permission for this operation.

17 |

Please click to return to the home page.

20 |

If this does not return you to the home page, then the username you supplied is not authorized to access this server. 21 | Please click to log out and try with a different set of credentials.

24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/utils/OutOfBandUserFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 University of Washington. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.utils; 17 | 18 | /** 19 | * Interface for out-of-band retrieval of the current user's 20 | * credentials. This is applicable to Gae deployments but other 21 | * deployments through portals could potentially leverage this 22 | * functionality. 23 | * 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class OutOfBandUserFetcher { 27 | 28 | /** 29 | * Through means outside the webserver scope, obtain the 30 | * logged-in user's email. This provides a bridge to the 31 | * Google AppEngine OAuth service mechanism for OAuth 32 | * manipulation of the AppEngine instance. 33 | * 34 | * @return the user's email string (mailto:username@domain.org) 35 | */ 36 | public String getEmail() { 37 | return null; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/table/AuditCSVPopupClickHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.table; 18 | 19 | import com.google.gwt.event.dom.client.ClickEvent; 20 | import com.google.gwt.event.dom.client.ClickHandler; 21 | import org.opendatakit.aggregate.client.AggregateUI; 22 | import org.opendatakit.aggregate.client.popups.AuditCSVPopup; 23 | 24 | public class AuditCSVPopupClickHandler implements ClickHandler { 25 | 26 | private final String keyString; 27 | 28 | public AuditCSVPopupClickHandler(String keyString) { 29 | this.keyString = keyString; 30 | } 31 | 32 | @Override 33 | public void onClick(ClickEvent event) { 34 | AuditCSVPopup popup = new AuditCSVPopup(keyString); 35 | popup.setPopupPositionAndShow(popup.getPositionCallBack()); 36 | AggregateUI.getUI().getTimer().restartTimer(); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/form/GeopointElementList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.form; 18 | 19 | import java.io.Serializable; 20 | import java.util.ArrayList; 21 | 22 | public class GeopointElementList implements Serializable { 23 | /** 24 | * Serialization Version Identifier 25 | */ 26 | private static final long serialVersionUID = -7472836506605295283L; 27 | private ArrayList geopointElements = new ArrayList(); 28 | 29 | public void addGeopointElement(String displayName, String elementKey) { 30 | KmlOptionSetting node = new KmlOptionSetting(displayName, elementKey); 31 | geopointElements.add(node); 32 | } 33 | 34 | public ArrayList getGeopointElements() { 35 | return geopointElements; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/HelpDialogsToggleButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.user.client.ui.Image; 20 | 21 | public final class HelpDialogsToggleButton extends AggregateImageToggleButton { 22 | 23 | private static final Image HELP_DIALOG_ICON_ON = new Image("images/help_dialog_on.jpg"); 24 | private static final Image HELP_DIALOG_ICON_OFF = new Image("images/help_dialog_off.jpg"); 25 | private static final String TOOLTIP_TXT = "Help Balloons"; 26 | private static final String HELP_BALLOON_TXT = "This will display a more detailed help balloon when" 27 | + "you hover over an icon."; 28 | 29 | public HelpDialogsToggleButton() { 30 | super(HELP_DIALOG_ICON_OFF, HELP_DIALOG_ICON_ON, TOOLTIP_TXT, HELP_BALLOON_TXT); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/opendatakit/common/persistence/TestRow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.persistence; 17 | 18 | import java.time.LocalDate; 19 | import java.time.OffsetDateTime; 20 | import java.util.Date; 21 | 22 | class TestRow { 23 | public final String stringField; 24 | public final Integer integerField; 25 | public final WrappedBigDecimal doubleField; 26 | public final Date dateField; 27 | public final Boolean booleanField; 28 | 29 | TestRow(String someString, Integer someInteger, Double someDouble, String someDate, Boolean someBoolean) { 30 | stringField = someString; 31 | integerField = someInteger; 32 | doubleField = (someDouble == null) ? null : WrappedBigDecimal.fromDouble(someDouble); 33 | dateField = Date.from(LocalDate.parse(someDate).atStartOfDay().toInstant(OffsetDateTime.now().getOffset())); 34 | booleanField = someBoolean; 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/client/security/admin/SecurityAdminServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.security.client.security.admin; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | import java.util.ArrayList; 21 | import org.opendatakit.common.security.client.UserSecurityInfo; 22 | import org.opendatakit.common.security.common.GrantedAuthorityName; 23 | 24 | public interface SecurityAdminServiceAsync { 25 | 26 | void getAllUsers(boolean withAuthorities, AsyncCallback> callback); 27 | 28 | void setUsersAndGrantedAuthorities(String xsrfString, 29 | ArrayList users, 30 | ArrayList allGroups, 31 | AsyncCallback callback); 32 | } 33 | -------------------------------------------------------------------------------- /packer/ansible/roles/tomcat/files/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/LayoutUtils.java: -------------------------------------------------------------------------------- 1 | package org.opendatakit.aggregate.client; 2 | 3 | import static org.opendatakit.aggregate.buildconfig.BuildConfig.VERSION; 4 | 5 | import com.google.gwt.dom.client.Style; 6 | import com.google.gwt.user.client.rpc.AsyncCallback; 7 | import com.google.gwt.user.client.ui.HTML; 8 | import com.google.gwt.user.client.ui.UIObject; 9 | 10 | public class LayoutUtils { 11 | static HTML buildVersionNote(UIObject parent) { 12 | String shortVersion = VERSION.contains("-") ? VERSION.substring(0, VERSION.indexOf("-")) : VERSION; 13 | HTML html = new HTML("" + shortVersion + " - Checking versions..."); 14 | Style style = html.getElement().getStyle(); 15 | style.setProperty("position", "fixed"); 16 | style.setProperty("bottom", "0"); 17 | style.setProperty("left", "0"); 18 | style.setProperty("padding", "5px 10px"); 19 | style.setProperty("backgroundColor", "rgba(255,255,255,.9)"); 20 | 21 | Style parentStyle = parent.getElement().getStyle(); 22 | parentStyle.setProperty("paddingBottom", "40px"); 23 | 24 | SecureGWT.getPreferenceService().getVersioNote(new AsyncCallback() { 25 | @Override 26 | public void onFailure(Throwable caught) { 27 | html.setHTML("" + shortVersion + " - Version check failed"); 28 | } 29 | 30 | @Override 31 | public void onSuccess(String versionNote) { 32 | html.setHTML("" + versionNote + ""); 33 | } 34 | }); 35 | 36 | return html; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/exception/FormNotAvailableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.exception; 18 | 19 | import java.io.Serializable; 20 | 21 | public class FormNotAvailableException extends RequestFailureException implements Serializable { 22 | private static final String DEFAULT_MSG = "FormNoLongerAvailableException: Form is no longer available from Aggregate"; 23 | 24 | private String message; 25 | 26 | public FormNotAvailableException(Throwable arg0) { 27 | super(arg0); 28 | message = DEFAULT_MSG + "(" + arg0.getMessage() + ")"; 29 | } 30 | 31 | public FormNotAvailableException() { 32 | } 33 | 34 | @Override 35 | public String getLocalizedMessage() { 36 | return message; 37 | } 38 | 39 | @Override 40 | public String getMessage() { 41 | return message; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/filter/FilterService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.filter; 18 | 19 | import com.google.gwt.user.client.rpc.RemoteService; 20 | import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; 21 | import org.opendatakit.aggregate.client.exception.RequestFailureException; 22 | import org.opendatakit.common.persistence.client.exception.DatastoreFailureException; 23 | 24 | @RemoteServiceRelativePath("filterservice") 25 | public interface FilterService extends RemoteService { 26 | 27 | FilterSet getFilterSet(String formId) throws RequestFailureException, DatastoreFailureException; 28 | 29 | String updateFilterGroup(FilterGroup group) throws RequestFailureException, DatastoreFailureException; 30 | 31 | Boolean deleteFilterGroup(FilterGroup group) throws RequestFailureException, DatastoreFailureException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/FormActionStatusTimestamp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | import java.util.Date; 21 | 22 | public class FormActionStatusTimestamp implements Serializable { 23 | 24 | /** 25 | * 26 | */ 27 | private static final long serialVersionUID = 6347744032355543871L; 28 | 29 | private FormActionStatus status; 30 | private Date timestamp; 31 | 32 | public FormActionStatusTimestamp() { 33 | } 34 | 35 | public FormActionStatusTimestamp(FormActionStatus status, Date timestamp) { 36 | this.status = status; 37 | this.timestamp = timestamp; 38 | } 39 | 40 | public FormActionStatus getStatus() { 41 | return status; 42 | } 43 | 44 | public Date getTimestamp() { 45 | return timestamp; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/parser/Name.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 University of Washington 3 |

4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | in compliance with the License. You may obtain a copy of the License at 6 |

7 | http://www.apache.org/licenses/LICENSE-2.0 8 |

9 | Unless required by applicable law or agreed to in writing, software distributed under the License 10 | is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | or implied. See the License for the specific language governing permissions and limitations under 12 | the License. 13 | */ 14 | package org.opendatakit.aggregate.parser; 15 | 16 | /** 17 | * Simple data structure used in {@link NamingSet} to resolve table and column names. 18 | * 19 | * @author mitchellsundt@gmail.com 20 | * @author wbrunette@gmail.com 21 | */ 22 | final class Name { 23 | final String schema; 24 | final String prefix; 25 | final String qualifier; 26 | final String itemName; 27 | 28 | String mungedPrefix = ""; 29 | String mungedQualifier = ""; 30 | String mungedItemName = ""; 31 | 32 | String resolvedName = null; 33 | 34 | Name(String schema, String prefix, String qualifier, String itemName) { 35 | this.schema = schema; 36 | this.prefix = Naming.toPersistenceNaming(prefix); 37 | this.qualifier = Naming.toPersistenceNaming(qualifier); 38 | this.itemName = Naming.toPersistenceNaming(itemName); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/popups/EnketoRedirectErrorPopup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.popups; 18 | 19 | import com.google.gwt.user.client.ui.FlexTable; 20 | import com.google.gwt.user.client.ui.HTML; 21 | import org.opendatakit.aggregate.client.widgets.ClosePopupButton; 22 | 23 | public final class EnketoRedirectErrorPopup extends AbstractPopupBase { 24 | 25 | private final String ENKETO_WEBFORM_ERROR; 26 | 27 | public EnketoRedirectErrorPopup(String submissionKeyAsString) { 28 | super(); 29 | 30 | this.ENKETO_WEBFORM_ERROR = submissionKeyAsString; 31 | 32 | FlexTable layout = new FlexTable(); 33 | 34 | HTML message = new HTML(ENKETO_WEBFORM_ERROR); 35 | layout.setWidget(0, 0, message); 36 | layout.setWidget(0, 2, new ClosePopupButton(this)); 37 | 38 | setWidget(layout); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/format/FormatConsts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.constants.format; 19 | 20 | import org.opendatakit.common.web.constants.BasicConsts; 21 | 22 | 23 | /** 24 | * Constants used for formatting data 25 | * 26 | * @author wbrunette@gmail.com 27 | * @author mitchellsundt@gmail.com 28 | */ 29 | public final class FormatConsts { 30 | 31 | // formatting constants 32 | public static final String CSV_DELIMITER = BasicConsts.COMMA; 33 | public static final String HEADER_CONCAT = BasicConsts.COLON; 34 | public static final String JSON_VALUE_DELIMITER = BasicConsts.COMMA; 35 | public static final String TO_STRING_DELIMITER = BasicConsts.COLON + BasicConsts.SPACE; 36 | public static final String HEADER_PARENT_UID = "*parent_uid*"; 37 | public static final String TIME_FORMAT_STRING = "%02d:%02d:%02d"; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/table/BinaryPopupClickHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.table; 18 | 19 | import com.google.gwt.event.dom.client.ClickEvent; 20 | import com.google.gwt.event.dom.client.ClickHandler; 21 | import org.opendatakit.aggregate.client.AggregateUI; 22 | import org.opendatakit.aggregate.client.popups.BinaryPopup; 23 | 24 | public class BinaryPopupClickHandler implements ClickHandler { 25 | private final String value; 26 | private final boolean larger; 27 | 28 | public BinaryPopupClickHandler(String value, boolean larger) { 29 | this.value = value; 30 | this.larger = larger; 31 | } 32 | 33 | @Override 34 | public void onClick(ClickEvent event) { 35 | BinaryPopup popup = new BinaryPopup(value, larger); 36 | popup.setPopupPositionAndShow(popup.getPositionCallBack()); 37 | AggregateUI.getUI().getTimer().restartTimer(); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/datamodel/ODKEnumeratedElementException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.datamodel; 18 | 19 | import org.opendatakit.common.persistence.exception.ODKDatastoreException; 20 | 21 | 22 | /** 23 | * Exception for the case that a data store does not contain a proper 24 | * Submission; i.e., if there are missing or duplicated entries that 25 | * are identified by sequential ordinal values or part numbers. 26 | * 27 | * @author mitchellsundt@gmail.com 28 | */ 29 | public class ODKEnumeratedElementException extends ODKDatastoreException { 30 | 31 | /** 32 | * Serial number for serialization 33 | */ 34 | private static final long serialVersionUID = 1208668052898763165L; 35 | 36 | /** 37 | * Construct exception with the error message 38 | * 39 | * @param message exception message 40 | */ 41 | public ODKEnumeratedElementException(String message) { 42 | super(message); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/webapp/over-quota.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Quota exceeded 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 |
Quota Exceeded
17 | 18 |

You have exceeded one or more of the per-minute and/or daily usage quotas for your AppEngine application instance.

19 |

Please visit Google Cloud Platform - App Engine Dashboard and select your application id 20 | from the top-right drop-down. The Billing Status section for your application id is displayed beneath the Summary and Instances sections.

21 | Verify that you have not exceeded your free quota or daily spending limit (if you have set up billing) and that you have also not exceeded your per-minute usage limits.

23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/AggregateTextBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.event.logical.shared.ValueChangeEvent; 20 | import com.google.gwt.event.logical.shared.ValueChangeHandler; 21 | import com.google.gwt.user.client.ui.TextBox; 22 | 23 | public class AggregateTextBox extends TextBox implements ValueChangeHandler { 24 | 25 | private final AggregateBaseHandlers handlers; 26 | 27 | public AggregateTextBox(String tooltipText, String helpBalloonText) { 28 | super(); 29 | 30 | addValueChangeHandler(this); 31 | 32 | handlers = new AggregateBaseHandlers(this, tooltipText, helpBalloonText); 33 | addMouseOverHandler(handlers); 34 | addMouseOutHandler(handlers); 35 | } 36 | 37 | @Override 38 | public void onValueChange(ValueChangeEvent event) { 39 | handlers.userAction(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /installer/project/buildWar.xml: -------------------------------------------------------------------------------- 1 | 2 | ODKAggregate 3 | ODK Aggregate 4 | 0.0.0 5 | files/LICENSE.txt 6 | files/leftSide.png 7 | files/logo.png 8 | files/opendatakit.png 9 | 10 | 11 | components/params.xml 12 | 13 | 14 | components/configure_war.xml 15 | 16 | 17 | 0 18 | ${system_username} 19 | 0 20 | 1 21 | 500 22 | http://www.opendatakit.org 23 | asInvoker 24 | 1 25 | Open Data Kit 26 | 700 27 | files/opendatakit.ico 28 | files/opendatakit.ico 29 | 30 | 31 | en 32 | tagfile-en.lng 33 | 34 | 35 | 36 | 37 | ${product_shortname}-${product_version}-${platform_name}-installer.${platform_exec_suffix} 38 | /tmp 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/spring/RetryWithDefinedEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security.spring; 17 | 18 | import org.springframework.security.web.access.channel.AbstractRetryEntryPoint; 19 | 20 | /** 21 | * Enforce the port assignment for a given scheme (i.e., http or https). 22 | * This is used by the channel security filter. 23 | * 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class RetryWithDefinedEntryPoint extends AbstractRetryEntryPoint { 27 | 28 | String scheme; 29 | int port; 30 | 31 | public RetryWithDefinedEntryPoint(String scheme, int port) { 32 | super(scheme, (scheme.contains("s") ? 443 : 80)); // standard port... 33 | this.scheme = scheme; 34 | this.port = port; 35 | } 36 | 37 | protected Integer getMappedPort(Integer mapFromPort) { 38 | // don't care about the origin port -- we only have one port pair. 39 | return port; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/preferences/PreferenceService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.preferences; 18 | 19 | import com.google.gwt.user.client.rpc.RemoteService; 20 | import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; 21 | import com.google.gwt.user.server.rpc.XsrfProtect; 22 | import org.opendatakit.aggregate.client.exception.RequestFailureException; 23 | 24 | /** 25 | * These actions require the ROLE_USER privilege, which is the least capable 26 | * privilege (granted to all authorized users of the system). 27 | * 28 | * @author wbrunette@gmail.com 29 | */ 30 | @RemoteServiceRelativePath("preferenceservice") 31 | public interface PreferenceService extends RemoteService { 32 | PreferenceSummary getPreferences() throws RequestFailureException; 33 | 34 | @XsrfProtect 35 | void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions) throws RequestFailureException; 36 | 37 | String getVersioNote(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/ChartType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | public enum ChartType implements Serializable { 22 | PIE_CHART("Pie Chart", " Pie It"), 23 | BAR_GRAPH("Bar Graph", " Bar It"), 24 | // SCATTER_PLOT("Scatter Plot", "s", " Plot It"), 25 | MAP("Map", " Map It"); 26 | 27 | private String displayText; 28 | private String buttonText; 29 | 30 | private ChartType() { 31 | // GWT 32 | } 33 | 34 | private ChartType(String display, String buttonTxt) { 35 | displayText = display; 36 | buttonText = buttonTxt; 37 | } 38 | 39 | public String getButtonText() { 40 | return buttonText; 41 | } 42 | 43 | public String toString() { 44 | return displayText; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/submission/SubmissionRepeat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.submission; 19 | 20 | import java.util.List; 21 | import org.opendatakit.aggregate.datamodel.FormElementModel; 22 | 23 | /** 24 | * Interface for submission repeat that can be used to store a submission repeat 25 | * in the datastore 26 | * 27 | * @author wbrunette@gmail.com 28 | * @author mitchellsundt@gmail.com 29 | */ 30 | public interface SubmissionRepeat extends SubmissionValue { 31 | 32 | public FormElementModel getElement(); 33 | 34 | public SubmissionKey constructSubmissionKey(); 35 | 36 | public List getSubmissionSets(); 37 | 38 | public void addSubmissionSet(SubmissionSet submissionSet); 39 | 40 | public SubmissionElement resolveSubmissionKeyBeginningAt(int i, 41 | List parts); 42 | 43 | public String getUniqueKeyStr(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /docs/build-the-installer-app.md: -------------------------------------------------------------------------------- 1 | # ODK Aggregate - Build the Installer app 2 | 3 | ODK Aggregate uses BitRock InstallBuilder to generate installer apps for Windows, Linux and Mac hosts. 4 | 5 | The InstallBuilder project files are located under `installer` directory. 6 | 7 | ## Requirements 8 | 9 | **BitRock InstallBuilder** 10 | 11 | You can download it from [this website](https://installbuilder.bitrock.com/). 12 | 13 | ## Instructions 14 | 15 | 1. Copy the `gradle.properties.example` file at the root of the project to the same location, removing the `.example` extension 16 | 17 | Open the file and uncomment the line that corresponds to the operating system of your computer. 18 | 19 | 2. Build the project for the installer build process with `./gradlew clean build installerBuild -xtest -PwarMode=installer` command 20 | 21 | 3. Open BitRock InstallBuilder app and open `build/installer/buildWar.xml` 22 | 23 | For more information about using BitRock InstallBuilder, you can check the [online documentation](https://installbuilder.bitrock.com/docs/installbuilder-userguide/index.html) 24 | 25 | ## Automated installer generation 26 | 27 | InstallBuilder has a command-line interface that can be used to produce the installers automatically: 28 | 29 | ```bash 30 | /path/to/installbuilder/bin/builder build build/installer/buildWar.xml linux-x64 31 | /path/to/installbuilder/bin/builder build build/installer/buildWar.xml linux 32 | /path/to/installbuilder/bin/builder build build/installer/buildWar.xml windows 33 | /path/to/installbuilder/bin/builder build build/installer/buildWar.xml osx 34 | ``` 35 | 36 | The installers will be built at `/path/to/installbuilder/output` 37 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/filter/FilterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.filter; 18 | 19 | import java.io.Serializable; 20 | import java.util.ArrayList; 21 | 22 | public final class FilterSet implements Serializable { 23 | 24 | private static final long serialVersionUID = -7646690488192856868L; 25 | private ArrayList groups = new ArrayList(); 26 | private String formId; 27 | 28 | public FilterSet() { 29 | } 30 | 31 | public FilterSet(String formId) { 32 | this.formId = formId; 33 | } 34 | 35 | public ArrayList getGroups() { 36 | return groups; 37 | } 38 | 39 | /** 40 | * This should add a new filter group to the database 41 | * 42 | * @param group the new group 43 | */ 44 | public void addFilterGroup(FilterGroup group) { 45 | groups.add(group); 46 | } 47 | 48 | public String getFormId() { 49 | return formId; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/form/MediaFileSummary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.form; 18 | 19 | import java.io.Serializable; 20 | 21 | public class MediaFileSummary implements Serializable { 22 | 23 | /** 24 | * 25 | */ 26 | private static final long serialVersionUID = -6087879867808529452L; 27 | 28 | private String filename; 29 | private String contentType; 30 | private Long contentLength; 31 | 32 | public MediaFileSummary() { 33 | } 34 | 35 | public MediaFileSummary(String filename, String contentType, Long contentLength) { 36 | this.filename = filename; 37 | this.contentType = contentType; 38 | this.contentLength = contentLength; 39 | } 40 | 41 | public String getFilename() { 42 | return filename; 43 | } 44 | 45 | public String getContentType() { 46 | return contentType; 47 | } 48 | 49 | public Long getContentLength() { 50 | return contentLength; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/HelpBookToggleButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.event.dom.client.ClickEvent; 20 | import com.google.gwt.user.client.ui.Image; 21 | import org.opendatakit.aggregate.client.popups.HelpBookPopup; 22 | 23 | public final class HelpBookToggleButton extends AggregateImageToggleButton { 24 | 25 | private static final Image HELP_BOOK_ICON = new Image("images/help_book_icon.png"); 26 | private static final String TOOLTIP_TEXT = "Show Detailed Help"; 27 | private static final String HELP_BALLOON_TXT = "This will display a more detailed help popup."; 28 | 29 | public HelpBookToggleButton() { 30 | super(HELP_BOOK_ICON, TOOLTIP_TEXT, HELP_BALLOON_TXT); 31 | } 32 | 33 | @Override 34 | public void onClick(ClickEvent event) { 35 | super.onClick(event); 36 | 37 | HelpBookPopup helpPopup = new HelpBookPopup(); 38 | helpPopup.show(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/AggregateListBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.event.dom.client.ChangeEvent; 20 | import com.google.gwt.event.dom.client.ChangeHandler; 21 | import com.google.gwt.user.client.ui.ListBox; 22 | 23 | public class AggregateListBox extends ListBox implements ChangeHandler { 24 | 25 | private final AggregateBaseHandlers handlers; 26 | 27 | public AggregateListBox(String tooltipText, boolean multipleValueSelection, String helpBalloonText) { 28 | super(); 29 | setMultipleSelect(multipleValueSelection); 30 | 31 | addChangeHandler(this); 32 | 33 | // setup help system 34 | handlers = new AggregateBaseHandlers(this, tooltipText, helpBalloonText); 35 | addMouseOverHandler(handlers); 36 | addMouseOutHandler(handlers); 37 | } 38 | 39 | @Override 40 | public void onChange(ChangeEvent event) { 41 | handlers.userAction(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/BeanDefs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.constants; 17 | 18 | /** 19 | * @author wbrunette@gmail.com 20 | * @author mitchellsundt@gmail.com 21 | */ 22 | public class BeanDefs { 23 | 24 | public static final String HTTP_CLIENT_FACTORY = "http_client_factory"; 25 | public static final String FORM_DELETE_BEAN = "form_delete"; 26 | public static final String PURGE_OLDER_SUBMISSIONS_BEAN = "purge_submissions"; 27 | public static final String USER_BEAN = "user_service"; 28 | public static final String DATASTORE_BEAN = "datastore"; 29 | public static final String UPLOAD_TASK_BEAN = "upload_task"; 30 | public static final String KML_BEAN = "kml_task"; 31 | public static final String CSV_BEAN = "csv_task"; 32 | public static final String JSON_FILE_BEAN = "json_file_task"; 33 | public static final String WORKSHEET_BEAN = "worksheet_creator"; 34 | public static final String IMAGE_UTIL = "image_util"; 35 | public static final String WATCHDOG = "watchdog"; 36 | } 37 | -------------------------------------------------------------------------------- /packer/scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | # Delete all Linux headers 4 | dpkg --list \ 5 | | awk '{ print $2 }' \ 6 | | grep 'linux-headers' \ 7 | | xargs apt-get -y purge; 8 | 9 | # Remove specific Linux kernels, such as linux-image-3.11.0-15 but 10 | # keeps the current kernel and does not touch the virtual packages, 11 | # e.g. 'linux-image-amd64', etc. 12 | dpkg --list \ 13 | | awk '{ print $2 }' \ 14 | | grep 'linux-image-[234].*' \ 15 | | grep -v `uname -r` \ 16 | | xargs apt-get -y purge; 17 | 18 | # Delete Linux source 19 | dpkg --list \ 20 | | awk '{ print $2 }' \ 21 | | grep linux-source \ 22 | | xargs apt-get -y purge; 23 | 24 | # Delete ansible 25 | apt-get -y purge ansible; 26 | 27 | # Delete compilers 28 | apt-get -y purge gcc-6 cpp-6; 29 | 30 | # Delete development packages 31 | dpkg --list \ 32 | | awk '{ print $2 }' \ 33 | | grep -- '-dev$' \ 34 | | xargs apt-get -y purge; 35 | 36 | # Delete unused packages 37 | apt-get -y autoremove; 38 | apt-get -y clean; 39 | 40 | # Clean apt cache 41 | rm -rf /var/cache/apt/*; 42 | mkdir -p /var/cache/apt/archives/partial; 43 | 44 | # Clean tmp 45 | rm -rf /tmp/*; 46 | 47 | # delete any logs that have built up during the install 48 | find /var/log/ -name *.log -exec rm -f {} \; 49 | 50 | # Create remove vagrant user, force new password on boot 51 | cat > /etc/rc.local << EOL 52 | #!/bin/sh -eux 53 | deluser vagrant 54 | rm -rf /home/vagrant 55 | echo "root:aggregate" | chpasswd 56 | chage -d 0 root 57 | systemctl disable rc-local.service 58 | rm /etc/sudoers.d/99_vagrant; 59 | rm /etc/rc.local 60 | EOL 61 | 62 | # Install script 63 | chmod +x /etc/rc.local 64 | systemctl enable rc-local.service -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/externalserv/ServicesAdminServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.externalserv; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | import org.opendatakit.aggregate.constants.common.BinaryOption; 21 | import org.opendatakit.aggregate.constants.common.ExternalServicePublicationOption; 22 | 23 | public interface ServicesAdminServiceAsync { 24 | 25 | void getExternalServices(String formid, AsyncCallback callback); 26 | 27 | void createGoogleSpreadsheet(String formId, String name, ExternalServicePublicationOption esOption, String ownerEmail, AsyncCallback callback); 28 | 29 | void createSimpleJsonServer(String formId, String authKey, String url, ExternalServicePublicationOption es, String ownerEmail, BinaryOption binaryOption, AsyncCallback callback); 30 | 31 | void deletePublisher(String uri, AsyncCallback callback); 32 | 33 | void restartPublisher(String uri, AsyncCallback callback); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/UserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security; 17 | 18 | import org.opendatakit.common.persistence.exception.ODKDatastoreException; 19 | import org.opendatakit.common.web.CallingContext; 20 | 21 | 22 | /** 23 | * Minimal service for accessing information about the current 24 | * user and the calling context. 25 | * 26 | * @author wbrunette@gmail.com 27 | * @author mitchellsundt@gmail.com 28 | */ 29 | public interface UserService { 30 | 31 | String createLogoutURL(); 32 | 33 | Realm getCurrentRealm(); 34 | 35 | User getCurrentUser(); 36 | 37 | User getDaemonAccountUser(); 38 | 39 | boolean isAccessManagementConfigured(); 40 | 41 | void reloadPermissions(); 42 | 43 | boolean isUserLoggedIn(); 44 | 45 | String getSuperUserEmail(); 46 | 47 | String getSuperUserUsername(); 48 | 49 | boolean isSuperUser(CallingContext cc) throws ODKDatastoreException; 50 | 51 | boolean isSuperUsernamePasswordSet(CallingContext cc) throws ODKDatastoreException; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/submission/SubmissionElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.aggregate.submission; 17 | 18 | import org.opendatakit.aggregate.datamodel.FormElementModel; 19 | 20 | /** 21 | * Common base class to SubmissionSet, SubmissionValue 22 | * 23 | * @author mitchellsundt@gmail.com 24 | * @author wbrunette@gmail.com 25 | */ 26 | public interface SubmissionElement { 27 | 28 | /** 29 | * Get Property Name 30 | * 31 | * @return property name 32 | */ 33 | public String getPropertyName(); 34 | 35 | 36 | /** 37 | * Get the submission element's form element model 38 | * 39 | * @return form element model 40 | */ 41 | public FormElementModel getFormElementModel(); 42 | 43 | /** 44 | * Perform a left-to-right depth-first traversal of the submission. 45 | * 46 | * @param visitor to invoke on each element in the submission. 47 | * @return true if the traversal should end (short-circuit) immediately. 48 | */ 49 | public boolean depthFirstTraversal(SubmissionVisitor visitor); 50 | } 51 | -------------------------------------------------------------------------------- /cloud-config/virtualbox/README.md: -------------------------------------------------------------------------------- 1 | This Cloud-Config setup is intended for development and testing purposes by deploying Aggregate locally using VirtualBox 2 | 3 | ## Prerequisites 4 | 5 | - Ubuntu 18.04 6 | - VirtualBox 7 | - Required packages: 8 | - socat 9 | - qemu-utils 10 | - genisoimage 11 | - cloud-utils 12 | 13 | `sudo apt-get install socat qemu-utils genisoimage cloud-utils` 14 | 15 | ## Differences with the standard cloud Cloud-Config stack 16 | 17 | - This stack doesn't include certbot (no SSL support) 18 | - This stack will install a fresh build of Aggregate, instead of the latest available release 19 | - You need to use the `odk` user to log into the machine (this user is not present in the standard stack) 20 | 21 | ## Instructions 22 | 23 | - Run the `./build.sh` script providing: 24 | - The path to your SSH public key as first argument (usually `~/.ssh/id_rsa.pub`) 25 | - Optionally, your host machine's non-loopback (usually 192.168.x.y) IP address as second argument 26 | 27 | If you don't provide this argument, the script will try to guess one 28 | 29 | Example: `./build.sh ~/.ssh/id_rsa.pub` 30 | 31 | Example: `./build.sh ~/.ssh/id_rsa.pub 192.168.1.129` 32 | 33 | This command will build a fresh Aggregate WAR, which will be deployed into the VM 34 | 35 | - Browse Aggregate at http://{HOST_IP}:10080. In the example above, this would be [http://192.168.1.129:10080](http://192.168.1.129:10080) 36 | 37 | ## To do 38 | 39 | - Make the host IP detection more robust 40 | 41 | `ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//"` Shows all non-loopback/virtual devices 42 | Then we can get the IP with `ip address | grep enp0s31f6 | grep inet` 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/submission/SubmissionUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.submission; 18 | 19 | import java.io.Serializable; 20 | import java.util.ArrayList; 21 | 22 | public class SubmissionUI implements Serializable { 23 | 24 | /** 25 | * Serialization Identifier 26 | */ 27 | private static final long serialVersionUID = -5614397233493602380L; 28 | 29 | private ArrayList values; 30 | 31 | private String submissionKeyAsString; 32 | 33 | public SubmissionUI() { 34 | 35 | } 36 | 37 | public SubmissionUI(ArrayList values, String submissionKeyAsString) { 38 | this.values = values; 39 | this.submissionKeyAsString = submissionKeyAsString; 40 | } 41 | 42 | public int getNumberOfFields() { 43 | return values.size(); 44 | } 45 | 46 | public ArrayList getValues() { 47 | return values; 48 | } 49 | 50 | public String getSubmissionKeyAsString() { 51 | return submissionKeyAsString; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/ClosePopupButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.event.dom.client.ClickEvent; 20 | import com.google.gwt.event.dom.client.ClickHandler; 21 | import com.google.gwt.user.client.ui.PopupPanel; 22 | 23 | public final class ClosePopupButton extends AggregateButton implements ClickHandler { 24 | 25 | private static final String BUTTON_TXT = ""; 26 | private static final String TOOLTIP_TXT = "Close"; 27 | private static final String HELP_BALLOON_TXT = "Close the window"; 28 | 29 | private final PopupPanel popup; 30 | 31 | public ClosePopupButton(PopupPanel popup) { 32 | super(BUTTON_TXT, TOOLTIP_TXT, HELP_BALLOON_TXT); 33 | this.popup = popup; 34 | addStyleDependentName("close"); 35 | addStyleDependentName("negative"); 36 | } 37 | 38 | @Override 39 | public void onClick(ClickEvent event) { 40 | super.onClick(event); 41 | 42 | popup.hide(); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/persistence/exception/ODKEntityPersistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.persistence.exception; 18 | 19 | 20 | /** 21 | * Exception for the case that a data store persistence problem occurs 22 | * 23 | * @author wbrunette@gmail.com 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class ODKEntityPersistException extends ODKDatastoreException { 27 | 28 | /** 29 | * Serial number for serialization 30 | */ 31 | private static final long serialVersionUID = -8914267881767842131L; 32 | 33 | /** 34 | * Construction exception with error message and throwable cause 35 | * 36 | * @param message exception message 37 | * @param cause throwable cause 38 | */ 39 | public ODKEntityPersistException(String message, Throwable cause) { 40 | super(message, cause); 41 | } 42 | 43 | /** 44 | * Construction exception with throwable cause 45 | * 46 | * @param cause throwable cause 47 | */ 48 | public ODKEntityPersistException(Throwable cause) { 49 | super(cause); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/AggregateButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.event.dom.client.ClickEvent; 20 | import com.google.gwt.event.dom.client.ClickHandler; 21 | import com.google.gwt.user.client.ui.Button; 22 | 23 | public class AggregateButton extends Button implements ClickHandler { 24 | 25 | private final AggregateBaseHandlers handlers; 26 | 27 | public AggregateButton(String buttonText, String tooltipText) { 28 | this(buttonText, tooltipText, null); 29 | } 30 | 31 | public AggregateButton(String buttonText, String tooltipText, String helpBalloonText) { 32 | super(buttonText); 33 | 34 | addClickHandler(this); 35 | 36 | // setup help system 37 | handlers = new AggregateBaseHandlers(this, tooltipText, helpBalloonText); 38 | addMouseOverHandler(handlers); 39 | addMouseOutHandler(handlers); 40 | } 41 | 42 | @Override 43 | public void onClick(ClickEvent event) { 44 | handlers.userAction(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/ExternalServiceType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * Copyright (C) 2018 Nafundi 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | public enum ExternalServiceType implements Serializable { 22 | GOOGLE_SPREADSHEET("Google Spreadsheet", false), 23 | JSON_SERVER("JSON Server", false), 24 | // Obsolete external service type as of v2.0 25 | OHMAGE_JSON_SERVER("OBSOLETE - Ohmage JSON Server", true), 26 | GOOGLE_FUSIONTABLES("OBSOLETE - Google FusionTables", true), 27 | REDCAP_SERVER("OBSOLETE - REDCap Server", true), 28 | GOOGLE_MAPS_ENGINE("OBSOLETE Google Maps Engine", true); 29 | 30 | private final String name; 31 | private final boolean obsolete; 32 | 33 | ExternalServiceType(String name, boolean obsolete) { 34 | this.name = name; 35 | this.obsolete = obsolete; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public String toString() { 43 | return name; 44 | } 45 | 46 | public boolean isObsolete() { 47 | return obsolete; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/form/KmlOptionSetting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.form; 18 | 19 | import java.io.Serializable; 20 | 21 | public final class KmlOptionSetting implements Serializable { 22 | 23 | /** 24 | * Serialization Version Identifier 25 | */ 26 | private static final long serialVersionUID = -6824246262410791228L; 27 | 28 | private String displayName; 29 | private String elementKey; 30 | 31 | public KmlOptionSetting() { 32 | } 33 | 34 | public KmlOptionSetting(String displayName, String elementKey) { 35 | this.setDisplayName(displayName); 36 | this.setElementKey(elementKey); 37 | } 38 | 39 | public String getDisplayName() { 40 | return displayName; 41 | } 42 | 43 | public void setDisplayName(String displayName) { 44 | this.displayName = displayName; 45 | } 46 | 47 | public String getElementKey() { 48 | return elementKey; 49 | } 50 | 51 | public void setElementKey(String elementKey) { 52 | this.elementKey = elementKey; 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/persistence/exception/ODKOverQuotaException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.persistence.exception; 18 | 19 | 20 | /** 21 | * Exception for the case that a data store operation 22 | * exceeds a quota restriction (e.g., Google AppEngine) 23 | * 24 | * @author wbrunette@gmail.com 25 | * @author mitchellsundt@gmail.com 26 | */ 27 | public class ODKOverQuotaException extends ODKDatastoreException { 28 | 29 | /** 30 | * Serial number for serialization 31 | */ 32 | private static final long serialVersionUID = -8914267881767842131L; 33 | 34 | /** 35 | * Construction exception with error message and throwable cause 36 | * 37 | * @param message exception message 38 | * @param cause throwable cause 39 | */ 40 | public ODKOverQuotaException(String message, Throwable cause) { 41 | super(message, cause); 42 | } 43 | 44 | /** 45 | * Construction exception with throwable cause 46 | * 47 | * @param cause throwable cause 48 | */ 49 | public ODKOverQuotaException(Throwable cause) { 50 | super(cause); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/form/FormServiceAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.form; 18 | 19 | import com.google.gwt.user.client.rpc.AsyncCallback; 20 | import java.util.ArrayList; 21 | import org.opendatakit.aggregate.client.filter.FilterGroup; 22 | 23 | public interface FormServiceAsync { 24 | 25 | void getForms(AsyncCallback> callback); 26 | 27 | void getExports(AsyncCallback> callback); 28 | 29 | void getPossibleKmlSettings(String formId, AsyncCallback callback); 30 | 31 | void getGpsCoordnates(String formId, AsyncCallback callback); 32 | 33 | void createCsvFromFilter(FilterGroup group, AsyncCallback callback); 34 | 35 | void createKmlFromFilter(FilterGroup group, ArrayList kmlElementsToInclude, AsyncCallback callback); 36 | 37 | void createJsonFileFromFilter(FilterGroup group, AsyncCallback callback); 38 | 39 | void deleteExport(String uri, AsyncCallback callback); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/submission/SubmissionField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Google Inc. 3 | * Copyright (C) 2010 University of Washington. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | * use this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | 18 | package org.opendatakit.aggregate.submission; 19 | 20 | import org.opendatakit.aggregate.exception.ODKConversionException; 21 | import org.opendatakit.common.datamodel.BinaryContentManipulator; 22 | import org.opendatakit.common.persistence.exception.ODKDatastoreException; 23 | import org.opendatakit.common.web.CallingContext; 24 | 25 | /** 26 | * Interface for submission field that can be used to store 27 | * a submission field in the datastore 28 | * 29 | * @param a GAE datastore type 30 | * @author wbrunette@gmail.com 31 | * @author mitchellsundt@gmail.com 32 | */ 33 | public interface SubmissionField extends SubmissionValue { 34 | 35 | boolean isBinary(); 36 | 37 | T getValue(); 38 | 39 | void setValueFromString(String value) throws ODKConversionException; 40 | 41 | BinaryContentManipulator.BlobSubmissionOutcome setValueFromByteArray(byte[] byteArray, String contentType, String unrootedFilePath, boolean overwriteOK, CallingContext cc) throws ODKDatastoreException; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/constants/common/FormActionStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.constants.common; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * Status of a MiscTasks action. 23 | * 24 | * @author user 25 | */ 26 | public enum FormActionStatus implements Serializable { 27 | 28 | IN_PROGRESS("Active"), // created or task is running 29 | RETRY_IN_PROGRESS("Retrying"), // task is running 30 | FAILED("Scheduled"), // task completed with failure; retry again later. 31 | ABANDONED("Failed"), // task completed with failure; no more retries should occur. 32 | SUCCESSFUL("Successful"); // task completed successfully. 33 | 34 | private String displayText; 35 | 36 | private FormActionStatus() { 37 | // GWT 38 | } 39 | 40 | private FormActionStatus(String display) { 41 | displayText = display; 42 | } 43 | 44 | /** 45 | * @return true if this request is considered 'active' 46 | */ 47 | public boolean isActiveRequest() { 48 | return (this != ABANDONED) && (this != SUCCESSFUL); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/submission/SubmissionService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.submission; 18 | 19 | import com.google.gwt.user.client.rpc.RemoteService; 20 | import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; 21 | import org.opendatakit.aggregate.client.exception.FormNotAvailableException; 22 | import org.opendatakit.aggregate.client.exception.RequestFailureException; 23 | import org.opendatakit.aggregate.client.filter.FilterGroup; 24 | import org.opendatakit.common.persistence.client.exception.DatastoreFailureException; 25 | 26 | @RemoteServiceRelativePath("submissionservice") 27 | public interface SubmissionService extends RemoteService { 28 | 29 | SubmissionUISummary getSubmissions(FilterGroup filter) throws FormNotAvailableException, RequestFailureException, DatastoreFailureException; 30 | 31 | SubmissionUISummary getRepeatSubmissions(String keyString) throws FormNotAvailableException, RequestFailureException, DatastoreFailureException; 32 | 33 | String getSubmissionAuditCSV(String keyString) throws RequestFailureException; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/widgets/RepeatViewButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.widgets; 18 | 19 | import com.google.gwt.event.dom.client.ClickEvent; 20 | import com.google.gwt.event.dom.client.ClickHandler; 21 | import org.opendatakit.aggregate.client.popups.RepeatPopup; 22 | 23 | public final class RepeatViewButton extends AggregateButton implements ClickHandler { 24 | 25 | private static final String BUTTON_TXT = "View"; 26 | private static final String TOOLTIP_TXT = "View the items"; 27 | private static final String HELP_BALLOON_TXT = "This will open up a smaller popup table with the items" + 28 | "you are requesting to view."; 29 | 30 | private final String url; 31 | 32 | public RepeatViewButton(String url) { 33 | super(BUTTON_TXT, TOOLTIP_TXT, HELP_BALLOON_TXT); 34 | this.url = url; 35 | } 36 | 37 | @Override 38 | public void onClick(ClickEvent event) { 39 | super.onClick(event); 40 | 41 | RepeatPopup popup = new RepeatPopup(url); 42 | popup.setPopupPositionAndShow(popup.getPositionCallBack()); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/submission/type/jr/JRTime.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Nafundi 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.submission.type.jr; 18 | 19 | import static java.time.format.DateTimeFormatter.ofLocalizedTime; 20 | 21 | import java.time.LocalDate; 22 | import java.time.OffsetTime; 23 | import java.time.format.FormatStyle; 24 | import java.util.Date; 25 | 26 | public class JRTime implements JRTemporal { 27 | private final Date parsed; 28 | private final OffsetTime value; 29 | private final String raw; 30 | 31 | public JRTime(Date parsed, OffsetTime value, String raw) { 32 | this.parsed = parsed; 33 | this.value = value; 34 | this.raw = raw; 35 | } 36 | 37 | @Override 38 | public Date getParsed() { 39 | return parsed; 40 | } 41 | 42 | @Override 43 | public String getRaw() { 44 | return raw; 45 | } 46 | 47 | @Override 48 | public OffsetTime getValue() { 49 | return value; 50 | } 51 | 52 | @Override 53 | public String humanFormat(FormatStyle style) { 54 | return value 55 | .atDate(LocalDate.now()) 56 | .toZonedDateTime() 57 | .format(ofLocalizedTime(style)); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/client/popups/AbstractPopupBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.client.popups; 18 | 19 | import com.google.gwt.user.client.Window; 20 | import com.google.gwt.user.client.ui.PopupPanel; 21 | 22 | public class AbstractPopupBase extends PopupPanel { 23 | 24 | public AbstractPopupBase() { 25 | super(false); 26 | setModal(true); // things not in the popup are inactive 27 | 28 | // Set glass behind the popup so that the things behind it are grayed out. 29 | this.setGlassEnabled(true); 30 | this.setGlassStyleName("gwt-PopupPanelGlassAggregate"); 31 | 32 | } 33 | 34 | public PopupPanel.PositionCallback getPositionCallBack() { 35 | return new PopupPanel.PositionCallback() { 36 | @Override 37 | public void setPosition(int offsetWidth, int offsetHeight) { 38 | int left = Window.getScrollLeft() + ((Window.getClientWidth() - offsetWidth) / 2); 39 | int top = Window.getScrollTop() + ((Window.getClientHeight() - offsetHeight) / 2); 40 | setPopupPosition(left, top); 41 | } 42 | }; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/client/exception/AccessDeniedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.common.security.client.exception; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * Access denied exception that can be returned through GWT. 23 | * 24 | * @author mitchellsundt@gmail.com 25 | */ 26 | public class AccessDeniedException extends Exception implements Serializable { 27 | private static final long serialVersionUID = 3102327639058143399L; 28 | 29 | private String message; 30 | 31 | public AccessDeniedException() { 32 | super(); 33 | message = "AccessDeniedException"; 34 | } 35 | 36 | public AccessDeniedException(String arg0) { 37 | super(arg0); 38 | message = arg0; 39 | } 40 | 41 | public AccessDeniedException(Throwable arg0) { 42 | super(arg0); 43 | message = "AccessDeniedException (" + arg0.getMessage() + ")"; 44 | } 45 | 46 | @Override 47 | public String getLocalizedMessage() { 48 | return message; 49 | } 50 | 51 | @Override 52 | public String getMessage() { 53 | return message; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/aggregate/server/GeopointHeaderIncludes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.opendatakit.aggregate.server; 18 | 19 | public class GeopointHeaderIncludes { 20 | private String elementName; 21 | private boolean includeLatitude; 22 | private boolean includeLongitude; 23 | private boolean includeAltitude; 24 | private boolean includeAccuracy; 25 | 26 | public GeopointHeaderIncludes(String elementName, boolean latitude, boolean longitude, 27 | boolean altitude, boolean accuracy) { 28 | this.elementName = elementName; 29 | this.includeLatitude = latitude; 30 | this.includeLongitude = longitude; 31 | this.includeAltitude = altitude; 32 | this.includeAccuracy = accuracy; 33 | } 34 | 35 | public boolean includeLatitude() { 36 | return includeLatitude; 37 | } 38 | 39 | public boolean includeLongitude() { 40 | return includeLongitude; 41 | } 42 | 43 | public boolean includeAltitude() { 44 | return includeAltitude; 45 | } 46 | 47 | public boolean includeAccuracy() { 48 | return includeAccuracy; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/persistence/Query.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 University of Washington 3 |

4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | in compliance with the License. You may obtain a copy of the License at 6 |

7 | http://www.apache.org/licenses/LICENSE-2.0 8 |

9 | Unless required by applicable law or agreed to in writing, software distributed under the License 10 | is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | or implied. See the License for the specific language governing permissions and limitations under 12 | the License. 13 | */ 14 | package org.opendatakit.common.persistence; 15 | 16 | import java.util.List; 17 | import org.opendatakit.common.persistence.exception.ODKDatastoreException; 18 | 19 | /** 20 | * The Query interface defines how persistence implementations should create query functionality. 21 | * 22 | * @author wbrunette@gmail.com 23 | * @author mitchellsundt@gmail.com 24 | */ 25 | public interface Query { 26 | 27 | void addSort(DataField attributeName, Direction direction); 28 | 29 | void addFilter(DataField attributeName, FilterOperation op, Object value); 30 | 31 | List executeQuery() throws ODKDatastoreException; 32 | 33 | QueryResult executeQuery(QueryResumePoint startCursor, int fetchLimit) throws ODKDatastoreException; 34 | 35 | List executeDistinctValueForDataField(DataField dataField) throws ODKDatastoreException; 36 | 37 | enum Direction { 38 | ASCENDING, 39 | DESCENDING 40 | } 41 | 42 | enum FilterOperation { 43 | EQUAL, 44 | NOT_EQUAL, 45 | GREATER_THAN, 46 | GREATER_THAN_OR_EQUAL, 47 | LESS_THAN, 48 | LESS_THAN_OR_EQUAL; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /packer/ansible/roles/aggregate/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install packages 3 | apt: 4 | pkg: '{{ item }}' 5 | install_recommends: no 6 | with_items: 7 | - unzip 8 | 9 | - name: set facts 10 | set_fact: 11 | tomcat_webapps_dir: /var/lib/tomcat8/webapps 12 | motd_dir: /etc/update-motd.d 13 | 14 | - name: copy db init script 15 | copy: 16 | src: init.sql 17 | dest: /tmp/init.sql 18 | mode: 0644 19 | 20 | - name: setup database 21 | command: psql -f /tmp/init.sql 22 | become_user: postgres 23 | 24 | - name: clean db init script 25 | file: 26 | state: absent 27 | path: /tmp/init.sql 28 | 29 | - name: Clean webapps dir 30 | file: 31 | state: absent 32 | path: '{{ tomcat_webapps_dir }}/' 33 | 34 | - name: Create webapps dir 35 | file: 36 | state: directory 37 | path: '{{ tomcat_webapps_dir }}/ROOT' 38 | 39 | - name: Deploy Aggregate 40 | unarchive: 41 | src: ROOT.war 42 | dest: '{{ tomcat_webapps_dir }}/ROOT' 43 | 44 | - name: install config tool 45 | copy: 46 | src: aggregate-config.sh 47 | dest: /usr/local/bin/aggregate-config 48 | mode: 0755 49 | 50 | - name: install report ips script 51 | copy: 52 | src: aggregate-report-ips.sh 53 | dest: /usr/local/bin/aggregate-report-ips 54 | mode: 0755 55 | 56 | - name: install update issue script 57 | copy: 58 | src: aggregate-update-issue.sh 59 | dest: /usr/local/bin/aggregate-update-issue 60 | mode: 0755 61 | 62 | - name: install version file 63 | copy: 64 | src: aggregate-version 65 | dest: /usr/local/bin/aggregate-version 66 | mode: 0644 67 | 68 | - name: Link update issue script on dhcp exit hook 69 | file: 70 | state: link 71 | src: /usr/local/bin/aggregate-update-issue 72 | dest: /etc/dhcp/dhclient-exit-hooks.d/aggregate-update-issue -------------------------------------------------------------------------------- /src/main/java/org/opendatakit/common/security/spring/DigestAuthenticationFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 University of Washington 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.opendatakit.common.security.spring; 17 | 18 | import java.io.IOException; 19 | import javax.servlet.FilterChain; 20 | import javax.servlet.ServletException; 21 | import javax.servlet.ServletRequest; 22 | import javax.servlet.ServletResponse; 23 | import org.springframework.security.core.context.SecurityContextHolder; 24 | 25 | /** 26 | * Wraps the Spring class and ensures that if an Authentication is already 27 | * determined for this request, that it isn't overridden. 28 | * 29 | * @author mitchellsundt@gmail.com 30 | */ 31 | public class DigestAuthenticationFilter extends org.springframework.security.web.authentication.www.DigestAuthenticationFilter { 32 | 33 | @Override 34 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 35 | throws IOException, ServletException { 36 | if (SecurityContextHolder.getContext().getAuthentication() == null) { 37 | super.doFilter(request, response, chain); 38 | } else { 39 | chain.doFilter(request, response); 40 | } 41 | } 42 | 43 | } 44 | --------------------------------------------------------------------------------