Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Then a dummy map engine must be setup to draw the uploaded layers (hopefully this will be simplified in future).
This map engine should be added to the client configurations map view.
The default name for the map engine is mapengine.upload, and would need to be explicitly specified in the upload configuration if a different name is used.

Code Block
xml
xml
titleExample dummy upload map enginexml
	<wms:mapengine id="mapengine.upload">
		<url><![CDATA[http://localhost:8081/geoserver/wms]]></url>
		<format>image/png</format>
		<transparent>true</transparent>
		<layers>
			<layer>dummy</layer>
		</layers>
		<selection>false</selection>
		<acetate>false</acetate>
	</wms:mapengine>

The namespace for the upload parameters is urn:com.cohga.spatial.upload#1.0, so the following should be added to the list of namespaces at the top of the config file:
xmlns:upload= "urn:com.cohga.spatial.upload#1.0"

Code Block
xml
xml
titleUpload parametersxml
	<upload:parameter tempPath="temp" destinationDir="dest" memFileSizeThreshold="1" sizeMax="5">
		<projections label="Choose Projection">
			<entry value="EPSG:4283">Geographic (GDA94)</entry>
			<entry value="EPSG:20254">MGA Zone 54 (AGD66)</entry>
			<entry value="EPSG:20255">MGA Zone 55 (AGD66)</entry>
			<entry value="EPSG:28354">MGA Zone 54 (GDA94)</entry>
			<entry value="EPSG:28355" default="true">MGA Zone 55 (GDA94)</entry>
			<entry value="EPSG:3111">VicGrid94 (GDA94)</entry>
		</projections>

		<colors label="Choose Colour">
			<entry value="#FF0000" default="true">Red</entry>
			<entry value="#FF7F7F">Light Red</entry>
			<entry value="#008000">Green</entry>
			<entry value="#209C20">Light Green</entry>
			<entry value="#0000FF">Blue</entry>
			<entry value="#ADD8E6">Light Blue</entry>
			<entry value="#00FFFF">Cyan</entry>
			<entry value="#FF00FF">Magenta</entry>
			<entry value="#808080">Grey</entry>
			<entry value="#D3D3D3">Light Grey</entry>
		</colors>

		<layername label="Input Layer Name" />

		<csv xLabel="X Field Column" yLabel="Y Field Column" />

		<cleaning maximumFileAgeInHours="96" checkDelayInHours="6" />

		<drawing>
			<markShape>circle</markShape>
			<markShapeSize>8</markShapeSize>
			<strokeWidth>1</strokeWidth>
			<timeout>60</timeout>
		</drawing>
	</upload:parameter>

...

  • cross
  • circle
  • triangle
  • X
  • star
  • arrow
  • hatch
  • square
Code Block
xml
xml
titleBasic button to add to toolbar in client config using default valuesxml
	<item action="com.cohga.spatial.upload.uploadFile">
Code Block
xml
xml
titleAdvanced button to add to toolbar in client config with default values customisedxml
	<item action="com.cohga.spatial.upload.uploadFile">
		<mapEngine>mapengine.upload</mapEngine>
		<windowTitle>Upload File</windowTitle>
		<windowWidth>400</windowWidth>
		<windowHeight>160</windowHeight>
		<addText>Add</addText>
		<addTooltip>Add local files</addTooltip>
		<clearAllText>Clear</clearAllText>
		<clearAllTooltip>Clear all uploading files</clearAllTooltip>
		<uploadText>Upload</uploadText>
		<uploadTooltip>Upload All Files</uploadTooltip>
		<stopText>Stop</stopText>
		<stopTooltip>Stop uploading</stopTooltip>
		<step1Heading>Step 1: Upload file(s)</step1Heading>
		<step1PromtText><![CDATA[<p>Please select files</p>]]></step1PromtText>
		<step2Heading>Step 2: Input parameters</step2Heading>
		<tocGroupLabel>Upload</tocGroupLabel>
		<tocGroupDescription>Uploaded Layers</tocGroupDescription>
	</item>
Code Block
xml
xml
titleAlternative customised buttonxml
	<item action="com.cohga.spatial.upload.uploadFile">
		<text>Import CSV File</text>
		<mapEngine>mapengine.upload</mapEngine>
		<windowTitle>Import CSV file as a New Layer</windowTitle>
		<windowWidth>400</windowWidth>
		<windowHeight>300</windowHeight>
		<addText>Browse</addText>
		<addTooltip>Browse Local Files</addTooltip>
		<clearAllText>Clear</clearAllText>
		<clearAllTooltip>Clear All Files</clearAllTooltip>
		<uploadText>Import</uploadText>
		<uploadTooltip>Import All Files</uploadTooltip>
		<step1Heading>Step 1: Import CSV file</step1Heading>
		<step2Heading>Step 2: Choose parameters</step2Heading>
		<step1PromtText><![CDATA[<p>Please select the CSV file to import. (.csv or .txt and 5MB limit).</p><p>&nbsp;</p>]]></step1PromtText>
		<tocGroupLabel>Uploads</tocGroupLabel>
		<tocGroupDescription>Uploaded Layers</tocGroupDescription>
	</item>
Code Block
xml
xml
titleExample ToC view with shapefile and csv uploadxml
<view id='com.cohga.html.client.map.tocView'>
	<label>Layers</label>
	<location>west</location>
	<toolbar>
		<item>-&gt;</item>
		<item action="com.cohga.client.actions.menuAction">
			<iconCls>icon-database_go</iconCls>
			<text>Add Data</text>
			<item action="com.cohga.spatial.upload.uploadFile">
				<tocId>toc.main</tocId>
				<mapEngine>mapengine.upload</mapEngine>
				<text>Import CSV File</text>
				<windowTitle>Import CSV file as a New Layer</windowTitle>
				<windowWidth>400</windowWidth>
				<windowHeight>400</windowHeight>
				<addText>Browse</addText>
				<addTooltip>Browse Local Files</addTooltip>
				<clearAllText>Clear</clearAllText>
				<clearAllTooltip>Clear All Files</clearAllTooltip>
				<uploadText>Import</uploadText>
				<uploadTooltip>Import All Files</uploadTooltip>
				<step1Heading>Step 1: Import CSV file</step1Heading>
				<step2Heading>Step 2: Choose parameters</step2Heading>
				<step1PromtText><![CDATA[<p>Please select the CSV file to import. (.csv or .txt and 5MB limit).</p><p>&nbsp;</p>]]></step1PromtText>
				<tocGroupLabel>Uploads</tocGroupLabel>
				<tocGroupDescription>Uploaded Layers</tocGroupDescription>
			</item>
			<item action="com.cohga.spatial.upload.uploadFile">
				<maxFileCount>4</maxFileCount>
				<tocId>toc.main</tocId>
				<mapEngine>mapengine.upload</mapEngine>
				<text>Import Shapefile</text>
				<windowTitle>Import Shapefile as a New Layer</windowTitle>
				<windowWidth>400</windowWidth>
				<windowHeight>300</windowHeight>
				<addText>Browse</addText>
				<addTooltip>Browse Local Files</addTooltip>
				<clearAllText>Clear</clearAllText>
				<clearAllTooltip>Clear All Files</clearAllTooltip>
				<uploadText>Import</uploadText>
				<uploadTooltip>Import All Files</uploadTooltip>
				<step1Heading>Step 1: Select .shp, .dbf and .shx files</step1Heading>
				<step2Heading>Step 2: Choose parameters</step2Heading>
				<step1PromtText><![CDATA[<p>Please select the shapefile to import. (.shp, .shx and .dbf and 5MB limit).</p><p>&nbsp;</p>]]></step1PromtText>
				<tocGroupLabel>Uploads</tocGroupLabel>
				<tocGroupDescription>Uploaded Layers</tocGroupDescription>
			</item>
		</item>
	</toolbar>
</view>