|
Home > Archive > Microsoft Content Management Server > December 2005 > Update html placeholder problem
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 |
Update html placeholder problem
|
|
| Ismail Mayat 2005-12-23, 7:49 am |
| Hello all,
I have a problem with a .net windows app that I have written. I am using
win xp mcms2002 sp1 and .net. My application loops through all channels /
postings and html placeholders. When it encounters html placeholder I am
using html tidy and some xsls to clean up the content.
I clean the content save back to html placeholder. Submit , approve and
commit. I do not get any errors the content is definately saving to the cms
repository becuase when i test a clean posting my retriveing it using my
windows application i can see that the originally word created content does
not have any word formatting in it.
The issue is that when i navigate to website I am still seeing old content.
I have tried clearing the cms cache to no avail.
The snippets of code below detail some of things that I am doing in the
application
this is how i am creating cms application context as you can see i have
selected update mode
CmsApplicationContext oCMS = new CmsApplicationContext();
oCMS. AuthenticateAsUser(sUser,sPass,Publishin
gMode.Update);
when processing posting i loop through postings placeholders and test if its
html then as per code below cast it to htmlplaceholder
HtmlPlaceholder oHtmlPh = objPH as HtmlPlaceholder;
string strHTML = oHtmlPh.Html;
strHTML =cleanUp(strHTML) //remove word and stlyes using html tidy
oHtmlPh.Html = strHTML;
In another function after processing all the html placeholders for a given
posting i do
if (objPostTosave.CanSubmit)
{
Logger.Debug("submitting " + objPostTosave.DisplayName);
objPostTosave.Submit();
// Do not forget to commit your changes back to CMS.
_objMCMSDAL.CMS.CommitAll();
Logger.Debug("submitted");
}
if (objPostTosave.State == PostingState.WaitingForEditorApproval)
{
Logger.Debug("Approving " + objPostTosave.DisplayName);
objPostTosave.Approve();
_objMCMSDAL.CMS.CommitAll();
Logger.Debug("approved");
}
if (objPostTosave.State == PostingState.WaitingForModeratorApproval)
{
Logger.Debug("By passing waiting for moderator for posting " +
objPostTosave.DisplayName);
objPostTosave.Approve();
_objMCMSDAL.CMS.CommitAll();
Logger.Debug("approved");
}
Any one any suggestions??
| |
| Stefan [MSFT] 2005-12-23, 7:49 am |
| Hi Ismail,
do you have ASP.NET output caching implemented?
Then you need to wait till the cache is expired.
Also check if the time on the SQL server and the MCMS server is
synchronized.
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
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Ismail Mayat" <IsmailMayat@discussions.microsoft.com> wrote in message
news:56163AD6-886E-4209-9310-1D1A6CFFBEC8@microsoft.com...
> Hello all,
>
> I have a problem with a .net windows app that I have written. I am using
> win xp mcms2002 sp1 and .net. My application loops through all channels /
> postings and html placeholders. When it encounters html placeholder I am
> using html tidy and some xsls to clean up the content.
>
> I clean the content save back to html placeholder. Submit , approve and
> commit. I do not get any errors the content is definately saving to the
> cms
> repository becuase when i test a clean posting my retriveing it using my
> windows application i can see that the originally word created content
> does
> not have any word formatting in it.
>
> The issue is that when i navigate to website I am still seeing old
> content.
> I have tried clearing the cms cache to no avail.
>
> The snippets of code below detail some of things that I am doing in the
> application
>
>
> this is how i am creating cms application context as you can see i have
> selected update mode
>
> CmsApplicationContext oCMS = new CmsApplicationContext();
> oCMS. AuthenticateAsUser(sUser,sPass,Publishin
gMode.Update);
>
> when processing posting i loop through postings placeholders and test if
> its
> html then as per code below cast it to htmlplaceholder
>
>
> HtmlPlaceholder oHtmlPh = objPH as HtmlPlaceholder;
> string strHTML = oHtmlPh.Html;
>
> strHTML =cleanUp(strHTML) //remove word and stlyes using html tidy
>
> oHtmlPh.Html = strHTML;
>
> In another function after processing all the html placeholders for a given
> posting i do
>
>
> if (objPostTosave.CanSubmit)
> {
> Logger.Debug("submitting " + objPostTosave.DisplayName);
> objPostTosave.Submit();
> // Do not forget to commit your changes back to CMS.
> _objMCMSDAL.CMS.CommitAll();
> Logger.Debug("submitted");
> }
> if (objPostTosave.State == PostingState.WaitingForEditorApproval)
> {
> Logger.Debug("Approving " + objPostTosave.DisplayName);
> objPostTosave.Approve();
> _objMCMSDAL.CMS.CommitAll();
> Logger.Debug("approved");
> }
> if (objPostTosave.State == PostingState.WaitingForModeratorApproval)
> {
> Logger.Debug("By passing waiting for moderator for posting " +
> objPostTosave.DisplayName);
> objPostTosave.Approve();
> _objMCMSDAL.CMS.CommitAll();
> Logger.Debug("approved");
> }
>
>
>
> Any one any suggestions??
>
>
>
| |
| Ismail Mayat 2005-12-23, 7:49 am |
| Stefan,
With regards to caching on dev site its not enabled ie the global.asx.cs
does not inherit from CmsHttpContext. Also in the template files there are
no caching directives.
With regards to to time syncronisation im not to sure how to check. However
I do have a server with db and mcms on the same server called hq_server_04.
I also have another mcms dev install on my local pc which points to db on
hq_server_04.
Also with regards to caching would restarting server /pc and clearing the
cache using sca not mean that cache is cleared.
Many thanks .
| |
| Stefan [MSFT] 2005-12-23, 7:49 am |
| Hi Ismail,
clicking the clear cache button only clears the MCMS Node cache.
Not any other caches.
Your problem is strange and you should open a support case for this.
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
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Ismail Mayat" <IsmailMayat@discussions.microsoft.com> wrote in message
news:C88623F0-B3A6-4333-B580-DFB625E2C9C6@microsoft.com...
> Stefan,
>
> With regards to caching on dev site its not enabled ie the global.asx.cs
> does not inherit from CmsHttpContext. Also in the template files there
> are
> no caching directives.
>
> With regards to to time syncronisation im not to sure how to check.
> However
> I do have a server with db and mcms on the same server called
> hq_server_04.
> I also have another mcms dev install on my local pc which points to db on
> hq_server_04.
>
> Also with regards to caching would restarting server /pc and clearing the
> cache using sca not mean that cache is cleared.
>
> Many thanks .
|
|
|
|
|