1

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

john,
As promised I will post through the forum now with questions etc.  I am starting work on setting up the forms etc for the above.  I am in the process of ready the installation instructions for Geoserver - which installation option should I go for?  Is it the OS-independent binary, which it says is the most popular?

2

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
I've used the Windows Installer and the Mac OSX installers before both successfully and without too much bother. Not sure about the OS independent binary though, I guess that is popular for Linux installs.

John van Breda
Biodiverse IT

3

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

I used the OS independent binary in the end before your reply and it seems to work fine.  It saved saving an .exe on my PC which I would have had to let our IT people know about.  Thanks anyways

4

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

John,

Another question:

I have installed Geoserver, as stated before.  I am now following your wiki doc guide to installing GeoServer for Indicia - the 'configuration for indicia' section.  I have got stuck at the second hurdle.  I have created a new workspace, but I am stuck on step 4.  It is the Connection Parameters bit I am stuck on.  I am using the BRC testwarehouse to set this up and test initially (then moving to the live warehouse once this all works).  What would the parameters be?  Your text in step 4 says the host and port are for the geoserver installation, but should it not be the indicia database?  As using 'localhost' and '5432' seems to tell me I am not connecting.  Would it be the general BRC host number?  Also I guessed at the database name being 'testwarehouse' and the schema being 'indicia'.
FYI my Geoserver installation is saved on my pc at: C:\Program Files\GeoServer.
NB: At the start of step 4 it says 'go to Data>workspaces and click on Add New Workpsace link' - I presume you meant 'Store' in both cases instead of 'workspace'?

If you have the parameters for the live database also that would be useful, so I have that for the live version. 
If there is any other info regarding the BRC warehouse that you think I would need for the rest of the biobliztz set up, particularly the remainder of the geoserver configuration.....that would be really useful.

Thanks
Sam

5

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
There is a GeoServer instance already running on the test warehouse at testwarehouse.indicia.org.uk:8080/geoserver. You can use that one directly which is already configured to access the data. Same on the live warehouse. I'm not sure about getting a GeoServer to connect across the web - it is possible but may need to have some reconfiguration done on the server.
Best Wishes
John

John van Breda
Biodiverse IT

6 (edited by samneal 17-05-2011 15:35:05)

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

thanks John.  Saves me setting up the GeoServer if it is both on the test and live warehouses.  This should therefore be all I need (in terms of the GeoServer) to set up to run the bioblitz and other public surveys, where the data is on the test or live (eventually) warehouse?  I guess if I wanted to use it with GIS etc (not on the warehouse) in the future, then I would need to set up something else myself.

7

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

You probably ought to get your forms running against the live server before putting real data in.
In theory you can point your GIS directly at the data on the live warehouse via GeoServer's web services, but agreed it may be easier with a local copy of the data.

John van Breda
Biodiverse IT

8

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Agreed thanks on both.

How do I make the MNHNL Dynamic 1 form record 'today's date' as a default 'samples date' stamp, rather than asking people to add 'today's date' when entering a record, as well as the 'determination date'.  Am I correct that the new version of indicia Iform module (0.6) would allow for this?

Whilst on the subject of the new version of indicia.  Do I need to update my IForm module each time there is a new version of indicia?  It is obviously not a problem at all to update modules in Drupal; however you did kindly customise a little my pre-built MNHNL Dynamic 1 form and Verification form for our public surveys.  Or do I just update to version 0.6 of the module then replace these forms with my customised ones?  I will need to be doing this with the helper_config.php file, as this has all my keys for google maps etc in.
Should I ever update my Jquery modules?  As I know you said before that they had to be specific versions otherwise they won't work.......it is just that Drupal is telling me I need to update these.
Apologies for many questions.Thanks

9

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
Using today as the default date has been supported for quite a while (v0.5 I think). On the editor for the form, go to the Other IForm Parameters section and there is a box for Default Values. On a newline in this box, enter

sample:date=today

Today is a special value the form will automatically replace with the current date. You could also specify a fixed date, e.g. 02/06/2011 instead of today.

Generally we aim for backwards compatibility, so that releasing a new version of the Warehouse does not require an upgrade to the iform module though of course it would contain new features and bug fixes. I'm fairly sure that the changes we made to your php files were bug fixes to IE support that were also applied to the main code-base, in which case you can just copy over the contents of the iform-0.6.1.zip file onto your module copy. Just in case I am wrong you could keep a copy of the changed files, but I certainly would not want to work with custom versions of the core files as it makes future upgrades a nightmare. The iform-0.6.1.zip file does not contain a copy of helper_config.php so all your API keys will be preserved.

If Drupal asks you to update your Jquery modules, you need to make sure you upgrade to one that contains the same version of jQuery (1.3.2) or jQuery-ui (1.7.1) otherwise you will get compatibility problems.

Best Wishes

John van Breda
Biodiverse IT

10

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

John,

As mentioned before I am currently developing the bioblitz dynamic form for the data input (http://www.nbis.org.uk/drupal/big-urban-wildlife-watch-test2).  It is in early stages at the moment.  I have a few questions:

Firstly thanks for the code for the today's date default value.  How do I make this input in the correct date format for the form?  As when you use 'click here' dates in the form it usually records as e.g. 20/05/2011, however the today's date defaults to 2011-05-20.

Although I have only set up the basics I cannot save a record as it says that I need to put in the spatial reference in, even though I already have....and it goes back to the spatial reference box.

In the list grid part of the form, i.e. after clicking on 'Add list of occurrences'.  The 'click here' does not go to the calender to select the date, as it does in the single occurrence option.  What do I need to change, is it something to do with the attribute setup in the warehouse?

From the text under the 'user interface' > 'form structure' I see that you can change some of the labels for the controls.  How would you go about changing the labels for the buttons on the intial grid page (the 'Add single occurrence' and 'Add list of occurrences' buttons)?

How do you remove the initial grid from the intial grid page, but still leave the 2 buttons mentioned above to either enter a single record or a list?

The intention of the form is a short intro text and then the ability to quickly add either a single record, a list of records or to input a csv file of records.  The form, with the initial grid is set up to do the former two, but not the last.  I notice there is a csv upload Iform that we can setup.  Would it be best to setup one of these forms for this survey and then add it as a link from the intro text of the above dynamic form, so that all three options are available?

Many thanks and apologies for the number of questions

Sam

11

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
No problem! I'll try and go through them one at a time. First, the today date does use yyyy-mm-dd format in 0.6.1 but has been fixed to dd/mm/yyyy format since then. If you want to fix just this particular issue rather than update everything then edit your copy of client_helpers/data_entry_helper.php and find the following:

if ($options['default']=='today')
      $options['default'] = date('Y-m-d');

Change it to

if ($options['default']=='today')
      $options['default'] = date('d/m/Y');

To change the text on the 'Add' buttons, you need to specify language strings. This tutorial covers various types of ways to override things on the form including the language strings. The 2 you need for the buttons are LANG_Add_Sample_Single and LANG_Add_Sample_Grid. BUT, the form does not have any current way of showing these buttons without the grid. So, one approach might be to create a normal Drupal page and embed links into it for the 2 types of form. You can find out what the links should be to by clicking the buttons on the current form (it is just a slight change to the query string to force the grid input mode). This page can then also include a link to the CSV upload form as you mention - though please bear in mind the csv upload functionality is in a fairly early stage of development so needs to be handled with a little care.

To check the problem you have with the date picker and spatial ref fields I'll need to have a look at the actual form running - is there a login I can use (you might have sent me one before? If so I'll find it tomorrow when I am at my desk).

Cheers

John van Breda
Biodiverse IT

12

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
A lot of the problems you had were because when you had edited the custom attributes (e.g. first name, surname etc) on the warehouse you had inadvertantly set the default control type to a postcode box. This is an easy mistake to make in v0.6 but I have already changed the warehouse code for 0.7 to ensure that this does not happen.

The determination date won't give you a drop down in the grid - I think we spoke about this before but I haven't done the code to get date pickers loading in the grid properly yet. I have changed my code so that it skips the click here default value - would you like me to upgrade your client helpers to the latest version? I think I still have the ftp details.

John van Breda
Biodiverse IT

13

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

John,

Attempting to put together the csv upload form (http://www.nbis.org.uk/drupal/BUWW2011csvUploadForm) to be linked to from my intro page of the survey (http://www.nbis.org.uk/drupal/BUWW2011).  I know you said this form is in early stages, so it may not be surprising that I have a problem.  I have set the form up and tried it and it gets to the point after matching fields that you then click 'upload'......I click on that button and it says 'Preparing to upload', and gets stuck there.

Any thoughts?

Cheers

Sam

14

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
Yes, I've had a look at this and it is because of limitations in browsers when using AJAX calls between different domains. I have implemented a simple fix for this but it needs an update on the server side as well - so I will just check with Jim that it is OK to update the warehouses.
Cheers
John

John van Breda
Biodiverse IT

15

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
I've patched both the test warehouse and your site via FTP with the small fix so it should work now.
Cheers
John

John van Breda
Biodiverse IT

16

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

thanks for the patches etc John

17

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

I have tested the upload and it works on the testwarehouse. Thanks.
I presume the patches etc are on the live warehouse too now?  So that when I move to that all should work fine.

One thing on the csv upload: I cannot choose the UK master list as the list verify against (or whatever the terminology was, sorry can't remember)......I can only choose the species lists I have set up.  I guess there is something in the survey that I need to change on the warehouse?

Cheers

Sam

18

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

oh and one more thing on the upload form:
How do you make sure that the 'today's date' code is set in the preset settings of the 'Other Iform parameters', so that when matching fields you do not have to match sample:date and it is automatically included as column in the CSV as default (as with my dynamic iform).  I have tried just putting in the code you gave me: 'sample:date=today' in the preset settings....but I guess I need more code around it to be this specific. 
It would also be good if 'determination date' was a required field to match up, instead of date (sample:date); as this is the attribute I am using (whether correctly I'm not sure) as the date when people saw the species (i.e. made the record) and the sample:date is essentially today's date (i.e. the date they send us the record through Indicia).

Thanks

Sam

19

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
Unfortunately the preset settings only apply to the options that are available on the first page of the import wizard at the moment. The way I would do this is to add a column called date with a fixed value in it to the CSV file before import. It's a good idea for the future though. For now I have updated the help text to make it a bit clearer.
I can see in the code exactly why the list of checklists available is restricted - because it is filtered to those associated with the website you are using. I just need to think through the implications before I remove this filter!

John van Breda
Biodiverse IT

20 (edited by samneal 02-06-2011 10:47:39)

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

thanks John.  No worries on the date thing, I was going to do as you suggest anyway as a solution.  The main date situation to sort was the dynamic form....so that was fine.

If you decide you can alter the species list filter for the csv upload, could it also work for the live warehouse?

On a another issue: The final thing to do (other than move to the live environment) is to set up a distribution map form.  I have started to set up at: http://www.nbis.org.uk/drupal/BUWW2011map.  Could you tell me how I need to set it up to display all records for the survey (as the form is intended), as it currently does not seem to.....maybe I need to set up a different featuretype on the testwarehouse geoserver application or do I need the full path of the featuretype? Also, and more importantly, could you tell me how to set the form up so that I can have a number showing number of species next to each urban area listed in our custom sample attribute 'Nearest town or city?:'?  The numbers could be outside the map if easier and they need to update when the map reloads (along with the distribution of records).  Although for almost all of our future and present public surveys we just need a distibution map of records (by species in most cases); the main thing we need for the bioblitz is a total number of species recorded in each urban area.
Is this possible?

Many thanks for your thoughts on this.

21

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Using Firefox and Firebug's Net tab, I had a look at the requests being sent for map data. The layer being added is generating this request which gives an error 404 - not found:
http://www.nbis.org.uk/drupal/wms?LAYERS=indicia%3Adetail_occurrences&TRANSPARENT=true&CQL_FILTER=website_id%3D20&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A900913&BBOX=-54412.918803569,6831583.6830408,266622.59993667,7015032.5508924&WIDTH=1050&HEIGHT=600

This looks to be because it is trying to access GeoServer as if it was installed on your Drupal instance - probably meaning that the geoserver path is not setup in helper_config.php.

To get the totals for each town/city you would need to write a custom XML report and add it to the Warehouse which returns species count grouped by your custom attribute. Then I would probably suggest rather than using the IForm distribution map (which only does a limited set of things), using a normal Drupal page with the PHP filter enabled to add a map AND a report_grid with this output. You can then use CSS to move the report grid alongside the map. To get you started, here is the map code I used to display a refreshing map at CM Bioblitz:

<?php
require_once 'sites/all/modules/iform/client_helpers/data_entry_helper.php';
data_entry_helper::$js_path='/naturewatch/sites/all/modules/iform/media/js/';
drupal_add_css('sites/all/modules/iform/client_helpers/prebuilt_forms/css/node.17.css');
require_once 'sites/all/modules/iform/client_helpers/map_helper.php';
$readAuth = data_entry_helper::get_read_auth(12, '......');
$options = array(
    'readAuth' => $readAuth,
    'presetLayers' => array('google_physical'),
    'editLayer' => true,
    'layers' => array(),
    'initial_lat'=>50.768,
    'initial_long'=>-2.025,
    'initial_zoom'=>13,
    'width'=>425,
    'height'=>500,
    'standardControls'=>array(),
    'indiciaWMSLayers'=>array('cmbioblitz:boundary','cmbioblitz:occurrence_map')
  );
echo map_helper::map_panel($options);
map_helper::$javascript .= "
setTimeout('window.location=\"species-count-summary\";', 30*1000 );
";

echo map_helper::dump_javascript();
?>
John van Breda
Biodiverse IT

22

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

John.
Thanks for reply.
Yes the geoserver url in the helper_config......I completely forgot that I had not put that in, what a prat.  I have now put that in and it seems to work, well it is displaying records at least.

Regarding the xml and map:
I will have a look at the php in a bit - but if I'm stuggling would using the report grid form work as an alternative....as long as the xml report if written?
Regarding the xml report - how do you add new reports to the warehouse in the reports area? Plus do you have some example xml from one of the other reports to help put this xml report I need together?

Many thanks

23

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Hi Sam
You can browse the warehouse code online to pick up examples. E.g. http://code.google.com/p/indicia/source … _group.xml. Do you have your own warehouse copy to test any reports against?

If you use the Report Grid form plus the Map form, you can combine this with the Drupal panels module to build a page with both the forms displayed side by side. The tutorial at http://code.google.com/p/indicia/wiki/D … dReporting gives an introduction to this type of approach. Don't worry about the Report_map form mentioned in the tutorial as this is all new stuff coming in Indicia 0.7, but it does explain how to put more than one iform on a page using Panels.

Cheers

John van Breda
Biodiverse IT

24

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

John.  Thanks for response.

Thanks for the link to xml eg, I will have a look at this.  I do not have my own warehouse to test against.  Would it be ok to test against the testwarehouse if you could tell me how to add the xml to the testwarehouse/live warehouse to then test?

Thanks for the advice on the panels option, this is likely to be much easier for me to handle than the code (as you know I'm a novice when it comes to php/web code in general); although I may try the code too.

25

Re: Norfolk Big Urban Wildlife Watch (Bioblitz)

Sam,
If you like, try writing the XML then send it to me and I can test it for you, then copy to the test warehouse.

John van Breda
Biodiverse IT