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




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Customizing delete  
Randall


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


 
02-25-05 07:50 AM

Hi all,

I am trying to customizing the delete action and for that I am writing code
in this module.
protected override void PerformActionBehavior()
{

base.PerformActionBehavior();
customcode();
}

Looks like this module is never called. Any suggestions?

Thanks!
Randall






[ Post a follow-up to this message ]



    Re: Customizing delete  
Frank Joppe


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


 
02-25-05 10:49 PM

Randall:

Did you write this custom code in a custom control? Are you sure you
are using this custom control in your console or a substitution of it?

"examnotes" <Randall@discussions.microsoft.com> wrote in message news:<69E705
A6-3139-4A03-A39A-538EE8B561E5@microsoft.com>...
> Hi all,
>
> I am trying to customizing the delete action and for that I am writing cod
e
> in this module.
> protected override void PerformActionBehavior()
> 		{
>
> 			base.PerformActionBehavior();
> 			customcode();
> 		}
>
> Looks like this module is never called. Any suggestions?
>
> Thanks!
> Randall





[ Post a follow-up to this message ]



    Re: Customizing delete  
Stefan [MSFT]


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


 
02-25-05 10:49 PM

Hi Randall,

if it never gets called, then you might not have added your custom action to
the defaultconsole.ascx file.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights
Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
----------------------


"Randall" <Randall@discussions.microsoft.com> wrote in message
news:69E705A6-3139-4A03-A39A-538EE8B561E5@microsoft.com...
> Hi all,
>
> I am trying to customizing the delete action and for that I am writing
code
> in this module.
> protected override void PerformActionBehavior()
> {
>
> base.PerformActionBehavior();
> customcode();
> }
>
> Looks like this module is never called. Any suggestions?
>
> Thanks!
> Randall
>







[ Post a follow-up to this message ]



    Re: Customizing delete  
Randall


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


 
02-25-05 10:49 PM

Stefan,

What do you mean by custom action? Delete.cs or the customcode() method?

Thanks!
Randall

"Stefan [MSFT]" wrote:

> Hi Randall,
>
> if it never gets called, then you might not have added your custom action 
to
> the defaultconsole.ascx file.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
> Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
> ----------------------
>
>
> "Randall" <Randall@discussions.microsoft.com> wrote in message
> news:69E705A6-3139-4A03-A39A-538EE8B561E5@microsoft.com... 
> code 
>
>
>





[ Post a follow-up to this message ]



    Re: Customizing delete  
Randall


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


 
02-25-05 10:49 PM

Stafan and Frank,

Thanks for replying  back to me.
Custom control is a function defined in that delete.cs file. and in
PerformActionBehaviour after calling the Base.PerformBehaviourAction I am
trying to call this function.
I am sure that this delete.cs is called because I have added it
defaultconsole.ascx.

If I do debugging then Control goes in that module and does everything but
if I just run the application then after deleteing the posting nothing
happens.

Any idea?
I appreciate your help.

Thanks!!
Randall


"Stefan [MSFT]" wrote:

> Hi Randall,
>
> if it never gets called, then you might not have added your custom action 
to
> the defaultconsole.ascx file.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
> Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
> ----------------------
>
>
> "Randall" <Randall@discussions.microsoft.com> wrote in message
> news:69E705A6-3139-4A03-A39A-538EE8B561E5@microsoft.com... 
> code 
>
>
>





[ Post a follow-up to this message ]



    Re: Customizing delete  
Stefan [MSFT]


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


 
02-25-05 10:49 PM

Hi Randall,

a custom action is one of your actions. You need to add or replace one of
the actions in the defaultconsole.ascx with your own action to get it
implemented.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights
Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
----------------------


"Randall" <Randall@discussions.microsoft.com> wrote in message
news:C2D14449-148B-4DF2-A610-5CA142F92079@microsoft.com...[vbcol=seagreen]
> Stefan,
>
> What do you mean by custom action? Delete.cs or the customcode() method?
>
> Thanks!
> Randall
>
> "Stefan [MSFT]" wrote:
> 
action to[vbcol=seagreen] 
rights[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Customizing delete  
Stefan [MSFT]


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


 
02-25-05 10:49 PM

Hi Randall,

please explain in more detail. You mentioned when doing debugging the
routine is called.
When is it not called?
What is the difference?
I did not understand the explanation below.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights
Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
----------------------


"Randall" <Randall@discussions.microsoft.com> wrote in message
news:078EEDD8-B743-49BD-AEE0-79C6AC47F997@microsoft.com...[vbcol=seagreen]
> Stafan and Frank,
>
> Thanks for replying  back to me.
> Custom control is a function defined in that delete.cs file. and in
> PerformActionBehaviour after calling the Base.PerformBehaviourAction I am
> trying to call this function.
> I am sure that this delete.cs is called because I have added it
> defaultconsole.ascx.
>
> If I do debugging then Control goes in that module and does everything but
> if I just run the application then after deleteing the posting nothing
> happens.
>
> Any idea?
> I appreciate your help.
>
> Thanks!!
> Randall
>
>
> "Stefan [MSFT]" wrote:
> 
action to[vbcol=seagreen] 
rights[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Customizing delete  
Randall


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


 
02-25-05 10:49 PM

I did that . That's how it executes the custom console action except for tha
t
method.
Any idea ? I appreciate you help.

Thanks!
Randall

"Stefan [MSFT]" wrote:

> Hi Randall,
>
> a custom action is one of your actions. You need to add or replace one of
> the actions in the defaultconsole.ascx with your own action to get it
> implemented.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
> Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
> ----------------------
>
>
> "Randall" <Randall@discussions.microsoft.com> wrote in message
> news:C2D14449-148B-4DF2-A610-5CA142F92079@microsoft.com... 
> action to 
> rights 
>
>
>





[ Post a follow-up to this message ]



    Re: Customizing delete  
Stefan [MSFT]


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


 
02-25-05 10:49 PM

Hi Randall,

please post your complete code.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights
Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
----------------------


"Randall" <Randall@discussions.microsoft.com> wrote in message
news:4A4BF6BA-C631-492D-AADD-DAFCDBD634F7@microsoft.com...
> I did that . That's how it executes the custom console action except for
that[vbcol=seagreen]
> method.
> Any idea ? I appreciate you help.
>
> Thanks!
> Randall
>
> "Stefan [MSFT]" wrote:
> 
of[vbcol=seagreen] 
rights[vbcol=seagreen] 
method?[vbcol=seagreen] 
writing[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Customizing delete  
Randall


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


 
02-25-05 10:49 PM

Stefan,
Here is the code.
====================
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using Microsoft.ContentManagement.Publishing;
using Microsoft.ContentManagement.Publishing.Extensions.Placeholders;
using Microsoft.ContentManagement.Web;
using Microsoft.ContentManagement.WebAuthor;
using Microsoft.ContentManagement.WebControls;
using Microsoft.ContentManagement.WebControls.ConsoleControls;
using System.Data.SqlClient;
using System.Xml;

namespace CMSCustomControls
{
/// <summary>
/// Summary description for Delete.
/// </summary>
public class Delete :
Microsoft.ContentManagement.WebControls.ConsoleControls.DeleteAction
{
public Delete()
{
//
// TODO: Add constructor logic here
//

}



public override string Text
{
get
{
return "Delete";
}
}
//

public override string ActionJavascript
{
get
{
if((CmsHttpContext.Current.Posting.Name.ToLower()=="default")||(CmsHttpConte
xt.Current.Posting.Template.Name=="Topics"))
{
if(CmsHttpContext.Current.Posting.CustomProperties["Delete"].Value ==
"False")
{
string returnValue;
returnValue = "window.alert('You can not delete this posting.')";
return returnValue;
}


else
{
string action = base.ActionJavascript;
return action;
}
}
else
{
string action = base.ActionJavascript;
return action;
}
}
}

protected override void PerformActionBehavior()
{

base.PerformActionBehavior();
GenerateRssXml();
}



protected string GetPostingSummary(Posting p)
{
return p.Description;

}

protected void GenerateRssXml()
{
XmlTextWriter Xmlwriter = new XmlTextWriter("c:/news/index1.xml",
Encoding.UTF8);

Xmlwriter.WriteStartElement("rss");
Xmlwriter.WriteAttributeString("version", "2.0");
Xmlwriter.WriteStartElement("channel");

Xmlwriter.WriteElementString("title","News Releases");
Xmlwriter.WriteElementString("link","link");
Xmlwriter.WriteElementString("copyright","© Copyright");
//Xmlwriter.WriteElementString("description","Description of your Web
site");
int i=0;
PostingCollection pc = newschannel.Postings ;
foreach (Posting p in newschannel.Postings )
{
Xmlwriter.WriteElementString("title",title);
Xmlwriter.WriteElementString("link","+p.url" );
Xmlwriter.WriteElementString("pubDate",p.StartDate.ToLocalTime().ToString("r
"));
Xmlwriter.WriteElementString("description",GetPostingSummary(p);
Xmlwriter.WriteElementString("pubDate",p.StartDate
.ToLocalTime().ToString("r"));
Xmlwriter.WriteEndElement();
Xmlwriter.Close();


}

}
}
=============================
index1.xml is never created.

Did I miss something?

Thanks!
Randall

"Stefan [MSFT]" wrote:

> Hi Randall,
>
> please post your complete code.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
> Book: Building Websites Using MCMS: http://tinyurl.com/56jt8
> ----------------------
>
>
> "Randall" <Randall@discussions.microsoft.com> wrote in message
> news:4A4BF6BA-C631-492D-AADD-DAFCDBD634F7@microsoft.com... 
> that 
> of 
> rights 
> method? 
> writing 
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:41 AM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   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