Tree of Resource Gallery
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Tree of Resource Gallery




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Tree of Resource Gallery  
George Leithead


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:18 PM

Hi all,

I want to use the R.A.D. editor, however there is a problem with it.
Basically, when you want to upload a resource, it uses a drop-down list.
That's not a problem you say, well, actually it is if you have a site which
is VERY hierarchical and deep.

I therefore want to change this so that I have a "browse" option to go and
select the appropriate resource gallery.  I've got this all working fine,
however I'm not sure how to render out the resource gallery as a tree.

Could someone help me get started on this one?  There are methods and
properties such as ResourceGalleryTree, BuildResourceGallery,
BuildResourceGalleryTree that all look like the right thing, but there is no
help on these!

All help is much appreciated!

George Leithead
RAD Manager







[ Post a follow-up to this message ]



    Re: Tree of Resource Gallery  
George Leithead


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:18 PM

Never mind, I figured it out.  Was a STUPID mistake on my part.  My class
was called ResourceGallery, therefore was causing problems when trying to
reference the MCMS ResourceGallery method!!

Anyway, here is the basic code, for others who want it!

protected Microsoft.Web.UI.WebControls.TreeView ResourceGalleryTree;

private void Page_Load(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

// Put user code to initialize the page here

ResourceGalleryTree.ShowLines = true;

ResourceGalleryTree.ShowPlus = true;

BuildResourceGalleryTree(CmsHttpContext.Current.RootResourceGallery.Resource
Galleries["Intranet"], null);

}

public void  BuildResourceGalleryTree(ResourceGallery
 startGallery, TreeNode
parentTreeNode)

{

TreeNode myNewNode = new TreeNode();

myNewNode.NavigateUrl = startGallery.Guid;

myNewNode.Text = startGallery.Name;

// If null, then we are at the root!

if (parentTreeNode == null)

{

// Add the new node

ResourceGalleryTree.Nodes.Add(myNewNode);

}

else

{

// Add our new not to the specified parent node

parentTreeNode.Nodes.Add(myNewNode);

parentTreeNode.Expanded = false;

}

// If sub-channels, recursively call to finish the tree

foreach(ResourceGallery subResourceGallery in
startGallery.ResourceGalleries)

{

 BuildResourceGalleryTree(subResourceGall
ery, myNewNode);

}

}



"George Leithead" <george.leithead@davislangdonDINAHSPAMMEH.com> wrote in
message news:4152a04c$0$20246$ed9e5944@reading.news.pipex.net...
> Hi all,
>
> I want to use the R.A.D. editor, however there is a problem with it.
> Basically, when you want to upload a resource, it uses a drop-down list.
> That's not a problem you say, well, actually it is if you have a site
which
> is VERY hierarchical and deep.
>
> I therefore want to change this so that I have a "browse" option to go and
> select the appropriate resource gallery.  I've got this all working fine,
> however I'm not sure how to render out the resource gallery as a tree.
>
> Could someone help me get started on this one?  There are methods and
> properties such as ResourceGalleryTree, BuildResourceGallery,
> BuildResourceGalleryTree that all look like the right thing, but there is
no
> help on these!
>
> All help is much appreciated!
>
> George Leithead
> RAD Manager
>
>







[ Post a follow-up to this message ]



    Re: Tree of Resource Gallery  
George Leithead


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:18 PM

Ok, now I have the basics.  Anyone know how I order the tree based on the
ResourceGallery.Name?

George Leithead
Davis Langdon
RAD Manager


"George Leithead" <george.leithead@davislangdonDINAHSPAMMEH.com> wrote in
message news:4152a574$0$20248$ed9e5944@reading.news.pipex.net...
> Never mind, I figured it out.  Was a STUPID mistake on my part.  My class
> was called ResourceGallery, therefore was causing problems when trying to
> reference the MCMS ResourceGallery method!!
>
> Anyway, here is the basic code, for others who want it!
>
> protected Microsoft.Web.UI.WebControls.TreeView ResourceGalleryTree;
>
> private void Page_Load(object sender, System.EventArgs e)
>
> {
>
> // Put user code to initialize the page here
>
> // Put user code to initialize the page here
>
> ResourceGalleryTree.ShowLines = true;
>
> ResourceGalleryTree.ShowPlus = true;
>
>
BuildResourceGalleryTree(CmsHttpContext.Current.RootResourceGallery.Resource
> Galleries["Intranet"], null);
>
> }
>
> public void  BuildResourceGalleryTree(ResourceGallery
 startGallery,
TreeNode
> parentTreeNode)
>
> {
>
> TreeNode myNewNode = new TreeNode();
>
> myNewNode.NavigateUrl = startGallery.Guid;
>
> myNewNode.Text = startGallery.Name;
>
> // If null, then we are at the root!
>
> if (parentTreeNode == null)
>
> {
>
> // Add the new node
>
> ResourceGalleryTree.Nodes.Add(myNewNode);
>
> }
>
> else
>
> {
>
> // Add our new not to the specified parent node
>
> parentTreeNode.Nodes.Add(myNewNode);
>
> parentTreeNode.Expanded = false;
>
> }
>
> // If sub-channels, recursively call to finish the tree
>
> foreach(ResourceGallery subResourceGallery in
> startGallery.ResourceGalleries)
>
> {
>
>  BuildResourceGalleryTree(subResourceGall
ery, myNewNode);
>
> }
>
> }
>
>
>
> "George Leithead" <george.leithead@davislangdonDINAHSPAMMEH.com> wrote in
> message news:4152a04c$0$20246$ed9e5944@reading.news.pipex.net... 
> which 
and[vbcol=seagreen] 
fine,[vbcol=seagreen] 
is[vbcol=seagreen]
> no 
>
>







[ Post a follow-up to this message ]



    Re: Tree of Resource Gallery  
Angus Logan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:18 PM

Hi George,

You could add them to a SortedList array; but be sure to check if the key
already exists before you add them.

Cheers
--
 ________________________________________


Angus Logan  (MCAD/MCDBA/MCP)
Lead Software Developer
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
 ________________________________________


"George Leithead" <george.leithead@davislangdonDINAHSPAMMEH.com> wrote in
message news:4152a6f8$0$20243$ed9e5944@reading.news.pipex.net...
> Ok, now I have the basics.  Anyone know how I order the tree based on the
> ResourceGallery.Name?
>
> George Leithead
> Davis Langdon
> RAD Manager
>
>
> "George Leithead" <george.leithead@davislangdonDINAHSPAMMEH.com> wrote in
> message news:4152a574$0$20248$ed9e5944@reading.news.pipex.net... 
class[vbcol=seagreen] 
to[vbcol=seagreen] 
>
BuildResourceGalleryTree(CmsHttpContext.Current.RootResourceGallery.Resource
 
> TreeNode 
in[vbcol=seagreen] 
list.[vbcol=seagreen] 
> and 
> fine, 
> is 
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:52 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register