History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: OQ-146
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dick Anderson
Reporter: Dick Anderson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenQuote

WSRP summary display problem

Created: 27/Jul/09 04:49 AM   Updated: 30/Jul/11 05:04 AM
Component/s: openquote
Affects Version/s: 1.1
Fix Version/s: 1.3SP1

Release Notes Comment: Quotation page no longer only partially generates when accessed by WSRP


 Description  « Hide
Exception thrown when rendereing the login section on WSRP

See below from com.openquote.ui.Functions

public static String getPortalName(RenderResponse response) {
        String[] actionUrlPart=response.createActionURL().toString().split("/");
        
        if ("auth".equals(actionUrlPart[2])) { **** throws array out of bounds error here
            return actionUrlPart[4];
        }
        else {
            return actionUrlPart[3];
        }
    }

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Matthew Tomlinson - 28/Mar/11 05:40 PM
Suggested fix (currently being tested):

    /**
     * Return the name of the portal that a render response relates to.
     * The action URL for non-authenticated takes this kind of form:
     * /portal/portal/<portal-name>/<page-name>/<window-name>
     * When authenticated the same URL looks like this:
     * /portal/auth/portal/<portal-name>/<page-name>/<window-name>
     * Alternative URL's may contain no portal name
     * /wsrp_rewrite?wsrp-urlType=blockingAction&amp;wsrp-interactionState=JBPNS_/wsrp_rewrite
     */
    public static String getPortalName(RenderResponse response) {
     String actionUrl = response.createActionURL().toString();
        String[] actionUrlPart=actionUrl.split("/");
        
        // find index in url of portal name
        int nameIndex = 0;
        if (actionUrlPart.length>2 && "auth".equals(actionUrlPart[2])) {
         nameIndex = 4;
        }
        else{
         nameIndex = 3;
        }
        
        // if none found return nothing
        if(nameIndex == 0 || actionUrlPart.length<=nameIndex){
         return "";
        }
        
        // return portal name
     return actionUrlPart[nameIndex];

    }