Re: Struggling with the tutorial
I'm struggling with the basic data entry tutorial. I've battled my way to step 8 where my drop-down list is empty. Inclusion of "data_entry_helper::system_check()" has reported:
System check
Success: PHP version is 5.3.3.
Success: The cUrl PHP library is installed.
Success: Indicia Warehouse URL responded to a POST request.
Warning: The $geoserver_url setting in helper_config.php should include the protocol (e.g. http://).
Error: The following configuration entries are missing from helper_config.php : $upload_path. This may prevent the data_entry_helper class from functioning normally.
Warning: The following configuration entries are not specified in helper_config.php : $geoserver_url, $bing_api_key, $flickr_api_key, $flickr_api_secret. This means the respective areas of functionality will not be available.
Success: Cache directory is present and writeable.
I'm not sure if the Error is significant as I'm not actually uploading anything at this point, but it may be indicative of something. $upload_path is in neither the helper_config.php that came with Indicia or the helper_config.php that I downloaded from http://code.google.com/p/indicia/downloads/list this morning and which is being required in my php. (There is a $indicia_upload_path in the one that came with Indicia though, which isn't being used...?).
It is all installed under localhost on my machine:
* Indicia is installed in C:\Webstuff\www\indicia (accessed as http://localhost/indicia)
* My website is in C:\Webstuff\www\indicia_sandpit (accessed as http://localhost/indicia_sandpit/index.php.
* The downloaded client_helpers-0.7.0.zip was unzipped into C:\Webstuff\www\indicia_sandpit and $base_url to set 'http://localhost/indicia/' in helper_config.php.
(I downloaded Indicia on Friday when it was 0.6 and the client_helpers this morning which now seem to be 0.7? Is there a compatibility issue?)
My PHP is
<html>
<head>
<?php require 'client_helpers/data_entry_helper.php'; ?>
</head>
<body>
<?php echo data_entry_helper::system_check(); ?>
<form method="post">
<?php
// Get authorisation tokens to update and read from the Warehouse.
echo data_entry_helper::get_auth(1, 'Qwer4321');
$readAuth = data_entry_helper::get_read_auth(1, 'Qwer4321');
?>
<input type='hidden' id='website_id' name='website_id' value='1' />
<input type='hidden' id='record_status' name='record_status' value='C' />
<?php
echo data_entry_helper::autocomplete(array(
'label'=>'Species',
'fieldname'=>'occurrence:taxa_taxon_list_id',
'table'=>'taxa_taxon_list',
'captionField'=>'taxon',
'valueField'=>'id',
'extraParams'=>$readAuth + array('taxon_list_id' => '1')
));
?>
</form>
<?php echo data_entry_helper::dump_javascript(); ?>
</body>
</html>
Which results in the following output
<html>
<head>
</head>
<body>
<div class="ui-widget ui-widget-content ui-state-highlight ui-corner-all"><p class="ui-widget-header"><strong>System check</strong></p><ul><li>Success: PHP version is 5.3.3.</li><li>Success: The cUrl PHP library is installed.</li><li>Success: Indicia Warehouse URL responded to a POST request.</li><li class="ui-widget ui-state-error">Warning: The $geoserver_url setting in helper_config.php should include the protocol (e.g. http://).</li><li class="ui-widget ui-state-error">Error: The following configuration entries are missing from helper_config.php : $upload_path. This may prevent the data_entry_helper class from functioning normally.</li><li class="ui-widget ui-state-error">Warning: The following configuration entries are not specified in helper_config.php : $geoserver_url, $bing_api_key, $flickr_api_key, $flickr_api_secret. This means the respective areas of functionality will not be available.</li><li>Success: Cache directory is present and writeable.</li></ul></div>
<form method="post">
<input id="auth_token" name="auth_token" type="hidden" class="hidden" value="d2e316fa08f45c96e6b85f8674295b627111e04c" />
<input id="nonce" name="nonce" type="hidden" class="hidden" value="3b39015d2089fcaf5d85a6310581aedd2f1634e6" />
<input type='hidden' id='website_id' name='website_id' value='1' />
<input type='hidden' id='record_status' name='record_status' value='C' />
<label for="occurrence:taxa_taxon_list_id:taxon">Species:</label>
<input type="hidden" class="hidden" id="occurrence:taxa_taxon_list_id" name="occurrence:taxa_taxon_list_id" value="" />
<input id="occurrence:taxa_taxon_list_id:taxon" name="occurrence:taxa_taxon_list_id:taxon" value="" class=" required" />
<span class="deh-required">*</span><br/>
</form>
<link rel='stylesheet' type='text/css' href='http://localhost/indicia/media/css/jquery.autocomplete.css' />
<script type="text/javascript" src="http://localhost/indicia/media/js/jquery.js"></script>
<script type="text/javascript" src="http://localhost/indicia/media/js/ie_vml_sizzlepatch_2.js"></script>
<script type="text/javascript" src="http://localhost/indicia/media/js/jquery.autocomplete.js"></script>
<script type='text/javascript'>/* <![CDATA[ */
if (typeof indiciaData==='undefined') {
indiciaData = {};
}
indiciaData.windowLoaded=false;
jQuery(document).ready(function() {
jQuery('input#occurrence\\:taxa_taxon_list_id\\:taxon').autocomplete('http://localhost/indicia/index.php/services/data/taxa_taxon_list',
{
extraParams : {
orderby : 'taxon',
mode : 'json',
qfield : 'taxon',
auth_token : '96ce2b972a302f8e5401a0220af475f8ffd6116b',nonce : 'c447fcb7080933be6af389736745e0f0dd8ad03c',taxon_list_id : '1'
},
parse: function(data)
{
// Clear the current selected key as the user has changed the search text
jQuery('input#occurrence\\:taxa_taxon_list_id').val('');
var results = [];
jQuery.each(data, function(i, item) {
results[results.length] =
{
'data' : item,
'result' : item.taxon,
'value' : item.id
};
});
return results;
},
formatItem: function(item)
{
return item.taxon;
}
});
jQuery('input#occurrence\\:taxa_taxon_list_id\\:taxon').result(function(event, data) {
jQuery('input#occurrence\\:taxa_taxon_list_id').attr('value', data.id);
jQuery('input#occurrence\\:taxa_taxon_list_id').change();
});
});
/* ]]> */</script></body>
</html>
Any suggestions as to where I'm going wrong will be gratefully received...
Regards, Keith