Scratchpad Help Editor
Published on Scratchpad Help Editor (http://helpeditor.scratchpads.eu)

Home > Advanced training course

Advanced training course

The focus of this course lies on the import of data and the creation of custom content types and views.

For an online training course, keep the training window open next to a window with the training site.

The instructions are written for use with special training sites. The training sites are provided for the courses we teach, but are also available on request. You can also do the course on your own on the Sandbox [1] (username: test, password: pass). If you use the sandbox you must be prepared that other users may change the site at the same time and you must be aware that the sandbox is rebuild every 6 hours. So best start just after it was rebuild. What you see on the sandbox will differ from the training sites only in the 'Log in' section at the start of the course.

Training sites are established at: http://trainingXX.taxon.name [2]

Replace the 'XX' with the number that you have been issued. Log in with the following credentials:

Username:username

Password: password 

Training files can be downloaded from http://scratchpads.eu/scratchpad-training-files [3]. Keep this page open in a separate tab in your browser and download files as needed.

Browser: For the course please use the Mozilla Firefox browser which can be downloaded from http://www.mozilla.com [4]. If you don't have administrative rights on your computer you can use Portable Firefox [5].

The aim of this course will be to create a taxonomic website for the fly family Carnidae, specifically a species page for the bird parasite Carnus hemapterus. You can see what your training site might look like at the end of the basic and advanced course at http://carnidae.myspecies.info [6].

For this course we need a classification and a bibliography on our training site. Both have been covered in the basic training course. Please go to the following chapters to import a classification and bibliography:

  • 2.1 Add a vocabulary [7]
  • 2.2 Import from EOL [8]
  • 4.1 Import a bibliography [9]

Now start working through the advanced course.

1. Import data

Generally, all imported data need to be in a spreadsheet format, with a column for each field and a row for each record. A header row with the correct field names as they appear in the Scratchpad, facilitates the import. The spreadsheet needs to be saved as a comma- or tab-delimited file in UTF-8 format. Exceptions are bibliographic citations, which are imported in special bibliographic formats, and images, which are uploaded as image files, e.g. jpg.

To import a file click on the Import icon of the respective content type in the Content menu.

1.1. Import location and specimen records

Location and specimen data can be imported using a comma or tab separated file created within an Excel spreadsheet. You will need to import first the file with the location data and then the file with the specimen data. The files need to contain at least the required fields. To check which fields are required add a location/specimen and find the fields marked with a red asterisk. In addition to these fields you should add a 'Taxonomic name' for specimens. You may also choose to add additional data as you see fit. It will make the import easier if you use the correct field names in the header. Subsequent rows should contain the records. Make sure that for the fields which appear as drop down menus when you add a location/specimen, you enter one of these options in your matrix because the import will not work with terms that are not in this list. The same holds for the 'Taxonomic name': you need to enter a term that is in your vocabulary.

  • Downloaded Location_Import.txt [10]and Specimen_Import.txt [11].
  • Click the 'Import from CSV file' icon under locality in the 'Content' menu.
  • Upload the 'Location_Import.txt' file and click 'Next'.
  • Follow the instructions that appear on screen, uploading the file, choosing 'Tab separated' values, matching the column headings and parsing the data into the Scratchpad database.
  • Next import the specimen file into the specimen content type.

This is a very quick way to bulk import records.

2. Custom content types and views

Creating a custom content type allows you to create content in which the data are entered and saved in specific fields. If you already have data available, which are stored in a table or a database, you can create a custom content type with exactly the same fields and import the data into the Scratchpad. To show the data to the user in the best possible way you can then improve the view for this content type.

2.1. Create a 'Citation' content type

Example 1: You are going to create a 'Citation' content type and a view for presenting these citations. The citation will link a taxonomic name to the biblio in which this taxon is cited and to keywords about this citation. You will learn how to create a new content type, to link it to a vocabulary and to link it to another content type.

For this exercise you need to have a classification and a bibliography on your Scratchpad.

  • Go to the advanced administration page. In the 'Content Management' section click on 'Content types' and then on the 'Add content type' tab.
  • In the 'Identification' section enter the name (Citation), type (citation) and description (Keywords and page number linking taxa with references) of the new content type.
  • In the 'Vocabularies' section select the classification you want to be associated with the citations.
  • In the 'Autotag settings' section you can choose whether content of this type should be automatically tagged or not.

The default is on autotagging, which means that if data are imported they will be automatically tagged with this term occuring in the fields.

  • In the 'Submission form' section enter the title field label (Taxon name as cited). You do not need a body field, so delete the word "body" in 'Body field label'.
  • If you are working with organic groups and want to be able to use this content type within a group you need to change selection in the 'Organic groups' section to "Standard group post" or one of the other choices.
  • Click on 'Save content type'.
  • In the list of content types scroll down to your new content type and click on 'manage fields'.

If you wanted your fields to be sorted into groups, you would have to enter text in the two fields for 'New group' and save. Groups are useful if you have many fields. In a detailed description all head characters could for example belong to the group "Head". After adding groups first you can start adding fields, but you can also add the groups at a later stage and drag and drop the fields into the groups. However, for the Citation content type we don't need groups.

  • Go to the 'Add' section and 'New field'. Enter the label (Page) and field name (page) and select the field type "Text" and form element "Text field". Click on 'Save'.
    Enter the help text (First page number where taxon is cited). Adding a 'Help text' is useful if you want to advise users on a certain format, for example for type information, or just to explain what kind of information belongs into this field.
    Under 'Text processing' you can choose 'Plain text' if you don't need any special formats like italics. However, if you choose plain text and the users accidentally copies formatted text into this field, the html codes for these formats will show up in the field after saving. So if you expect a lot of copy/paste to happen, 'Filtered text' is the better option.
  • Click on 'Save field settings'.
  • Add another 'New field' with the label (Bibliography) and field name (biblio) and select the field type "Node reference" and form element "Autocomplete text field". Save.
    For this field we chose "Node reference" instead of "Text" because we don't want to enter a bibliographic citation, but instead link to an existing biblio node.
  • In the 'Global settings' section choose the content type 'Biblio' and under 'Advanced' choose "biblio-nodes" as 'View used to select the nodes'. Save.
  • Now you can either add another text field called Keywords, or you make a new taxonomy called Citation Keywords, for which you select only the content type ‘Citation’ and only the settings ‘Tags’ and ‘Multiple select’ (open a new browser tab to add the new taxonomy to keep the current page open and close the tab when you are done). If you do the latter, you don't need to add another field to the citation content type because you will be able to choose keywords when adding a citation automatically.
  • Under 'Manage fields' you can sort the fields by drag and drop.
  • Under the 'Display fields' tab, you can choose where the label should go. Choosing 'inline' will save space and allow for more fields to be visible on the screen without scrolling. Save.
  • As soon as a new content type is saved it is added to the ‘Content’ menu. Click on the “Add a Citation node” icon and enter two or three test citations (tagged to 'Carnus hemapterus').

The ‘Citation’ content type is now finished and a widget was automatically added to the taxon pages. Check a taxon page which actually has a citation tagged to it (Carnus hemapterus), and if necessary drag the new widget into the active section. We are now going to improve the view of the widget and afterwards we will make a new page to enable a better search for citations. For learning purposes we will create a completely new view, though we could modify the one which has been automatically generated.

You will learn how to create a taxon page view and a (single) page view, to change the table style, to add fields, fields, and relationships between two content types.

2.2. Create a 'Citation' panel view

  • Go to 'Administer' > 'Views' and click on 'Add'.
  • Enter the name (Citation2) and description (Table view of citations) for the view.
  • The view type is 'Node'.
  • Click on 'Next'.
  • Under the Basic settings' click on 'Title: None', enter the the title (Citation2) in the box that opens below and update. You will get a warning message for the Life preview, but you can ignore this for now.
  • Under 'Filters' click on the plus icon to add a new filter. In the box that opens below choose 'Node' in the drop down menu under 'Groups'. Scroll down, check 'Node: Type' and click on 'Add'. Select the ‘Citation’ node type and click on 'Update'. Click on 'Save'. This means that only content from the ‘Citation’ content type is shown in this view. Click on the question marks for explanations of the respective view parts.
  • Under 'Fields' click on the plus icon to add a field. In the box that opens below choose 'Node' in the drop down menu. Scroll down, check 'Node: Title' and click on 'Add'. Enter “Taxon name as cited” as label and check 'Link this field to its node'. Update. Add another field for the citation keywords. If you added the keywords as a simple field, it can be found under 'Groups' > 'Content'. If you added a new taxonomy you will find it under ‘Groups’ > ‘Taxonomy’, click on ‘Taxonomy: All terms’, click ‘Add’ and change the label to “Keywords”. Select ‘Limit terms by vocabulary’ and than the ‘Citation keywords’ and click on ‘Update’. Save.

Now we want to add the biblio field which we need to link bibliographic citations with our citation content type. Because 'Bibliography' is a different content type from ‘Citations’ we need to first establish a relationship between these content types.

  • Under ‘Relationships’ click on the plus icon, select “Content: Bibliography (field_biblio)” and ‘Add’. Click on 'Update' and save.
  • Now add a new field “Biblio: Biblio Citation” and choose the relationship “Bibliography”. Add the label (Reference), select “Trim this field to a maximum length”, enter a maximum length of “300” and select “Add an ellipsis”. Choose your preferred style, e.g. CSE, and save. Note: Currently 'Biblio Citation' is not showing correctly and we are waiting for the Drupal community to fix this. So instead add the biblio fields "Authors" and "Year of Publication" and add the field "Node: Title" with the relationship "Bibliography" and a link to the node.
  • Next add the page field (Content: Page) and save.
  • We want to create a taxon page view (panel view), so under 'Arguments' click on the plus icon to add a new argument. In the box that opens below choose 'Taxonomy' in the drop down menu, check 'Taxonomy: Term ID' and click on 'Add'. Under 'Action to take if argument is not present select 'Hide view / Page not found'. Click on 'Update' and 'Save'. You can also sort the panel by adding a sort criterion, for example 'Weight: Weight'.
  • Under 'Basic settings' click on Style: 'Unformatted' and change the view style to table. Click on 'Update'. Then, click on ‘Items to display’ and set the number of items to display to “0”, which means 'unlimited'. Otherwise you will only see the set number of items without knowing that there may be more items. Save.

To view you new 'Citation2' widget you need to go back to a taxon page which actually has citation tagged to it (Carnus hemapterus), and drag the new widget into the active section.

2.3. Create a 'Citation' page view

Now we are going to add a separate page.

  • Click on the 'Add display' button, with 'Page' chosen in the drop down box. Under ‘Page settings’ click on Path: 'None', enter the URL (content/citation2) and update.
  • Under ‘Basic settings’ click on ‘Use pager’, click on the ‘Override’ button to be able to have a different setting for this page than for the default we did earlier, select ‘Full pager’ and update. The pager enables you to click through several pages of citations instead of having one long list. Set the ‘Items to display’ to "10" and click the 'Override' button if necessary (it is not necessary if the button reads 'Use default'). Update and save.
  • Make sure you are still on the 'Page' display. Each time you save you go back to the Default settings and need to click on the 'Page' setting again. We need to remove the argument in order to show citations for all taxa on this page. Click on your argument, then on the 'Override' button, click on 'Remove' and save.
  • Make sure you are on the 'Page' display. If you want to check your new view click on 'View "Page"' in the upper right corner. You can go back to editing the view by clicking on the light grey '[Edit]' link which appears below the view title when you hover over the page (not the sidebar). From now on you will automatically view the "page" you produce when you click on 'Save'.
  • We want the user to search for taxon names and/or citation keywords. To do this we need to add two filters to our page view. Under ‘Filters’ click on the plus icon, choose 'Taxonomy' > 'Taxonomy: Term', select the Carnidae classification and update. Click on the 'Override' button and on the ‘Expose’ button so that users can see the filter. Select ‘Unlock operator’, enter the label “Search for: Taxonomic name”, uncheck ‘Force single’ and update. Save. Add another filter for the citation keywords and save.
  • Try out your new view. You can search for multiple terms when you separate terms with a comma.

2.4. Create a map view

  • Go to 'Administer' > 'Views' and click on 'Add'.
  • Enter the name (Map1) and description (Distribution map) for the view.
  • The view type is 'Node'.
  • Click on 'Next'.
  • Under 'Filters' click on the plus icon to add a new filter. In the box that opens below choose 'Node' in the drop down menu under 'Groups'. Scroll down, check 'Node: Type' and click on 'Add'. Select the ‘Specimen (DwC 1.2.1)’ node type and click on 'Update'. Click on 'Save'.

This means that only content from the ‘specimen' content type is shown in this view. However, to show a distribution map we need to show data from both the specimen and the location content type. Therefore we need to establish a relationship between these content types.

  • Under ‘Relationships’ click on the plus icon, select “Darwincore - Specimen: Darwincore location node” and ‘Add’. Enter the label (Darwincore location node), check " Require this relationship" and update.
  • Under 'Fields' click on the plus icon to add a field. In the box that opens below choose 'Node' in the drop down menu under 'Groups'. Scroll down, check 'Node: Title' and click on 'Add'. Enter “Title” as label and check 'Link this field to its node'. 'Update'. Add the following other fields: "Darwincore - Specimen: Taxonomic name", "Darwincore - Specimen: Sex", "Location: Latitude" and "Location: Longitude".
  • Under 'Basic settings' click on Style: 'Unformatted' and change the view style to 'Gmap' and set the ‘Items per page’ to unlimited (number of items to display is “0”). Click on 'Update' after each and 'Save'.
  • Click on the 'Add display' button, with 'Page' chosen in the drop down box. Under ‘Page settings’ click on Path: 'None', enter the URL (map1) and update.
  • Save. If you want to check your new view go back to the 'Page' display and click on 'View "Page"' in the upper right corner. You can go back to editing the view by clicking on the light grey '[Edit]' link which appears below the view title when you hover over the page (not the sidebar). From now on you will automatically view the "page" you produce when you click on 'Save'.
  • We want the user to search for taxon names. To do this we need to add a filter to our page view. Under ‘Filters’ click on the plus icon, choose 'Taxonomy' > 'Taxonomy: Term ID' and select the taxonomic vocabulary (choose one which has specimens connected with it). Click on the 'Override' button and on the ‘Expose’ button so that users can see the filter. Select ‘Unlock operator’, enter the label “Search for: Taxonomic name”, uncheck ‘Force single’ and update. Save.
  • Try out your new view. You can search for multiple terms when you separate terms with a comma. You can see the distribution for the taxa you select, but you can only see one node (pin) for each locality. Therefore if you select multiple taxa, you will not be able to verify whether one locality has more species than the one showing when you click on the pin. (We hope to improve this soon)
  • If you want to restrict your map to a certain project, say the species of Iceland, you can add another filter. Choose "(Darwincore location node) Darwincore - Location: Continent/BodyOfWater ", select 'Continent/BodyOfWater', select "Darwincore location node" as relationship, enter "Europe" as value and update. To make the view work properly you will need to have at least one locality with "Europe" in the continent field.
  • If you want to adapt the view of your map, you can change the color and size of the pins if you click on the cog icon next to the GMap style (under 'Marker / fallback marker to use:').

For other adaptations you can change the GMap module (on the advanced administration page click on 'GMap' in the site configuration section). However, be aware that this will change all the maps on your site.

3. Groups - Create private areas to cooperate on a specific project

Let's assume you want to prepare data for your 'PaperX' online, but you don't want anybody to see these data, yet, except for yourself and maybe some co-authors. However, you plan to make all the data visible to everyone as soon as the paper is published. The best way to do this is by using an organic group.
Organic groups are private areas on a Scratchpad which are only accessible to group members. A user can have a higher user role within a group. For example someone who is contributor to the main Scratchpad can be editor for a group and therefore edit group content created by other group members. Content generated within a group can be publicly visible or hidden and the whole group can be hidden as well.
The creator of a group is usually responsible for managing the group and its users, but he/she can also give this responsibility to another user.

  • Hover with the mouse over ‘Group’ in the ‘Content’ menu and click on the 'Add a group node' icon which appears to the right.
  • Enter the Group Name and Description. The Group Name should be short as it will show up in the web addresses of all content you produce within this group.
  • We don't mind people knowing about this group, so 'List in groups directory', can be checked. However, we don't want anybody except coauthors in the group, so we don't want the group to appear in the registration form, and keep the 'Registration form' field unchecked. If you select this field, you will get an email informing you of applications and asking you to approve or disapprove a new member. Choose the membership request you prefer. For our example select 'Invite only'. Save the group.
  • You are now on the group's main page. Click on the 'Edit' tab to further configure your group.
  • Under the 'Disallow public posts in this group' select 'Do not allow public posts in this group'. This will ensure that you can't make any content created in this group public, that is visible to non-group members.
  • Click on 'Next' and 'Save'.

Your group is now establish under the alias: …/content/groupname and all content you create within this group will have the alias …/groupname/contenttitle. It is useful to activate the Group detail block (through the administration pages), because it for example enables you to add content to the group from all group pages and to add new members to your group by clicking on ‘1 member’ (or 2, 3, ... members) in the group block. Check out this option. You can also add members to your group by clicking on 'Group' in the Content menu and clicking on the name of the group in the table. In the Content menu underneath the 'Group' link will now be two additional links to "Members" and "My membership". Click on "Members" and then on the 'Add members' tab to add users.

  • Now add a few examples of content to your group. When you are on the main group page every content you add using the content menu will automatically be added to the group. Otherwise you can add content to a group by selecting the group under the 'Access' tab in the 'Advanced options' section.
  • Log out of the Scratchpad to verify that the content you added to this group is not showing. You might have to reload the page for this.

We are now assuming that your paper was published and that you want all the data in your group to be visible to everyone.

  • Log back in and you will see the group content again. Go back to your group for example via the 'Group' link in the Content menu and clicking on the 'My groups' tab. Edit the group and click on the 'Delete' button. You will be asked what you want to do with the group's posts. Select 'Do nothing' and click on the 'Delete group' button. Your group is now deleted and all the content which belonged to this group is publicly available on your site.

Source URL: http://helpeditor.scratchpads.eu/content/advanced-training-course

Links:
[1] http://sandbox.scratchpads.eu/
[2] http://trainingXX.taxon.name
[3] http://scratchpads.eu/scratchpad-training-files
[4] http://www.mozilla.com/
[5] http://portableapps.com/apps/internet/firefox_portable
[6] http://carnidae.myspecies.info
[7] http://helpeditor.scratchpads.eu/%26amp;topic:scratchpadify_help/2-1--Add-a-vocabulary%26amp;
[8] http://helpeditor.scratchpads.eu/%26amp;topic:scratchpadify_help/2-2--Import-from-eol%26amp;
[9] http://helpeditor.scratchpads.eu/%26amp;topic:scratchpadify_help/4-1--Import-a-bibliography%26amp;
[10] http://helpeditor.scratchpads.eu/sites/helpeditor.scratchpads.eu/files/u1/Location_Import.txt
[11] http://helpeditor.scratchpads.eu/sites/helpeditor.scratchpads.eu/files/u1/Specimen_Import.txt