plainblack.com
Username Password
search
Bookmark and Share

    

SiteIndex logic

User knowmad
Date 9/25/2009 1:13 am
Views 649
Rating -1    Rate [
|
]
Previous · Next
User Message
knowmad

I'm trying to decipher how the SiteIndex.pm content handler determines which pages get added to its output. The following command is what builds the asset list:

 

    my $pages  = WebGUI::Asset->getRoot($session)->getLineage(["self","descendants"],{
        returnObjects      => 1,
        includeOnlyClasses => ["WebGUI::Asset::Wobject::Layout"],
        whereClause        => "assetData.groupIdView = 7",
        limit              => 20000
    });

 

I need some help understanding what the whereClause is doing. I wondered if it limited the list to only pages that were not hidden from navigation. However, this isn't the case (in v7.7.20). So what is it doing and what would it take to add the ability to exclude pages that are hidden from navigation?

 

Thanks,
William

 

----
Knowmad Technologies
http://www.knowmad.com



Back to Top
Rate [
|
]
 
 
roryzweistra
Hi William,
As I understand it, it means that only the page layouts that are viewable for everyone are added to the index.
group id 7 = everyone
Cheers,
Rory

On 25 sep 2009, at 08:13, <william@knowmad.com> wrote:
knowmad wrote:

I'm trying to decipher how the SiteIndex.pm content handler determines which pages get added to its output. The following command is what builds the asset list:

 

    my $pages  = WebGUI::Asset->getRoot($session)->getLineage(["self","descendants"],{
        returnObjects      => 1,
        includeOnlyClasses => ["WebGUI::Asset::Wobject::Layout"],
        whereClause        => "assetData.groupIdView = 7",
        limit              => 20000
    });

 

I need some help understanding what the whereClause is doing. I wondered if it limited the list to only pages that were not hidden from navigation. However, this isn't the case (in v7.7.20). So what is it doing and what would it take to add the ability to exclude pages that are hidden from navigation?

 

Thanks,
William

 

----
Knowmad Technologies
http://www.knowmad.com



http://www.webgui.org/develop/forum/siteindex-logic

--

WebGUI
http://www.webgui.org

----------------------------------------------------------------------------------------------------------------------Met vriendelijke groet,
Rory Zweistrarory@oqapi.nl
Rotterdamseweg 183 C2629 HDDelftNederland
T: (+31) 015 750 10 98F: (+31) 015 750 10 99www.oqapi.nl


Back to Top
Rate [
|
]
 
 
patspam
I'm trying to decipher how the SiteIndex.pm content handler determines which pages get added to its output. The following command is what builds the asset list:

    my $pages  = WebGUI::Asset->getRoot($session)->getLineage(["self","descendants"],{

Starting at the root node, return the root and all descendants that match the following constraints..

        returnObjects      => 1,

Instantiate and return objects rather than just assetIds..

        includeOnlyClasses => ["WebGUI::Asset::Wobject::Layout"],

Only include Page Layout assets..

        whereClause        => "assetData.groupIdView = 7",

Where "Who Can View" is set to "Everyone" (groupId == 7)

        limit              => 20000

And at most return only 20,000 items.

    });

You can run the same query from wgd via:
wgd ls --recursive --filter '%groupIdView% ~~ 7' /

Patrick

Back to Top
Rate [
|
]
 
 
knowmad

Patrick,

Thanks for the line-by-line play! The whereClause is the one that is the most densely packed. You've really got to understand the database to be able to use it effectively.

You can run the same query from wgd via:
wgd ls --recursive --filter '%groupIdView% ~~ 7' /

Now that's cool! I don't quite grok the filter but I'm sure the wgd docs explain all the fancy character substitution you're doing there.

 

William

----
Knowmad Technologies
http://www.knowmad.com



Back to Top
Rate [
|
]
 
 
perlDreamer
william@knowmad.com wrote:

> I need some help understanding what the whereClause is doing. I wondered
> if it limited the list to only pages that were not hidden from
> navigation. However, this isn't the case (in v7.7.20). So what is it
> doing and what would it take to add the ability to exclude pages that
> are hidden from navigation?

First, that sounds like a bug to me.

To make it obey the "Hide from navigation" Asset setting, you
would change the whereClause to:

whereClause        => "assetData.groupIdView = 7 and assetData.isHidden=0",

Colin


Back to Top
Rate [
|
]
 
 
knowmad


First, that sounds like a bug to me.

Yeah, I was debating on whether to consider this a bug. I think I'll defer to JT's logic and consider it a good place to put a switch. I've submitted an RFE to modify the conf file to support this option.

Thanks for the tips on how to make it obey the "Hide from navigation" Asset setting.

 

William

----
Knowmad Technologies
http://www.knowmad.com



Back to Top
Rate [
|
]
 
 
    



© 2012 Plain Black Corporation | All Rights Reserved