« March 2010 | Main | May 2010 »

April 28, 2010

Image cache notes

These notes built up while watching the GotDrupal video on Image Cache.

A suggested overview document on image cache.

Need these modules:
FileField (Tokens optional)
ImageCache (ImageAPI, ImageCacheUI also)
- ImageAPI GD2 is mentioned but not clear if it is a requirement

Configure ImageCache
- What are presets? - Tells imageCache which steps to take to modify images when they are identified (uploaded)
- Seem to be composed of Actions (which automatically alter uploaded images)

Filefield Tokens - can auto-append metadata (tokens) to uploaded files

Stopped at 36 minutes. Couldn't keep going.

Posted by kkwaiser at 10:11 AM | Comments (0)

April 27, 2010

Customize Biblio endnote export to include citekey (hack)

The Biblio module auto-increments a citation key but this key is not included in the Endote Tagged export by default. Here is a hack to include the citation key. In this case, I export the citation key into the Accession Number field.

1) Open the file containing the biblio_endnote_tagged_export() function: ~sites/all/modules/biblio/biblio.import.export.inc (Line 864)

2) Go to line 923 and change this:

if (!empty($node->biblio_accession_number))
$tagged .= "%M ". trim($node->biblio_accession_number) ."\r\n";

to this:

if (!empty($node->biblio_citekey))
$tagged .= "%M ". trim($node->biblio_citekey) ."\r\n";

Explanation: As mentioned, Biblio can be setup up to auto-increment the citation key (admin/settings/biblio > citekey). These values are stored in the "biblio" table as the field "biblio_citekey". All you are doing is substituting one database field for another.

3) Save the file and test the export.

Posted by kkwaiser at 10:31 AM | Comments (0)

April 26, 2010

OBFS form notes

Here are some important components of the obfs form:


-Line 357 - "User thank you message"
- text for the auto-email to the user post-registration

-Line 399: "Success Content"
- The content for the web page after the form is submitted

- Line 393 "mail('kkwaiser@umich.edu', 'OBFS Registration', ...)"
- The email(s) of UMBS staff who should receive a copy of the Registration information

Posted by kkwaiser at 12:55 PM | Comments (0)

April 23, 2010

Rides: North 23

View Larger Map

This ride took 1hr 17 minutes on 4.23.10 for an average speed of 15.5 mph.

Posted by kkwaiser at 10:02 PM | Comments (0)

Counting number of records in a View

I've added a counter to the Visitors page that shows how many people we are expecting. I swiped the code from here


and placed it in the View header. Cool.

Posted by kkwaiser at 10:42 AM | Comments (0)

Buoy notes

A list of things I need to request from MHL:

List of Sensors (Make/Model/Variables)
Example data file (streamed from buoy)
Other documentation (writeups on underlying system)
Old Poster PResentation(s)
Logo's images

Posted by kkwaiser at 08:57 AM | Comments (0)

April 20, 2010

Rides: Ann Arbor - Barton Hills

View Larger Map

Posted by kkwaiser at 08:07 PM | Comments (0)

April 19, 2010

Citing Data Sets

Here are a few good resources on citing data sets:


Posted by kkwaiser at 03:16 PM | Comments (0)

April 09, 2010

Getting Panels going

1) Get the latest version of Panels and Chaos Tools

2) Put these modules into sites/all/modules

3) Go to admin/build/modules and enable:
- Views Bonus: Panels
- Panels
- Chaos Tools
- Ctools Page Manager
- CTools Views Content Panes

4) Create a panel.
- Go to admin/build/panels > Panel Page
- Follow this tutorial for more: http://drupal.org/node/206792

Posted by kkwaiser at 11:33 AM | Comments (0)

Updating modules on Live site

This entry outlines how to update a module on the live site using Views 2.10 as an example.

1) View the status of module for the site: admin/reports/updates

2) Download the appropriate modules to your local machine.

3) Put site into maintenance mode: admin/settings/site-maintenance

4) Backup the database through phpMyAdmin
- Place this file in: /Private/drupal...

5) Backup the code
$ cd blah/drupal/newModules/
$ sudo tar -czf sites_backup_4_9_2010.tar.gz blah/sites/
% cp .htaccess ~/Private/drupal/
- Place this file in: /Private/drupal...

6) SFTP the the latest version of the module to drupal/newModules

7) Unpack the new modules into sites/all/modules.
% cd ~/sites/all/modules/
% tar -xzf ~drupal/newModules/blah.tar.gz

8) *Deprecated - see extended entry for original text*

9) *Deprecated - see extended entry for original text*

10) Run update.php

11) Check status admin/reports/updates and errors admin/reports/dblog

12) Navigate to a few pages to make sure everything looks right
- NOTE: the gmap module requires another move. Copy the old sites/all/modules/gmap/thirdparty/Clusterer2.js file into the new module directory.

13) Take site out of maintenance mode

14) Check to make sure the views are functioning properly (again)

8) Delete the old module folders
% rm -rf sites/all/modules/gmap/
% rm -rf sites/all/modules/views/

9) Copy the new modules over
% cp -rf ~/Private/drupal/newModules/views/ sites/all/modules/

Posted by kkwaiser at 10:42 AM | Comments (0)

April 08, 2010

Subsites and path auto

I'm beginning to have second thoughts about using the subsites module because it does not jive well with my goal of being able to upgrade to Drupal 7 when it is ready. I have a feeling we may lose a lot of progress.

Where's that put us? Dunno. But the path auto module looks strong (depends on the token module) and we'll need it eventually anyways. That would allow a specific url for a research project.

Posted by kkwaiser at 01:08 PM | Comments (0)

Edit Research Site Locations

Editing Research Site Locations

1) Login so you can edit nodes

2) Browse to the research site you want to edit. Click Edit > Location Information

3) Notice Location Name is complete. If this is blank the lat/long information won't be saved

4) Find the site Marker on the Google map. Move it as necessary.

5) Save and view your changes

a) For some reason the map interface doesn't center correctly on the point when editing, zoom out to find your point
- I've raised this issue on drupal.org : http://drupal.org/node/765592
b) You can also add an address instead of using the map interface.

Posted by kkwaiser at 09:14 AM | Comments (0)

April 06, 2010

How to create webforms in Drupal

How to create a webform in Drupal.

Version info:
Drupal 6.16
Webform 6.x-2.9

You've installed the Webform module into sites/all/modules but not enabled it.

Other resources:

Webform Documentation and Project homepage: http://drupal.org/project/webform (notice Documentation tab)

1) Login:
- go to http://blah.lsa.umich.edu/alpha/login
- You can change your password and find other information at the "My Account" link

2) Enable the Webform module (if it's not already):
- Administer > Site Building > Modules
- Find and Check on the Webform box > Save Configuration (at bottom of page)

3) Start a new Webform:
- Create content > Webform (URL: ~node/add/webform)

4) Complete Configuration Section
- Title
- Description
- Confirmation Message
- URL Path settings
- There's a lot more on this first page, ask Kyle or check Documentation for help
- Save and note the URL

5) Add Form Components
- Click on Edit > Form Components (it's tabbed)
- Enter a component name (e.g. First Name)
- Choose a field type (e.g. textfield)
- Is this field Mandatory? Should it be emailed to you (or others)?
- Click Add
- Set further options such as defaults, lengths, etc.
- Click Submit

6) Check your changes by clicking on View

7) Continue adding fields
- Make sure to make note of the different Types

8) Move form from testing environment to production
- Once you form is perfect, I believe we can transfer it to the live site by using this module: http://drupal.org/project/node_clone

Posted by kkwaiser at 03:09 PM | Comments (0)

April 02, 2010

How to enter publications into Drupal's Biblio via DOI

This entry is a guide to entering a publication into Drupal's Biblio module. Note that most Administrative information for the bibliography can be found here at Administer > Site Configuration > Biblio Settings (URL: admin/settings/biblio)

1) Login:
- go to http://blah.umich.edu/alpha/login
- You can change your password and find other information at the "My Account" link

2) Set up DOI import for the bibliography:
- Create Content > Biblio > DOI Lookup
- Click on "You need to register with CrossRef" and complete following page

3) Synchronize your CrossRef information
- Go to My Account > Edit > Biblio Settings > CrossRef Login Information
- Add your email (e.g., kkwaiser@umich.edu) to the Account ID box
- Save

3) Import an publication via a DOI:
- Create Content > Biblio > DOI Lookup
- Enter this DOI: 10.1672/08-41.1 > Click Populate using DOI

4) QA/QC the new publication:
- Authors: Make sure the pre-existing authors have correct name (via auto-complete)
- Person References: These should be the same as the authors. If the name doesn't autocomplete, enter the name and a "person" of that name will be created
- Abstract: Did it import?
- Notes: Anything important to add?
- Custom 1: If UMBS has a hardcopy on file enter the following: Archived copy available at the University of Michigan Biological Station
- Custom 2: Field for research sites associated with this publication. For example: Lake Michigan/Lake Huron/Lake Superior
- Research Site Reference: Should be the same information as Custom 2. If the site doesn't exist it will be created and you may want to go edit the site characteristics (such as location!)
- Custom 3: A list of associated habitats. For example: Northern Hardwoods/Swamp-Hardwood-Conifer
- Keywords: This is an auto-complete field. Please use existing terms wherever possible although it is possible to create new terms if needed.

5) Save or Preview the entry.

Posted by kkwaiser at 12:01 PM | Comments (0)

April 01, 2010

Caching Views 2 pages in Drupal

This Lullabot article on caching is great.

Here are a few links to discussion on caching in Views

I've turned time-based caching on for the research site map to see if that will decrease rendering time. Here are some numbers:

Loading the map of research sites (all 630+ sites) from home on a MacBook with safari, a (mediocre) wireless connection and the view caching set to none gives a LOADING TIME OF 16.87 seconds.

Loading the map of research sites (all 630+ sites) from home on a MacBook with safari (I emptied browser cache and restarted), a (mediocre) wireless connection and the view caching set to time-status with the time options both at 1 hour, gives a LOADING TIME OF 16.7 seconds. Although I cleared the browser cache and ran the test again and the load time was less than 4 seconds.

Since the page cache really sped things up, I'm going to leave it. Still need to make a decision on caching the query and/or html and the length of time store these caches.

This forum touches on a few points. Might be worth posting a question of about time constraints here.

For now, I've set a 6 day cache because I'm not making changes to research sites right now.

Posted by kkwaiser at 09:36 AM | Comments (0)