Successfully reported this slideshow.
Beyond the Intranet  A new way to look at Open Atrium   Antonio De Marco       Andrea Pescetti     antonio@nuvole.org    a...
“   Open Atrium is an intranet in a box that has group    spaces to allow different teams to have their own    conversatio...
Part intranet, part do-it-yourself projectwith a kick of open source hotness
Part intranet, part do-it-yourself projectwith a kick of open source hotnessfor all tastes: the easygoing and the picky
Possibilities
Open Atrium out of the box.
Open Atrium as a public website.
Open Atrium as a fully customized private group.
Open Atrium as a social network.
Open Atrium as a file manager.
Open Atrium as you like it.
Technologies
Features A feature is a collection of Drupal entities(views, contexts, fields, etc...) which taken    together satisfy a ce...
SpacesA way to make one Drupal site act        like several sites.     http://drupal.org/project/spaces
PURL            Persistent URLA helper for other modules interested in using   elements of the page request to sustain    ...
OG      Organic GroupsEnable users to create and manage        their own groups.       http://drupal.org/project/og
Recipes
How toAdd custom user profile fields
core = "6.x"dependencies[] = "features"dependencies[] = "text"description = "Custom profile feature."features[content][] =...
How toOverride Atriums core configuration
core = "6.x"dependencies[] = "book"dependencies[] = "codefilter"...description = "Atrium sitewide settings and configurati...
<?php/*** Implementation of hook_strongarm_alter()*/function custom_profile_strongarm_alter(&$items) {  if (isset($items[u...
Features component alter hooks
“   Hooks to modify components defined by other    features. These come in the form    hook_COMPONENT_alter where COMPONENT...
How toAlter contexts at run-time
/*** Implementation of hook_context_load_alter().*/function spaces_context_load_alter(&$context) {  $space = spaces_get_sp...
How toRemove the Welcome video block
<?php/*** Implementation of hook_spaces_presets_alter()*/function custom_group_spaces_presets_alter(&$items) {    // Store...
Overridden...$ drush featuresName                   Feature                Status    State       Atrium                 at...
How toCreate custom group types
core = "6.x"dependencies[] = "atrium_news"dependencies[] = "atrium_pages"dependencies[] = "context"dependencies[] = "menu"...
Custom feature set
/*** Implementation of hook_spaces_presets().*/function atrium_portal_spaces_presets() {...spaces_features => array(  atri...
Custom dashboard context
/*** Implementation of hook_spaces_presets().*/function atrium_portal_spaces_presets() {...context => array(  spaces_dashb...
Thank You.  http://nuvole.org
Extending and Customizing Open Atrium
Upcoming SlideShare
Loading in …5
×

Extending and Customizing Open Atrium

10,771 views

Published on

  • Be the first to comment

Extending and Customizing Open Atrium

  1. 1. Beyond the Intranet A new way to look at Open Atrium Antonio De Marco Andrea Pescetti antonio@nuvole.org andrea@nuvole.org
  2. 2. “ Open Atrium is an intranet in a box that has group spaces to allow different teams to have their own conversations. It comes with six features - a blog, a wiki, a calendar, a to do list, a shoutbox, and a dashboard to manage it all. Development Seed
  3. 3. Part intranet, part do-it-yourself projectwith a kick of open source hotness
  4. 4. Part intranet, part do-it-yourself projectwith a kick of open source hotnessfor all tastes: the easygoing and the picky
  5. 5. Possibilities
  6. 6. Open Atrium out of the box.
  7. 7. Open Atrium as a public website.
  8. 8. Open Atrium as a fully customized private group.
  9. 9. Open Atrium as a social network.
  10. 10. Open Atrium as a file manager.
  11. 11. Open Atrium as you like it.
  12. 12. Technologies
  13. 13. Features A feature is a collection of Drupal entities(views, contexts, fields, etc...) which taken together satisfy a certain use-case. http://drupal.org/project/features
  14. 14. SpacesA way to make one Drupal site act like several sites. http://drupal.org/project/spaces
  15. 15. PURL Persistent URLA helper for other modules interested in using elements of the page request to sustain information between pages. http://drupal.org/project/purl
  16. 16. OG Organic GroupsEnable users to create and manage their own groups. http://drupal.org/project/og
  17. 17. Recipes
  18. 18. How toAdd custom user profile fields
  19. 19. core = "6.x"dependencies[] = "features"dependencies[] = "text"description = "Custom profile feature."features[content][] = "profile-field_profile_city"features[content][] = "profile-field_profile_country"name = "Custom Profile"package = "Features"project = "custom_profile"version = "6.x-1.0" custom_profile.info
  20. 20. How toOverride Atriums core configuration
  21. 21. core = "6.x"dependencies[] = "book"dependencies[] = "codefilter"...description = "Atrium sitewide settings and configuration."...features[variable][] = "upload_uploadsize_default"features[variable][] = "upload_usersize_default"features[variable][] = "user_picture_default"...name = "Atrium"package = "Atrium" atrium.info
  22. 22. <?php/*** Implementation of hook_strongarm_alter()*/function custom_profile_strongarm_alter(&$items) {  if (isset($items[user_picture_default])) {    $items[user_picture_default]->value = sites/.../user.png;  }}?> hook_strongarm_alter()
  23. 23. Features component alter hooks
  24. 24. “ Hooks to modify components defined by other features. These come in the form hook_COMPONENT_alter where COMPONENT is the default_hook declared by any of components within features. CTools also has a variety of hook_FOO_alters. features.api.php
  25. 25. How toAlter contexts at run-time
  26. 26. /*** Implementation of hook_context_load_alter().*/function spaces_context_load_alter(&$context) {  $space = spaces_get_space();  if ($space) {    foreach (array_keys(context_reactions()) as $plugin) {      $override = $space->controllers ->context ->get("{$context->name}:reaction:{$plugin}");      if (!is_null($override)) {        $context->reactions[$plugin] = $override;      }    }  }}
  27. 27. How toRemove the Welcome video block
  28. 28. <?php/*** Implementation of hook_spaces_presets_alter()*/function custom_group_spaces_presets_alter(&$items) {  // Store a reference to our target block section.  $blocks = &$items[atrium_groups_private]->value[context][spaces_dashboard-custom-1:reaction:block][blocks];   // Remove "Welcome" block.  unset($blocks[atrium-welcome_member]);  // Add "Latest discussions" block.  $blocks[views-blog_listing-block_1] = array(    module => views,    delta => blog_listing-block_2,    region => content,    weight => 1,  );}?> hook_spaces_presets_alter()
  29. 29. Overridden...$ drush featuresName                 Feature              Status    State       Atrium               atrium               Enabled   Overridden  Atrium Blog          atrium_blog          Enabled     Atrium Notebook      atrium_book          Enabled               Atrium Calendar      atrium_calendar      Enabled               Atrium Case Tracker  atrium_casetracker   Enabled               Atrium Groups        atrium_groups        Enabled   Overridden  Atrium Members       atrium_members       Enabled    Atrium Profile       atrium_profile       Enabled   ...but Upgrade-safe
  30. 30. How toCreate custom group types
  31. 31. core = "6.x"dependencies[] = "atrium_news"dependencies[] = "atrium_pages"dependencies[] = "context"dependencies[] = "menu"dependencies[] = "spaces"features[context][] = "layout_portal"features[ctools][] = "context:context:3"features[ctools][] = "spaces:spaces:3"features[menu_custom][] = "menu-portal"features[menu_links][] = "menu-portal:calendar"features[menu_links][] = "menu-portal:dashboard"features[spaces_presets][] = "atrium_portal"name = "atrium_portal"package = "Features" atrium_portal.info
  32. 32. Custom feature set
  33. 33. /*** Implementation of hook_spaces_presets().*/function atrium_portal_spaces_presets() {...spaces_features => array(  atrium_blog => 0,  atrium_book => 0,  atrium_calendar => 1,  atrium_casetracker => 0,  atrium_members => 0,  atrium_news => 1,  atrium_pages => 1,  atrium_shoutbox => 0,  spaces_dashboard => 1,),...atrium_portal.spaces.inc
  34. 34. Custom dashboard context
  35. 35. /*** Implementation of hook_spaces_presets().*/function atrium_portal_spaces_presets() {...context => array(  spaces_dashboard-custom-1:reaction:block => array(    blocks => array(      views-atrium_news-block_3 => array(        module => views,        delta => atrium_news-block_3,        region => content,        weight => 0,      ),      views-calendar_listing-block_1 => array(        module => views,        delta => calendar_listing-block_1,        region => right,        weight => 0,      ),    ),  ), atrium_portal.spaces.inc
  36. 36. Thank You. http://nuvole.org

×