listing all resources in a 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 > listing all resources in a resource gallery




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

    listing all resources in a resource gallery  
drazic19


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


 
11-20-05 10:50 PM

Hi,

Been trying to implement some code to list all resources in a resource
galley. My problem comes with setting which gallery i should look at, not
sure how to do this. List code is as follows:

Dim cmsContext As CmsHttpContext = CmsHttpContext.Current

'get the current channel
Dim currentChannel As Channel = cmsContext.Channel

For Each cmsResource As Resource In 'needs a way to specify a galler
name

AddItem(cmsResource.DisplayName, cmsResource.Url,
cmsResource.Size, cmsResource.FileExtension, cmsResource.LastModifiedDate)

Next

Thanks,

Michael





[ Post a follow-up to this message ]



    Re: listing all resources in a resource gallery  
Chester Ragel


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


 
11-21-05 01:47 AM

Hi Michael,

It is not possible to get a cms object using its name (because name is not
used as a key value in cms). If you have the guid/path... (check the
CmsContext.Searches to get the list of methods which can be used) of the
resource gallery you can use that to get the resource gallery via
cmsContext.Searches (Also the API has a method
cmsContext.RootResourceGallery which will return the root resource gallery -
in some cases this one also can be used).

If you are going to get the gallery using its path then the code will be,

Dim resourceGallery As ResourceGallery = cmsContext.Searches.GetByPath("path
of the resource gallery") 'the path will be something like
"/Resources/....."
For Each cmsResource As Resource In resourceGallery.Resources
' AddItem(cmsResource.DisplayName, cmsResource.Url, cmsResource.Size,
cmsResource.FileExtension, cmsResource.LastModifiedDate)
Next

Cheers,
Chester.

~Are you using MCMS? Then try MCMS Manager -
http://mcmsmanager.sourceforge.net~


"drazic19" <drazic19@discussions.microsoft.com> wrote in message
news:75E007DD-6F29-4582-A2B6-7D48EE3A85EF@microsoft.com...
> Hi,
>
> Been trying to implement some code to list all resources in a resource
> galley. My problem comes with setting which gallery i should look at, not
> sure how to do this. List code is as follows:
>
>         Dim cmsContext As CmsHttpContext = CmsHttpContext.Current
>
>         'get the current channel
>         Dim currentChannel As Channel = cmsContext.Channel
>
>         For Each cmsResource As Resource In 'needs a way to specify a
galler
> name
>
>             AddItem(cmsResource.DisplayName, cmsResource.Url,
> cmsResource.Size, cmsResource.FileExtension, cmsResource.LastModifiedDate)
>
>         Next
>
> Thanks,
>
> Michael







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:58 PM.      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