fix header
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,9 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
+ <component name="DaemonCodeAnalyzer">
+ <disable_hints />
+ </component>
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+ <OptionsSetting value="true" id="Add" />
+ <OptionsSetting value="true" id="Remove" />
+ <OptionsSetting value="true" id="Checkout" />
+ <OptionsSetting value="true" id="Update" />
+ <OptionsSetting value="true" id="Status" />
+ <OptionsSetting value="true" id="Edit" />
+ <ConfirmationsSetting value="0" id="Add" />
+ <ConfirmationsSetting value="0" id="Remove" />
+ </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true">
<output url="file://$PROJECT_DIR$/out" />
</component>
- <component name="RegexUtilComponent" text="1900-01-01 2007/08/13 1900.01.01 1900 01 01 1900-01.01 1900 13 01 1900 02 31" flags="0" regex="(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])" mode="0" />
+ <component name="RunManager">
+ <configuration default="true" type="Remote" factoryName="Remote">
+ <option name="USE_SOCKET_TRANSPORT" value="true" />
+ <option name="SERVER_MODE" value="false" />
+ <option name="SHMEM_ADDRESS" value="javadebug" />
+ <option name="HOST" value="localhost" />
+ <option name="PORT" value="5005" />
+ <method />
+ </configuration>
+ <configuration default="true" type="Applet" factoryName="Applet">
+ <module name="" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="HTML_FILE_NAME" />
+ <option name="HTML_USED" value="false" />
+ <option name="WIDTH" value="400" />
+ <option name="HEIGHT" value="300" />
+ <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+ <option name="VM_PARAMETERS" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <method />
+ </configuration>
+ <configuration default="true" type="Application" factoryName="Application">
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="VM_PARAMETERS" />
+ <option name="PROGRAM_PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <option name="ENV_VARIABLES" />
+ <option name="PASS_PARENT_ENVS" value="true" />
+ <module name="" />
+ <envs />
+ <method />
+ </configuration>
+ <list size="0" />
+ <configuration name="<template>" type="JUnit" default="true" selected="false">
+ <option name="MAIN_CLASS_NAME" />
+ <option name="VM_PARAMETERS" value="-ea" />
+ <option name="PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+ </configuration>
+ <configuration name="<template>" type="TestNG" default="true" selected="false">
+ <option name="MAIN_CLASS_NAME" />
+ <option name="VM_PARAMETERS" value="-ea" />
+ <option name="PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+ </configuration>
+ <configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
+ <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
+ </configuration>
+ <configuration name="<template>" type="WebApp" default="true" selected="false">
+ <Host>localhost</Host>
+ <Port>5050</Port>
+ </configuration>
+ </component>
+ <component name="masterDetails">
+ <states>
+ <state key="ProjectJDKs.UI">
+ <settings>
+ <splitter-proportions>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </splitter-proportions>
+ </settings>
+ </state>
+ </states>
+ </component>
</project>
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,36 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="BookmarkManager">
- <bookmark url="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read.rdf" line="71" />
- </component>
<component name="ChangeListManager">
<list default="true" id="89ace156-8d75-43de-ba53-6e829c197435" name="Default" comment="">
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/resource_item.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_basic_fields.html" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_basic_fields.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_metadata_fields.html" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_metadata_fields.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/package/read.html" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/read.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/package/read.rdf" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/read.rdf" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/package/read_base.html" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/read_base.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/package/resource_read.html" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/package/resource_read.html" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext-datagovau.iml" afterPath="$PROJECT_DIR$/ckanext-datagovau.iml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ckanext/datagovau/templates/header.html" afterPath="$PROJECT_DIR$/ckanext/datagovau/templates/header.html" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="ckanext-datagovau.iws" />
<ignored path=".idea/workspace.xml" />
- <file path="/Dummy.txt" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379987697128" ignored="false" />
- <file path="/plugin.py" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379980346924" ignored="false" />
- <file path="/setup.py" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379980236185" ignored="false" />
- <file path="/package_basic_fields.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379984845682" ignored="false" />
- <file path="/package_metadata_fields.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379984915516" ignored="false" />
- <file path="/read_base.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379985182291" ignored="false" />
- <file path="/read.rdf" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379985068490" ignored="false" />
- <file path="/README.rst" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1378703724236" ignored="false" />
- <file path="/a.dummy" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379987251443" ignored="false" />
- <file path="/read.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379984781447" ignored="false" />
- <file path="/create.py" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1378705719051" ignored="false" />
- <file path="/additional_info.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1378717234941" ignored="false" />
- <file path="/resource_read.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379985226010" ignored="false" />
- <file path="/resources_list.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379986542457" ignored="false" />
- <file path="/resource_item.html" changelist="89ace156-8d75-43de-ba53-6e829c197435" time="1379987596016" ignored="false" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -45,7 +23,7 @@
<disable_hints />
</component>
<component name="DebuggerManager">
- <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
+ <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true" converted="true">
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
@@ -81,9 +59,8 @@
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
- <ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
- <breakpoint_rules />
- <ui_properties />
+ <breakpoint_rules converted="true" />
+ <ui_properties converted="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
@@ -91,37 +68,11 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="read_base.html" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read_base.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="6" column="110" selection-start="190" selection-end="190" vertical-scroll-proportion="-3.9230769">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="resource_read.html" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/resource_read.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="10" column="0" selection-start="233" selection-end="246" vertical-scroll-proportion="-6.5384617">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
<file leaf-file-name="read.html" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/user/read.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="read.rdf" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read.rdf">
- <provider selected="true" editor-type-id="text-editor">
- <state line="57" column="119" selection-start="2936" selection-end="2936" vertical-scroll-proportion="0.0">
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="680">
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
@@ -130,7 +81,8 @@
<file leaf-file-name="dashboard_datasets.html" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/user/dashboard_datasets.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="21" selection-start="0" selection-end="18" vertical-scroll-proportion="-0.0">
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="420">
+ <caret line="0" column="18" selection-start-line="0" selection-start-column="18" selection-end-line="0" selection-end-column="18" />
<folding />
</state>
</provider>
@@ -139,16 +91,8 @@
<file leaf-file-name="plugin.py" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/plugin.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="154" selection-start="577" selection-end="577" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="resource_item.html" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/resource_item.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="22" column="129" selection-start="1133" selection-end="1133" vertical-scroll-proportion="0.5771605">
+ <state vertical-scroll-proportion="0.0" vertical-offset="280" max-vertical-offset="1080">
+ <caret line="14" column="49" selection-start-line="14" selection-start-column="49" selection-end-line="14" selection-end-column="49" />
<folding />
</state>
</provider>
@@ -157,7 +101,8 @@
<file leaf-file-name="package_basic_fields.html" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_basic_fields.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="51" column="125" selection-start="2745" selection-end="2745" vertical-scroll-proportion="-13.807693">
+ <state vertical-scroll-proportion="0.0" vertical-offset="500" max-vertical-offset="620">
+ <caret line="25" column="0" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
<folding />
</state>
</provider>
@@ -166,7 +111,18 @@
<file leaf-file-name="read.html" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="12" column="96" selection-start="451" selection-end="451" vertical-scroll-proportion="-7.8461537">
+ <state vertical-scroll-proportion="-9.230769" vertical-offset="0" max-vertical-offset="460">
+ <caret line="12" column="25" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="header.html" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/header.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.58890146" vertical-offset="0" max-vertical-offset="1200">
+ <caret line="26" column="56" selection-start-line="26" selection-start-column="56" selection-end-line="26" selection-end-column="56" />
<folding />
</state>
</provider>
@@ -207,14 +163,16 @@
<option value="$PROJECT_DIR$/ckanext/datagovau/templates/package/read_base.html" />
<option value="$PROJECT_DIR$/ckanext/datagovau/templates/package/read.html" />
<option value="$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/resource_item.html" />
+ <option value="$PROJECT_DIR$/ckanext/datagovau/templates/header.html" />
</list>
</option>
</component>
+ <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
- <option name="x" value="-4" />
- <option name="y" value="-4" />
- <option name="width" value="1928" />
- <option name="height" value="1044" />
+ <option name="x" value="-1" />
+ <option name="y" value="24" />
+ <option name="width" value="1922" />
+ <option name="height" value="1033" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
@@ -230,7 +188,7 @@
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
- <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+ <navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
@@ -242,7 +200,6 @@
<sortByType />
</navigator>
<panes>
- <pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -271,7 +228,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value=".idea" />
+ <option name="myItemId" value="ckanext" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -288,6 +245,10 @@
<option name="myItemId" value="ckanext" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="datagovau" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -306,6 +267,10 @@
<option name="myItemId" value="datagovau" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="templates" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -325,7 +290,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="public" />
+ <option name="myItemId" value="templates" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="user" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -351,7 +320,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="user" />
+ <option name="myItemId" value="package" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -380,6 +349,10 @@
<option name="myItemId" value="package" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="snippets" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -391,48 +364,24 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="ckanext" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="datagovau" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="templates" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="package" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="snippets" />
+ <option name="myItemId" value=".idea" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
+ <pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
- <property name="project.structure.last.edited" value="Project" />
+ <property name="GoToClass.includeLibraries" value="false" />
+ <property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
- <property name="project.structure.proportion" value="0.0" />
- <property name="options.splitter.main.proportions" value="0.3" />
<property name="MemberChooser.sorted" value="false" />
- <property name="options.lastSelected" value="vcs.Git" />
- <property name="last_opened_file_path" value="$PROJECT_DIR$" />
- <property name="project.structure.side.proportion" value="0.0" />
- <property name="DefaultHtmlFileTemplate" value="Html5" />
+ <property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
- <property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="WebServerToolWindowFactoryState" value="false" />
- <property name="MemberChooser.showClasses" value="true" />
- <property name="GoToClass.includeLibraries" value="false" />
- <property name="options.searchVisible" value="true" />
- <property name="options.splitter.details.proportions" value="0.2" />
</component>
<component name="PyConsoleOptionsProvider">
<option name="myPythonConsoleState">
@@ -448,6 +397,14 @@
</key>
</component>
<component name="RunManager">
+ <configuration default="true" type="Remote" factoryName="Remote">
+ <option name="USE_SOCKET_TRANSPORT" value="true" />
+ <option name="SERVER_MODE" value="false" />
+ <option name="SHMEM_ADDRESS" value="javadebug" />
+ <option name="HOST" value="localhost" />
+ <option name="PORT" value="5005" />
+ <method />
+ </configuration>
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@@ -457,18 +414,12 @@
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
+ <option name="ADD_CONTENT_ROOTS" value="true" />
+ <option name="ADD_SOURCE_ROOTS" value="true" />
<module name="ckanext-datagovau" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
- <method />
- </configuration>
- <configuration default="true" type="Remote" factoryName="Remote">
- <option name="USE_SOCKET_TRANSPORT" value="true" />
- <option name="SERVER_MODE" value="false" />
- <option name="SHMEM_ADDRESS" value="javadebug" />
- <option name="HOST" value="localhost" />
- <option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="tests" factoryName="Unittests">
@@ -478,6 +429,8 @@
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
+ <option name="ADD_CONTENT_ROOTS" value="true" />
+ <option name="ADD_SOURCE_ROOTS" value="true" />
<module name="" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
@@ -527,6 +480,8 @@
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
+ <option name="ADD_CONTENT_ROOTS" value="true" />
+ <option name="ADD_SOURCE_ROOTS" value="true" />
<module name="ckanext-datagovau" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
@@ -536,13 +491,6 @@
<option name="TEST_TYPE" value="TEST_SCRIPT" />
<option name="PATTERN" value="" />
<option name="USE_PATTERN" value="false" />
- <method />
- </configuration>
- <configuration default="true" type="JavascriptDebugSession" factoryName="Local" singleton="true">
- <JSDebuggerConfigurationSettings>
- <option name="engineId" value="embedded" />
- <option name="fileUrl" />
- </JSDebuggerConfigurationSettings>
<method />
</configuration>
<list size="0" />
@@ -605,16 +553,16 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
- <frame x="-4" y="-4" width="1928" height="1044" extended-state="6" />
- <editor active="false" />
+ <frame x="-1" y="24" width="1922" height="1033" extended-state="6" />
+ <editor active="true" />
<layout>
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3290735" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3290735" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22048998" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16183448" sideWeight="0.77951" order="0" side_tool="false" content_ui="combo" />
+ <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16145833" sideWeight="0.77951" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.22048998" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
@@ -622,170 +570,143 @@
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32962137" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22048998" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
+ </component>
+ <component name="Vcs.Log.UiProperties">
+ <option name="RECENTLY_FILTERED_USER_GROUPS">
+ <collection />
+ </option>
+ <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
+ <collection />
+ </option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
- <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
- <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
- <option name="CHECK_NEW_TODO" value="true" />
<option name="myTodoPanelSettings">
- <value>
- <are-packages-shown value="false" />
- <are-modules-shown value="false" />
- <flatten-packages value="false" />
- <is-autoscroll-to-source value="false" />
- </value>
+ <TodoPanelSettings />
</option>
- <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
- <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
- <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
- <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
- <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
- <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
- <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
- <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
- <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
- <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
- <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
- <option name="SHORT_DIFF_HORIZONTALLY" value="true" />
- <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
- <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
- <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
- <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
- <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
- <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
- <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
- <option name="LIMIT_HISTORY" value="true" />
- <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
- <option name="UPDATE_FILTER_SCOPE_NAME" />
- <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
- <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
- <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
- <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
- <option name="LAST_COMMIT_MESSAGE" value="Allow anonymous access to datastore API search" />
- <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
- <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
- <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
- <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
- <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
- <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
- <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
- <option name="ACTIVE_VCS_NAME" />
- <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
- <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
- <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
- <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
- <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
<MESSAGE value="Update HTML package output to interim metadata standard" />
<MESSAGE value="Move Disqus comments to package not resource page" />
<MESSAGE value="Allow anonymous access to datastore API search" />
+ <option name="LAST_COMMIT_MESSAGE" value="Allow anonymous access to datastore API search" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/user/read.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="680">
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/user/dashboard_datasets.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="420">
+ <caret line="0" column="18" selection-start-line="0" selection-start-column="18" selection-end-line="0" selection-end-column="18" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/plugin.py">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.0" vertical-offset="280" max-vertical-offset="1080">
+ <caret line="14" column="49" selection-start-line="14" selection-start-column="49" selection-end-line="14" selection-end-column="49" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_basic_fields.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.0" vertical-offset="500" max-vertical-offset="620">
+ <caret line="25" column="0" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.0" vertical-offset="240" max-vertical-offset="460">
+ <caret line="12" column="25" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_metadata_fields.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read_base.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="11" column="0" selection-start="247" selection-end="1668" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/resource_read.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="14" column="89" selection-start="580" selection-end="580" vertical-scroll-proportion="0.0">
- <folding />
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="0">
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/setup.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="23" column="48" selection-start="677" selection-end="677" vertical-scroll-proportion="0.6788194">
- <folding />
+ <state vertical-scroll-proportion="0.6788194" vertical-offset="0" max-vertical-offset="0">
+ <caret line="23" column="48" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/plugin.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="154" selection-start="577" selection-end="577" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read.rdf">
- <provider selected="true" editor-type-id="text-editor">
- <state line="57" column="119" selection-start="2936" selection-end="2936" vertical-scroll-proportion="0.0">
+ <state vertical-scroll-proportion="0.0" vertical-offset="280" max-vertical-offset="1080">
+ <caret line="14" column="49" selection-start-line="14" selection-start-column="49" selection-end-line="14" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_metadata_fields.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="18" column="70" selection-start="675" selection-end="675" vertical-scroll-proportion="-11.769231">
- <folding />
+ <state vertical-scroll-proportion="-11.769231" vertical-offset="0" max-vertical-offset="0">
+ <caret line="18" column="70" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/user/dashboard_datasets.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="21" selection-start="0" selection-end="18" vertical-scroll-proportion="-0.0">
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="420">
+ <caret line="0" column="18" selection-start-line="0" selection-start-column="18" selection-end-line="0" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/user/read.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/resource_read.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="10" column="0" selection-start="233" selection-end="246" vertical-scroll-proportion="-6.5384617">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read_base.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="6" column="110" selection-start="190" selection-end="190" vertical-scroll-proportion="-3.9230769">
+ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="0">
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/read.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="12" column="96" selection-start="451" selection-end="451" vertical-scroll-proportion="-7.8461537">
+ <state vertical-scroll-proportion="-9.230769" vertical-offset="0" max-vertical-offset="460">
+ <caret line="12" column="25" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/package_basic_fields.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="51" column="125" selection-start="2745" selection-end="2745" vertical-scroll-proportion="-13.807693">
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/package/snippets/resource_item.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="22" column="129" selection-start="1133" selection-end="1133" vertical-scroll-proportion="0.5771605">
+ <state vertical-scroll-proportion="0.0" vertical-offset="500" max-vertical-offset="620">
+ <caret line="25" column="0" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/ckanext/datagovau/templates/header.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.58890146" vertical-offset="0" max-vertical-offset="1200">
+ <caret line="26" column="56" selection-start-line="26" selection-start-column="56" selection-end-line="26" selection-end-column="56" />
<folding />
</state>
</provider>
--- a/admin/autoupdate.py
+++ b/admin/autoupdate.py
@@ -1,18 +1,17 @@
import requests
import ckanapi
-# copy (select id,url,format,extras from resource where extras like '%"autoupdate": "active"%') TO STDOUT WITH CSV;
-# f759e4b6-723c-4863-8a26-1529d689cad8,http://data.gov.au/geoserver/geelong-roofprints-kml/wms?request=GetCapabilities,wms,"{""autoupdate"": ""active""}"
-import fileinput
import csv
+import sys
+import psycopg2
+import json
+from subprocess import Popen, PIPE
-def updateresource(id):
- url = 'http://data.disclosurelo.gs'
- api_key = ''
- db_credentials = ''
- print id
- ckan = ckanapi.RemoteCKAN('http://data.disclosurelo.gs')
+def updateresource(resource_id, dataset_id):
+ print ' --- '
+ ckan = ckanapi.RemoteCKAN(api_url,api_key)
#ckan = ckanapi.RemoteCKAN('http://demo.ckan.org')
- resource = ckan.action.resource_show(id=id)
+ resource = ckan.action.resource_show(id=resource_id)
+ print 'updating '+resource['name']+'('+resource_id+', '+dataset_id+')'
print resource
url = resource['url']
#last_modified= 'Mon, 24 Feb 2014 01:48:29 GMT'
@@ -22,6 +21,7 @@
headers['If-None-Match'] = resource['etag']
if 'file_last_modified' in resource:
headers["If-Modified-Since"] = resource['file_last_modified']
+ print headers
r = requests.head(url, headers=headers)
if r.status_code == 304:
print 'not modified'
@@ -34,14 +34,42 @@
if 'etag' in r.headers:
resource['etag'] = r.headers['etag']
#save updated resource
- if 'format' == 'shp':
- print "geoingest!"
+ print resource
+ result = ckan.call_action('resource_update',resource)
+ if resource['format'].lower() == 'shp' or resource['format'].lower() == 'kml':
+ print "geoingest!"
+ pargs= ['dga-spatialingestor.py', db_settings_json, api_url, api_key, dataset_id]
+ print pargs
+ p = Popen(pargs)#, stdout=PIPE, stderr=PIPE)
+ p.communicate()
else:
- ckan.action.datapusher_submit(resource_id=id)
-# result = ckan.action.resource_update(id,resource)
+ print "datapusher!"
+ # https://github.com/ckan/ckan/blob/master/ckanext/datapusher/logic/action.py#L19
+ ckan.action.datapusher_submit(resource_id=resource_id)
+if len(sys.argv) != 4:
+ print "autoupdate ingester. command line: postgis_url api_url api_key"
+ sys.exit(-1)
+else:
+ (path, db_settings_json, api_url, api_key) = sys.argv
+ db_settings = json.loads(db_settings_json)
+ datastore_db_settings = dict(db_settings)
+ datastore_db_settings['dbname'] = db_settings['datastore_dbname']
+ datastore_db_settings_json = json.dumps(datastore_db_settings)
-for line in fileinput.input():
- row = csv.reader(line)
- updateresource(line.replace("\n",""))
+try:
+ conn = psycopg2.connect(dbname=db_settings['dbname'], user=db_settings['user'], password=db_settings['password'], host=db_settings['host'])
+except:
+ failure("I am unable to connect to the database.")
+# Open a cursor to perform database operations
+cur = conn.cursor()
+conn.set_isolation_level(0)
+cur.execute('select resource.id resource_id, package.id dataset_id from resource inner join resource_group on resource.resource_group_id = resource_group.id inner join package on resource_group.package_id = package.id where resource.extras like \'%"autoupdate": "active"%\';')
+row = cur.fetchone()
+while row is not None:
+ updateresource(row[0],row[1])
+ # process
+ row = cur.fetchone()
+cur.close()
+conn.close()
--- a/ckanext-datagovau.iml
+++ b/ckanext-datagovau.iml
@@ -2,9 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
- </content>
+ <content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
--- a/ckanext/datagovau/__init__.py
+++ b/ckanext/datagovau/__init__.py
@@ -1,1 +1,8 @@
+# this is a namespace package
+try:
+ import pkg_resources
+ pkg_resources.declare_namespace(__name__)
+except ImportError:
+ import pkgutil
+ __path__ = pkgutil.extend_path(__path__, __name__)
--- a/ckanext/datagovau/plugin.py
+++ b/ckanext/datagovau/plugin.py
@@ -22,6 +22,10 @@
filtered_dict[dataset['id']] = dataset
return filtered_dict.values()
+def get_related_dataset(related_id):
+ result = model.Session.execute("select dataset_id from related_dataset where related_id =\'"+related_id+"\' limit 1;").first()[0]
+ return result
+
def related_create(context, data_dict=None):
return {'success': False, 'msg': 'No one is allowed to create related items'}
@@ -37,7 +41,7 @@
plugins.implements(plugins.IAuthFunctions)
def get_auth_functions(self):
- return {'rekated_create': related_create}
+ return {'related_create': related_create}
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
@@ -51,6 +55,6 @@
# config['licenses_group_url'] = 'http://%(ckan.site_url)/licenses.json'
def get_helpers(self):
- return {'get_user_datasets': get_user_datasets}
+ return {'get_user_datasets': get_user_datasets, 'get_related_dataset': get_related_dataset}
--- a/ckanext/datagovau/templates/header.html
+++ b/ckanext/datagovau/templates/header.html
@@ -1,4 +1,42 @@
{% ckan_extends %}
+
+{% block header_account_logged %}
+{% if c.userobj.sysadmin %}
+<li>
+ <a href="{{ h.url_for(controller='admin', action='index') }}" title="{{ _('Sysadmin settings') }}">
+ <i class="icon-legal"> Sysadmin settings</i>
+ </a>
+</li>
+{% endif %}
+<li>
+ <a href="{{ h.url_for(controller='user', action='read', id=c.userobj.name) }}" class="image" title="{{ _('View profile') }}">
+ {{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''), size=22) }}
+ <span class="username">{{ c.userobj.display_name }}</span>
+ </a>
+</li>
+{% set new_activities = h.new_activities() %}
+<li class="notifications {% if new_activities > 0 %}notifications-important{% endif %}">
+ {% set notifications_tooltip = ngettext('Dashboard (%(num)d new item)', 'Dashboard (%(num)d new items)', new_activities) %}
+ <a href="{{ h.url_for(controller='user', action='dashboard') }}" title="{{ notifications_tooltip }}">
+ <i class="icon-dashboard"> Dashboard</i>
+ <span>{{ new_activities }}</span>
+ </a>
+</li>
+{% block header_account_settings_link %}
+<li>
+ <a href="{{ h.url_for(controller='user', action='edit', id=c.userobj.name) }}" title="{{ _('Edit settings') }}">
+ <i class="icon-cog"> Edit settings</i>
+ </a>
+</li>
+{% endblock %}
+{% block header_account_log_out_link %}
+<li>
+ <a href="{{ h.url_for('/user/_logout') }}" title="{{ _('Log out') }}">
+ <i class="icon-signout"> Log out</i>
+ </a>
+</li>
+{% endblock %}
+{% endblock %}
{% block header_site_navigation %}
<nav class="section navigation">
@@ -7,10 +45,11 @@
{{ h.build_nav_main(
('search', _('Datasets')),
('organizations_index', _('Organizations')),
- ('about', _('About'))
+ ('about', _('About')),
+ ('stats', _('Site Statistics'))
) }}
- <li><a href="//data.gov.au/stats">Site Statistics</a></li>
- <li><a href="https://datagovau.ideascale.com/">Feedback/Request Data</a></li>
+ <li><a href="/related">Use Cases</a></li>
+ <li><a href="https://datagovau.ideascale.com/">Feedback/Request Data</a></li>
{% endblock %}
</ul>
</nav>
--- /dev/null
+++ b/ckanext/datagovau/templates/package/read_base.html
@@ -1,1 +1,10 @@
+{% ckan_extends %}
+{% block content_primary_nav %}
+ {{ h.build_nav_icon('dataset_read', _('Dataset'), id=pkg.name) }}
+ {{ h.build_nav_icon('dataset_groups', _('Groups'), id=pkg.name) }}
+ {{ h.build_nav_icon('dataset_activity', _('Activity Stream'), id=pkg.name) }}
+ {{ h.build_nav_icon('related_list', _('Use Cases'), id=pkg.name) }}
+{% endblock %}
+
+
--- a/ckanext/datagovau/templates/package/snippets/resource_form.html
+++ b/ckanext/datagovau/templates/package/snippets/resource_form.html
@@ -21,7 +21,7 @@
{% call form.input(field_url, label=url_label, id='field-image-url', placeholder=placeholder, value=data.get(field_url), error=errors.get(field_url), classes=['control-full']) %}
<span id="autoupdate_form">
- {% call form.select('autoupdate', label=_('Generate API from this Link'), options= [{'value': 'active', 'text': 'Active'}, {'value': 'inactive', 'text': 'Inactive'}], selected='Active', error=errors.autoupdate) %}
+ {% call form.select('autoupdate', label=_('Generate API from this Link'), options= [{'value': 'active', 'text': 'Active'}, {'value': 'inactive', 'text': 'Inactive'}], selected='Inactive', error=errors.autoupdate) %}
<br/>
Where a file is compatible with either CKAN or GeoServer we will attempt to make a functional end-point for this resource. The link provided above will also be checked for a new version based on the update frequency as set at the dataset level.
</span>
--- /dev/null
+++ b/ckanext/datagovau/templates/related/dashboard.html
@@ -1,1 +1,100 @@
+{% extends "page.html" %}
+{% set page = c.page %}
+{% set item_count = c.page.item_count %}
+
+{% block subtitle %}{{ _('Government Data Use Cases') }}{% endblock %}
+
+{% block breadcrumb_content %}
+ <li>{{ _('Government Data Use Cases') }}</li>
+{% endblock %}
+
+{% block primary_content %}
+ <article class="module">
+ <div class="module-content">
+ <h1 class="page-heading">
+ {% block page_heading %}{{ _('Government Data Use Cases') }}{% endblock %}
+ </h1>
+
+ {% block related_items %}
+ {% if item_count %}
+ {% trans first=page.first_item, last=page.last_item, item_count=item_count %}
+ <p>Showing items <strong>{{ first }} - {{ last }}</strong> of <strong>{{ item_count }}</strong> use cases found</p>
+ {% endtrans %}
+ {% elif c.filters.type %}
+ {% trans item_count=item_count %}
+ <p><strong>{{ item_count }}</strong> use cases found</p>
+ {% endtrans %}
+ {% else %}
+ <p class="empty">{{ _('There have been no use cases submitted yet.') }}
+ {% endif %}
+ {% endblock %}
+
+ {% block related_list %}
+ {% if page.items %}
+ {% snippet "related/snippets/related_list.html", related_items=page.items %}
+ {% endif %}
+ {% endblock %}
+ </div>
+
+ {% block page_pagination %}
+ {{ page.pager() }}
+ {% endblock %}
+ </article>
+{% endblock %}
+
+{% block secondary_content %}
+ <section class="module module-narrow module-shallow">
+ <h2 class="module-heading">{{ _('What are use cases?') }}</h2>
+ <div class="module-content">
+ {% trans %}
+ <p>Use Cases are any apps, articles, visualisations or ideas using datasets.</p>
+
+ <p>For example, it could be a custom visualisation, pictograph
+ or bar chart, an app using all or part of the data or even a news story
+ that references datasets from this site.</p>
+
+ <p> Send your ideas to <a href="mailto:data.gov@finance.gov.au">data.gov@finance.gov.au</a> with Title; Description; URL; Image URL; and Type: [API|Applications|Idea|News Article|Paper|Post|Visualisation]</p>
+ {% endtrans %}
+ </div>
+ </section>
+
+ <section class="module module-narrow module-shallow">
+ <h2 class="module-heading">{{ _('Filter Results') }}</h2>
+ <form action="" method="get" class="module-content form-inline form-narrow">
+ <input type='hidden' name='page' value='1'/>
+
+ <div class="control-group">
+ <label for="field-type">{{ _('Filter by type') }}</label>
+ <select id="field-type" name="type">
+ <option value="">{{ _('All') }}</option>
+ {% for option in c.type_options %}
+ <option value="{{ option.value }}"{% if c.filters.type == option.value %} selected="selected"{% endif %}>{{ option.text or option.value }}</option>
+ {% endfor %}
+ </select>
+ </div>
+
+ <div class="control-group">
+ <label for="field-sort">{{ _('Sort by') }}</label>
+ <select id="field-sort" name="sort">
+ <option value="">{{ _('Default') }}</option>
+ {% for option in c.sort_options %}
+ <option value="{{ option.value }}"{% if c.filters.sort == option.value %} selected="selected"{% endif %}>{{ option.text or option.value }}</option>
+ {% endfor %}
+ </select>
+ </div>
+
+ <div class="control-group">
+ <label for="field-featured" class="checkbox">
+ <input type="checkbox" id="field-featured" name="featured" {% if c.filters.get('featured') == 'on' %} checked="checked"{% endif %}></input>
+ {{ _('Only show featured items') }}
+ </label>
+ </div>
+
+ <div class="form-actions">
+ <button class="btn btn-primary">{{ _('Apply') }}</button>
+ </div>
+ </form>
+ </section>
+{% endblock %}
+
--- /dev/null
+++ b/ckanext/datagovau/templates/related/snippets/related_item.html
@@ -1,1 +1,48 @@
+{#
+Displays a single related item.
+related - The related item dict.
+pkg_id - The id of the owner package. If present the edit button will be
+ displayed.
+
+Example:
+
+
+
+#}
+{% set placeholder_map = {
+'application': h.url_for_static('/base/images/placeholder-application.png')
+} %}
+{% set tooltip = _('Go to {related_item_type}').format(related_item_type=related.type|replace('_', ' ')|title) %}
+<li class="related-item media-item" data-module="related-item">
+ <img src="{{ related.image_url or placeholder_map[related.type] or h.url_for_static('/base/images/placeholder-image.png') }}" alt="{{ related.title }}" class="media-image">
+ <h3 class="media-heading">{{ related.title }}</h3>
+ {% if related.description %}
+ <div class="prose">
+{{ h.render_markdown(related.description) }}
+</div>
+ {% endif %}
+ {% if h.check_access('package_show',{"id":h.get_related_dataset(related.id)}) %}
+<small>Using dataset: {{ h.get_action('package_show',{"id":h.get_related_dataset(related.id)}).title }}</small>
+ {% endif %}
+
+ <a class="media-view" href="{{ related.url }}" target="_blank" title="{{ tooltip }}">
+ <span>{{ tooltip }}</span>
+ <span class="banner">
+ {%- if related.type == 'application' -%}
+ app
+ {%- elif related.type == 'visualization' -%}
+ viz
+ {%- else -%}
+ {{ related.type | replace('news_', '') }}
+ {%- endif -%}
+ </span>
+ </a>
+ {% if pkg_id %}
+ {{ h.nav_link(_('Edit'), controller='related', action='edit', id=pkg_id, related_id=related.id, class_='btn btn-primary btn-small media-edit') }}
+ {% endif %}
+</li>
+{% if position is divisibleby 3 %}
+ <li class="clearfix js-hide"></li>
+{% endif %}
+