|
Home > Archive > Microsoft Content Management Server > August 2004 > Release owner when creating new 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 |
Release owner when creating new posting
|
|
| Guy Babbitt 2004-08-27, 6:08 pm |
| I am having a hard time releasing the owner of a posting when I am creating
the initial page. I can release the owner on reedit, but I would also like
to have the option to release the owner when the page is first created.
I have created a class to handle this action and inherited from
AuthoringSaveNewAction. I can succesfully include the option on my console
and I see it when I am creating a new page. The problem I am having is that
the
protected override void PerformActionBehavior()
is never firing. The one big difference between a new page and a reedit is
that you get the webform asking for a name. I am wondering if that is not
causing me to be directed back to the base class causing me to miss the
event.
Any thoughts on how I can either fix this or debug the problem more
effectively?
Guy
| |
| Stefan [MSFT] 2004-08-27, 6:08 pm |
| Hi Guy,
check my solution on this:
http://www.gotdotnet.com/Community/...D4-6D469BE34BC0
This solution contains all necessary console actions.
Cheers,
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Guy Babbitt" <guy_babbitt@fsafood.com> wrote in message
news:#VcBHdGjEHA.556@tk2msftngp13.phx.gbl...
> I am having a hard time releasing the owner of a posting when I am
creating
> the initial page. I can release the owner on reedit, but I would also
like
> to have the option to release the owner when the page is first created.
>
> I have created a class to handle this action and inherited from
> AuthoringSaveNewAction. I can succesfully include the option on my
console
> and I see it when I am creating a new page. The problem I am having is
that
> the
>
> protected override void PerformActionBehavior()
>
> is never firing. The one big difference between a new page and a reedit
is
> that you get the webform asking for a name. I am wondering if that is not
> causing me to be directed back to the base class causing me to miss the
> event.
>
> Any thoughts on how I can either fix this or debug the problem more
> effectively?
>
> Guy
>
>
| |
| Guy Babbitt 2004-08-27, 6:08 pm |
| That is exactly what I am doing, but since mine doesn't work I decided to
give yours a shot. Same behavior. If I put a breakpoint on the base.Text I
will see a break every time the page loads, so I know the class is being
accessed. I also know this because I see the option in my admin console.
When I click the link I am taken to the page where I specify the posting
name. The problem is my breakpoint at base.PerformActionBehavior() is never
hit. Any idea what might cause this. As I mentioned, it only happens
happens here and I don't know if it is because of the actionjavascript in
the base class that throws the "save as" dialog or what else it might be.
public class SaveNewandReleaseOwnership : AuthoringSaveNewAction
{
internal const string ID_FIELD_NEWPAGE_NAME = "WBC_fieldNewPageName";
internal const string ID_FIELD_NEWPAGE_DISPLAYNAME =
"WBC_fieldNewPageDisplayName";
public SaveNewandReleaseOwnership()
{
base.Text = "Save with Release Ownership";
}
protected override void PerformActionBehavior()
{
base.PerformActionBehavior();
PostingCollection pc =
CmsHttpContext.Current.Searches.UserPostingsInProduction();
foreach (Posting p in pc)
{
if (p.Parent.Path == CmsHttpContext.Current.Channel.Path)
{
if (p.Name == Page.Request.Form[ID_FIELD_NEWPAGE_NAME])
{
p.ReleaseOwnership();
CmsHttpContext.Current.CommitAll();
}
}
}
}
}
"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eH%237deHjEHA.2456@TK2MSFTNGP10.phx.gbl...
> Hi Guy,
>
> check my solution on this:
> http://www.gotdotnet.com/Community/...D4-6D469BE34BC0
> This solution contains all necessary console actions.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> MCMS FAQ:
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...t+S
erver
> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Guy Babbitt" <guy_babbitt@fsafood.com> wrote in message
> news:#VcBHdGjEHA.556@tk2msftngp13.phx.gbl...
> creating
> like
> console
> that
> is
>
>
| |
| Stefan [MSFT] 2004-08-27, 6:08 pm |
| Hi Guy,
some customers have exensivly tested these console actions and run them in
their production environment - so these controls work fine.
Do you have a custom workflow implemented (custom events)?
If yes, please disable them and test again.
Cheers,
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Guy Babbitt" <guy_babbitt@fsafood.com> wrote in message
news:OXyncoHjEHA.3664@TK2MSFTNGP12.phx.gbl...
> That is exactly what I am doing, but since mine doesn't work I decided to
> give yours a shot. Same behavior. If I put a breakpoint on the base.Text
I
> will see a break every time the page loads, so I know the class is being
> accessed. I also know this because I see the option in my admin console.
> When I click the link I am taken to the page where I specify the posting
> name. The problem is my breakpoint at base.PerformActionBehavior() is
never
> hit. Any idea what might cause this. As I mentioned, it only happens
> happens here and I don't know if it is because of the actionjavascript in
> the base class that throws the "save as" dialog or what else it might be.
>
> public class SaveNewandReleaseOwnership : AuthoringSaveNewAction
>
> {
>
> internal const string ID_FIELD_NEWPAGE_NAME = "WBC_fieldNewPageName";
>
> internal const string ID_FIELD_NEWPAGE_DISPLAYNAME =
> "WBC_fieldNewPageDisplayName";
>
> public SaveNewandReleaseOwnership()
>
> {
>
> base.Text = "Save with Release Ownership";
>
> }
>
> protected override void PerformActionBehavior()
>
> {
>
> base.PerformActionBehavior();
>
> PostingCollection pc =
> CmsHttpContext.Current.Searches.UserPostingsInProduction();
>
> foreach (Posting p in pc)
>
> {
>
> if (p.Parent.Path == CmsHttpContext.Current.Channel.Path)
>
> {
>
> if (p.Name == Page.Request.Form[ID_FIELD_NEWPAGE_NAME])
>
> {
>
> p.ReleaseOwnership();
>
> CmsHttpContext.Current.CommitAll();
>
> }
>
> }
>
> }
>
> }
>
> }
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
> news:eH%237deHjEHA.2456@TK2MSFTNGP10.phx.gbl...
http://www.gotdotnet.com/Community/...D4-6D469BE34BC0[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
reedit[vbcol=seagreen]
>
>
|
|
|
|
|