1

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

2

Re: Struggling with the tutorial

Hi Keith
First, you've managed to download things right at the point in time when I was uploading the new version! What I would suggest you do is download the warehouse files again from today (v0.7) and copy them over your existing install. Then visit the warehouse home page and follow the link to upgrade. More info here.
I don't think that this would cause your issue though. Can I check that you have successfully created a species list which has an ID 1 and also has one or more species in it?
Finally, this may be just a wording thing but the control you have created is an auto-complete not a drop-down. You should see an empty input box, but typing in a single character or more from the beginning of one of the species names in your list should show some matches.

If none of these are the source of the problem then let me know.

John van Breda
Biodiverse IT

3

Re: Struggling with the tutorial

Hi John,

I downloaded 0.7.0 and replaced the old indicia folder with the new one. (I followed the online directions that say "Please note, if you are re-installing the Indicia Warehouse for whatever reason, always remove the contents of the previous installation from the folder completely before copying over the new files. Simply copying the new files on top of an existing installation does not work for reinstallations. ")

I then got this error message when trying to run indicia/index.php

Fatal error: Call to undefined function mysql_connect() in  C:\Webstuff\www\indicia\system\libraries\drivers\Database\Mysql.php on line 61

I had to enable extension=php_mysql.dll in php.ini to resolve. Have you changed the database engine? I've only went through the pain of installing PostgreSQL on Friday. Do I now have to install MySQL? (A word of warning for anyone tempted to install PostgreSQl 9.1 - don't. You currently need 9.0 in order to work with the current PostGIS).

I then found that indicia had seemingly "lost" (allegedly) my old configuration information, requiring me to go through the Demo Configuration, Email Configuration and Database Configuration steps again, and then having done so, found that most of my earlier website configurations have gone. My previous user/person (confusing terminology) had gone, though it still remembered its email address somewhere as it wouldn't let me re-use the earlier one. (There was an "unknown" user in there). In trying to fix I created other users/persons which then became "unknown" when I deleted them, but each somewhere retained its email address so that they can't now be respecified in the system - I've nearly run out of personal email addresses now!). The website list had been remembered. The species list and taxon group lists have seemingly gone (unless they only appear to the user/person that created them, which has now become unknown/deleted).

To answer your questions, yes I had a species list with ID=1 containing two species. I don't appear to have them anymore though...

The other was loose terminology on my part. I meant auto-complete. When I typed a letter contained within one of the two defined species a blue line appeared below (thin in Firefox, rather thicker in IE) which I deduced was an empty list. (It also apeared when I typed a letter that I knew not to be in either name).

After nearly two days getting this far I'm giving up for the day, rather dispirited.

Regards, Keith

4

Re: Struggling with the tutorial

Hi Keith
Sorry to hear you are having problems. First though note that the message reads "if you are re-installing Indicia", not if you are upgrading which you were doing since you already had a working install. What you have done will definitely have destroyed your configuration of the Indicia Warehouse, including the part that tells the framework to use PostgreSQL rather than MySQL, hence the error messages! The page you read that statement from is the Wiki Installation guide rather than the upgrade notes which I had directed you to.

Assuming that this hiccup has left behind a working warehouse, you should still have an admin login which lets you view the full list of all websites, lists, people etc.

Incidentally the terminology regarding users & people is fairly logical I think - all users are people, but not all people are users. Hence you can have a list of people plus a list of users (which is a subset of the list of people).

If you want a faster way of getting going with Indicia than learning to write your own PHP pages, then the Instant Indicia tutorials are now available from the downloads page.

John van Breda
Biodiverse IT