transit to next page from casGenericSuccess page using link in jasing cas single sign on - spring-webflow

I want to navigate to my added jsp page from casGenericSuccess.jsp but I am not able to transit to next page using hyperlink.
What i did is:
changes in login-webflow.xml
<view-state id="viewGenericLoginSuccess" view="casLoginGenericSuccessView">
<transition on="userManagement" to="userManagementHome" />
</view-state>
default_views.properties
userManagementHome.(class)=org.springframework.web.servlet.view.JstlView
userManagementHome.url=/WEB-INF/view/jsp/default/ui/userManagementHome.jsp
casGenericSuccessView.jsp
<jsp:directive.include file="includes/top.jsp" />
<div id="msg" class="success">
<spring:message code="screen.success.header" />
<p><spring:message code="screen.success.success" /></p>
<p><spring:message code="screen.success.security" /></p>
<a href="login?_flowExecutionKey=${flowExecutionKey}&_eventId=userManagement">User Management
</div>
<jsp:directive.include file="includes/bottom.jsp" />
Also I tried changing href to login?&_eventId=userManagement
I have my userManagementHome.jsp at same place where casGenericSuccess.jsp is present.
can someone please help me out navigate to my page.
Right now it is not navigating and displays the same casGenericSuccess.jsp page on click of user management link.

Try with execution instead of _flowExecutionKey

Related

Create custom search form indexed_search TYPO3 v8

I'm trying to add a custom search form into my template, the TypoScript I used in a v7 install no longer works.
If I copy the Fluid form used in the extension (Form.html) and place it into one of my Fluid template a search box appears but it posts back to itself, even though I have set a rootPidList in my constants. This is the code I copy:
<f:form action="search" method="post" id="tx_indexedsearch" pageUid="{settings.targetPid}">
<div class="tx-indexedsearch-hidden-fields">
<f:form.hidden name="search[_sections]" value="0" />
<f:form.hidden name="search[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
<f:form.hidden name="search[pointer]" id="tx_indexedsearch_pointer" value="0" />
<f:form.hidden name="search[ext]" value="{searchParams.ext}" />
<f:form.hidden name="search[searchType]" value="{searchParams.searchType}" />
<f:form.hidden name="search[defaultOperand]" value="{searchParams.defaultOperand}" />
<f:form.hidden name="search[mediaType]" value="{searchParams.mediaType}" />
<f:form.hidden name="search[sortOrder]" value="{searchParams.sortOrder}" />
<f:form.hidden name="search[group]" value="{searchParams.group}" />
<f:form.hidden name="search[languageUid]" value="{searchParams.languageUid}" />
<f:form.hidden name="search[desc]" value="{searchParams.desc}" />
<f:form.hidden name="search[numberOfResults]" value="{searchParams.numberOfResults}" />
<f:form.hidden name="search[extendedSearch]" value="{searchParams.extendedSearch}" />
</div>
<fieldset>
<legend><f:translate key="form.legend" /></legend>
<div class="tx-indexedsearch-form">
<label for="tx-indexedsearch-searchbox-sword"><f:translate key="form.searchFor" />:</label>
<f:form.textfield name="search[sword]" value="{sword}" id="tx-indexedsearch-searchbox-sword" class="tx-indexedsearch-searchbox-sword" />
</div>
<div class="tx-indexedsearch-search-submit">
<f:form.submit name="search[submitButton]" value="{f:translate(key: 'form.submit')}" id="tx-indexedsearch-searchbox-button-submit" class="tx-indexedsearch-searchbox-button" />
</div>
</fieldset>
And my typoscript:
config.index_enable = 1
page.config.index_enable = 1
plugin.tx_indexedsearch.settings.targetPid = 31
If I add the stock indexed search plugin to a random page, this will work.
Just to rule it out, I've also disable realurl just in case.
Thanks again T3 community.
if you just copy the search template into your output/ page template, there is no plugin available which provides values for the specific variables needed in this template-part.
either you use an output of a page where you have inserted the plugin (copy from HTML-source)
or you insert the plugin in all pages:
this can be done with a column you inherit and where the plugin is inserted on top level
or you use typoscript to render the plugin into a fluid-variable and display the generated HTML in your (page-)template.

Drop-down list AutoPostBack is not firing in asp.net

In my asp.net website I have created a user control called GlobalHeader.ascx to make header content consistent throughout the website and put a text box control for search functionality as given below:
<div style="display:none;">
<form id="sample"></form>
</div>
<div>
<form id="cse-search-box" name="cse-search-box" method="get" action="/Search Results.aspx">
<input type="hidden" name="cof" value="FORID:11;NB:1" />
<input type="text" name="q" id="q" class="search-txt" onfocus="if(this.value=='Search')this.value='';" onblur="if(this.value=='')this.value='Search';" value="Search"/>
<input type="submit" name="sa" value="Search" class="search-iocn" />
</form>
Now in child page I'm having a drop-down control having AutoPostBack=true and OnSelectedIndexChanged="DrpdwnListSelectedIndexChanged" i.e. on item change event DrpdwnListSelectedIndexChanged is fired and and show some data just under drop-down list. BUT this functionality is ONLY work when I remove search functionality from Header user control.
<asp:DropDownList runat="server" ID="drpdwnList" AutoPostBack="True" OnSelectedIndexChanged="DrpdwnListSelectedIndexChanged">
</asp:DropDownList>
This means form tag preventing drop-down list AutoPostBack functionality to work.
Why so?
How can I make both functionality work together?
Interesting thing is that If I remove <form id="sample"></form> from top search functionality doesn't work.
Thanks

Spring security authorize taglib with jstl variable if statement not working

I have a problem on my jsp where i am trying to hide some content based on a users spring security role but also on another variable (store) in my spring security user object. I can't get the syntax correct.
I have a property in my security object named store. When I try and print it out using the following...
<sec:authentication property="principal.store" var="userStore"/>
<c:out value="${userStore }"/>
<sec:authentication access="hasRole('ROLE_LEVEL_7')"/>
<div class="ym-fbox" id="store">
<form:label path="store">Store<sup class="ym-required">*</sup></form:label>
<form:input path="store" class="required" />
</sec:authorize>
The user store variable gets printed correctly and no issues.
But then when I try and use this variable in conjunction with spring security taglibs to hide content my jso doesn't work properly...
<sec:authentication property="principal.store" var="userStore"/>
<c:if test="${userStore eq 'MyStore'}">
<sec:authentication access="hasRole('ROLE_LEVEL_7')"/>
<div class="ym-fbox" id="store">
<form:label path="store">Store<sup class="ym-required">*</sup></form:label>
<form:input path="store" class="required" />
</sec:authorize>
I'm thinking what I am trying to do is not possible? Can anyone help me with a way to do this? The aim is to check the user store variable before checking the role. i.e. both variables are used to decide whether to hide content.
thanks
I'm not sure why the if statement did not work but I changed what I had to below and got it to work.
<sec:authentication property="principal.store" var="userStore"/>
<c:if test="${userStore eq lovStoreNone}">
<sec:authorize access="hasRole('ROLE_LEVEL_7')">
<div class="ym-fbox" id="store">
<form:label path="store"><spring:message code="label.store"/></form:label>
<form:select path="store">
<form:options items="${stores}" />
</form:select>
</div>
</sec:authorize>
</c:if>

Sharepoint Online Upload File Form

Can I make upload file form in some sandboxed WebPart for Sharepoint Online, and if I can, how can I?
I've searched a lot and found only solutions, available for Client Object Model for outside clients, there is no example how to do this with JSOM (Client Object Model for Javascript) and usual way to upload with asp:FileUpload don't work in sandbox solution, PostedFile length = 0
You do have the option of using the ActiveX STSUpld.UploadCtl control - this enables you to provide the Multi-file upload as you see in a document library.
Note that in the following - Confirmation-URL must be set (where to go when upload is done) and the destination must be set as well to an existing document library.
<script type="text/jscript">
function DocumentUpload() {
var uploadCtl = document.getElementById("idUploadCtl");
uploadCtl.MultipleUpload();
}
</script>
<input type='hidden' name='Confirmation-URL' id='Confirmation-URL' value='' />
<input type='hidden' name='PostURL' id='PostURL' value='' />
<input type="hidden" name="Cmd" value="Save" />
<input type="hidden" name="putopts" value="true" /> <!-- Overwrite files -->
<input type="hidden" name="VTI-GROUP" value="0" />
<input type="hidden" name="destination" id="destination" value="/TestDL" /> <!-- Files destination path, must already exist -->
<p style="margin-left:auto;margin-right:auto;margin-top:0px;margin-bottom:0px;text-align:center;padding:0px !important; vertical-align:top;width:100%;">
<script type="text/javascript">
try {
if (new ActiveXObject("STSUpld.UploadCtl"))
document.write("<OBJECT id=\"idUploadCtl\" name=\"idUploadCtl\" CLASSID=\"CLSID:07B06095-5687-4d13-9E32-12B4259C9813\" WIDTH=\"600px\" HEIGHT=\"250px\" ></OBJECT>");
}
catch (error) {
}
</script>
<asp:Button runat="server" accesskey="O" id="OKButton" CssClass="ms-ButtonHeightWidth" OnPropertyChange="if (this.value != 'Upload files') this.click();" Text="Upload files" UseSubmitBehavior="False" OnClientClick="DocumentUpload(); return false;" />
<asp:Button runat="server" accesskey="C" id="CancelButton" CssClass="ms-ButtonHeightWidth" Text="Cancel" UseSubmitBehavior="False" OnClientClick="window.location ='<somewhere to go>'; return false;" />
Hope this helps....
After some search I finally found solution, based on Codeplex's SPServices. There is plugin SPWidgets(https://github.com/purtuga/SPWidgets/). This plugin loads an iframe with upload.asmx (Sharepoint's default upload form), then set display: none for all elements on this page, exept input[type=file] and adds button, wich can submit form in iframe. After submit plugin catches iframe state (_onIFramePageChange event) and do some callbacks depends on iframe url.
This looks like some ugly workaround, but it is only working solution that I found after hours of search.
There's not too many options, however check out SPServices on CodePlex - this would be the best place to start. Remember - SharePoint expects a binary object when calling the service. You have to capture the file and convert it to binary first, then call the web service to upload.
I have an example but not with me at current location - if the above doesn't get you started, let me know and I will find and post.

Adding from within from runat server asp.net

I am having a signup page at the upper of the page there is a form tag that is runat server. I want to add a code that is given by paypal take payment. That code contains a simple html controls not asp.net controls but when i paste to the code to the page then it don't submit it to the action it postback the form and don't do with paypal code at all. when i checked the source of the code it doesn't shows the from tag given by the paypal. it doesn't rander the form given by the paypal. I also have to take the form at top because my page has asp.net controls that's why that is necessary.
Please tell the solution
You must not use asp.net form tag in asp.net while payment processing.
Use this
<body onload="document.paypal.submit();">
<form name="paypal" action='<%= ConfigurationManager.AppSettings["PayPalSubmitUrl"] %>'
method="post">
// rest html goes here
</form>
</body>
I always do it like this for paypal processing
I assume you are using PayPal Standard.
If so, collect submitted values from (regular ASP.Net) form. Then forward them to PayPal like this -
protected void SubmitRadButton_Click(object sender, EventArgs e)
{
string paypalUrl = IsTestMode ?
"https://www.sandbox.paypal.com/us/cgi-bin/webscr" :
"https://www.paypal.com/us/cgi-bin/webscr";
var builder = new StringBuilder();
builder.Append(paypalUrl);
builder.AppendFormat("?cmd=_xclick&business={0}", EmailTextBox.Text);
builder.Append("&lc=US&no_note=0&currency_code=USD");
builder.AppendFormat("&item_name={0}", ItemNameHiddenField.Value);
builder.AppendFormat("&amount={0}", AmountTextBox.Text);
builder.AppendFormat("&return={0}", ReturnUrl);
builder.AppendFormat("&cancel_return={0}", CancelUrl);
builder.AppendFormat("&undefined_quantity={0}", 1);
builder.AppendFormat("&item_number={0}", ItemNumberHiddenField.Value);
builder.AppendFormat("&cpp_header_image={0}", HeaderImage);
HttpContext.Current.Response.Redirect(builder.ToString());
}
I tried the same but didn't work. Please see my paypal code that they provided and let me know how to do this. I have tried the above method previously but this time isn't working with code. May be it is for subscription code different. Read the code following and let me know about how to use this.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="LL5LZEB8L6T8S" />
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif"
name="submit" alt="PayPal - The safer, easier way to pay online!" />
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif"
width="1" height="1" />
</form>
Thanks

Resources