Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Anatomy of a 5000 hour project

BoldMinded
October 16, 2012

The Anatomy of a 5000 hour project

#eeciconf2012

BoldMinded

October 16, 2012

Transcript

36 slides
  1. 1

  2. 4

  3. 5

  4. TEAM JASON DICKS HTML/CSS/EE PHILIP BRAND LEAD DEV JONNY BRANUM

    SOLR GURU JOSH ANDERSON EE BRIAN LITZINGER ADD-ONS ISAAC RAWAY ADD-ONS 13
  5. MULTILINGUAL/DRAFTS TRANSLATION IMPORT/EXPORT ROBUST SEARCH ZIP FILE GENERATION USER DOWNLOAD

    HISTORY CUSTOM FORM BUILDER KEY FEATURES UHURA UHURA SOLR PLAYA/CUSTOM ASSETS PLUS PROFORM HOURS 350 200 250 200 125 0 1125 16
  6. TRANSCRIBE & BETTER WORKFLOW DID NOT EXIST HAD A GREAT

    IDEA TURNS OUT IT WAS A TERRIBLE IDEA (100 FIELDS X 12) X 2 = 2400 COLUMNS MULTILINGUAL/DRAFTS 17
  7. USE CUSTOM TABLE BUILD FIELDTYPE TO HOUSE OTHER FIELDTYPES WORKED!

    BUT JAVASCRIPT EVENTS WERE FLAKY AND WOULDN’T SUPPORT MATRIX MULTILINGUAL TAKE 2! 18
  8. HAD TO BE A BETTER WAY MULTILINGUAL TAKE 3! $this->api_channel_fields->apply('display_publish_field',

    array($field_value)); $this->EE->api_channel_fields->apply('save', array($data[$field_name])); $this->EE->api_channel_fields->apply('replace_tag', array('data' => $data, 'params' => $params, 'tagdata' => $tagdata)); 19
  9. JACKPOT! function apply($method, $parameters = array()) { $_ft_path = $this->ft_paths[$this->field_type];

    $this->EE->load->add_package_path($_ft_path, FALSE); $res = call_user_func_array(array(&$this->field_types[$this->field_type], $method), $parameters); $this->EE->load->remove_package_path($_ft_path); return $res; } 20
  10. JACKPOT! function apply($method, $parameters = array()) { $_ft_path = $this->ft_paths[$this->field_type];

    $this->EE->load->add_package_path($_ft_path, FALSE); require PATH_THIRD .'/uhura/libraries/uhura.php'; $res = call_user_func_array(array(&$this->field_types[$this->field_type], $method), $parameters); $this->EE->load->remove_package_path($_ft_path); return $res; } 21
  11. function apply($method, $parameters = array()) { $_ft_path = $this->ft_paths[$this->field_type]; $this->EE->load->add_package_path($_ft_path,

    FALSE); if(array_key_exists('uhura', $this->EE->addons->get_installed())) { if(isset($this->EE->form_validation->_error_array) AND count($this->EE->form_validation->_error_array) > 0) { // Do nothing. } else { require_once 'Uhura_Api_channel_fields.php'; $uhura = new Uhura_Api_channel_fields($this); $parameters = $uhura->apply($method, $this->field_type, $parameters); } } $res = call_user_func_array(array(&$this->field_types[$this->field_type], $method), $parameters); $this->EE->load->remove_package_path($_ft_path); return $res; } 22
  12. SCOPED TO USE SOLR CAN WE USE A 3RD PARTY

    SEARCH MODULE INSTEAD? SERIOUSLY THOUGHT ABOUT IT FOR A WEEK STUCK WITH SOLR. GLAD WE DID. (EVEN THOUGH IT WAS AN EPIC P.I.T.A.) SEARCH 24
  13. <schema name="VictaulicSearch" version="1.4"> <types> <fieldtype name="text_en_US" class="solr.TextField"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/>

    <filter class="solr.StandardFilterFactory"/> <filter class="solr.ISOLatin1AccentFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.SnowballPorterFilterFactory" language="English"/> </analyzer> </fieldtype> ... 26
  14. <!-- title of entry [one per language] --> <field name="title_en_US"

    type="string" indexed="true" stored="true" /> <field name="title_es_ES" type="string" indexed="true" stored="true" /> <field name="title_es_MX" type="string" indexed="true" stored="true" /> ... <!-- text searched actual content [one per language] --> <field name="content_en_US" type="text_en_US" indexed="true" stored="true" /> <field name="content_es_ES" type="text_es_ES" indexed="true" stored="true" /> <field name="content_es_MX" type="text_es_MX" indexed="true" stored="true" /> ... <!-- facet search options based on entry categories or relationships --> <!-- Relationships (Playa) --> <field name="systemType" type="int" indexed="true" multiValued="true" stored="true" /> <field name="productCategory" type="int" indexed="true" multiValued="true" stored="true" /> <field name="productBrand" type="int" indexed="true" multiValued="true" stored="true" /> <field name="productSubcategory" type="int" indexed="true" multiValued="true" stored="true" /> <field name="productSystem" type="int" indexed="true" multiValued="true" stored="true" /> ... <!-- Categories --> <field name="business" type="int" indexed="true" multiValued="true" stored="true" /> <field name="businessApplication" type="int" indexed="true" multiValued="true" stored="true" /> <field name="region" type="int" indexed="true" multiValued="true" stored="true" /> <field name="facilityType" type="int" indexed="true" multiValued="true" stored="true" /> <field name="howDoI" type="int" indexed="true" multiValued="true" stored="true" /> ... 27
  15. $config['solr']['requiredFields'] = array( "id", "entryDate", "urlSlug", "channelId", "title", "content" );

    // Mapping Playa or category fields to facets $config['solr']['relationshipMappings'] = array( 'productBrand' => array( 'literature_rel_product_brands', 'product_parent_brand' ), 'productCategory' => array( 'product_category', 'literature_rel_product_cat' ), 'business' => array( 'calendar_rel_businesses', 'contact_rel_businesses', 'literature_rel_businesses', 'news_rel_businesses', 'product_rel_businesses', 'study_rel_businesses', 'video_rel_businesses' ), 'businessApplication' => array( 'business_rel_applications', 'product_rel_applications' ) ); 28
  16. // Fields used for the facets. The sidebar facet list

    renders in this order. $config['solr']['multiValueFields'] = array( 'channelId', 'facilityType', 'systemType', 'howDoI', 'eventType', 'literatureType', 'newsCategory', 'productCategory', 'productSubcategory', 'productBrand', 'joiningSystem', 'pipeMaterialCategory', 'pipeSchedule', 'productSizeRangeInches', 'productSizeRangeMetric', 'deflector', 'response', 'productKFactorImperial', 'productKFactorSi', 'productOrificeInches', 'productOrificeMetric', 'business', 'businessApplication', 'productSystem', 'videoCategory', 'facilityType', 'discontinued', 'region' ); 29
  17. // Set search boost to a higher priority, if not

    set here, then it gets a 1 $config['solr']['boost'] = array( // channel_id => boost value 5 => 9, // products 19 => 2, // videos 15 => 2, // literature, 14 => 2 // solutions ); 30
  18. // entry_submit_absolute_end() $facets['businessGroup'][] = $playa_id; $facets['businessGroup'][] = $cat_id; $facets['content_'.$language] =

    trim(strip_tags(implode(' ', $content_fields))); $facets['snippet_'.$language] = trim(strip_tags(implode(' ', $snippet_fields))); // Assemble our output to send to Solr $out = array( 'id' => $entry_id, 'entry_id' => $entry_id, 'entryDate' => ((isset($meta['entry_date']) AND $meta['entry_date'] != "" AND $meta['entry_date'] != "0") ? $meta['entry_date'] : $this->EE->localize->now), 'editDate' => ((isset($meta['edit_date']) AND $meta['edit_date'] != "") ? strtotime($meta['edit_date']) : $meta['entry_date']), 'urlSlug' => ((isset($data['structure__uri']) AND $data['structure__uri'] != '') ? $data['structure__uri'] : $this->_generate_url_slug($meta, $entry_id)), 'imageUrl_'. $language => $image, 'imageUrl' => $image, 'channelId' => $meta['channel_id'], 'title_'. $language => $title, 'title' => $title ); 31
  19. CAD PACKAGES SOFTWARE MODULES CAD FILES PAC-SERIES 745 DELUGE.RFA PAC-SERIES

    745 DRY.RFA PAC-SERIES 745 PRE.RFA FIRE PROTECTION AUTO-DESK REVIT 33
  20. GO OUTSIDE YOUR SAFE ZONE. SLOW DOWN. PLAN YOUR CODE.

    EE CAN HANDLE JUST ABOUT ANYTHING. MORAL OF THE STORY 35

More Decks by BoldMinded

Other Decks in Technology