How to override or change the action call in websphere portal 8.0 application - websphere-portal

What I did.
Step 1: I have made a web page and added Search widget as web content.
when I have seen the view-source code the I have got action call on submit of search button is : action='/wps/myportal/Search/Search%20Center/!ut/p/b1/jZBBDoIwEEXPwgFMP4QWWNbW0EbAaEShG8PCmCYCLozn1xLiwig4u0nemz_5xJCKmK552Etzt33XXN1u2AkQQukY6_SwpeBhTn2q9gHAXkA9AN-HY_BFylUYZUAspYCWy4QVjAIrjP4bQBgHDlAySnJAs__yJwJm_CMxH0iS-Q7ZiB2PgNQfgakXxwu_O5hroVB9eya3tiwrWL3gnvcEg0x68A!!/dl4/d5/L0lJSklKSmchL0lCakFBQXlBQkVRaVFBISEvNEprRnQyUWp2eWpDL1o2X0NHQUg0N0wwMEdQNzkwSURCOTBNTkkwT0kzL1o3X0NHQUg0N0wwMEdQNzkwSURCOTBNTkkwT0E2LzFicVBOWkpqZWRB/'.
Now I want change this action functionality either can I write my own action and How do I do my development so the action developed by me is invoked?.

If you want custom action processing then you should create your own search portlet and use that instead. You can then use the Search and Index API to create your results page.

Related

Salesforce Lightning - how to set nooverride for Lightning, but retain override in Classic

We are planning to migrate our users from Classic to Lightning with a phased roll out. That means we need to retain all the behaviours of Classic and Lightning in parallel for a period of time.
That's working well, except for Button Overrides. There doesn't appear to be a way of configuring Lightning to use the standard edit behaviour, while Classic retains an edit form override. For classic the options available are No Override, Custom S-Control and Visual Force Page. However, the only options available for Lightning are Lightning Component or Use the Salesforce Classic override. There's no option for No Override.
We tried writing a custom Aura component to re-direct to the edit page with ?nooverride=1 but that doesn't work - the user is re-directed, but once the edit page is closed and saved, the user is left on a blank page, not re-directed back to the view of the edited page.
Does anyone have a workaround, or explanation as to why this seems not to be possible ?
whenever you specify a Url as a retURL parameter Salesforce will redirect to that url.
Now in Salesforce Classic view page means xxx.salesforce.com/IdOfRecordToView so You can try retURL parameter in URL with the value of Salesforce Record id which you are editing
example : xxx.salesforce.com/a010000000000qn/e?retURL=%2Fa010000000000qn&nooverride=1

Add a 'Title' to the new OneNote page created using LogicApps connector?

I am trying to use Logic Apps to create a new page in my OneNote book whenever a new email comes from some particular DL. Now my query is how do I name my new page automatically as the OneNote connector in LogicApps doesn't provide that option?
I have tried changing the logic app json code but not able to find the correct logic where it needs to be changed.
The Page Content is just HTML. You basically need to set the head > title for the title of the page.

Can I add a horizontal navigation panel in the chatbot

My chatbot returns text from search engines results on the chatbot screen with the link in the form of a list.
I want to add a horizontal navigation button suc that at once only 1 text result is shown for a query and the next result can be seen by clicking the next botton which will slide over the current result.
Can this be achieved via conversation>
Conversation is one REST API endpoint, so you can calling the Watson conversation service, and built your application with custom code.
Take a look in this project: conversation-simple. One example using Watson Conversation with Node.js (Back-end). You can simple download this project and make your custom design (like buttons) in the front-end or add more business roles in the back-end. Or, you can add your HTML custom code in the conversation and will render for you.
But, like I said, you need to build one custom code to added this painel in the Front-end (HTML, CSS, Javascript). I recommend take a look jQuery, bootstrap, or search templates.
See the API Reference for using Watson Conversation.
See the Official documentation for using this API.

Lightning experience deep link to custom Visualforce tab

Do you know if it is possible to deep link a custom tab on the left hand navigation?
In my web app I allow the user to login through SSO from Salesforce ( so I use salesforce as authentication provider ), than when the user credentials are ensured i redirect the user to the tab using an aspex url like the following:
https://{domain}/apex/{VisualforceTabsName}?sfdc.tabName={VisualforceTabsRef}
or a servlet integration link like the following:
https://na15.salesforce.com/servlet/servlet.Integration?lid={lid}&ic=1&linkToken={linkToken}
I got those links simply right clicking the tabs and copy the link, now this is not going to work on the new ligthening experience where the link is something like the following;
https://gs0.lightning.force.com/one/one.app?source=aloha#{token}
Now it seems to me that the token in this case is user specific, so it can't be used as high level reference to the Visualforce tab.
Do you know if there is a way to do the same in the Lightening Experience (Spring 16' release)? Or if there is a different way to achieve the same result?
Thanks
In Lightning Experience, you can reference custom tabs using the developer name of the tab (note that this is the API name of the tab containing the Visualforce page, not of the page itself). This URL should work:
{domain}/lightning/n/{tabName}
This assumes that you have already created a tab for your Visualforce page.

CSRF safe Custom button linked to Apex method

I'm looking for a technique to execute Apex code from a custom button added to the Opportunity object in a way that protects the user against CSRF.
The current approach being used comes from the question - Custom Button or Link to a Visualforce page with a custom controller. Essentially:
There is an Opportunity Custom Button with the Content Source set to "Visualforce Page".
The Content for this button is set to a Visualforce page that uses Opportunity for the standardController, has an extension apex class entered and an action for a method in that class
The action method returns a PageReference to another custom Visualforce page, including adding a parameter with the Opportunity Id.
This second custom Visualforce page does the bulk of the actual work, including making web service callouts and performing DML operations before redirecting the user back to the Opportunity.
The issue with this approach is that the second custom Visualforce page is retrieved via an HTTP GET, pulls parameters from the query string, and performs update/insert DML operations with no CSRF protection. This is being picked up by the Force.com Security Source Code Scanner.
I should add that this apex code is deployed as both a managed and a unmanaged package, hence the extra work to redirect to the target Visualforce Page using a PageReference. This ensures the namespace prefix is added if required.
How can I avoid the CSRF issue?
I don't want to add a form to the second visualforce page with a button that they must press to start the process (and hence picking up the ViewStateCSRF protection in the postback). From the users perspective they have already pressed the button to perform the operation.
I've asked this question before on the developer force forum and didn't come up with a solution - Cross-Site Request Forgery (CSRF/XSRF) safe Custom Button action
Perhaps I should be trying to move the code out of the controller for the second visual force page and using the extension to the stand controller instead?
I could switch to a Javascript callback to an Apex Web Service (as suggested in Call a apex method from a custom button and How invoke APEX method from custom button), but it seems a bit messy and I'm not sure if I'd just be opening up another range of security issues with the web service.
I booked Partner Security Office Hours with Salesforce and discussed this issue directly with them.
What I'm trying to do isn't currently supported if CSRF protection is required (I.e. to publish to the App Exchange). They suggested two alternative approaches:
Create an intermediate form in a Visualforce page that triggers the sensitive Apex Code. Hence picking up the built in CSRF protection.
Override the Opportunity Detail page (using apex:Details to display similar information). This new Visualforce page would include a similar form post back to option 1 to invoke the sensitive APEX code and get automatic CSRF protection.
Another approach that doesn't use custom buttons is to embed/inline a Visualforce page (see Embed a Page on a Standard Layout) containing just the required button within the standard page layout.
The embedded Visualforce page must use the standard object controller (Opportunity in my case) to appear in the list of available Visualforce pages on the standard page layout. The Visualforce page itself can be very minimal with just a commandButton inside a <apex:form>. The label of the Visualforce page can also be displayed in the page layout.
<apex:page id="embeddedPage" StandardController="Opportunity" extensions="OpportunityExtensionController" showHeader="false" standardStylesheets="true">
<apex:form >
<apex:commandButton value="CSRF Safe Button" action="someMethodInTheExtensionClass" />
</apex:form>
public with sharing class OpportunityExtensionController {
private final Opportunity opportunityFromController;
public OpportunityExtensionController(ApexPages.StandardController controller) {
opportunityFromController = (Opportunity)controller.getRecord();
}
public PageReference someMethodInTheExtensionClass() {
// Perform directly here within the postback rather than redirecting to another page to prevent against XSRF
System.debug('opportunityFromController.Id:' + opportunityFromController.Id);
}
}
This should protect against CSRF as the commandButton will pick up the "com.salesforce.visualforce.ViewStateCSRF" hidden input with the post back to the server inside the resulting iframe.
I've raised the Idea Invoking Apex code from the standard Entity Details pages with CSRF protection to see if they can add support for this directly with custom buttons.
Why don't you use a JavaScript button in the first place to launch the second page? Bypass the first page altogether.
Salesforce will apply merging to the script before rendering (so you can use {!Opportunity.Id} to include opp id in the second URL) and you can simply redirect the browser to your second page.

Resources