Package blackberry.web.widget.bf

Examples of blackberry.web.widget.bf.HTTPResponseStatus


     * @see net.rim.device.api.browser.field2.BrowserFieldController
     */
    public InputConnection handleResourceRequest( BrowserFieldRequest request ) throws Exception {

        if( this._browserField == null ) {
            return new HTTPResponseStatus( HTTPResponseStatus.SC_SERVER_ERROR, request ).getResponse();
        }
        if( request.getURL().startsWith( "http://localhost:8472/" ) ) {
            URI requestURI = URI.create( request.getURL() );
            String[] splitPath = StringUtilities.split( requestURI.getPath(), "/" );
            String featureID = "";
            for( int i = 0; i < splitPath.length - 1; i++ ) {
                if( featureID == "" ) {
                    featureID = featureID + splitPath[ i ];
                } else {
                    featureID = featureID + "." + splitPath[ i ];
                }
            }
            Object ext = ( (WidgetConfigImpl) _widgetConfig ).getExtensionObjectForFeature( featureID );
            if( ext != null && ext instanceof IJSExtension ) {
                JSExtensionRequest req = new JSExtensionRequest( request.getURL(), request.getPostData(), request.getHeaders(),
                        ( (WidgetConfigImpl) _widgetConfig ).getFeatureTable() );
                JSExtensionResponse res = new JSExtensionResponse( request.getURL(), null, request.getHeaders() );
                try {
                    ( (IJSExtension) ext ).invoke( req, res );
                    return new BrowserFieldResponse( res.getURL(), res.getPostData(), res.getHeaders() );
                } catch( net.rim.device.api.web.WidgetException e ) {
                    // this block is reached if the method cannot be found within the extension
                    return new HTTPResponseStatus( HTTPResponseStatus.SC_NOT_IMPLEMENTED, request ).getResponse();
                }
            } else {
                if( ext == null ) {
                    return new HTTPResponseStatus( HTTPResponseStatus.SC_NOT_FOUND, request ).getResponse();
                } else if( !( ext instanceof IJSExtension ) ) {
                    return new HTTPResponseStatus( HTTPResponseStatus.SC_NOT_IMPLEMENTED, request ).getResponse();
                }
            }
        }
        WidgetAccess access = _widgetPolicy.getElement( request.getURL(), _widgetConfig.getAccessList() );
        if( access == null && !_hasMultiAccess ) {
View Full Code Here

TOP

Related Classes of blackberry.web.widget.bf.HTTPResponseStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.