[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bricolage-commits
Subject:    [6632] Add searching on all URIs to story and media.
From:       theory () bricolage ! cc
Date:       2005-08-31 22:32:38
Message-ID: 20050831223238.29942.qmail () x1 ! develooper ! com
[Download RAW message or body]

Revision: 6632
Author:   theory
Date:     2005-08-31 15:32:35 -0700 (Wed, 31 Aug 2005)
ViewCVS:  http://viewsvn.bricolage.cc/?rev=6632&view=rev

Log Message:
-----------
Add searching on all URIs to story and media.

Modified Paths:
--------------
    bricolage/trunk/lib/Bric/Biz/Asset/Business/Media.pm
    bricolage/trunk/lib/Bric/Biz/Asset/Business/Story.pm
    bricolage/trunk/lib/Bric/Changes.pod



["r6632-theory.diff" (r6632-theory.diff)]

Modified: bricolage/trunk/lib/Bric/Biz/Asset/Business/Media.pm
===================================================================
--- bricolage/trunk/lib/Bric/Biz/Asset/Business/Media.pm	2005-08-31 22:13:37 UTC (rev 6631)
+++ bricolage/trunk/lib/Bric/Biz/Asset/Business/Media.pm	2005-08-31 22:32:35 UTC (rev 6632)
@@ -196,6 +196,7 @@
      related_media_id     => 'media_container_tile mctrm',
      contrib_id           => 'media__contributor sic',
      note                 => 'media_instance mmi2',
+     uri                  => 'media_uri uri',
 };
 
 PARAM_FROM_MAP->{_not_simple} = PARAM_FROM_MAP->{simple};
@@ -241,7 +242,7 @@
       published_version     => "mt.published_version = i.version AND i.checked_out = '0'",
       user__id              => 'i.usr__id = ?',
       user_id              => 'i.usr__id = ?',
-      uri                   => 'LOWER(i.uri) LIKE LOWER(?)',
+      uri                   => 'mt.id = uri.media__id AND LOWER(uri.uri) LIKE LOWER(?)',
       file_name             => 'LOWER(i.file_name) LIKE LOWER(?)',
       location              => 'LOWER(i.location) LIKE LOWER(?)',
       _checked_in_or_out    => 'i.checked_out = '
@@ -313,6 +314,9 @@
                                 'sic.member__id = ?' ],
     note                   => [ 'mmi2.media__id = mt.id',
                                 'LOWER(mmi2.note) LIKE LOWER(?)'],
+    uri                    => [ 'mt.id = uri.media__id',
+                                'LOWER(uri.uri) LIKE LOWER(?)'],
+
 };
 
 use constant PARAM_ORDER_MAP => {

Modified: bricolage/trunk/lib/Bric/Biz/Asset/Business/Story.pm
===================================================================
--- bricolage/trunk/lib/Bric/Biz/Asset/Business/Story.pm	2005-08-31 22:13:37 UTC (rev 6631)
+++ bricolage/trunk/lib/Bric/Biz/Asset/Business/Story.pm	2005-08-31 22:32:35 UTC (rev 6632)
@@ -299,6 +299,7 @@
        related_story_id     => 'story_container_tile sctrs',
        related_media_id     => 'story_container_tile sctrm',
        note                 => 'story_instance si2',
+       uri                  => 'story_uri uri',
 };
 
 PARAM_FROM_MAP->{_not_simple} = PARAM_FROM_MAP->{simple};
@@ -317,6 +318,7 @@
       workflow_id            => 's.workflow__id = ?',
       _null_workflow_id      => 's.workflow__id IS NULL',
       primary_uri            => 'LOWER(s.primary_uri) LIKE LOWER(?)',
+      uri                    => 's.id = uri.story__id AND LOWER(uri.uri) LIKE LOWER(?)',
       element_id             => 's.element__id = ?',
       element__id            => 's.element__id = ?',
       element_key_name       => 's.element__id = e.id AND LOWER(e.key_name) LIKE LOWER(?)',
@@ -428,6 +430,8 @@
                                 'sc2.category__id = ?' ],
     primary_category_id    => [ "i.id = sc2.story_instance__id AND sc2.main = '1'",
                                 'sc2.category__id = ?' ],
+    uri                    => [ 's.id = uri.story__id',
+                                'LOWER(uri.uri) LIKE LOWER(?)' ],
     category_uri           => [ 'i.id = sc2.story_instance__id AND sc2.category__id = c.id',
                                 'LOWER(c.uri) LIKE LOWER(?)' ],
     keyword                => [ 'sk.story_id = s.id AND k.id = sk.keyword_id',
@@ -757,6 +761,11 @@
 Returns a list of stories with a given primary URI. May use C<ANY> for a list
 of possible values.
 
+=item uri
+
+Returns a list of stories with a given URI. May use C<ANY> for a list of
+possible values.
+
 =item story.category
 
 Pass in a story ID, and a list of stories in the same categories as the story

Modified: bricolage/trunk/lib/Bric/Changes.pod
===================================================================
--- bricolage/trunk/lib/Bric/Changes.pod	2005-08-31 22:13:37 UTC (rev 6631)
+++ bricolage/trunk/lib/Bric/Changes.pod	2005-08-31 22:32:35 UTC (rev 6632)
@@ -140,6 +140,12 @@
 
 Added support for searching on UUIDs to the story and media classes. [David]
 
+=item *
+
+Added suport for searching on URIs in the story class and modified the same
+parameter in the media class to search I<all> possible URIs for media, not
+just the URI associated with the primary output channel. [David]
+
 =back
 
 =head1 VERSION 1.9.0 "Punkin" (2005-08-19)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic