« November 2010 | Main | January 2011 »

December 22, 2010

Enhancing core's Taxonomy module in Drupal

A note that I'm going to start using the following modules and why.

Unitag Module - allows a free-tagging vocabulary to become Read-only.

What?!

Terms that are entered and are not part of the vocabulary are sent to limbo for management approval. This is perfect because I want researchers to tag with their own terms but I don't want them mucking up my system!

1) Install and Enable
2) Go to Unitag Settings (admin/content/taxonomy/unitag/settings)
3) Enable Read only and Sanitize on the Keyword and Classification vocabularies

Taxonomy Role very similar to Taxonomy Permissions. Basically controls whether a particular vocabulary will appear on the node edit form based upon their Role.

1) Install and Enable
2) Visit Permissions to set which roles will be able to see which Vocabularies on the node/edit form.

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

December 20, 2010

Update, upgrade and reboot via command line for Ubuntu

Some notes for how to keep a system up to date when you only have SSH (command line) access:

From an Ubuntu forum:

$ sudo apt-get update
$ sudo apt-get upgrade

What is the difference between these commands?

Put another way, update does not make any changes to the set of installed packages, it merely checks to see what's new. Whereas upgrade does.

To reboot from SSH (command line) use this command or see some other options:

$ sudo reboot
which is equivalent to
$ sudo init 6

One thing I am not sure of is what happens if you shut down via SSH. Can you boot a computer via SSH? Probably, but I haven't figured it out yet.

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

December 17, 2010

Using Skype with a Microsoft LifeCam 6000 on Ubuntu

I've probably tried sillier things than trying to get Microsoft hardware to play well with Linux (like when I was 8 and stacked a step-stool on top of a step-stool on top of a high-chair...that didn't end well at all) but this command seems to make it all work:

$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

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

December 16, 2010

Notes on Updating to Drupal 6.20

Of course, less than a week after I go live with v1.0 of the Research Gateway a stream of holiday releases crop up. This is for notes on the upgrades.

Form is as follows:
________________________________________________________
What I've got
What is available and/or recommended
The download link of the version I'm going to install
________________________________________________________
Drupal core 6.19
Recommended version: 6.20 (2010-Dec-15)
http://ftp.drupal.org/files/projects/drupal-6.20.tar.gz
________________________________________________________
Content Construction Kit (CCK) 6.x-3.x-dev (2010-Nov-10)
Recommended version: 6.x-3.x-dev (2010-Dec-06)
http://ftp.drupal.org/files/projects/cck-6.x-3.x-dev.tar.gz
________________________________________________________
Date 6.x-2.x-dev (2010-Nov-13)
Recommended version: 6.x-2.6 (2010-Aug-14)
Development version: 6.x-2.x-dev (2010-Dec-13)
http://ftp.drupal.org/files/projects/date-6.x-2.x-dev.tar.gz
________________________________________________________
FileField 6.x-3.7
Recommended version: 6.x-3.9 (2010-Dec-12)
http://ftp.drupal.org/files/projects/filefield-6.x-3.9.tar.gz
________________________________________________________
Image Resize Filter 6.x-1.9
Recommended version: 6.x-1.10 (2010-Dec-05)
http://ftp.drupal.org/files/projects/image_resize_filter-6.x-1.10.tar.gz
________________________________________________________
ImageField 6.x-3.7
Recommended version: 6.x-3.9 (2010-Dec-12)
http://ftp.drupal.org/files/projects/imagefield-6.x-3.9.tar.gz
________________________________________________________
Markup 6.x-1.x-dev (2010-Jul-11)
Recommended version: 6.x-1.0-alpha1 (2010-Dec-14)
http://ftp.drupal.org/files/projects/markup-6.x-1.0-alpha1.tar.gz
________________________________________________________
Node export 6.x-2.22
Recommended version: 6.x-2.24 (2010-Dec-09)
http://ftp.drupal.org/files/projects/node_export-6.x-2.24.tar.gz
________________________________________________________
Views 6.x-2.11
Security update: 6.x-2.12 (2010-Dec-15)
http://ftp.drupal.org/files/projects/views-6.x-2.12.tar.gz
________________________________________________________

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

December 15, 2010

NodeAccess vs Content Access + ACL

My notes while evaluating these similar modules. Spoiler alert, I went with Content Access + ACL.

NodeAccess
+ Fewer rebuilds of the permissions (rebuilding is really annoying when experimenting/developing)
+ Configuration of default access for content types are all on one page
+ Out-of-the-box ability to set access for Roles per content type
+ Out-of-the-box ability to set access for Roles and Users per Node
+ 6000+ users
- D7? No D7 port in the works
- No development activity for the last 1.5 years

Content Access
- Rebuilds are time consuming!
- Need an additional module (ACL) to get user-specific access to node, however ACL seems well maintained and is an API only module
- Default configuration is on each Content Type config page
- User interface not as slick as NodeAccess
+ D7 port is underway
+ 20,000+ users


So, to summarize, NodeAccess is +5/-2 and Content Access +2/-4 but Content Access wins? Is this the BCS or something?

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

Improving and refining access to content in Drupal 6

Just when I thought I had things figured out I've been forced to revisit the issue of content access in Drupal. Hopefully, this will be a good thing in the end as I have also considered DataSet, DataFile and other access issues.

This post is log of changes:

1) Install and enable Content Access and ACL.

See evaluation post of CA here.

2) Modify default access and publication states for content types:

Person
- Unpublished by default
- Default Content Access Settings: Anonymous = View
- Using View Unpublished to allow view access to non-Authors, non-Admins by role (REU Reviewer and Staff)

REU Application
- Published by default
- Content Access: View/Edit limited to REU Reviewer

Housing Application
- Published by default
- Content Access: View/Edit limited to Staff

Research Project
- Published by default
- Content Access: View to Anonymous, Edit to Author
- Catch: If the Author wants to let another User edit their Project, the node will have to be published and Content Access settings should be changed accordingly (i.e., Not Viewable to Anonymous, add user with permissions.)

DataSets, DataFiles, Variables will look the same as Research Project

Research Sites,
- Published by Default
- Content Access: Viewable by anonymous
- Problem

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

December 13, 2010

User Related Modules for Drupal 6

I've come to the conclusion that all Project Leads (PI's, Graduate Students, Co-PI's) will be required to maintain an account through our Research Gateway. There are several reasons for and implications of this decision. Explanation follows:

Reasons for:
1) Project Leads will eventually need a user account anyways as they will be submitting data later on.
2) Project Leads need to register their Research Project with UMBS as part of their application. Without an authentication requirement, anonymous users would need the ability to create Research Projects and this just doesn't seem like a good idea

Implications:
1) Another account for people to manage
2) Exposure to the Research Gateway
3) Personal information and Research Projects will be saved and should cut down on future effort once complete


Where Confusion Arises:
I currently have Research Projects from 2010 that returning researchers may want to cite when they apply to visit UMBS in 2011. For this to be possible I will need to 1) create User accounts for those researchers a priori and 2) give them the ability to edit the Research Project, because 3) the researcher will need to complete further fields.


Either way:

User Import Module can be used to create many Users via a csv import.

User Import Framework Module looks like User Import's little brother.

Protect Critical Users Module will not allow specified Users to be deleted. Seems sensible.

Node Access User Reference Module allows a CCK field that specify Users who can be configured to have View or Edit abilities on a node. For fun, see if you can find the killer caveat on the project page!!

UserPlus Module seems like a bulk operations module for Users.

Posted by kkwaiser at 04:05 PM | Comments (0)

December 09, 2010

A new module to expose external tables to Views?

I really need a module that exposes data in external tables to Views. Unfortunately, of the two existing options one is one its way out and the other has poor issue-response statistics - I repeat, poor, poor, poor issue-response statistics - no documentation - I repeat, no, no documentation - and is a bit convoluted. Do you sense frustration?!

This has led me to imagine a module that adds a new View type, call it External Table, with configuration options on the Views interface whereby users can specify an external table by name. This module would then pass the table fields (column headers) to Views which could be added to a view of the table. Honestly, I would stop there at first and later build in filters that could be applied to values within a column, passing of arguments, and other bells and whistles.

This philosophy differs from that of other modules in a few ways. Specifically, it is 1) 100% dependent on the Views module, 2) highly focused in its mission, 3) completely integrated into the Views module configuration interface (i.e., no extra admin configuration options).

How to do this? Here are a few posts that may be relevant:

The Views Developers Group has taken up this subject.

Apparently, the "Displaying the Forecast section" of this tutorial is helpful.

Webchick recommends the code uploaded in this comment.

Someone wishing for similar functionality within Drupal 7.

This patch may contain parts of a solution but note a TW dependency: Enable views to handle external tables properly, allowing for joins across tables in different mysql databases

Just some references to previous posts of mine related to this subject:

Delving further into the Data Module

How to for the Data Module

Overall Approach to Data in Tables with Drupal

Storing data in tables (not csv's)

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

December 06, 2010

Theming Marinelli

First off, this is a hack and I'm not a themer so don't think any of the following is the correct way to do things. I'm in the uncomfortable position of having to mimic the css of a different site. The following is a temporary fix (i.e., crappy approximation.)

1) Install Marinelli and enable Giordani.

2) Setup dropdown menu's

Keep: Site Name, Shortcut Icon, Search Box

Path to shortcut Icon:
sites/default/files/images/umbs_icon.jpg

Dropdown for menu items

3) Edit primary links menu (admin/build/menu-customize/primary-links)
- Enable and Expand all links you want to show up.
- Mimic the structure found here :http://www.lsa.umich.edu/umbs/

4) Tweak CSS:

Increase spacing between lines of text:
marinelli/typography.css
change:
body{ line-height: 1.5em;}

Menu changes ->
sites/all/themes/marinelli/layout.css

Reduce header height
line 29
#header
height: 100px;

#utilities
padding: 5px; /* originally 0; */

line 127
left: -19px

line 135
#utilities #plinks ul li {
margin-right: -14px;

line 101
#utilities form { /*search box*/
position:absolute;
right:9px;
bottom:0;
}

Modify graphics.css
sites/all/themes/marinelli/graphics.css

line 8
body{
background: url("http://www.lsa.umich.edu/vgn-ext-templating/sites/umbs/images/tone.gif") repeat scroll 0 0 #EDEDED;

line 13
#page
border: 12px solid #FFFFFF;

line 20
remove call to rotate.php, set background to white
#header {background: #FFFFFF; /*rotates images in the banners folder */}

Change look of search box
line 42
#utilities input.form-text {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #000000;
color: white;


links.css

sites/all/themes/marinelli/links.css

Modify the test of the home page link:
line 86
#header h1 a, #header p a{
color: #FFFFFF;
text-shadow: 3px -1px 1px #1D496F;
}

5) Put the Menu and Search Bar below the header image following this post.

* Note the Captcha Option that shows up below the search bar causes it to get misplaced. Going to live with it for now.

6) To modify Logo/Header areas see this post

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

Establishing Workflow for Researcher Products

The concept is relatively straightforward, establish a workflow system around researcher-created products to ensure content isn't published prematurely.

Attributes:
- Abundantly obvious as to which state is appropriate at a given time
- Publication of content is the final step

Product
- Three Statuses:

1) In progress - researcher is actively editing the content, accessible to the Content Owner and site Administrator. NOT PUBLISHED
2) Ready for review - content is ready to be published (i.e. version 1 is complete). Administrator should check for keywords and web-necessary index terms. NOT PUBLISHED
3) Published - Researcher and Administrator agree all Content is ready for public release.


Rules to implement:

At this point, only the Statuses exist but rules can be added to send out email notifications upon Content creation or Content publication.

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

December 04, 2010

Using Node Clone in Drupal 6

A smattering of steps:

1) Download, install and enbable the Node Clone Module.

2) Set permissions at admin/user/permissions so that the appropriate roles can either Clone All Nodes or Clone Own Nodes.

3) Configure the Clone module at admin/settings/clone. I omitted all Content Types except DataFile and Variable just to be conservative.

4) Test

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

Building a Friendly Metadata Interface for Researchers in Drupal

This is what my job is all about but I haven't had much of a chance to focus on it in the last month or so. The following steps are taken with the goal of building a user-friendly interface for researchers to manage research projects, personnel, metadata and datasets within a web-database framework. DEIMS, the framework alias, stands for the Drupal Ecological Information Management System.

Here are the steps in bullet point fashion. Assumptions as to knowledge of the basic content type structure (Research Project, Person, Research Site, DataSet-> DataFile-> Variable) is assumed. For a primer, see this article by several LTER data types.

1) Create content from within another content type

The nested nature of metadata storage it is somewhat counter intuitive to the manner in which we would normally create it. For example,

DataSet -> DataFile -> Variable

The intuitive way to create metadata is to start at DataSet and create the DataFiles and Variables as they come up. This isn't immediately possible in Drupal but as I outline in this admittedly sparse post, javascript can be used to generate pop-up screens that allow for this.

2) Allow researchers to clone or duplicate DataFiles and Variables

The metadata held with DataFile is necessarily redundant due to the fact that only one file upload is allowed per DataFile. If the researcher has a lot of files with identical metadata (but different data values) they can clone a DataFile node and alter only those bits of information that are unique. For example, they can just upload a new file. See a How to for the Node Clone module.

3) Allow uploaded files to be (available to the) Public or Private.

No researcher is going to trust you with their data if, in the second after it is uploaded onto your website, it becomes available to anyone with an internet connect. The DataFile content type I use has 2 upload fields, one public and one private. The latter restricts access of the file but not the metadata to the researcher and the administrator. Here's my post on creating a Public/Private file system in Drupal.

4) Build a friendly, navigable layout that allows easy travel from point A to point B.

This will be ongoing but a few improvements to date:
- Use Panels to so that users are presented with content they have authored.
- Create custom menu for different User Roles.

5) Establish a Workflow system around Research Projects, DataSets and DataFiles that allows progress to be saved but not published.

See this post for more notes.

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

December 02, 2010

Allowing User Roles to View Unpublished Content in Drupal

Intro: I have unpublished content that comes via CCK-built registration form and I want specific User Roles to be able to access (view) it but not edit it.

Problem: Only User Roles with "Administer Node" rights can access (view) unpublished content, but this also give them Edit rights. In this case, I don't want the people who are evaluating incoming applications to be able to edit the applications. This is more for their protection than anything else.

Solution:
1) Work something out with panels that evaluates the Author's Role and if that User Role = Applicant, then only allow the Authenticated (Acting) User to view the Node...........Actually, I don't think this will work...

which is why I went with this

2) The View Unpublished Module places an additional permissions section into admin/user/permissions that allows you to specify which roles can View unpublished content (on a per content type basis.)

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