|
Home > Archive > Microsoft Content Management Server > August 2005 > how to save content in posting
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to save content in posting
|
|
|
| Hello,
I 've created channel end postings with publishing API, and i want to insert
content in place holder in this postings. I can edit but i can't save
content. In order to save page I'm using user control with functions :
submit(); and commitAll();
--
regards,
Nihal
| |
| Danny Hille 2005-08-25, 7:49 am |
| missing info: are you using CmsHttpContext.Current.CommitAll() ?
Posting p = CmsHttpContext.Searches.GetBy... as Posting;
if(p!=null)
{
for(int i=0;i<p.Placeholders.Count;i++)
{
p.Placeholders[i].Datasource.RawContent =
p.Placeholders[i].Datasource.RawContent.Replace("test","MyLittleTest");
}
if(p.CanSubmit)p.Submit();
if(p.CanApprove)p.Approve();
CmsHttpContext.Current.CommitAll();
}
Check if the posting is approved! the user migt not have approval rights...
"nihal" wrote:
> Hello,
>
> I 've created channel end postings with publishing API, and i want to insert
> content in place holder in this postings. I can edit but i can't save
> content. In order to save page I'm using user control with functions :
> submit(); and commitAll();
> --
> regards,
> Nihal
| |
|
| Yes, I'm using CmsHttpContext.Current.Approve();
what I 'm trying to save into the place holder I edit it from Internet
Explorer. But I'm not using the defautConsole for saving content. I'm using
my own user control
you see ?
thanks for your help
--
Regards,
Nihal
"Danny Hille" a écrit :
[vbcol=seagreen]
> missing info: are you using CmsHttpContext.Current.CommitAll() ?
>
> Posting p = CmsHttpContext.Searches.GetBy... as Posting;
> if(p!=null)
> {
> for(int i=0;i<p.Placeholders.Count;i++)
> {
> p.Placeholders[i].Datasource.RawContent =
> p.Placeholders[i].Datasource.RawContent.Replace("test","MyLittleTest");
> }
> if(p.CanSubmit)p.Submit();
> if(p.CanApprove)p.Approve();
> CmsHttpContext.Current.CommitAll();
>
> }
>
> Check if the posting is approved! the user migt not have approval rights...
>
>
>
> "nihal" wrote:
>
| |
| Danny Hille 2005-08-25, 6:02 pm |
| Xref: number1.nntp.dca.giganews.com microsoft.public.cmserver.general:53426
If you are out of cms context (you might be calling a separate Aspx file with
the guid param) You need to Use CmsApplicationContext
ex:
try{
CmsApplicationContext cac = new CmsApplicationContext();
cac. AuthenticateAsCurrentUser(PublishingMode
.Update);
//find the posting
Posting p = cac.SearchByGuid("your posting GUID") as Posting;
//Do stuff to your posting
if(p.CanSubmit)p.Submit();
if(p.CanApprove)p.Approve();
CmsHttpContext.Current.CommitAll();
finally
{
if(cac!=null)cac.Dispose();
}
"nihal" wrote:
[vbcol=seagreen]
> Yes, I'm using CmsHttpContext.Current.Approve();
> what I 'm trying to save into the place holder I edit it from Internet
> Explorer. But I'm not using the defautConsole for saving content. I'm using
> my own user control
> you see ?
>
> thanks for your help
> --
> Regards,
> Nihal
>
>
> "Danny Hille" a écrit :
>
| |
| Stefan [MSFT] 2005-08-26, 7:53 am |
| Hi Nihal,
you need to ensure that your user control renders links to the same console
actions as the default console.
You can customize these to image links, hyperlinks or buttons but you need
to use the same console actions - or custom console actions you can create
if you like.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"nihal" <nihal_101@hotmail.com> wrote in message
news:CFFE61A9-0201-43E9-AAE1-0ED8DEE0E087@microsoft.com...[vbcol=seagreen]
> Yes, I'm using CmsHttpContext.Current.Approve();
> what I 'm trying to save into the place holder I edit it from Internet
> Explorer. But I'm not using the defautConsole for saving content. I'm
> using
> my own user control
> you see ?
>
> thanks for your help
> --
> Regards,
> Nihal
>
>
> "Danny Hille" a écrit :
>
|
|
|
|
|