├── .idea ├── .name ├── modules │ ├── logs │ │ └── application.log │ ├── root.iml │ └── root-build.iml ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── sqldialects.xml ├── libraries │ ├── SBT__dom4j_dom4j_1_6_1_jar.xml │ ├── SBT__junit_junit_4_11_jar.xml │ ├── SBT__tyrex_tyrex_1_0_1_jar.xml │ ├── SBT__xalan_xalan_2_7_1_jar.xml │ ├── SBT__org_w3c_css_sac_1_3_jar.xml │ ├── SBT__org_json_json_20080701_jar.xml │ ├── SBT__xalan_serializer_2_7_1_jar.xml │ ├── SBT__cglib_cglib_nodep_2_1_3_jar.xml │ ├── SBT__com_h2database_h2_1_3_175_jar.xml │ ├── SBT__javax_transaction_jta_1_1_jar.xml │ ├── SBT__joda_time_joda_time_2_3_jar.xml │ ├── SBT__net_java_dev_jna_jna_3_4_0_jar.xml │ ├── SBT__org_yaml_snakeyaml_1_13_jar.xml │ ├── SBT__xml_apis_xml_apis_1_4_01_jar.xml │ ├── SBT__com_typesafe_config_1_2_1_jar.xml │ ├── SBT__commons_io_commons_io_2_2_jar.xml │ ├── SBT__io_netty_netty_3_9_3_Final_jar.xml │ ├── SBT__org_slf4j_slf4j_api_1_7_6_jar.xml │ ├── SBT__xerces_xercesImpl_2_11_0_jar.xml │ ├── SBT__org_joda_joda_convert_1_6_jar.xml │ ├── SBT__org_objenesis_objenesis_1_0_jar.xml │ ├── SBT__org_specs2_classycle_1_4_3_jar.xml │ ├── SBT__com_google_guava_guava_16_0_1_jar.xml │ ├── SBT__org_slf4j_jul_to_slf4j_1_7_6_jar.xml │ ├── SBT__org_webbitserver_webbit_0_4_14_jar.xml │ ├── SBT__com_fasterxml_classmate_1_0_0_jar.xml │ ├── SBT__net_java_dev_jna_platform_3_4_0_jar.xml │ ├── SBT__com_jolbox_bonecp_0_8_0_RELEASE_jar.xml │ ├── SBT__commons_codec_commons_codec_1_9_jar.xml │ ├── SBT__org_easytesting_fest_assert_1_4_jar.xml │ ├── SBT__org_easytesting_fest_util_1_1_6_jar.xml │ ├── SBT__org_hamcrest_hamcrest_core_1_3_jar.xml │ ├── SBT__org_mockito_mockito_core_1_9_5_jar.xml │ ├── SBT__org_slf4j_jcl_over_slf4j_1_7_6_jar.xml │ ├── SBT__ch_qos_logback_logback_core_1_1_1_jar.xml │ ├── SBT__com_typesafe_play_play_2_11_2_3_7_jar.xml │ ├── SBT__org_javassist_javassist_3_18_2_GA_jar.xml │ ├── SBT__org_reflections_reflections_0_9_8_jar.xml │ ├── SBT__org_scala_sbt_test_interface_1_0_jar.xml │ ├── SBT__org_scala_stm_scala_stm_2_11_0_7_jar.xml │ ├── SBT__com_typesafe_play_build_link_2_3_7_jar.xml │ ├── SBT__com_google_code_findbugs_jsr305_2_0_3_jar.xml │ ├── SBT__org_apache_commons_commons_exec_1_1_jar.xml │ ├── SBT__org_apache_commons_commons_lang3_3_1_jar.xml │ ├── SBT__org_scala_lang_scala_reflect_2_11_1_jar.xml │ ├── SBT__org_scalaz_scalaz_core_2_11_7_0_6_jar.xml │ ├── SBT__org_specs2_specs2_core_2_11_2_3_12_jar.xml │ ├── SBT__org_specs2_specs2_mock_2_11_2_3_12_jar.xml │ ├── SBT__ch_qos_logback_logback_classic_1_1_1_jar.xml │ ├── SBT__com_novocode_junit_interface_0_11_RC1_jar.xml │ ├── SBT__commons_logging_commons_logging_1_1_3_jar.xml │ ├── SBT__net_sourceforge_htmlunit_htmlunit_2_13_jar.xml │ ├── SBT__org_apache_httpcomponents_httpcore_4_3_jar.xml │ ├── SBT__org_scala_lang_scala_compiler_2_11_0_jar.xml │ ├── SBT__org_scalaz_scalaz_effect_2_11_7_0_6_jar.xml │ ├── SBT__org_specs2_specs2_common_2_11_2_3_12_jar.xml │ ├── SBT__org_specs2_specs2_junit_2_11_2_3_12_jar.xml │ ├── SBT__com_typesafe_play_play_java_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_play_jdbc_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_play_json_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_play_test_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_twirl_api_2_11_1_0_2_jar.xml │ ├── SBT__net_sourceforge_nekohtml_nekohtml_1_9_19_jar.xml │ ├── SBT__org_apache_httpcomponents_httpmime_4_3_1_jar.xml │ ├── SBT__org_avaje_ebeanorm_avaje_ebeanorm_3_3_4_jar.xml │ ├── SBT__org_postgresql_postgresql_9_3_1102_jdbc4_jar.xml │ ├── SBT__org_specs2_specs2_matcher_2_11_2_3_12_jar.xml │ ├── SBT__com_typesafe_akka_akka_actor_2_11_2_3_4_jar.xml │ ├── SBT__com_typesafe_akka_akka_slf4j_2_11_2_3_4_jar.xml │ ├── SBT__com_typesafe_play_play_exceptions_2_3_7_jar.xml │ ├── SBT__net_sourceforge_cssparser_cssparser_0_9_11_jar.xml │ ├── SBT__org_apache_httpcomponents_httpclient_4_3_1_jar.xml │ ├── SBT__org_specs2_specs2_analysis_2_11_2_3_12_jar.xml │ ├── SBT__org_eclipse_jetty_jetty_io_8_1_12_v20130726_jar.xml │ ├── SBT__org_fluentlenium_fluentlenium_core_0_9_2_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_api_2_39_0_jar.xml │ ├── SBT__javax_validation_validation_api_1_1_0_Final_jar.xml │ ├── SBT__org_apache_tomcat_tomcat_servlet_api_8_0_5_jar.xml │ ├── SBT__org_eclipse_jetty_jetty_http_8_1_12_v20130726_jar.xml │ ├── SBT__org_eclipse_jetty_jetty_util_8_1_12_v20130726_jar.xml │ ├── SBT__org_jboss_logging_jboss_logging_3_2_0_Final_jar.xml │ ├── SBT__org_scala_lang_modules_scala_xml_2_11_1_0_1_jar.xml │ ├── SBT__org_scalaz_scalaz_concurrent_2_11_7_0_6_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_java_2_39_0_jar.xml │ ├── SBT__org_springframework_spring_core_4_0_3_RELEASE_jar.xml │ ├── SBT__com_fasterxml_jackson_core_jackson_core_2_3_2_jar.xml │ ├── SBT__com_typesafe_play_play_iteratees_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_play_java_jdbc_2_11_2_3_7_jar.xml │ ├── SBT__org_springframework_spring_beans_4_0_3_RELEASE_jar.xml │ ├── SBT__com_typesafe_play_play_datacommons_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_play_functional_2_11_2_3_7_jar.xml │ ├── SBT__com_typesafe_play_play_java_ebean_2_11_2_3_7_jar.xml │ ├── SBT__commons_collections_commons_collections_3_2_1_jar.xml │ ├── SBT__net_sourceforge_htmlunit_htmlunit_core_js_2_13_jar.xml │ ├── SBT__org_avaje_ebeanorm_avaje_ebeanorm_agent_3_2_2_jar.xml │ ├── SBT__org_hibernate_hibernate_validator_5_0_3_Final_jar.xml │ ├── SBT__org_specs2_specs2_matcher_extra_2_11_2_3_12_jar.xml │ ├── SBT__com_typesafe_netty_netty_http_pipelining_1_1_2_jar.xml │ ├── SBT__org_fluentlenium_fluentlenium_festassert_0_9_2_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_support_2_39_0_jar.xml │ ├── SBT__org_springframework_spring_context_4_0_3_RELEASE_jar.xml │ ├── SBT__com_fasterxml_jackson_core_jackson_databind_2_3_2_jar.xml │ ├── SBT__org_eclipse_jetty_jetty_websocket_8_1_12_v20130726_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_ie_driver_2_39_0_jar.xml │ ├── SBT__com_fasterxml_jackson_core_jackson_annotations_2_3_2_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_chrome_driver_2_39_0_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_iphone_driver_2_39_0_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_remote_driver_2_39_0_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_safari_driver_2_39_0_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_android_driver_2_39_0_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_firefox_driver_2_39_0_jar.xml │ ├── SBT__org_seleniumhq_selenium_selenium_htmlunit_driver_2_39_0_jar.xml │ ├── SBT__org_scala_lang_modules_scala_parser_combinators_2_11_1_0_1_jar.xml │ ├── SBT__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_1_Final_jar.xml │ └── SBT__org_scala_lang_scala_library_2_11_4_jar.xml ├── checkstyle-idea.xml ├── modules.xml ├── scala_compiler.xml ├── dataSources.xml ├── dataSources.local.xml ├── sbt.xml ├── misc.xml └── compiler.xml ├── .settings └── org.eclipse.core.resources.prefs ├── activator-launch-1.3.2.jar ├── app ├── views │ ├── index.scala.html │ └── main.scala.html ├── controllers │ └── Application.java └── models │ └── PageRetrieval.java ├── conf ├── messages ├── routes ├── evolutions │ └── default │ │ └── 1.sql └── application.conf ├── doc ├── play-example-postgresql-home-page.png └── play-example-postgresql-screencast.png ├── project ├── build.properties └── plugins.sbt ├── Procfile ├── LICENSE ├── test ├── ModelTest.java └── IntegrationTest.java ├── .gitignore ├── activator.bat ├── README.md └── activator /.idea/.name: -------------------------------------------------------------------------------- 1 | play-example-postgresql -------------------------------------------------------------------------------- /.idea/modules/logs/application.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /activator-launch-1.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ics-software-engineering/play-example-postgresql/HEAD/activator-launch-1.3.2.jar -------------------------------------------------------------------------------- /app/views/index.scala.html: -------------------------------------------------------------------------------- 1 | @(message: String) 2 | 3 | @main("play-example-postgresql") { 4 | 5 | @message 6 | 7 | } 8 | -------------------------------------------------------------------------------- /conf/messages: -------------------------------------------------------------------------------- 1 | # Messages 2 | 3 | computers.list.title={0,choice,0#No computers|1#One computer|1<{0,number,integer} computers} found 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/play-example-postgresql-home-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ics-software-engineering/play-example-postgresql/HEAD/doc/play-example-postgresql-home-page.png -------------------------------------------------------------------------------- /doc/play-example-postgresql-screencast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ics-software-engineering/play-example-postgresql/HEAD/doc/play-example-postgresql-screencast.png -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | #Activator-generated Properties 2 | #Mon Apr 06 09:56:27 HST 2015 3 | template.uuid=3f8cc5b7-60fe-4efc-9fe6-209a610b1b39 4 | sbt.version=0.13.7 5 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: target/universal/stage/bin/play-example-postgresql -Dhttp.port=${PORT} -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL} 2 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/views/main.scala.html: -------------------------------------------------------------------------------- 1 | @(title: String)(content: Html) 2 | 3 | 4 | 5 | 6 | 7 | @title 8 | 9 | 10 | @content 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/sqldialects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__dom4j_dom4j_1_6_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__junit_junit_4_11_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__tyrex_tyrex_1_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__xalan_xalan_2_7_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_w3c_css_sac_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_json_json_20080701_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__xalan_serializer_2_7_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__cglib_cglib_nodep_2_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_h2database_h2_1_3_175_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_transaction_jta_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__joda_time_joda_time_2_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_java_dev_jna_jna_3_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_yaml_snakeyaml_1_13_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__xml_apis_xml_apis_1_4_01_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_config_1_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_io_commons_io_2_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_netty_netty_3_9_3_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_slf4j_api_1_7_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__xerces_xercesImpl_2_11_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_joda_joda_convert_1_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_objenesis_objenesis_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_classycle_1_4_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_google_guava_guava_16_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_jul_to_slf4j_1_7_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_webbitserver_webbit_0_4_14_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_classmate_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_java_dev_jna_platform_3_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_jolbox_bonecp_0_8_0_RELEASE_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_codec_commons_codec_1_9_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_easytesting_fest_assert_1_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_easytesting_fest_util_1_1_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_hamcrest_hamcrest_core_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_mockito_mockito_core_1_9_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_jcl_over_slf4j_1_7_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__ch_qos_logback_logback_core_1_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_javassist_javassist_3_18_2_GA_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_reflections_reflections_0_9_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_sbt_test_interface_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_stm_scala_stm_2_11_0_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/routes: -------------------------------------------------------------------------------- 1 | # Routes 2 | # This file defines all application routes (Higher priority routes first) 3 | # ~~~~ 4 | 5 | # Home page 6 | GET / controllers.Application.index() 7 | 8 | # Map static resources from the /public folder to the /assets URL path 9 | GET /assets/*file controllers.Assets.at(path="/public", file) 10 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_build_link_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_google_code_findbugs_jsr305_2_0_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_exec_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_lang3_3_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scala_reflect_2_11_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scalaz_scalaz_core_2_11_7_0_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_core_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_mock_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__ch_qos_logback_logback_classic_1_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_novocode_junit_interface_0_11_RC1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_logging_commons_logging_1_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sourceforge_htmlunit_htmlunit_2_13_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_httpcomponents_httpcore_4_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scala_compiler_2_11_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scalaz_scalaz_effect_2_11_7_0_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_common_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_junit_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_java_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_jdbc_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_json_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_test_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_twirl_api_2_11_1_0_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sourceforge_nekohtml_nekohtml_1_9_19_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_httpcomponents_httpmime_4_3_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_avaje_ebeanorm_avaje_ebeanorm_3_3_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_postgresql_postgresql_9_3_1102_jdbc4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_matcher_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_akka_akka_actor_2_11_2_3_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_akka_akka_slf4j_2_11_2_3_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_exceptions_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sourceforge_cssparser_cssparser_0_9_11_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_httpcomponents_httpclient_4_3_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_analysis_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_eclipse_jetty_jetty_io_8_1_12_v20130726_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_fluentlenium_fluentlenium_core_0_9_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_api_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_validation_validation_api_1_1_0_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_tomcat_tomcat_servlet_api_8_0_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_eclipse_jetty_jetty_http_8_1_12_v20130726_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_eclipse_jetty_jetty_util_8_1_12_v20130726_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_jboss_logging_jboss_logging_3_2_0_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_modules_scala_xml_2_11_1_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scalaz_scalaz_concurrent_2_11_7_0_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_java_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_springframework_spring_core_4_0_3_RELEASE_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_core_jackson_core_2_3_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_iteratees_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_java_jdbc_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_springframework_spring_beans_4_0_3_RELEASE_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_datacommons_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_functional_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_play_play_java_ebean_2_11_2_3_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_collections_commons_collections_3_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sourceforge_htmlunit_htmlunit_core_js_2_13_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_avaje_ebeanorm_avaje_ebeanorm_agent_3_2_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_hibernate_hibernate_validator_5_0_3_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_specs2_specs2_matcher_extra_2_11_2_3_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_netty_netty_http_pipelining_1_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_fluentlenium_fluentlenium_festassert_0_9_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_support_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_springframework_spring_context_4_0_3_RELEASE_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_core_jackson_databind_2_3_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_eclipse_jetty_jetty_websocket_8_1_12_v20130726_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_ie_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_core_jackson_annotations_2_3_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_chrome_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_iphone_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_remote_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_safari_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_android_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_firefox_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_seleniumhq_selenium_selenium_htmlunit_driver_2_39_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_modules_scala_parser_combinators_2_11_1_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_1_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/scala_compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /app/controllers/Application.java: -------------------------------------------------------------------------------- 1 | package controllers; 2 | 3 | import models.PageRetrieval; 4 | import play.mvc.Controller; 5 | import play.mvc.Result; 6 | import views.html.index; 7 | 8 | public class Application extends Controller { 9 | public static String homePageString = "This page has been retrieved "; 10 | 11 | public static Result index() { 12 | int retrievals = PageRetrieval.find().all().size(); 13 | PageRetrieval newStamp = new PageRetrieval(); 14 | newStamp.save(); 15 | return ok(index.render(homePageString + retrievals + " times.")); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | postgresql 6 | true 7 | org.postgresql.Driver 8 | jdbc:postgresql://localhost:5432/play_example_postgresql 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This software is licensed under the Apache 2 license, quoted below. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with 4 | the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 5 | 6 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 7 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific 8 | language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /.idea/dataSources.local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | memory 6 | johnson 7 | play_example_postgresql.pg_catalog play_example_postgresql.public 8 | play_example_postgresql.pg_catalog play_example_postgresql.public 9 | 10 | 11 | -------------------------------------------------------------------------------- /conf/evolutions/default/1.sql: -------------------------------------------------------------------------------- 1 | # --- Created by Ebean DDL 2 | # To stop Ebean DDL generation, remove this comment and start using Evolutions 3 | 4 | # --- !Ups 5 | 6 | create table page_retrieval ( 7 | id bigint not null, 8 | timestamp bigint, 9 | constraint pk_page_retrieval primary key (id)) 10 | ; 11 | 12 | create sequence page_retrieval_seq; 13 | 14 | 15 | 16 | 17 | # --- !Downs 18 | 19 | SET REFERENTIAL_INTEGRITY FALSE; 20 | 21 | drop table if exists page_retrieval; 22 | 23 | SET REFERENTIAL_INTEGRITY TRUE; 24 | 25 | drop sequence if exists page_retrieval_seq; 26 | 27 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 2 | 3 | // The Play plugin 4 | addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7") 5 | 6 | // web plugins 7 | 8 | addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0") 9 | 10 | addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0") 11 | 12 | addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.0") 13 | 14 | addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1") 15 | 16 | addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0") 17 | 18 | addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.0") 19 | 20 | addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0") 21 | 22 | -------------------------------------------------------------------------------- /.idea/sbt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scala_library_2_11_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 24 | 26 | -------------------------------------------------------------------------------- /app/models/PageRetrieval.java: -------------------------------------------------------------------------------- 1 | package models; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | import play.db.ebean.Model; 6 | 7 | @Entity 8 | public class PageRetrieval extends Model { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | @Id 13 | private Long id; 14 | private Long timestamp = System.currentTimeMillis(); 15 | 16 | /** 17 | * The EBean ORM finder method for database queries on LastTimeStamp. 18 | * @return The finder method for products. 19 | */ 20 | public static Finder find() { 21 | return new Finder(Long.class, PageRetrieval.class); 22 | } 23 | 24 | /** 25 | * @return the timestamp associated with the page retrieval. 26 | */ 27 | public Long getTimestamp() { 28 | return timestamp; 29 | } 30 | 31 | /** 32 | * @param timestamp the timestamp to set 33 | */ 34 | public void setTimestamp(Long timestamp) { 35 | this.timestamp = timestamp; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /test/ModelTest.java: -------------------------------------------------------------------------------- 1 | import models.PageRetrieval; 2 | import org.junit.Test; 3 | import static org.fest.assertions.Assertions.assertThat; 4 | import static play.test.Helpers.fakeApplication; 5 | import static play.test.Helpers.inMemoryDatabase; 6 | import static play.test.Helpers.running; 7 | 8 | /** 9 | * Check the model implementation. 10 | * @author Philip Johnson 11 | */ 12 | public class ModelTest { 13 | 14 | /** 15 | * Create and save an instance and see if it can be retrieved. 16 | * NOTE: Running this test within IntelliJ 14.1 fails with a PersistenceException. 17 | * Use 'activator test' for correct operation. 18 | */ 19 | @Test 20 | public void test() { 21 | running(fakeApplication(inMemoryDatabase()), new Runnable() { 22 | public void run() { 23 | PageRetrieval newStamp = new PageRetrieval(); 24 | newStamp.save(); 25 | assertThat(PageRetrieval.find().all().size()).isEqualTo(1); 26 | } 27 | }); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /test/IntegrationTest.java: -------------------------------------------------------------------------------- 1 | import controllers.Application; 2 | import org.junit.Test; 3 | import play.libs.F.Callback; 4 | import play.test.TestBrowser; 5 | 6 | import static org.fest.assertions.Assertions.assertThat; 7 | import static play.test.Helpers.HTMLUNIT; 8 | import static play.test.Helpers.fakeApplication; 9 | import static play.test.Helpers.inMemoryDatabase; 10 | import static play.test.Helpers.running; 11 | import static play.test.Helpers.testServer; 12 | 13 | /** 14 | * Do integration testing. This means do tests with complete running application. 15 | * @author Philip Johnson 16 | */ 17 | public class IntegrationTest { 18 | 19 | /** 20 | * Check to see if the welcome page is being shown 21 | */ 22 | @Test 23 | public void test() { 24 | running(testServer(3333, fakeApplication(inMemoryDatabase())), HTMLUNIT, new Callback() { 25 | public void invoke(TestBrowser browser) { 26 | browser.goTo("http://localhost:3333"); 27 | assertThat(browser.pageSource()).contains(Application.homePageString); 28 | } 29 | }); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Intellij ### 4 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 5 | 6 | ## Directory-based project format: 7 | 8 | # User-specific stuff: 9 | .idea/workspace.xml 10 | .idea/tasks.xml 11 | .idea/dictionaries 12 | .idea/play2_project_settings.xml 13 | 14 | # Sensitive or high-churn files: 15 | # .idea/dataSources.ids 16 | # .idea/dataSources.xml 17 | # .idea/sqlDataSources.xml 18 | # .idea/dynamic.xml 19 | # .idea/uiDesigner.xml 20 | 21 | # Gradle: 22 | # .idea/gradle.xml 23 | # .idea/libraries 24 | 25 | # Mongo Explorer plugin: 26 | # .idea/mongoSettings.xml 27 | 28 | ## File-based project format: 29 | *.ipr 30 | *.iws 31 | 32 | ## Plugin-specific files: 33 | 34 | # IntelliJ 35 | out/ 36 | 37 | # mpeltonen/sbt-idea plugin 38 | .idea_modules/ 39 | 40 | # JIRA plugin 41 | atlassian-ide-plugin.xml 42 | 43 | # Crashlytics plugin (for Android Studio and IntelliJ) 44 | com_crashlytics_export_strings.xml 45 | crashlytics.properties 46 | crashlytics-build.properties 47 | 48 | 49 | ### PlayFramework ### 50 | # Ignore Play! working directory # 51 | bin/ 52 | /db 53 | .eclipse 54 | /lib/ 55 | /logs/ 56 | /modules 57 | /project/project 58 | /project/target 59 | /target 60 | tmp/ 61 | test-result 62 | server.pid 63 | *.eml 64 | /dist/ 65 | .cache 66 | -------------------------------------------------------------------------------- /conf/application.conf: -------------------------------------------------------------------------------- 1 | # This is the main configuration file for the application. 2 | # ~~~~~ 3 | 4 | # Secret key 5 | # ~~~~~ 6 | # The secret key is used to secure cryptographics functions. 7 | # 8 | # This must be changed for production, but we recommend not changing it in this file. 9 | # 10 | # See http://www.playframework.com/documentation/latest/ApplicationSecret for more details. 11 | 12 | application.secret="o`[_HLm/_^TTH:^]]RjZdUc_^Jng1;o1WD6aLHsV^4Qs>1pvq:D1FItuYoy]O@Pe" 13 | application.secret=${?APP_SECRET} 14 | 15 | # The application languages 16 | # ~~~~~ 17 | application.langs="en" 18 | 19 | # Global object class 20 | # ~~~~~ 21 | # Define the Global object class for this application. 22 | # Default to Global in the root package. 23 | # application.global=Global 24 | 25 | # Router 26 | # ~~~~~ 27 | # Define the Router object to use for this application. 28 | # This router will be looked up first when the application is starting up, 29 | # so make sure this is the entry point. 30 | # Furthermore, it's assumed your route file is named properly. 31 | # So for an application router like `conf/my.application.Router`, 32 | # you may need to define a router file `my.application.routes`. 33 | # Default to Routes in the root package (and `conf/routes`) 34 | # application.router=my.application.Routes 35 | 36 | # Database configuration 37 | # ~~~~~ 38 | # You can declare as many datasources as you want. 39 | # By convention, the default datasource is named `default` 40 | # 41 | db.default.driver=org.postgresql.Driver 42 | db.default.url="jdbc:postgresql://localhost/play_example_postgresql" 43 | db.default.url=${?DATABASE_URL} 44 | # 45 | # You can expose this datasource via JNDI if needed (Useful for JPA) 46 | # db.default.jndiName=DefaultDS 47 | 48 | # Evolutions 49 | # ~~~~~ 50 | # You can disable evolutions if needed 51 | # evolutionplugin=disabled 52 | 53 | applyEvolutions.default=true 54 | 55 | # Ebean configuration 56 | # ~~~~~ 57 | # You can declare as many Ebean servers as you want. 58 | # By convention, the default server is named `default` 59 | # 60 | 61 | ebean.default="models.*" 62 | 63 | # Logger 64 | # ~~~~~ 65 | # You can also configure logback (http://logback.qos.ch/), 66 | # by providing an application-logger.xml file in the conf directory. 67 | 68 | # Root logger: 69 | logger.root=ERROR 70 | 71 | # Logger used by the framework: 72 | logger.play=INFO 73 | 74 | # Logger provided to your application: 75 | logger.application=DEBUG 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /activator.bat: -------------------------------------------------------------------------------- 1 | @REM activator launcher script 2 | @REM 3 | @REM Environment: 4 | @REM In order for Activator to work you must have Java available on the classpath 5 | @REM JAVA_HOME - location of a JDK home dir (optional if java on path) 6 | @REM CFG_OPTS - JVM options (optional) 7 | @REM Configuration: 8 | @REM activatorconfig.txt found in the ACTIVATOR_HOME or ACTIVATOR_HOME/ACTIVATOR_VERSION 9 | @setlocal enabledelayedexpansion 10 | 11 | @echo off 12 | 13 | set "var1=%~1" 14 | if defined var1 ( 15 | if "%var1%"=="help" ( 16 | echo. 17 | echo Usage activator [options] [command] 18 | echo. 19 | echo Commands: 20 | echo ui Start the Activator UI 21 | echo new [name] [template-id] Create a new project with [name] using template [template-id] 22 | echo list-templates Print all available template names 23 | echo help Print this message 24 | echo. 25 | echo Options: 26 | echo -jvm-debug [port] Turn on JVM debugging, open at the given port. Defaults to 9999 if no port given. 27 | echo. 28 | echo Environment variables ^(read from context^): 29 | echo JAVA_OPTS Environment variable, if unset uses "" 30 | echo SBT_OPTS Environment variable, if unset uses "" 31 | echo ACTIVATOR_OPTS Environment variable, if unset uses "" 32 | echo. 33 | echo Please note that in order for Activator to work you must have Java available on the classpath 34 | echo. 35 | goto :end 36 | ) 37 | ) 38 | 39 | if "%ACTIVATOR_HOME%"=="" ( 40 | set "ACTIVATOR_HOME=%~dp0" 41 | @REM remove trailing "\" from path 42 | set ACTIVATOR_HOME=!ACTIVATOR_HOME:~0,-1! 43 | ) 44 | 45 | set ERROR_CODE=0 46 | set APP_VERSION=1.3.2 47 | set ACTIVATOR_LAUNCH_JAR=activator-launch-%APP_VERSION%.jar 48 | 49 | rem Detect if we were double clicked, although theoretically A user could 50 | rem manually run cmd /c 51 | for %%x in (%cmdcmdline%) do if %%~x==/c set DOUBLECLICKED=1 52 | 53 | rem FIRST we load a config file of extra options (if there is one) 54 | set "CFG_FILE_HOME=%UserProfile%\.activator\activatorconfig.txt" 55 | set "CFG_FILE_VERSION=%UserProfile%\.activator\%APP_VERSION%\activatorconfig.txt" 56 | set CFG_OPTS= 57 | if exist %CFG_FILE_VERSION% ( 58 | FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%CFG_FILE_VERSION%") DO ( 59 | set DO_NOT_REUSE_ME=%%i 60 | rem ZOMG (Part #2) WE use !! here to delay the expansion of 61 | rem CFG_OPTS, otherwise it remains "" for this loop. 62 | set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME! 63 | ) 64 | ) 65 | if "%CFG_OPTS%"=="" ( 66 | if exist %CFG_FILE_HOME% ( 67 | FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%CFG_FILE_HOME%") DO ( 68 | set DO_NOT_REUSE_ME=%%i 69 | rem ZOMG (Part #2) WE use !! here to delay the expansion of 70 | rem CFG_OPTS, otherwise it remains "" for this loop. 71 | set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME! 72 | ) 73 | ) 74 | ) 75 | 76 | rem We use the value of the JAVACMD environment variable if defined 77 | set _JAVACMD=%JAVACMD% 78 | 79 | if "%_JAVACMD%"=="" ( 80 | if not "%JAVA_HOME%"=="" ( 81 | if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe" 82 | 83 | rem if there is a java home set we make sure it is the first picked up when invoking 'java' 84 | SET "PATH=%JAVA_HOME%\bin;%PATH%" 85 | ) 86 | ) 87 | 88 | if "%_JAVACMD%"=="" set _JAVACMD=java 89 | 90 | rem Detect if this java is ok to use. 91 | for /F %%j in ('"%_JAVACMD%" -version 2^>^&1') do ( 92 | if %%~j==java set JAVAINSTALLED=1 93 | if %%~j==openjdk set JAVAINSTALLED=1 94 | ) 95 | 96 | rem Detect the same thing about javac 97 | if "%_JAVACCMD%"=="" ( 98 | if not "%JAVA_HOME%"=="" ( 99 | if exist "%JAVA_HOME%\bin\javac.exe" set "_JAVACCMD=%JAVA_HOME%\bin\javac.exe" 100 | ) 101 | ) 102 | if "%_JAVACCMD%"=="" set _JAVACCMD=javac 103 | for /F %%j in ('"%_JAVACCMD%" -version 2^>^&1') do ( 104 | if %%~j==javac set JAVACINSTALLED=1 105 | ) 106 | 107 | rem BAT has no logical or, so we do it OLD SCHOOL! Oppan Redmond Style 108 | set JAVAOK=true 109 | if not defined JAVAINSTALLED set JAVAOK=false 110 | if not defined JAVACINSTALLED set JAVAOK=false 111 | 112 | if "%JAVAOK%"=="false" ( 113 | echo. 114 | echo A Java JDK is not installed or can't be found. 115 | if not "%JAVA_HOME%"=="" ( 116 | echo JAVA_HOME = "%JAVA_HOME%" 117 | ) 118 | echo. 119 | echo Please go to 120 | echo http://www.oracle.com/technetwork/java/javase/downloads/index.html 121 | echo and download a valid Java JDK and install before running Activator. 122 | echo. 123 | echo If you think this message is in error, please check 124 | echo your environment variables to see if "java.exe" and "javac.exe" are 125 | echo available via JAVA_HOME or PATH. 126 | echo. 127 | if defined DOUBLECLICKED pause 128 | exit /B 1 129 | ) 130 | 131 | rem Check what Java version is being used to determine what memory options to use 132 | for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do ( 133 | set JAVA_VERSION=%%g 134 | ) 135 | 136 | rem Strips away the " characters 137 | set JAVA_VERSION=%JAVA_VERSION:"=% 138 | 139 | rem TODO Check if there are existing mem settings in JAVA_OPTS/CFG_OPTS and use those instead of the below 140 | for /f "delims=. tokens=1-3" %%v in ("%JAVA_VERSION%") do ( 141 | set MAJOR=%%v 142 | set MINOR=%%w 143 | set BUILD=%%x 144 | 145 | set META_SIZE=-XX:MetaspaceSize=64M -XX:MaxMetaspaceSize=256M 146 | if "!MINOR!" LSS "8" ( 147 | set META_SIZE=-XX:PermSize=64M -XX:MaxPermSize=256M 148 | ) 149 | 150 | set MEM_OPTS=!META_SIZE! 151 | ) 152 | 153 | rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config. 154 | set _JAVA_OPTS=%JAVA_OPTS% 155 | if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS% 156 | 157 | set DEBUG_OPTS= 158 | 159 | rem Loop through the arguments, building remaining args in args variable 160 | set args= 161 | :argsloop 162 | if not "%~1"=="" ( 163 | rem Checks if the argument contains "-D" and if true, adds argument 1 with 2 and puts an equal sign between them. 164 | rem This is done since batch considers "=" to be a delimiter so we need to circumvent this behavior with a small hack. 165 | set arg1=%~1 166 | if "!arg1:~0,2!"=="-D" ( 167 | set "args=%args% "%~1"="%~2"" 168 | shift 169 | shift 170 | goto argsloop 171 | ) 172 | 173 | if "%~1"=="-jvm-debug" ( 174 | if not "%~2"=="" ( 175 | rem This piece of magic somehow checks that an argument is a number 176 | for /F "delims=0123456789" %%i in ("%~2") do ( 177 | set var="%%i" 178 | ) 179 | if defined var ( 180 | rem Not a number, assume no argument given and default to 9999 181 | set JPDA_PORT=9999 182 | ) else ( 183 | rem Port was given, shift arguments 184 | set JPDA_PORT=%~2 185 | shift 186 | ) 187 | ) else ( 188 | set JPDA_PORT=9999 189 | ) 190 | shift 191 | 192 | set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=!JPDA_PORT! 193 | goto argsloop 194 | ) 195 | rem else 196 | set "args=%args% "%~1"" 197 | shift 198 | goto argsloop 199 | ) 200 | 201 | :run 202 | 203 | if "!args!"=="" ( 204 | if defined DOUBLECLICKED ( 205 | set CMDS="ui" 206 | ) else set CMDS=!args! 207 | ) else set CMDS=!args! 208 | 209 | rem We add a / in front, so we get file:///C: instead of file://C: 210 | rem Java considers the later a UNC path. 211 | rem We also attempt a solid effort at making it URI friendly. 212 | rem We don't even bother with UNC paths. 213 | set JAVA_FRIENDLY_HOME_1=/!ACTIVATOR_HOME:\=/! 214 | set JAVA_FRIENDLY_HOME=/!JAVA_FRIENDLY_HOME_1: =%%20! 215 | 216 | rem Checks if the command contains spaces to know if it should be wrapped in quotes or not 217 | set NON_SPACED_CMD=%_JAVACMD: =% 218 | if "%_JAVACMD%"=="%NON_SPACED_CMD%" %_JAVACMD% %DEBUG_OPTS% %MEM_OPTS% %ACTIVATOR_OPTS% %SBT_OPTS% %_JAVA_OPTS% "-Dactivator.home=%JAVA_FRIENDLY_HOME%" -jar "%ACTIVATOR_HOME%\%ACTIVATOR_LAUNCH_JAR%" %CMDS% 219 | if NOT "%_JAVACMD%"=="%NON_SPACED_CMD%" "%_JAVACMD%" %DEBUG_OPTS% %MEM_OPTS% %ACTIVATOR_OPTS% %SBT_OPTS% %_JAVA_OPTS% "-Dactivator.home=%JAVA_FRIENDLY_HOME%" -jar "%ACTIVATOR_HOME%\%ACTIVATOR_LAUNCH_JAR%" %CMDS% 220 | 221 | if ERRORLEVEL 1 goto error 222 | goto end 223 | 224 | :error 225 | set ERROR_CODE=1 226 | 227 | :end 228 | 229 | @endlocal 230 | 231 | exit /B %ERROR_CODE% 232 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # play-example-postgresql 2 | 3 | This application illustrates how to configure Play to access a PostgreSQL database, as well as how to deploy it to Heroku. The functionality is simple: the application creates a PostgreSQL table called `page_retrieval` containing two columns: an Id and a timestamp. A new row is added to the database each time the home page of the application is retrieved. Thus, the size of the table indicates the number of times the home page has been retrieved, and that value is printed to the home page each time it is accessed: 4 | 5 | ![screenshot](https://raw.githubusercontent.com/ics-software-engineering/play-example-postgresql/master/doc/play-example-postgresql-home-page.png) 6 | 7 | Here are the steps required to run this application: 8 | 9 | 10 | #### 1. Install PostgreSQL. 11 | 12 | Download and install a local copy of [PostgreSQL](http://www.postgresql.org/). Play-example-postgresql was tested with PostgreSQL 9.3 (since that is the current version used by Heroku by default). Later versions of PostgreSQL may still work. 13 | 14 | To test that your PostgreSQL installation was successful, you should be able to run psql from the command line and list the currently installed databases as follows: 15 | 16 | ```Shell 17 | [~/]-> psql 18 | psql (9.3.5) 19 | Type "help" for help. 20 | 21 | johnson=# \l 22 | List of databases 23 | Name | Owner | Encoding | Collate | Ctype | Access privileges 24 | -------------------------+---------+----------+-------------+-------------+--------------------- 25 | johnson | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 26 | postgres | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 27 | template0 | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/johnson + 28 | | | | | | johnson=CTc/johnson 29 | template1 | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/johnson + 30 | | | | | | johnson=CTc/johnson 31 | (4 rows) 32 | 33 | johnson=# \q 34 | [~/]-> 35 | ``` 36 | #### 2. Create a database called play\_example\_postgresql 37 | 38 | This application makes a JDBC connection to a local database called play\_example\_postgresql, as shown [here](https://github.com/ics-software-engineering/play-example-postgres/blob/master/conf/application.conf#L42). 39 | 40 | So, you need to create this database in your local PostgreSQL server. A simple approach is to use psql: 41 | 42 | ```Shell 43 | [~/]-> psql 44 | psql (9.3.5) 45 | Type "help" for help. 46 | 47 | johnson=# create database play_example_postgresql ; 48 | CREATE DATABASE 49 | johnson=# \l 50 | List of databases 51 | Name | Owner | Encoding | Collate | Ctype | Access privileges 52 | -------------------------+---------+----------+-------------+-------------+--------------------- 53 | johnson | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 54 | play_example_postgresql | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 55 | postgres | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 56 | template0 | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/johnson + 57 | | | | | | johnson=CTc/johnson 58 | template1 | johnson | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/johnson + 59 | | | | | | johnson=CTc/johnson 60 | (6 rows) 61 | johnson=# \q 62 | [~/]-> 63 | ``` 64 | #### 3. Run the application 65 | 66 | Now run the Play application using Activator: 67 | 68 | ```Shell 69 | ~/projecthosting/github/play/play-example-postgresql]-> activator run 70 | [info] Loading project definition from /Users/johnson/projecthosting/github/play/play-example-postgresql/project 71 | [info] Updating {file:/Users/johnson/projecthosting/github/play/play-example-postgresql/project/}play-example-postgresql-build... 72 | [info] Resolving org.fusesource.jansi#jansi;1.4 ... 73 | [info] Done updating. 74 | [info] Set current project to play-example-postgresql (in build file:/Users/johnson/projecthosting/github/play/play-example-postgresql/) 75 | [info] Updating {file:/Users/johnson/projecthosting/github/play/play-example-postgresql/}root... 76 | [info] Resolving jline#jline;2.12 ... 77 | [info] Done updating. 78 | 79 | --- (Running the application, auto-reloading is enabled) --- 80 | 81 | [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000 82 | 83 | (Server started, use Ctrl+D to stop and go back to the console...) 84 | ``` 85 | The application should now be accessible at [http://localhost:9000](http://localhost:9000). 86 | 87 | Once you try to retrieve it in a browser, you should see the following additional lines printed out in the console: 88 | 89 | ```Shell 90 | [info] Compiling 2 Scala sources to /Users/johnson/projecthosting/github/play/play-example-postgres/target/scala-2.11/classes... 91 | [info] play - database [default] connected at jdbc:postgresql://localhost/play_example_postgresql 92 | [info] play - Application started (Dev) 93 | ``` 94 | 95 | #### 4. Verify your installation 96 | 97 | Test that you have run the application successfully by retrieving the application in your browser and then refreshing the page. You should see the counter increment in value. 98 | 99 | #### 5. Deploy to Heroku 100 | 101 | It is quite easy to deploy this application to Heroku. First, you must [sign up for a Heroku account](https://signup.heroku.com/www-header) and install the [Heroku toolbelt](https://toolbelt.heroku.com/). 102 | 103 | Second, make sure this application is in the master branch of a local git repository. If the source code is not already under git control, you can set it up quickly with the following commands in the directory containing the application: 104 | 105 | ```Shell 106 | $ git init 107 | $ git add . 108 | $ git commit -m "init" 109 | ``` 110 | 111 | Third, create a new application on Heroku using `heroku create`: 112 | 113 | ```Shell 114 | $ heroku create 115 | Creating warm-frost-1289... done, stack is cedar-14 116 | http://warm-frost-1289.herokuapp.com/ | git@heroku.com:warm-frost-1289.git 117 | Git remote heroku added 118 | ``` 119 | 120 | Fourth, deploy the application using `git push heroku master`: 121 | 122 | ```Shell 123 | $ git push heroku master 124 | Counting objects: 93, done. 125 | Delta compression using up to 4 threads. 126 | Compressing objects: 100% (84/84), done. 127 | Writing objects: 100% (93/93), 1017.92 KiB | 0 bytes/s, done. 128 | Total 93 (delta 38), reused 0 (delta 0) 129 | remote: Compressing source files... done. 130 | remote: Building source: 131 | remote: 132 | remote: -----> Play 2.x - Scala app detected 133 | remote: -----> Installing OpenJDK 1.8... done 134 | remote: -----> Downloading SBT... done 135 | remote: -----> Priming Ivy cache (Scala-2.11, Play-2.3)... done 136 | remote: -----> Running: sbt update 137 | ... 138 | remote: -----> Dropping ivy cache from the slug 139 | remote: -----> Dropping sbt boot dir from the slug 140 | remote: -----> Dropping compilation artifacts from the slug 141 | remote: -----> Discovering process types 142 | remote: Procfile declares types -> web 143 | remote: 144 | remote: -----> Compressing... done, 93.3MB 145 | remote: -----> Launching... done, v6 146 | remote: https://warm-frost-1289.herokuapp.com/ deployed to Heroku 147 | remote: 148 | remote: Verifying deploy... done. 149 | To https://git.heroku.com/warm-frost-1289.git 150 | * [new branch] master -> master 151 | ``` 152 | More information is available in the [Deploying to Heroku](https://www.playframework.com/documentation/2.3.x/ProductionHeroku) page of the Play Framework documentation. 153 | 154 | Fifth, verify your deployment by retrieving the Heroku application in your browser. If the deployment was successful, you should be able to refresh the page and see the counter increment in value. 155 | 156 | ## Screencast 157 | 158 | Click the image below to watch a six minute walkthrough of the code: 159 | 160 | 161 | -------------------------------------------------------------------------------- /activator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ### ------------------------------- ### 4 | ### Helper methods for BASH scripts ### 5 | ### ------------------------------- ### 6 | 7 | realpath () { 8 | ( 9 | TARGET_FILE="$1" 10 | 11 | cd "$(dirname "$TARGET_FILE")" 12 | TARGET_FILE=$(basename "$TARGET_FILE") 13 | 14 | COUNT=0 15 | while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ] 16 | do 17 | TARGET_FILE=$(readlink "$TARGET_FILE") 18 | cd "$(dirname "$TARGET_FILE")" 19 | TARGET_FILE=$(basename "$TARGET_FILE") 20 | COUNT=$(($COUNT + 1)) 21 | done 22 | 23 | if [ "$TARGET_FILE" == "." -o "$TARGET_FILE" == ".." ]; then 24 | cd "$TARGET_FILE" 25 | TARGET_FILEPATH= 26 | else 27 | TARGET_FILEPATH=/$TARGET_FILE 28 | fi 29 | 30 | # make sure we grab the actual windows path, instead of cygwin's path. 31 | if ! is_cygwin; then 32 | echo "$(pwd -P)/$TARGET_FILE" 33 | else 34 | echo $(cygwinpath "$(pwd -P)/$TARGET_FILE") 35 | fi 36 | ) 37 | } 38 | 39 | # TODO - Do we need to detect msys? 40 | 41 | # Uses uname to detect if we're in the odd cygwin environment. 42 | is_cygwin() { 43 | local os=$(uname -s) 44 | case "$os" in 45 | CYGWIN*) return 0 ;; 46 | *) return 1 ;; 47 | esac 48 | } 49 | 50 | # This can fix cygwin style /cygdrive paths so we get the 51 | # windows style paths. 52 | cygwinpath() { 53 | local file="$1" 54 | if is_cygwin; then 55 | echo $(cygpath -w $file) 56 | else 57 | echo $file 58 | fi 59 | } 60 | 61 | # Make something URI friendly 62 | make_url() { 63 | url="$1" 64 | local nospaces=${url// /%20} 65 | if is_cygwin; then 66 | echo "/${nospaces//\\//}" 67 | else 68 | echo "$nospaces" 69 | fi 70 | } 71 | 72 | # Detect if we should use JAVA_HOME or just try PATH. 73 | get_java_cmd() { 74 | if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then 75 | echo "$JAVA_HOME/bin/java" 76 | else 77 | echo "java" 78 | fi 79 | } 80 | 81 | echoerr () { 82 | echo 1>&2 "$@" 83 | } 84 | vlog () { 85 | [[ $verbose || $debug ]] && echoerr "$@" 86 | } 87 | dlog () { 88 | [[ $debug ]] && echoerr "$@" 89 | } 90 | execRunner () { 91 | # print the arguments one to a line, quoting any containing spaces 92 | [[ $verbose || $debug ]] && echo "# Executing command line:" && { 93 | for arg; do 94 | if printf "%s\n" "$arg" | grep -q ' '; then 95 | printf "\"%s\"\n" "$arg" 96 | else 97 | printf "%s\n" "$arg" 98 | fi 99 | done 100 | echo "" 101 | } 102 | 103 | exec "$@" 104 | } 105 | addJava () { 106 | dlog "[addJava] arg = '$1'" 107 | java_args=( "${java_args[@]}" "$1" ) 108 | } 109 | addApp () { 110 | dlog "[addApp] arg = '$1'" 111 | sbt_commands=( "${app_commands[@]}" "$1" ) 112 | } 113 | addResidual () { 114 | dlog "[residual] arg = '$1'" 115 | residual_args=( "${residual_args[@]}" "$1" ) 116 | } 117 | addDebugger () { 118 | addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1" 119 | } 120 | addConfigOpts () { 121 | dlog "[addConfigOpts] arg = '$*'" 122 | for item in $* 123 | do 124 | addJava "$item" 125 | done 126 | } 127 | # a ham-fisted attempt to move some memory settings in concert 128 | # so they need not be messed around with individually. 129 | get_mem_opts () { 130 | local mem=${1:-1024} 131 | local meta=$(( $mem / 4 )) 132 | (( $meta > 256 )) || meta=256 133 | (( $meta < 1024 )) || meta=1024 134 | 135 | # default is to set memory options but this can be overridden by code section below 136 | memopts="-Xms${mem}m -Xmx${mem}m" 137 | if [[ "${java_version}" > "1.8" ]]; then 138 | extmemopts="-XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=${meta}m" 139 | else 140 | extmemopts="-XX:PermSize=64m -XX:MaxPermSize=${meta}m" 141 | fi 142 | 143 | if [[ "${java_opts}" == *-Xmx* ]] || [[ "${java_opts}" == *-Xms* ]] || [[ "${java_opts}" == *-XX:MaxPermSize* ]] || [[ "${java_opts}" == *-XX:ReservedCodeCacheSize* ]] || [[ "${java_opts}" == *-XX:MaxMetaspaceSize* ]]; then 144 | # if we detect any of these settings in ${java_opts} we need to NOT output our settings. 145 | # The reason is the Xms/Xmx, if they don't line up, cause errors. 146 | memopts="" 147 | extmemopts="" 148 | fi 149 | 150 | echo "${memopts} ${extmemopts}" 151 | } 152 | require_arg () { 153 | local type="$1" 154 | local opt="$2" 155 | local arg="$3" 156 | if [[ -z "$arg" ]] || [[ "${arg:0:1}" == "-" ]]; then 157 | die "$opt requires <$type> argument" 158 | fi 159 | } 160 | is_function_defined() { 161 | declare -f "$1" > /dev/null 162 | } 163 | 164 | # If we're *not* running in a terminal, and we don't have any arguments, then we need to add the 'ui' parameter 165 | detect_terminal_for_ui() { 166 | [[ ! -t 0 ]] && [[ "${#residual_args}" == "0" ]] && { 167 | addResidual "ui" 168 | } 169 | # SPECIAL TEST FOR MAC 170 | [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]] && [[ "${#residual_args}" == "0" ]] && { 171 | echo "Detected MAC OSX launched script...." 172 | echo "Swapping to UI" 173 | addResidual "ui" 174 | } 175 | } 176 | 177 | # Processes incoming arguments and places them in appropriate global variables. called by the run method. 178 | process_args () { 179 | while [[ $# -gt 0 ]]; do 180 | case "$1" in 181 | -h|-help) usage; exit 1 ;; 182 | -v|-verbose) verbose=1 && shift ;; 183 | -d|-debug) debug=1 && shift ;; 184 | -mem) require_arg integer "$1" "$2" && app_mem="$2" && shift 2 ;; 185 | -jvm-debug) 186 | if echo "$2" | grep -E ^[0-9]+$ > /dev/null; then 187 | addDebugger "$2" && shift 188 | else 189 | addDebugger 9999 190 | fi 191 | shift ;; 192 | -java-home) require_arg path "$1" "$2" && java_cmd="$2/bin/java" && shift 2 ;; 193 | -D*) addJava "$1" && shift ;; 194 | -J*) addJava "${1:2}" && shift ;; 195 | *) addResidual "$1" && shift ;; 196 | esac 197 | done 198 | 199 | is_function_defined process_my_args && { 200 | myargs=("${residual_args[@]}") 201 | residual_args=() 202 | process_my_args "${myargs[@]}" 203 | } 204 | } 205 | 206 | # Actually runs the script. 207 | run() { 208 | # TODO - check for sane environment 209 | 210 | # process the combined args, then reset "$@" to the residuals 211 | process_args "$@" 212 | detect_terminal_for_ui 213 | set -- "${residual_args[@]}" 214 | argumentCount=$# 215 | 216 | #check for jline terminal fixes on cygwin 217 | if is_cygwin; then 218 | stty -icanon min 1 -echo > /dev/null 2>&1 219 | addJava "-Djline.terminal=jline.UnixTerminal" 220 | addJava "-Dsbt.cygwin=true" 221 | fi 222 | 223 | # run sbt 224 | execRunner "$java_cmd" \ 225 | "-Dactivator.home=$(make_url "$activator_home")" \ 226 | $(get_mem_opts $app_mem) \ 227 | ${java_opts[@]} \ 228 | ${java_args[@]} \ 229 | -jar "$app_launcher" \ 230 | "${app_commands[@]}" \ 231 | "${residual_args[@]}" 232 | 233 | local exit_code=$? 234 | if is_cygwin; then 235 | stty icanon echo > /dev/null 2>&1 236 | fi 237 | exit $exit_code 238 | } 239 | 240 | # Loads a configuration file full of default command line options for this script. 241 | loadConfigFile() { 242 | cat "$1" | sed '/^\#/d' 243 | } 244 | 245 | ### ------------------------------- ### 246 | ### Start of customized settings ### 247 | ### ------------------------------- ### 248 | usage() { 249 | cat < [options] 251 | 252 | Command: 253 | ui Start the Activator UI 254 | new [name] [template-id] Create a new project with [name] using template [template-id] 255 | list-templates Print all available template names 256 | -h | -help Print this message 257 | 258 | Options: 259 | -v | -verbose Make this runner chattier 260 | -d | -debug Set sbt log level to debug 261 | -mem Set memory options (default: $sbt_mem, which is $(get_mem_opts $sbt_mem)) 262 | -jvm-debug Turn on JVM debugging, open at the given port. 263 | 264 | # java version (default: java from PATH, currently $(java -version 2>&1 | grep version)) 265 | -java-home Alternate JAVA_HOME 266 | 267 | # jvm options and output control 268 | -Dkey=val Pass -Dkey=val directly to the java runtime 269 | -J-X Pass option -X directly to the java runtime 270 | (-J is stripped) 271 | 272 | # environment variables (read from context) 273 | JAVA_OPTS Environment variable, if unset uses "" 274 | SBT_OPTS Environment variable, if unset uses "" 275 | ACTIVATOR_OPTS Environment variable, if unset uses "" 276 | 277 | In the case of duplicated or conflicting options, the order above 278 | shows precedence: environment variables lowest, command line options highest. 279 | EOM 280 | } 281 | 282 | ### ------------------------------- ### 283 | ### Main script ### 284 | ### ------------------------------- ### 285 | 286 | declare -a residual_args 287 | declare -a java_args 288 | declare -a app_commands 289 | declare -r real_script_path="$(realpath "$0")" 290 | declare -r activator_home="$(realpath "$(dirname "$real_script_path")")" 291 | declare -r app_version="1.3.2" 292 | 293 | declare -r app_launcher="${activator_home}/activator-launch-${app_version}.jar" 294 | declare -r script_name=activator 295 | java_cmd=$(get_java_cmd) 296 | declare -r java_opts=( "${ACTIVATOR_OPTS[@]}" "${SBT_OPTS[@]}" "${JAVA_OPTS[@]}" "${java_opts[@]}" ) 297 | userhome="$HOME" 298 | if is_cygwin; then 299 | # cygwin sets home to something f-d up, set to real windows homedir 300 | userhome="$USERPROFILE" 301 | fi 302 | declare -r activator_user_home_dir="${userhome}/.activator" 303 | declare -r java_opts_config_home="${activator_user_home_dir}/activatorconfig.txt" 304 | declare -r java_opts_config_version="${activator_user_home_dir}/${app_version}/activatorconfig.txt" 305 | 306 | # Now check to see if it's a good enough version 307 | declare -r java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}') 308 | if [[ "$java_version" == "" ]]; then 309 | echo 310 | echo No java installations was detected. 311 | echo Please go to http://www.java.com/getjava/ and download 312 | echo 313 | exit 1 314 | elif [[ ! "$java_version" > "1.6" ]]; then 315 | echo 316 | echo The java installation you have is not up to date 317 | echo Activator requires at least version 1.6+, you have 318 | echo version $java_version 319 | echo 320 | echo Please go to http://www.java.com/getjava/ and download 321 | echo a valid Java Runtime and install before running Activator. 322 | echo 323 | exit 1 324 | fi 325 | 326 | # if configuration files exist, prepend their contents to the java args so it can be processed by this runner 327 | # a "versioned" config trumps one on the top level 328 | if [[ -f "$java_opts_config_version" ]]; then 329 | addConfigOpts $(loadConfigFile "$java_opts_config_version") 330 | elif [[ -f "$java_opts_config_home" ]]; then 331 | addConfigOpts $(loadConfigFile "$java_opts_config_home") 332 | fi 333 | 334 | run "$@" 335 | -------------------------------------------------------------------------------- /.idea/modules/root.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /.idea/modules/root-build.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | --------------------------------------------------------------------------------