erver error. Contact the site administrator. Source: Resolution Object Model
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 > erver error. Contact the site administrator. Source: Resolution Object Model




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

    erver error. Contact the site administrator. Source: Resolution Object Model  
hemlata_shah@yahoo.com


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


 
08-22-05 10:57 PM

Hi Stephan
I am running out into a problem while submitting a posting.
I am using HTML Placeholders on the template there are some custom
properties.
There is TreeNodeCollection which we use to show the posting.

We are using the following code in btnTopSaveforPreview_Click()
posting.Approve();
AppContext.CommitAll();
posting.ReleaseOwnership();
AppContext.CommitAll();
On clicking the Preview button, btnTopSaveforPreview_Click() is invoked
We get a error "Exception: System.Runtime.InteropServices.COMException
Message: Server error. Contact the site administrator. Source:
Resolution Object Model at
Microsoft.ContentManagement.Interop.Publishing.IRcwPlaceholder.set_RawConten
t(String
RawContent) at
Microsoft.ContentManagement.Publishing.DefaultPlaceholderDatasource.set_RawC
ontent(String
value) at
TF.ML.Online.ContentMgmtPub.userControls.Admin.CMAManageContentType.btnTopSa
veforPreview_Click(Object
sender, EventArgs e)"

Can you plz let me what exactly can be the problem?
This a bit urgent, as this is happening on one of the production
server....
Any help on this would be highly appreciated.

Regards
HS






[ Post a follow-up to this message ]



    Re: erver error. Contact the site administrator. Source: Resolution Object Model  
Shawn


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


 
08-22-05 10:57 PM

I'm not Stefan but...

I have a few questions:
1) Is this a new posting or an existing posting?
2) What permissions does the user executing the code have?
3) Are you affecting the values inside the placeholders on the posting?
4) Is the application a web-based application or WinForm?

It's a little unclear exactly what you're trying to accomplish and
what's happening, in code, beyond the snippet your provided.

Shawn






[ Post a follow-up to this message ]



    Re: erver error. Contact the site administrator. Source: Resolution Object Model  
Stefan [MSFT]


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


 
08-22-05 10:57 PM

Hi HS,

the call stack shows that a placeholder is being updated from inside the
btnTopSaveforPreview event.
And here something goes wrong.

Is there some code you did not list below?
Or are there workflow events registered? Then please disable them and test
again.

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
----------------------


<hemlata_shah@yahoo.com> wrote in message
news:1124735065.322076.191040@g43g2000cwa.googlegroups.com...
> Hi Stephan
>  I am running out into a problem while submitting a posting.
> I am using HTML Placeholders on the template there are some custom
> properties.
> There is TreeNodeCollection which we use to show the posting.
>
> We are using the following code in btnTopSaveforPreview_Click()
>  posting.Approve();
> AppContext.CommitAll();
> posting.ReleaseOwnership();
>        AppContext.CommitAll();
> On clicking the Preview button, btnTopSaveforPreview_Click() is invoked
> We get a error "Exception: System.Runtime.InteropServices.COMException
> Message: Server error. Contact the site administrator. Source:
> Resolution Object Model at
> Microsoft.ContentManagement.Interop.Publishing.IRcwPlaceholder.set_RawCont
ent(String
> RawContent) at
> Microsoft.ContentManagement.Publishing.DefaultPlaceholderDatasource.set_Ra
wContent(String
> value) at
> TF.ML.Online.ContentMgmtPub.userControls.Admin.CMAManageContentType.btnTop
SaveforPreview_Click(Object
> sender, EventArgs e)"
>
> Can you plz let me what exactly can be the problem?
> This a bit urgent, as this is happening on one of the production
> server....
> Any help on this would be highly appreciated.
>
> Regards
> HS
>







[ Post a follow-up to this message ]



    Re: erver error. Contact the site administrator. Source: Resolution Object Model  
hemlata_shah@yahoo.com


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


 
08-23-05 10:53 PM

private void btnTopSaveforPreview_Click(object sender, System.EventArgs
e)
{
try
{

string historychannels =
posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawConten
t;
string selectedchannels =
posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent;

// Creating he XML for Channel Tree

TreeNodeCollection nodes =  ChannelTree.Nodes;
this.SelectedChannels = null;
this.SelectedChannels = new StringCollection();

foreach(TreeNode node in nodes)
{
this.getAllSelectedChannels(node);
}


// You now have the set of selected channels in the collection
// SelectedChannels

// Save the channels in the XMLPlaceHolderControl
XmlDocument xmlChannels = new XmlDocument();
XmlNode xmlnode;
XmlElement element;

// Creating the XML Structure
xmlChannels.LoadXml("<Channels></Channels>");

foreach(string chSelectedChannels in SelectedChannels)
{
xmlnode = xmlChannels.CreateNode(XmlNodeType.Element, "Channel",""
);
xmlnode.InnerText = chSelectedChannels;
element = xmlChannels.DocumentElement;
element.AppendChild(xmlnode);

}

// Persisting SelectedChannelsHistory in SelectedChannels

historychannels =
posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawConten
t;
selectedchannels =
posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent;

posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent
= "<Channels></Channels>";
posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent
= xmlChannels.InnerXml;

posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawConten
t
= "<Channels></Channels>";
if(selectedchannels.Length>0)
posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawConten
t
= selectedchannels;


// Setting the  Posting Status to Saved. Production/ContentTypes
posting.CustomProperties["ProcessStatus"].Value = "Saved";
posting.CustomProperties["IsInPreview"].Value = "1";
posting.CustomProperties["IsInProduction"].Value = "0";

// Setting the  Posting Status to Saved. Initial Setup Properties
initposting.CustomProperties["ProcessStatus"].Value = "Saved";
initposting.CustomProperties["IsInPreview"].Value = "1";
initposting.CustomProperties["IsInProduction"].Value = "0";

// Call procedure for Admin and Saved
this.EnableForAdmin_Saved();

posting.Approve();
initposting.Approve();

AppContext.CommitAll();
posting.ReleaseOwnership();
initposting.ReleaseOwnership();
AppContext.CommitAll();

// Showing message to the user
string message =
context.SystemMessages. GetMessage(SystemMessagesCustomizationPa
rameters.Mess
ageEnum.MR31);
base.SetMessage(message) ;

}
catch(Exception excep)
{
// Handle Exception here
base.SetError(excep);
}

# region Posting in Site Map
// From here

try
{
// Call getAllSelectedChannels
// All Selected channels can be accessed by calling the
getAllSelectedChannels()
string selectedChannelList =
posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent ;

string currentHistorychannels =
posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawConten
t;

if(selectedChannelList.Length==0)
{
selectedChannelList = "<channels></channels>";
}

if(currentHistorychannels.Length==0)
{
currentHistorychannels = "<channels></channels>";
}

StringCollection deSelectedChannels = new StringCollection();

Template tTemplate = (Template)
AppContext.Searches.GetByPath("/Templates/lol/sec/en/Shared/Template1H");

string prodarticleguid = posting.Guid;

XmlDocument xmlChannels = new XmlDocument();
xmlChannels.LoadXml(selectedChannelList);

XmlDocument xmlHistoryChannels = new XmlDocument();
xmlHistoryChannels.LoadXml(currentHistorychannels);

string channel = string.Empty ;
Channel prodChannel = null;

CopyPostingDao copyDao = (CopyPostingDao)
base.GetDao(typeof(CopyPostingDao));

bool channelDeselected = true;

foreach(XmlElement historyElement in
xmlHistoryChannels.GetElementsByTagName("Channel"))
{
channelDeselected = true;
foreach(XmlElement selectedElement in
xmlChannels.GetElementsByTagName("Channel"))
{
if(selectedElement.InnerText == historyElement.InnerText)
{
channelDeselected = false;
break;
}
}

if (channelDeselected)
{
// This element was deselected
deSelectedChannels.Add(historyElement.InnerXml);
channel = historyElement.InnerText;
prodChannel = (Channel) AppContext.Searches.GetByPath(channel);

prodPosting = (Posting)
AppContext.Searches.GetByPath(channel+posting.Name);
if(prodPosting!=null)
{
prodPosting.Delete();
AppContext.CommitAll();
}
}

}

channel = null;

foreach(XmlElement element in
xmlChannels.GetElementsByTagName("Channel"))
{
// Create Posting using Template1h in the selected Channels
channel = element.InnerText;
prodChannel = (Channel) AppContext.Searches.GetByPath(channel);
// Checking if the Posting exists already, if so, we dont make any
changes
// Otherwise, we create a New Posting using Template1h
prodPosting = (Posting)
AppContext.Searches.GetByPath(channel+posting.Name);
if(prodPosting==null)
{
prodPosting = prodChannel.CreatePosting(tTemplate);

}
else
{
prodPosting.Delete();
AppContext.CommitAll();

prodPosting = prodChannel.CreatePosting(tTemplate);


}

// Name the posting same as the Preview/Article Posting Name
prodPosting.Name = posting.Name;
prodPosting.DisplayName =
RemoveHtmlSUPTags(posting.Placeholders["htmlTitle"].Datasource.RawConten
t.ToString());
string enddate = posting.CustomProperties["EndDate"].Value;
if(enddate.Length>0)
{
prodPosting.ExpiryDate  = DateTime.Parse(enddate);
}

// Set the Prod Posting Object name as the Posting Object name
prodPosting.CustomProperties["ObjectName"].Value =
posting.CustomProperties["ObjectName"].Value;

// Setting the Page ID of the Posting
if(prodPosting.Path.IndexOf("/SiteMap/ProductsandPlanning/") <= 0)
prodPosting.CustomProperties["PageID"].Value  =
"og/Online/ContentManagement/Articles/Standard";
else
prodPosting.CustomProperties["PageID"].Value  =
"og/Online/ContentManagement/Articles/ProdPlanArticle";


// Set IsInProduction Property
prodPosting.CustomProperties["IsInProduction"].Value = "0";

// Set IsInPreview Property
prodPosting.CustomProperties["IsInPreview"].Value = "1";

// Set the Article GUID Custom Property

// for enabling the Article Conroller to pickup the correct GUID
// and for solving the issues about inconsistent GUIDs during
replications
// prodPosting.CustomProperties["ArticleGUID"].Value =
posting.Guid ;
prodPosting.CustomProperties["ArticleGUID"].Value =
posting.CustomProperties["SourceGUID"].Value;

// Approve, Commit and release ownership
// Possiblity of multi-object commit - can show up here -
prodPosting.Approve();
AppContext.CommitAll();
prodPosting.ReleaseOwnership();
AppContext.CommitAll();

}
}
catch(Exception excep)
{
// Handle Exception here
base.SetError(excep);
}

# endregion


}






[ Post a follow-up to this message ]



    Re: erver error. Contact the site administrator. Source: Resolution Object Model  
Stefan [MSFT]


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


 
08-23-05 10:53 PM

Hi,

never use datasource.rawcontent to update a placeholder!
See here for details:

http://blogs.technet.com/stefan_gos.../24/119546.aspx

Please replace these references with the correctly casted placeholder
references.

If the problem still occurs, please attach VS.NET as debugger to the process
and step through the routine to see which of the placeholders is causing the
problem.

Btw: the posting object is not initialized in this method. Where do you set
this object?
Which mode is the CmsContext in when this code is being executed?

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
----------------------


<hemlata_shah@yahoo.com> wrote in message
news:1124821941.498973.224460@g44g2000cwa.googlegroups.com...
> private void btnTopSaveforPreview_Click(object sender, System.EventArgs
> e)
> {
> try
> {
>
> string historychannels =
> posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawCont
ent;
> string selectedchannels =
> posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent;
>
> // Creating he XML for Channel Tree
>
> TreeNodeCollection nodes =  ChannelTree.Nodes;
> this.SelectedChannels = null;
> this.SelectedChannels = new StringCollection();
>
> foreach(TreeNode node in nodes)
> {
> this.getAllSelectedChannels(node);
> }
>
>
> // You now have the set of selected channels in the collection
> // SelectedChannels
>
> // Save the channels in the XMLPlaceHolderControl
> XmlDocument xmlChannels = new XmlDocument();
> XmlNode xmlnode;
> XmlElement element;
>
> // Creating the XML Structure
> xmlChannels.LoadXml("<Channels></Channels>");
>
> foreach(string chSelectedChannels in SelectedChannels)
> {
> xmlnode = xmlChannels.CreateNode(XmlNodeType.Element, "Channel",""
> );
> xmlnode.InnerText = chSelectedChannels;
> element = xmlChannels.DocumentElement;
> element.AppendChild(xmlnode);
>
> }
>
> // Persisting SelectedChannelsHistory in SelectedChannels
>
> historychannels =
> posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawCont
ent;
> selectedchannels =
> posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent;
>
> posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent
> = "<Channels></Channels>";
> posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent
> = xmlChannels.InnerXml;
>
> posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawCont
ent
> = "<Channels></Channels>";
> if(selectedchannels.Length>0)
> posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawCont
ent
> = selectedchannels;
>
>
> // Setting the  Posting Status to Saved. Production/ContentTypes
> posting.CustomProperties["ProcessStatus"].Value = "Saved";
> posting.CustomProperties["IsInPreview"].Value = "1";
> posting.CustomProperties["IsInProduction"].Value = "0";
>
> // Setting the  Posting Status to Saved. Initial Setup Properties
> initposting.CustomProperties["ProcessStatus"].Value = "Saved";
> initposting.CustomProperties["IsInPreview"].Value = "1";
> initposting.CustomProperties["IsInProduction"].Value = "0";
>
> // Call procedure for Admin and Saved
> this.EnableForAdmin_Saved();
>
> posting.Approve();
> initposting.Approve();
>
> AppContext.CommitAll();
> posting.ReleaseOwnership();
> initposting.ReleaseOwnership();
> AppContext.CommitAll();
>
> // Showing message to the user
> string message =
> context.SystemMessages. GetMessage(SystemMessagesCustomizationPa
rameters.Me
ssageEnum.MR31);
> base.SetMessage(message) ;
>
> }
> catch(Exception excep)
> {
> // Handle Exception here
> base.SetError(excep);
> }
>
> # region Posting in Site Map
> // From here
>
> try
> {
> // Call getAllSelectedChannels
> // All Selected channels can be accessed by calling the
> getAllSelectedChannels()
> string selectedChannelList =
> posting.Placeholders["htmlSelectedChannels"].Datasource.RawContent ;
>
> string currentHistorychannels =
> posting.Placeholders["htmlSelectedChannelsHistory"].Datasource.RawCont
ent;
>
> if(selectedChannelList.Length==0)
> {
> selectedChannelList = "<channels></channels>";
> }
>
> if(currentHistorychannels.Length==0)
> {
> currentHistorychannels = "<channels></channels>";
> }
>
> StringCollection deSelectedChannels = new StringCollection();
>
> Template tTemplate = (Template)
> AppContext.Searches.GetByPath("/Templates/lol/sec/en/Shared/Template1H");
>
> string prodarticleguid = posting.Guid;
>
> XmlDocument xmlChannels = new XmlDocument();
> xmlChannels.LoadXml(selectedChannelList);
>
> XmlDocument xmlHistoryChannels = new XmlDocument();
> xmlHistoryChannels.LoadXml(currentHistorychannels);
>
> string channel = string.Empty ;
> Channel prodChannel = null;
>
> CopyPostingDao copyDao = (CopyPostingDao)
> base.GetDao(typeof(CopyPostingDao));
>
> bool channelDeselected = true;
>
> foreach(XmlElement historyElement in
> xmlHistoryChannels.GetElementsByTagName("Channel"))
> {
> channelDeselected = true;
> foreach(XmlElement selectedElement in
> xmlChannels.GetElementsByTagName("Channel"))
> {
> if(selectedElement.InnerText == historyElement.InnerText)
> {
> channelDeselected = false;
> break;
> }
> }
>
> if (channelDeselected)
> {
> // This element was deselected
> deSelectedChannels.Add(historyElement.InnerXml);
> channel = historyElement.InnerText;
> prodChannel = (Channel) AppContext.Searches.GetByPath(channel);
>
> prodPosting = (Posting)
> AppContext.Searches.GetByPath(channel+posting.Name);
> if(prodPosting!=null)
> {
> prodPosting.Delete();
> AppContext.CommitAll();
> }
> }
>
> }
>
> channel = null;
>
> foreach(XmlElement element in
> xmlChannels.GetElementsByTagName("Channel"))
> {
> // Create Posting using Template1h in the selected Channels
> channel = element.InnerText;
> prodChannel = (Channel) AppContext.Searches.GetByPath(channel);
> // Checking if the Posting exists already, if so, we dont make any
> changes
> // Otherwise, we create a New Posting using Template1h
> prodPosting = (Posting)
> AppContext.Searches.GetByPath(channel+posting.Name);
> if(prodPosting==null)
> {
> prodPosting = prodChannel.CreatePosting(tTemplate);
>
> }
> else
> {
> prodPosting.Delete();
> AppContext.CommitAll();
>
> prodPosting = prodChannel.CreatePosting(tTemplate);
>
>
> }
>
> // Name the posting same as the Preview/Article Posting Name
> prodPosting.Name = posting.Name;
> prodPosting.DisplayName =
> RemoveHtmlSUPTags(posting.Placeholders["htmlTitle"].Datasource.RawCont
ent.ToString());
> string enddate = posting.CustomProperties["EndDate"].Value;
> if(enddate.Length>0)
> {
> prodPosting.ExpiryDate  = DateTime.Parse(enddate);
> }
>
> // Set the Prod Posting Object name as the Posting Object name
> prodPosting.CustomProperties["ObjectName"].Value =
> posting.CustomProperties["ObjectName"].Value;
>
> // Setting the Page ID of the Posting
> if(prodPosting.Path.IndexOf("/SiteMap/ProductsandPlanning/") <= 0)
> prodPosting.CustomProperties["PageID"].Value  =
> "og/Online/ContentManagement/Articles/Standard";
> else
> prodPosting.CustomProperties["PageID"].Value  =
> "og/Online/ContentManagement/Articles/ProdPlanArticle";
>
>
> // Set IsInProduction Property
> prodPosting.CustomProperties["IsInProduction"].Value = "0";
>
> // Set IsInPreview Property
> prodPosting.CustomProperties["IsInPreview"].Value = "1";
>
> // Set the Article GUID Custom Property
>
> // for enabling the Article Conroller to pickup the correct GUID
> // and for solving the issues about inconsistent GUIDs during
> replications
> // prodPosting.CustomProperties["ArticleGUID"].Value =
> posting.Guid ;
> prodPosting.CustomProperties["ArticleGUID"].Value =
> posting.CustomProperties["SourceGUID"].Value;
>
> // Approve, Commit and release ownership
> // Possiblity of multi-object commit - can show up here -
> prodPosting.Approve();
> AppContext.CommitAll();
> prodPosting.ReleaseOwnership();
> AppContext.CommitAll();
>
> }
> }
> catch(Exception excep)
> {
> // Handle Exception here
> base.SetError(excep);
> }
>
> # endregion
>
>
> }
>







[ Post a follow-up to this message ]



    Re: erver error. Contact the site administrator. Source: Resolution Object Model  
hemlata_shah@yahoo.com


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


 
08-23-05 10:53 PM

Thanx a lot Stefan for the info.
the posting object is not initialized in this method. Where do you set
this object?  - its been initialized in the page load...
CmsContext Mode is in Saved mode...
I will just go thru ur reply and get back if any queires...

Thanks
Regards
HS






[ Post a follow-up to this message ]



    Re: erver error. Contact the site administrator. Source: Resolution Object Model  
Stefan [MSFT]


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


 
08-23-05 10:53 PM

Hi HS,

that is not the CmsContext mode that is the Posting state.
If you are using the CmsHttpContext then I assume that the mode is either
published or unpublished and not update.
Only in update mode you will be able to update placeholder content.

Please double check: CmsHttpContext.Current.Mode is what needs to be
checked.

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
----------------------


<hemlata_shah@yahoo.com> wrote in message
news:1124825616.608409.261710@o13g2000cwo.googlegroups.com...
> Thanx a lot Stefan for the info.
> the posting object is not initialized in this method. Where do you set
> this object?  - its been initialized in the page load...
> CmsContext Mode is in Saved mode...
> I will just go thru ur reply and get back if any queires...
>
> Thanks
> Regards
> HS
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





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