Pawtucket - Contribute form

From CollectiveAccess Documentation
Jump to: navigation, search

The Contribute form is a Pawtucket plugin that allows site audience to upload media and metadata directly to the database through a public or semi-public content submission page. Every aspect of this plugin is customizable, including which fields are included on the form, access control to the page and to the submitted records, styling treatment of the form, etc.

Implementing the Contribute form

The first step to implementing a Contribute form is to create a user interface that displays the metadata your site audience should see. This interface is just like any other Providence UI because it is, essentially, a back-end cataloging area that you are simply exposing to your users. As with normal user interfaces, the form UI can be added to the system in the installation profile or through the Administration portal. The UI should have a unique name and should be restricted to a record type that is created for the purpose of the form. Here's an example of the first few lines of code for a UI created for the Contribute form. In this example, the form is designed to collect object records of the type "user".

   <userInterface code="public_form" type="ca_objects">
      <labels>
        <label locale="en_US">
          <name>Public Form</name>
        </label>
      </labels>
      <screens>
        <screen idno="basic" default="1">
          <labels>
            <label locale="en_US">
              <name>Basic info</name>
            </label>
          </labels>
          <typeRestrictions>
            <restriction code="user" type="user"/>
          </typeRestrictions>
          <bundlePlacements>
            <placement code="preferred_labels">
              <bundle>preferred_labels</bundle>
            </placement>
            <placement code="ca_attribute_contribute_date">
              <bundle>ca_attribute_contribute_date</bundle>
            </placement>

Configuring contribute.conf

All of the configuration settings for the form are handled by a file called contribute.conf that can be found in app/plugins/Contribute/conf in your Pawtucket installation.

Setting Description Values
enabled Enables and disables the plugin. Set to 1 to enable. 0 (False) or 1 (True)
position_top_level_nav_item_before The code of the menu item that should be placed to the right of the Contribute link in the main navigation bar. To place the Contribute link as the right-most item, leave this blank. Menu code defined in the navigation.conf file
default_ui The userInterface code defined for the default UI that should be displayed on the form. Unique alphanumeric code defined in the installation profile or the Administration portal


After the main settings are configured, you must define the user interface-specific settings following the syntax below:

#
# Each UI must be defined here
#
uis = {
	# Name the default UI by its ''userInterface code''
	public_form = {

	# Set the name of the Contribute form (will display by default as the header on the Contribute page)
		label = {
			en_US = User Contribution Form
		},

	# If set to 1, login will be required before a user can access the form
		require_login = 1,

	# Sets the table and record type of the submitted content
		table = ca_objects,
		type = user,

	# Sets the record workflow status and the public access status of the newly created records
		status = 0,
		access = 0,

	# Includes on-screen SPAM prevention (in the form of a simple/quick math question) if set to 1
		spam_protection = 0,
		
	# Includes on-screen click-through agreement on the form if set to 1
		terms_and_conditions = 0,
		
	# Sets the default metadata for the media uploaded
		representation_type = front,
		representation_status = 0,
		representation_access = 1,
		
	# Where the user is re-directed to after a successful form submission
	# Values are:
	#		last_page = redirect to page user linked to form from
	#		splash = redirect to Pawtucket splash/front page
	#		url = redirect to Pawtucket url specified in post_submission_destination_url directive
	#		page = use result_html view to format direct response (no redirect)
		post_submission_destination = page,
		
	# Module/controller/action settings to generate url for user direction.  For more information on URL generation see 	
	# wiki.collectiveaccess.org/index.php?title=URL_Format
		post_submission_destination_url = { module =, controller = Browse, action = Index },
		
	# Set to a non-zero value to include an on-screen post-submission message
		set_post_submission_notification = 1,
		
		# Used for submissions that don't include media
		post_submission_notification_message = _(Thank you for your submission!)

		# Used for submissions that include uploaded media
		post_submission_notification_message_width_media = _(Your media has been uploaded. Thank you for your submission!)
	}
}

Additional settings

You may notice a comment at the bottom of contribute.conf that indicates you probably won't need to change any of the code in the bottom portion of the document. The settings controlled in the final section of the file are non-functional—in other words, they don't relate to performance. In this section an advanced user can control required fields and markers, display formats for metadata and label settings.

sphinx

Namespaces

Variants
Actions
Navigation
Tools
User
Personal tools