| Author |
Message |
Varad
Guest
|
Posted:
Tue Jan 11, 2005 4:09 am Post subject:
Getting CMSObject based on Posting: |
|
|
Hi Stefan
I'm passing the name of the posting to a CMStemplate through query string.
In this template I want to get the CMS collection (includes all placeholders)
for that posting. How do I do this? I looked through the PAPI guide, but
coudnt locate this one. Thanks
V |
|
| Back to top |
|
 |
Angus Logan [MVP]
Guest
|
Posted:
Tue Jan 11, 2005 5:53 am Post subject:
Re: Getting CMSObject based on Posting: |
|
|
Hi,
The Posting object (that contains a collection of placeholders among other
things) can be loaded by its path using the Searches object.
You need to check out the Searches.GetByPath method
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sitedevl/htm/frlrfmicrosoftcontentmanagementpublishingsearchesclassgetbypathtopic.asp)
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Varad" <varasani@gmail.com> wrote in message
news:08A88CBA-4B24-4DA2-BA36-C6B6336C135C@microsoft.com...
| Quote: | Hi Stefan
I'm passing the name of the posting to a CMStemplate through query
string.
In this template I want to get the CMS collection (includes all
placeholders)
for that posting. How do I do this? I looked through the PAPI guide, but
coudnt locate this one. Thanks
V |
|
|
| Back to top |
|
 |
Varad
Guest
|
Posted:
Tue Jan 11, 2005 6:59 am Post subject:
Re: Getting CMSObject based on Posting: |
|
|
Thanks Angus. I greatly appreciate your help.
"Angus Logan [MVP]" wrote:
| Quote: | Hi,
The Posting object (that contains a collection of placeholders among other
things) can be loaded by its path using the Searches object.
You need to check out the Searches.GetByPath method
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sitedevl/htm/frlrfmicrosoftcontentmanagementpublishingsearchesclassgetbypathtopic.asp)
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Varad" <varasani@gmail.com> wrote in message
news:08A88CBA-4B24-4DA2-BA36-C6B6336C135C@microsoft.com...
Hi Stefan
I'm passing the name of the posting to a CMStemplate through query
string.
In this template I want to get the CMS collection (includes all
placeholders)
for that posting. How do I do this? I looked through the PAPI guide, but
coudnt locate this one. Thanks
V
|
|
|
| Back to top |
|
 |
Varad
Guest
|
Posted:
Wed Jan 12, 2005 1:09 am Post subject:
Re: Getting CMSObject based on Posting: |
|
|
Hi Angus I'm getting an error trying to search by posting. Can you please
tell me what the error is:
Dim curPostingPath = Request.QueryString("CurPath")
Dim curPostingName = Request.QueryString("posting")
Dim curPostingObject As Searches
Dim newObject As Object = curPostingObject.GetByPath(curPostingPath)
I'm getting the error "Object reference not set to an instance of an
object." where I'm doing the GetByPath.
Thanks.
"Angus Logan [MVP]" wrote:
| Quote: | Hi,
The Posting object (that contains a collection of placeholders among other
things) can be loaded by its path using the Searches object.
You need to check out the Searches.GetByPath method
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sitedevl/htm/frlrfmicrosoftcontentmanagementpublishingsearchesclassgetbypathtopic.asp)
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Varad" <varasani@gmail.com> wrote in message
news:08A88CBA-4B24-4DA2-BA36-C6B6336C135C@microsoft.com...
Hi Stefan
I'm passing the name of the posting to a CMStemplate through query
string.
In this template I want to get the CMS collection (includes all
placeholders)
for that posting. How do I do this? I looked through the PAPI guide, but
coudnt locate this one. Thanks
V
|
|
|
| Back to top |
|
 |
Stefan [MSFT]
Guest
|
Posted:
Wed Jan 12, 2005 2:01 am Post subject:
Re: Getting CMSObject based on Posting: |
|
|
Hi Varad,
that usually indicates that either the path does not exist or the current
user does not have rights to this channel.
Cheers,
Stefan.
"Varad" <varasani@gmail.com> wrote in message
news:F514AB27-DBF0-40D8-AB51-6F93F805AE97@microsoft.com...
| Quote: | Hi Angus I'm getting an error trying to search by posting. Can you please
tell me what the error is:
Dim curPostingPath = Request.QueryString("CurPath")
Dim curPostingName = Request.QueryString("posting")
Dim curPostingObject As Searches
Dim newObject As Object = curPostingObject.GetByPath(curPostingPath)
I'm getting the error "Object reference not set to an instance of an
object." where I'm doing the GetByPath.
Thanks.
"Angus Logan [MVP]" wrote:
Hi,
The Posting object (that contains a collection of placeholders among
other
things) can be loaded by its path using the Searches object.
You need to check out the Searches.GetByPath method
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sitedevl/h |
tm/frlrfmicrosoftcontentmanagementpublishingsearchesclassgetbypathtopic.asp)
| Quote: |
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Varad" <varasani@gmail.com> wrote in message
news:08A88CBA-4B24-4DA2-BA36-C6B6336C135C@microsoft.com...
Hi Stefan
I'm passing the name of the posting to a CMStemplate through query
string.
In this template I want to get the CMS collection (includes all
placeholders)
for that posting. How do I do this? I looked through the PAPI guide,
but
coudnt locate this one. Thanks
V
|
|
|
| Back to top |
|
 |
Varad
Guest
|
Posted:
Wed Jan 12, 2005 2:27 am Post subject:
Re: Getting CMSObject based on Posting: |
|
|
So my syntax is right? But the path exists. I have a posting test 7 under
channel main. So the path I'm passing is /Channels/main/test7. That is a
valid path. The same user was able to post the posting. Why would user rights
be an issue now? I'm not sure if that is the case here. Thanks for your time
Stefan.
"Stefan [MSFT]" wrote:
| Quote: | Hi Varad,
that usually indicates that either the path does not exist or the current
user does not have rights to this channel.
Cheers,
Stefan.
"Varad" <varasani@gmail.com> wrote in message
news:F514AB27-DBF0-40D8-AB51-6F93F805AE97@microsoft.com...
Hi Angus I'm getting an error trying to search by posting. Can you please
tell me what the error is:
Dim curPostingPath = Request.QueryString("CurPath")
Dim curPostingName = Request.QueryString("posting")
Dim curPostingObject As Searches
Dim newObject As Object = curPostingObject.GetByPath(curPostingPath)
I'm getting the error "Object reference not set to an instance of an
object." where I'm doing the GetByPath.
Thanks.
"Angus Logan [MVP]" wrote:
Hi,
The Posting object (that contains a collection of placeholders among
other
things) can be loaded by its path using the Searches object.
You need to check out the Searches.GetByPath method
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sitedevl/h
tm/frlrfmicrosoftcontentmanagementpublishingsearchesclassgetbypathtopic.asp)
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Varad" <varasani@gmail.com> wrote in message
news:08A88CBA-4B24-4DA2-BA36-C6B6336C135C@microsoft.com...
Hi Stefan
I'm passing the name of the posting to a CMStemplate through query
string.
In this template I want to get the CMS collection (includes all
placeholders)
for that posting. How do I do this? I looked through the PAPI guide,
but
coudnt locate this one. Thanks
V
|
|
|
| Back to top |
|
 |
Varad
Guest
|
Posted:
Wed Jan 12, 2005 5:05 am Post subject:
Re: Getting CMSObject based on Posting: |
|
|
I found out why I was getting the error. I forgot to instantiate a new
CMsApplicationContext! I'm able to retrieve the posting now.
Dim curPostingPath = Request.QueryString("CurPath").ToString
Dim curPostingName = Request.QueryString("posting").ToString
Dim curPostingObject As Searches
Dim cmsAppCtx As CmsApplicationContext
->>Added this: cmsAppCtx = New CmsApplicationContext
cmsAppCtx.AuthenticateAsCurrentUser(PublishingMode.Published)
Dim newObject As Posting = cmsAppCtx.Searches.GetByPath(curPostingPath)
"Stefan [MSFT]" wrote:
| Quote: | Hi Varad,
that usually indicates that either the path does not exist or the current
user does not have rights to this channel.
Cheers,
Stefan.
"Varad" <varasani@gmail.com> wrote in message
news:F514AB27-DBF0-40D8-AB51-6F93F805AE97@microsoft.com...
Hi Angus I'm getting an error trying to search by posting. Can you please
tell me what the error is:
Dim curPostingPath = Request.QueryString("CurPath")
Dim curPostingName = Request.QueryString("posting")
Dim curPostingObject As Searches
Dim newObject As Object = curPostingObject.GetByPath(curPostingPath)
I'm getting the error "Object reference not set to an instance of an
object." where I'm doing the GetByPath.
Thanks.
"Angus Logan [MVP]" wrote:
Hi,
The Posting object (that contains a collection of placeholders among
other
things) can be loaded by its path using the Searches object.
You need to check out the Searches.GetByPath method
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sitedevl/h
tm/frlrfmicrosoftcontentmanagementpublishingsearchesclassgetbypathtopic.asp)
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Varad" <varasani@gmail.com> wrote in message
news:08A88CBA-4B24-4DA2-BA36-C6B6336C135C@microsoft.com...
Hi Stefan
I'm passing the name of the posting to a CMStemplate through query
string.
In this template I want to get the CMS collection (includes all
placeholders)
for that posting. How do I do this? I looked through the PAPI guide,
but
coudnt locate this one. Thanks
V
|
|
|
| Back to top |
|
 |
|
|
|
|