finding a resource guid from a path
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 > finding a resource guid from a path




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

    finding a resource guid from a path  
Chandy


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


 
02-29-04 05:34 PM

Hi all,

We are using the built-in MCMS resource gallery browser to select or
upload a resource then pull-back info on it and store it in a
placeholder.  The gallery browser returns the URL to the resource but
we want to store the GUID.  However, we don't seem able to resolve the
URL back to a GUID!

dim imageItem as Resource =
CType(CmsHttpContext.Current.Searches.GetByPath(imageURL), Resource)

This only ever returns Nothing.  How can I get the resource object to
get its GUID when all I have is a URL?

Suggestions appreciated!

Thanks,

Chandy





[ Post a follow-up to this message ]



    Re: finding a resource guid from a path  
Stefan [MSFT]


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


 
02-29-04 09:34 PM

Hi Chandy,

to get the GUID do the following:

string[] splt = imageUrl.Split('/');
string GUID = splt[3];
Resource rs = CmsHttpContext.Current.Searches.GetByGuid("{"+GUID+"}") a
s
Resource;
if (rs != null)
{
// ok, we got the Resource object
}
else
{
// sorry! Local resource. No object available.
}


Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Chandy" <chandy@totalise.co.uk> wrote in message
news:5af0375a.0402290851.2f354c82@posting.google.com...
> Hi all,
>
> We are using the built-in MCMS resource gallery browser to select or
> upload a resource then pull-back info on it and store it in a
> placeholder.  The gallery browser returns the URL to the resource but
> we want to store the GUID.  However, we don't seem able to resolve the
> URL back to a GUID!
>
> dim imageItem as Resource =
> CType(CmsHttpContext.Current.Searches.GetByPath(imageURL), Resource)
>
> This only ever returns Nothing.  How can I get the resource object to
> get its GUID when all I have is a URL?
>
> Suggestions appreciated!
>
> Thanks,
>
> Chandy







[ Post a follow-up to this message ]



    Re: finding a resource guid from a path  
Chandy


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


 
03-01-04 02:37 PM

Hi Stefan,

Yeah, that's pretty-much what I resorted to.  Cheers.

Chandy

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message news:<uO$cdhw$DHA.2432@
TK2MSFTNGP11.phx.gbl>...
> Hi Chandy,
>
> to get the GUID do the following:
>
>     string[] splt = imageUrl.Split('/');
>     string GUID = splt[3];
>     Resource rs = CmsHttpContext.Current.Searches.GetByGuid("{"+GUID+
"}") as
> Resource;
>     if (rs != null)
>     {
>         // ok, we got the Resource object
>     }
>     else
>     {
>         // sorry! Local resource. No object available.
>     }
>
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
>
> "Chandy" <chandy@totalise.co.uk> wrote in message
> news:5af0375a.0402290851.2f354c82@posting.google.com... 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:21 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