• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Select This! Entity Selectors in Reason CMS
 

Select This! Entity Selectors in Reason CMS

on

  • 229 views

 

Statistics

Views

Total Views
229
Views on SlideShare
229
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Select This! Entity Selectors in Reason CMS Select This! Entity Selectors in Reason CMS Presentation Transcript

    • Andrew Bacon ‟13Carleton College
    • me:
    • me:
    • me:
    • at WSG:
    • ➡ entities➡ relationships
    • entities:stuff.
    • entities:stuff like...➡ sites ➡ news posts➡ pages ➡ images, ...➡ a cat
    • entities:aggregations ofproperties...➡ id ➡ name➡ type ➡ created_on, ...
    • entities:some properties onlymake sense forcertain types
    • entities:some properties only make sense for certaintypes, e. g.:lol_cat boromirbreed
    • entities:aggregations ofproperties acrossdatabase tables.➡ entity➡ meta➡ chunk➡ newstype, image, ...
    • Some examples.meta➡ description➡ keywordschunk➡ content➡ authorimage➡ dimension➡ image_typenewstype➡ subtitle➡ on_front_page
    • Some examples.meta➡ description➡ keywordschunk➡ content➡ authorimage➡ dimension➡ image_typenewstype➡ subtitle➡ on_front_pagenews post
    • Some examples.meta➡ description➡ keywordschunk➡ content➡ authorimage➡ dimension➡ image_typenewstype➡ subtitle➡ on_front_pageimage
    • not entities:relationships
    • relationshipsThings are related to otherthings.➡ entity_a and entity_b
    • relationshipssilly examples:nation_to_cat_monarch
    • relationshipssilly examples:lolrus_to_bukkit
    • relationshipsreal examples:minisite_page_to_avav_to_av_fileminisite_page_to_imagenews_to_image
    • relationshipsThings are related to otherthings.➡ directional➡ entity_a and entity_b
    • detour:relationships have direction.➡ unidirectionalminisite_page_to_image
    • detour:relationships have direction.nation_to_cat_monarch
    • (disembodied)
    • detour:relationships have direction.➡ unidirectional➡ bidirectionalsite_to_user
    • detour:real examples of directionality➡ news_to_image
    • detour:relationships have direction.focusrelatednews_post_to_...
    • detour:relationships have direction.image_to_... or ..._to_imagefocusrelated
    • relationshipsThings are related to otherthings.➡ directional➡ number-sensitive➡ entity_a and entity_b
    • relationshipssilly examples:nation_to_cat_monarch
    • relationshipssilly examples:mom_to_kittens
    • relationshipsreal examples:➡ news_to_image
    • relationshipsThings are related to otherthings.➡ directional➡ number-sensitive➡ entity_a and entity_b➡ pretty darn arbitrary
    • entities:stuff like...➡ sites ➡ news posts➡ pages ➡ images, ...➡ types?➡ DB tables?!➡ „type‟!?!?
    • putting it togethertype_to_table relationships forentity 3, “Site.”rel_id entity_a entity_b rel_type7 Site (3) site (8) 111628 Site (3) meta (82) 194766 Site (3)ldap_cache(37716)1
    • entities in PHP➡ objects of class Entity➡ linked to corresponding entityin DB (if exists)
    • entities in PHPmethods to know aboutget_value($name, $value);set_value($name);id();
    • getting entitiesentity constructorentity selectors
    • the constructor$e = new Entity($id);
    • the selector$es =new Entity_Selector($site);
    • selectorwhy I was afraid➡ no formal introduction
    • selectorcommon tasksWhat properties of entities can we selectbased on?➡ Type➡ Relationship to a specific entity➡ Has a property with a specific value➡ ...?
    • selectoradd_type($id);Will select only entities of the given type.$es->add_type(id_of(„image‟));
    • selectoradd_relation($where);Selects only entities where a specificproperty meets some condition.$es->add_relation(„status.status != “pending”‟);
    • selectoradd_left_relationship($id[, $rel_id]);selected entities must exist on the left sideof a relationship with $entity_id on the rightside. Optional $relationship_id.“get the parent of thegiven entity.”
    • selectoradd_right_relationship($id[, $rel_id])selected entities must exist on the right sideof a relationship with $entity_id on the leftside. Optional $relationship_id.“get the child of the givenentity.”
    • selectorset_env(„site‟, $site_id);always set this.not the same thing as the site id you set inthe $es constructor.
    • selectorrun_one([$type, $status, $error]);Run the darn thing!Returns an array of entities.
    • selectoran example:Select all media works from a site➡$es = new Entity_Selector($site);➡$es->add_type(id_of(„av‟));➡$result = $es->run_one()
    • selectoranother example:Select all images related to a news item (forthis site!)➡$es = new Entity_Selector($site);➡$es->add_type(id_of(„image‟));➡$es->add_right_relationship($news_id,relationship[_id_of(„news_to_image‟));➡$result = $es->run_one()
    • selectoradd_left_relationship_field($rel_name, $table, $field);If there are entities that are on the left sideof the given relationship, add the givenfield.
    • selectorhow to look up info about a typeMaster admin -> types
    • more?!you know enough now.
    • other thoughtsthat guy sitting next to you isAMAZING with $es.➡ bigger selectors are not better.➡ limit_tables, limit_fields➡ fifth parameter of add_left_rel_field➡ google group: reason-cms
    • goodies!!!!available atgo.carleton.edu/...slides! cheat sheet!!?!?