[Geomoose-users] Feature Reports notes

Brent Fraser bfraser at geoanalytic.com
Mon Jun 1 17:02:18 PDT 2015


Ok, as it turns out it IS necessary to put the key name in the service 
definition (so follow my instructions sent at 10:57 below). For now.

I think the fix would be fairly simple:  change feature_report.php to 
reference the "PID" parameter (maybe "FID" would be a better name?).

Specifically, change line 67 from:

$layer->setFilter(str_replace('%qstring%', urldecode($_REQUEST[$qItem]), 
$query_info->getAttribute('string')));

to
$layer->setFilter(str_replace('%qstring%', $_REQUEST['PID'], 
$query_info->getAttribute('string')));

And an implementer would now specify:

<tr><td align="left"><b><a href = 
"javascript:GeoMOOSE.startService('*feature_report*', {'*PID*': 
'[BF_ID]', 'src' : 'Hydrography/Lakes'})">Report</a></b></td></tr>


(if the layer's unique key was named "BF_ID")

Best Regards,
Brent Fraser

On 6/1/2015 5:15 PM, Brent Fraser wrote:
> I need to correct the information is sent earlier.  The first part of 
> the instructions below ("Edit the feature_report service...") is not 
> necessary as the key field name is specified in the template ("<query 
> item="), not the service definition.
> Best Regards,
> Brent Fraser
> On 6/1/2015 10:57 AM, Brent Fraser wrote:
> There doesn't seem to be a lot of documentation for the Feature Report 
> service, so I made some notes:
>
> Feature Reports
>
>
> Edit (or copy) the feature_report service in the mapbook to add the 
> key field, for example:
>
>
>    <service name="feature_report_Hydrography" display="false" 
> keep-others="true">
>
> <url>php/feature_report.php</url>
>
> <input type="hidden" name="layers" value="Backgrounds/osm"/>
>
> <input type="hidden" name="src"/>
>
> <input type="hidden" name="BF_ID"/>
>
>    </service>
>
>
>
> Add the metadata to the feature’s map file:
>
> METADATA
>
> 'identify_record' 'BF_HYDRO_POLYGON_identify.html'
>
> 'popups' 'BF_HYDRO_POLYGON_popups.html'
>
> 'feature_report' 'BF_HYDRO_POLYGON_report.xml'
>
> END # of METADATA
>
>
> Edit the _identify template to add a link to generate and view the 
> report.  For example my BF_HYDRO_POLYGON_identify.html template has:
>
> <tr><td align="left"><b><a href = 
> "javascript:GeoMOOSE.startService('feature_report_Hydrography', 
> {'BF_ID': '[BF_ID]', 'src' : 
> 'Hydrography/Lakes'})">Report</a></b></td></tr>
>
>
>
> Create the report xml file (in my case the file is named 
> BF_HYDRO_POLYGON_report.xml) modifying the key name and the PDF report 
> name:
>
>    <query item="BF_ID" string="%qstring%"/>
>
>
>    <!-- This is the template -->
>
>    <template>BF_HYDRO_POLYGON_template.pdf</template>
>
>
> Create the report PDF file
>
> Copy the parcel_template.pdf to the name you entered in the report xml 
> file, for example:
>
>
> copy parcel_template.pdf BF_HYDRO_POLYGON_template.pdf
>
> -- 
> Best Regards,
> Brent Fraser
>
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20150601/f692125d/attachment-0001.html>


More information about the Geomoose-users mailing list