
Introduction
For use in Microsoft Content Management Server, this Decline Reason Web Author extension prompts authors to enter a reason when declining postings. It works in both single posting declines in the Web Author menu and multiple posting declines in the Approval Assistant dialog. The reason entered can be collected using Request.Form["NC_DeclineReason"] within the events CmsPosting_Declining and CmsPosting_Declined in global.asax, and be used for email notifications (code sample not included).
A VB.NET version of this extension is available here.
Installation Procedures
- Copy all the files in directory WebControlLibray to the web control library project of your MCMS solution.
- Copy the directory WebAuthor into the root of your web site. The file /WebAuthor/Client/Console.js contains the scripts for the custom console actions. If Console.js exists already, copy the new scripts into your existing Console.js.
- Copy the MCMS Web Author file \Program Files\Microsoft Content Management Server\Server\IIS_CMS\WebAuthor\Dialogs\TasksAssistant\ApprovalAssistant\ ApprovalAssistant.aspx into /WebAuthor/Dialogs/TasksAssistant/ApprovalAssistant/. In VS.NET 2003, when the file is included and you are asked to automatically generate the code-behind file for it, say No. Edit the file as follows:
- Change the source of the
DialogTitle register: <%@ Register tagprefix="WebAuthor" Tagname="DialogTitle"
Src="/ProjectName/CMS/WebAuthor/Controls/DialogTitle.ascx" %>
- Add a JavaScript include, an
onsubmit attribute in the form element, and a hidden element: .....
<%=EmbedHeadSection()%>
<script language="JavaScript" src="ApprovalAssistant.js"
type="text/javascript"></script>
</head>
.....
<form id="WBC_frmApprovalAssistant" method="post"
runat="server" onsubmit="return CMS_onMultipleDecline();">
<input type="hidden" name="NC_DeclineReason" value="">
.....
- Change the console actions to use the new custom classes. For example, if you are using DefaultConsole.ascx:
<%@ Register TagPrefix="CustomAction"
Namespace="McmsCustom.WebAuthor"
Assembly="WebControl Library Assembly Name" %>
......
<CmsConsole:Console runat="server" id="Console1">
<script language="javascript" type="text/javascript"
src="../WebAuthor/Client/Console.js"></script>
......
<cms:PresentationModeContainer mode="Unpublished" runat="server"
id="PresentationUnpublishedModeContainer1">
......
<CustomAction:ApprovalAssistantCustomAction
id="ApprovalAssistantAction1" runat="server">
<A id="ApprovalAssistantAnchor" href="#"
onclick="<%# Container.ActionJavascript %>;return false"
target=_self>
<%# Container.Text %>
</A>
<BR>
</CustomAction:ApprovalAssistantCustomAction>
......
<CustomAction:DeclineReasonAction
id="DeclineAction1" runat="server">
<A id="DeclineAnchor" href="#"
onclick="<%# Container.ActionJavascript %>;return false"
target=_self>
<%# Container.Text %>
</A>
<BR>
</CustomAction:DeclineReasonAction>
......
</cms:PresentationModeContainer>
......
</CmsConsole:Console>
- Rebuild your site solution in VS.NET.
History
- V1.0 - 2004.04.10 - Base.
- V1.1 - 2004.07.08
- Fixed the missing buttons in the dialog.
- Split CustomAction.cs into DeclineReasonAction.cs and ApprovalAssistantCustomAction.cs.
- V1.2 - 2006.05.14 - Added a ASP.NET 2.0 version.
| You must Sign In to use this message board. |
|
| | Msgs 1 to 9 of 9 (Total in Forum: 9) (Refresh) | FirstPrevNext |
|
 |
|
 |
Hi,
I have implemented step by step and I get the following error.
Parser Error: Could not find a part of the path "C:\cmspub\HRPAO.CMS\WebAuthor\Controls\DialogTitle.ascx".
Here is the full error:
System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\cmspub\HRPAO.CMS\WebAuthor\Controls\DialogTitle.ascx". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.Web.UI.Util.ReaderFromFile(String filename, HttpContext context, String configPath) at System.Web.UI.TemplateParser.ParseFile(String filename, String virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation() at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound) at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() at System.Web.UI.TemplateControlParser.GetReferencedType(TemplateControlParser parser, String virtualPath) at System.Web.UI.TemplateControlParser.GetUserControlType(String virtualPath) at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateParser.ParseStringInternal(String text) at System.Web.UI.TemplateParser.ParseString(String text, String virtualPath, String basePhysicalDir)
Thanks for any help.
John Haigh
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
There is a built-in CMS virtual directory. If your application name is HRPAO.CMS, try changing the value to /HRPAO.CMS/CMS/WebAuthor/Controls/DialogTitle.ascx.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi, I put the declinereason code to my CMS project (C#). There is a small problem with declining using Approval Assistant. If I select some postings in the Approval Assistant and then click on Decline button, I get an error message
Line: 12 char: 51 Error: Unterminated string constant Code: 0 URL: href="http://myserver/CmsProject/WebAuthor/Dialogs/DeclineReason/DeclineReasonDlg.aspx?wbc_purpose=Basic&NRMODE=Update&WBCMODE=PresentationUnpublished
If I close the error window It seems to work, the postings are declined. So it is no a critical error, but would be very nice to fix it. Any ideas will be appreciated
Regards Kamil
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It seems the problem was that I added the DeclineReasonDlg.js to my C# solution which has set code page 1250. When I checked-in the solution to the SourceSave the code page 1250 was probably set also for the DeclineReasonDlg.js. I also localized text from the DeclineReasonDlg.js to Czech. Since then it didn't work. So, I set the codepage UTF-8 for the DeclineReasonDlg.js and it seems to work now again. The purpose of the problem is still not very clear to me, but it works.
Regards Kamil
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The problem of missing buttons in dialog is due to MCMS SP1a. If you are using MCMS SP1, do not upgrade to V1.1.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
General
News
Question
Answer
Joke
Rant
Admin