Re: Url Replacement in HTMLplaceholder results ?nrmode=unpublished
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 > Re: Url Replacement in HTMLplaceholder results ?nrmode=unpublished




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

    Re: Url Replacement in HTMLplaceholder results ?nrmode=unpublished  
Danny Hille


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


 
08-31-05 12:49 PM

After a lot of testing peeking and poking I ended up where i started.
- New day same problem.

I rewrote my code to use the methods exposed by the plaveholdercontroles.
That did not help at all, i checked the url was valid. infact i wrote a test
aspx page
that takes a posting as a querystringparameter.
and enables you to edit the xml/html placeholdres on a page.
using this method the urls are still being written to the server as
?REMODE=Unpublished (even though I use updatemode)

Please help me, or direct me to a consulent that can help with this problem.

To minimize the amount of code i just unclude the save method.

//--------------------------------------------------------------------------
--------------------
//  savePostingDetails
//--------------------------------------------------------------------------
--------------------
string savePostingDetails()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string pguid = Request.Form["postingGUID"];
if(pguid!=null && pguid!="")
{
CmsApplicationContext cac = new CmsApplicationContext();
try
{
string un=Session["VELUXCMSUser"] as String;
string pw=Session["VELUXCMSPassword"] as String;
if(un!=null && pw!=null)
{
//This ugly hack is to support formslogin/autologin (is doesnot matter
if we use formslogin of windows authentication)
//the MCMS urls are still saved as nrmode=unpublished
//Te reason i dont use CmsHttpContext.Current.... is that this code is
not nessarely called from a template
cac.AuthenticateAsUser( un,pw,PublishingMode.Unpublished);
}
else
{
cac. AuthenticateAsCurrentUser(PublishingMode
.Update);
}
Posting p = cac.Searches.GetByGuid(pguid)as Posting;
if(p!=null)
{
if(p.CanSetProperties)
{
bool shouldsubmit = false;
//Set DisplayName
string postingDisplayName =
Server.UrlDecode(Request.Form["postingDisplayName"]);
if(postingDisplayName!=null && postingDisplayName!=p.DisplayName)
p.DisplayName = postingDisplayName;

//Set Name
string postingName = Request.Form["postingName"];
if(postingName!=null && postingName!=p.Name)
p.Name = postingName;

//Set Discription
string postingDescription = Request.Form["postingDescription"];
if(postingDescription!=null && postingDescription!=p.Description)
p.Description = postingDescription;

for(int i=0;i<p.Placeholders.Count;i++)
{
string type = "";
string raw = "";
string placeHolderContent =
Request.Form["postingPlaceholder_"+p.Placeholders[i].Name];
if(placeHolderContent!=null)
{
string content = "";
if(p.Placeholders[i] is XmlPlaceholder)
{
//do stuff for the XmlPlaceholder
}
else if(p.Placeholders[i] is HtmlPlaceholder)
{
//save HtmlPlaceholder content if content differs from postdate
type = "HtmlPlaceholder";
HtmlPlaceholder hph = p.Placeholders[i] as HtmlPlaceholder;
if(hph!=null)
{
content = hph.Html;
if(content!=placeHolderContent)
{
hph.Html = placeHolderContent;
shouldsubmit=true;
}
}
}
else
{
type = "Other";
//Discard if other
}
}
}
if(shouldsubmit)
{
if(p.CanSubmit)
{
p.Submit();
}
if(p.CanApprove)
{
p.Approve();
}
cac.CommitAll();
}
}
}

}
catch(Exception ex)
{
string exc = ex.ToString();
sb.Append(exc);
}
finally{cac.Dispose();}
}
// debug
sb.Append("<tt>");
for(int i=0;i< Request.Form.Count;i++)
{
sb.Append(Request.Form.AllKeys[i] + " = " +
Request.Form[i].Replace("<","<").Replace(">",">") + "<br>");
}
sb.Append("</tt></div>");
return sb.ToString();
}

Thanks
Danny





[ Post a follow-up to this message ]



    Sponsored Links  




 





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