DocuSign API: Pre-filling radio group tabs for template - templates

I have radio groups setup in my DocuSign template, and am trying to fill it up while creating an envelope using the template. Here's the XML structure that I've made:
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>******</accountId>
<status>sent</status>
<templateId>******</templateId>
<templateRoles>
<templateRole>
<email>******#test.com</email>
<name>****** ******</name>
<roleName>General</roleName>
<clientUserId>UserId</clientUserId>
<tabs>
<textTabs>
<text>
<tabLabel>Name</tabLabel>
<value>Test User</value>
</text>
<text>
<tabLabel>Address 1</tabLabel>
<value>123 Main Street</value>
</text>
<text>
<tabLabel>Address 2</tabLabel>
<value>Venice, CA 12345</value>
</text>
</textTabs>
<radioGroupTabs>
<radioGroup>
<groupName>Radio Group 1</groupName>
<radios>
<radio>
<selected>True</selected>
<value>Radio 1</value>
</radio>
<radio>
<selected>False</selected>
<value>Radio 2</value>
</radio>
</radios>
</radioGroup>
</radioGroupTabs>
</tabs>
</templateRole>
</templateRoles>
</envelopeDefinition>
Is this XML request correct? The 'Name' and 'Address *' tabs are correctly filled, but the radio group tabs are not filled at all.

Your XML looks correct to me; in fact, I was able to copy/paste (including the radioGroupTabs portion) from your code sample into my own request and it works as desired -- i.e., the radio button specified as selected in the request is indeed selected when the recipient opens the envelope.
I'd suggest you verify that the values of groupName and value (for each Radio) in the Request XML match exactly with the corresponding values specified for the Radio Button Tag Properties, as shown here in the DocuSign UI -- and keep in mind that values are case-sensitive:

Related

Sitecore: RTE Paste as Plain Text customization

I was experimenting with RTE buttons and found that the copy pasting from word to RTE allows all styles to be intact. So i read a post and got rid of the extra formatting. Now i want to deal with blank spaces and line breaks. So, with some analysis i have decided to allow:
One blank space for single line break. Statements to be shown as single paragraph.For example
"This is new. </br> This is weird." should become "<p>This is new. This is weird.</p>"
If multiple line breaks are found, then all break separated statements should act as single paragraph with only single break between them. For example
"This is new. </br></br></br> This is weird." should become "<p>This is new.</p> </br> <p>This is weird.</p>"
This would be very efficient for authors which previously would need to adjust the whole scrap after pasting from word.
I have tried using the "Paste as Plain Text" button but it does not take care of line breaks. So i was wondering how i could customize the button function to adjust it to my needs? where and how should i do this ??
In web.config file, you can change and update HTMLEditor setting. However, you might have different aspect and dynamic user's input in the HTML editor. So, I would suggest you create a customize RichText Editor in Core DB and an assembly if you need. Then, create another config file in App_include folder to patch and add your customized HTML editor with different setting. Below is from web.config file and you can update this configuration if you want to keep using default RichText Editor.
<!-- HTML EDITOR DEFAULT CONFIGURATION TYPE
Specifies the type responsible for setting up the rich text editor. Can be overriden at profile level. Must inherit from
Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration,Sitecore.Client.
Default value: Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration,Sitecore.Client
-->
<setting name="HtmlEditor.DefaultConfigurationType" value="Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration,Sitecore.Client" />
<!-- HTML EDITOR DEFAULT PROFILE
Path to the default html editor profile.
Default value: /sitecore/system/Settings/Html Editor Profiles/Rich Text Default
-->
<setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Default" />
<!-- HTML EDITOR LINE BREAK
Specifies the tag that the HTML editor inserts on Enter. Values can be
"br", "div" and "p".
-->
<setting name="HtmlEditor.LineBreak" value="p" />
<!-- HTML EDITOR REMOVE SCRIPTS
If true, the rich text editor removes script tags from RTE field values before saving. Setting the value to true reduces the potential for cross-site scripting and other script-related issues.
Default value: true
-->
<setting name="HtmlEditor.RemoveScripts" value="true" />
<!-- HTML EDITOR SUPPORT WEB CONTROLS
Indicates if the Html Editor supports web controls. If true, Web Controls are shown as yellow boxes.
Default value: true
-->
<setting name="HtmlEditor.SupportWebControls" value="true" />
<!-- HTML EDITOR VALIDATOR SERVICE URL
Specifies the url that validates XHtml.
-->
<setting name="HtmlEditor.ValidatorServiceUrl" value="http://validator.w3.org/check" />
You have to do this change in your Javascript... you can have custom JS when you are in authoring mode to catch the paste event and do the HTML manipulation in javascript...
An other option that would work as well in the ContentTree would be to add a button in the RTE that call this javascript, here you can find some explanation on how to add the button to the RTE.
https://markstiles.net/Blog/2011/02/05/adding-button-to-rich-text-editor.aspx

Goutte with behat: xml string as textarea value is filled with html entities

I have a page that contains a form with some input elements, including a textarea. Those input fields are populated with some values. Think of this whole page as an edit page for some entity. Textarea contains an XML string that shows properly within normal browser (eg. firefox and chrome) and looks like following:
<front>
<!-- top row -->
<cell>
<page>8</page>
</cell>
</front>
But when i run the test case with goutte mink driver the page is loaded and the value of textarea is encoded with special characters, like so:
<front>
<!-- top row -->
<cell>
<page>8</page>
</cell>
</front>
And when i press submit button that mess is sent to the server and saved instead of initial correct xml. Note that i do not touch it at all. I can just load the page and press submit button and it's all screwed. This happens only with goutte, but not with, say, selenium2.
So the question is: how can i force goutte interpret those html entities automatically and send them as correct data, not that encoded mess?
there's no solution for that. It seems as normal behavior of Goutte/Guzzle. As a workaround we ended up with following solution: in case Goutte driver is used we check page contents for all <textarea> elements, and if any found then for each we get their contents and plainly reinsert as follows:
$elements = $this->pageContent->findAll('xpath', '//textarea');
foreach ($elements as $element) {
$element->setValue($element->getText());
}

JSF listeners in selectOneMenu

I have a selectOneMenu item with some products. Some of them are unavailable so after you click on it the button "Add" should be disabled and some message should appear that "Sorry the product you chose is currently unavailable". I have no idea how to achieve that. Tried listeners, ajax and still nothing.
This is one of many versions of my JSF Page:
<h:form>
<h:selectOneMenu value="#{productBean.productName}">
<f:selectItems id ="other" value="#{productBean.other}" var="other" itemValue="#{ordersBean.productName}" itemLabel="#{other.name}" />
<f:ajax listener="#{productBean.valueChanged}" />
</h:selectOneMenu>
<h:commandButton value ="Dodaj do zamówienia" rendered="#{productBean.available}"/>
<h:outputLabel id="orderSummary"/>
</h:form>
Beans are rather standard. I just need a clue how to do that and probably I will be able to do it myself.
Thanks in advance.
Here's one of the ways:
In your AJAX listener you could check if a product is available and set up bean field accordingly, or add a message for a component.
Introduce a component in your view that'll hold the message to the user, for example with the #{bean.available ? '' : 'Sorry, out of stock'} value, or enclose it within a <h:panelGroup> and let that component have a rendered attribute, or attach <h:message>/<h:messages> somewhere in your view.
Specify id of the message holder to be rendered within render attribute of <f:ajax> tag.

Create custom ItemStyle template for SharePoint

I've created a custom ItemStyle_ContactDetails.xsl for a SharePoint 2010 content query web part, which points to this custom file via the ItemXslLink property. The web part will be filtered to display only one record for that department's contact info. The list it's reading has these columns:
#Title -- built-in SharePoint column
/dsQueryResponse/Rows/Row/#WorkAddress -- built-in SharePoint column
/dsQueryResponse/Rows/Row/#PrimaryNumber -- built-in SharePoint column
#EMail -- built-in SharePoint column
#Opening_x0020_Hours -- custom multi-line rich text column
The above names are what they're called in the Data View Web Part from another site. I had the following in that DVWP that worked for a local site:
<td colspan="2" class="ms-vb" style="text-align:center">
<b><xsl:value-of select="#Title"/></b><br></br>
<div style="margin-top:10px;"><xsl:value-of
select="/dsQueryResponse/Rows/Row/#WorkAddress"/>
(MAP)
</div>
Tel: <xsl:value-of select="/dsQueryResponse/Rows/Row/#PrimaryNumber"/><br></br>
<xsl:value-of select="#EMail"/>
<p><b>Opening Hours:</b></p>
<div style="position:relative; top:0; margin:0">
<xsl:value-of select="#Opening_x0020_Hours"
disable-output-escaping="yes"/>
</div>
</td>
How do I translate this to the custom ItemStyle_ContactDetails.xsl template? The user needs to see the info without having to click a link to get to it -- it's always going to be just one record for that department. Thanks.
Some serious trial-and-error yielded the result, along with this great article: http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx
Maybe others trying this same thing can find this useful: You can edit the custom XSL file on the server via SPDesigner, but you can't do the same with the web part and hope to have the changes immediately reflected. You must export the content query web part, then edit the file in Notepad, etc., to make your changes to the following 3 items:
Change the ItemXslLink to point to your custom XSL file:
<property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/ItemStyle_ContactDetails.xsl</property>
Change the ItemStyle item in the web part to reference your template name; the template name in the XSL file is ContactDetails:
<xsl:template name="ContactDetails" match="Row[#Style='ContactDetails']" mode="itemstyle">
So in your web part, you'd have this:
<property name="ItemStyle" type="string">ContactDetails</property>
Update the CommonViewFields to list your custom columns and their types:
<property name="CommonViewFields" type="string">WorkAddress, Text; EMail,Text; Contact_x0020_Department,Choice; Map,URL; Opening_x0020_Hours,Text; PrimaryNumber, Text</property>
Save the web part file and import (upload) it via the browser to your web part gallery. Each time you make changes to the web part, you'll want to do this; the XSL file can be edited and saved in SPDesigner and the changes reflect immediately in the browser.
Hope this helps someone who gets stuck like I was :)
Whenever I edit "CommonViewFields" in the Webpart, I cannot edit the Properties after inserting the Webpart because of Correlation Error.
I am using SP 2013 onprem. Do I really need to modify the Webpart ? Isn't it enough to create a custom itemstyle.xls ?
I am playing around now for days. Each days more I have to say - Sharepoint is a mess.

Email template using XSLT

HI all,
I have an XML with the different email bodies. I am using xslt to prepare an email template for sending these emails. I also want to include <subject> tag to the xml so that the email is more maintainable.I am using spring to send mail. I need to set the body ans subject of the mail. Body of the mail i am setting by using xslt transformation. I want to set the subject too.Please help me out if you have any idea!! I don't want to use xml parsing just for setting subject.Is there any way i can get the subject value using xslt??
here is my xml:
<mailMessage>
<mail type="pinReset">
<subject>Regarding account pin reset</subject>
<body>
<prefix>Hello User You have initiated a pin reset Please click
on the link below to reset your pin</prefix>
<suffix>Thank you</suffix>
</body>
</mail>
<mail type="emailUpdate">
<subject>Regarding account email update</subject>
<body>
<prefix>emailupdated</prefix>
<suffix>thank u</suffix>
</body>
</mail>
<mail type="failureCount">
<subject>Regarding account unsuccessful login</subject>
<body>
<prefix>failureCount</prefix>
<suffix>thank u</suffix>
</body>
</mail>
</mailMessage>
I want to fetch the subject separately.
You could create a second, very simple XSLT template that only outputs the subject line.
You can pass the string value for the subject, and the mail type as parameters to the XSLT transformation, and the transformation can be written in such a way as to produce the whole email message.