Examples of InternalStringBuilder


Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

        // If we couldn't find an appropriate module, try raising the action on the (deprecated) Global.app.
        //
       
        if ( sharedFlowToTry != null )
        {
            InternalStringBuilder sfActionURI = new InternalStringBuilder( sharedFlowToTry.getModulePath() );
            sfActionURI.append( '/' );
            sfActionURI.append( uriBaseName );
            rw.setOriginalServletPath( uri );
            ForwardRedirectHandler frh = _handlers.getForwardRedirectHandler();
            FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, null );
            frh.forward( context, sfActionURI.toString() );
            return true;
        }
       
        return false;
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

     */
    public static class DefaultModuleConfigLocator implements ModuleConfigLocator, Serializable
    {
        public String getModuleConfigPath( String moduleName )
        {
            InternalStringBuilder moduleConfPath = new InternalStringBuilder( getGenDir() );
            moduleConfPath.append( '/' ).append( PageFlowConstants.PAGEFLOW_MODULE_CONFIG_PREFIX );
           
            if ( moduleName.length() > 1 )
            {
                moduleConfPath.append( moduleName.replace( '/', '-' ) );
            }
           
            moduleConfPath.append( PageFlowConstants.PAGEFLOW_MODULE_CONFIG_EXTENSION );
            return moduleConfPath.toString();
        }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder


        // prepare to render the tree
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
        InternalStringBuilder sb = new InternalStringBuilder(1024);
        StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);

        // this is the treeId from the request.  If there was an tree expansion this will be
        // non-null and it identifies what tree had the expansion request.
        // we need to qualify the tree based upon the tagId
        assert(_trs.tagId != null);
        _trs.tagId = getIdForTagId(_trs.tagId);

        String treeId = request.getParameter(TreeElement.TREE_ID);
        if (treeId != null && _trs.tagId.equals(treeId)) {
            TreeHelpers.processTreeRequest(treeId, treeRoot, request, response);
        }

        // check for the nodes that are expanded...
        // Add the script support for the tree.
        if (_trs.runAtClient) {
            IScriptReporter sr = getScriptReporter();
            if (sr == null) {
                String s = Bundle.getString("Tags_TreeRunAtClientSC", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            if (!srs.isFeatureWritten(CoreScriptFeature.DYNAMIC_INIT)) {
                String s = Bundle.getString("Tags_TreeHtmlRunAtClient", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            assert(treeRoot instanceof ITreeRootElement);
            ITreeRootElement tre = (ITreeRootElement) treeRoot;

            Object[] args = new Object[8];
            args[0] = _iState.getImageRoot() + "/";
            args[1] = tre.getObjectName();
            args[2] = _iState.getNodeCollapsedImage();
            args[3] = _iState.getNodeExpandedImage();
            args[4] = _iState.getLastNodeCollapsedImage();
            args[5] = _iState.getLastNodeExpandedImage();
            args[6] = Bundle.getString("Tags_TreeAltTextExpand", null);
            args[7] = Bundle.getString("Tags_TreeAltTextCollapse", null);
            srs.writeFeature(sr, writer, CoreScriptFeature.TREE_INIT, false, false, args);

            tre.setTreeRenderState(_trs);
            tre.setInheritableState(_iState);
        }

        // create a containing tree level <div> and place the tree level styles on it.
        _divState.styleClass = _treeStyleClass;
        _divState.style = _treeStyle;
        String divId = null;
        if (_renderTagIdLookup) {
            _divState.id = _trs.tagId;
            divId = _divState.id;
        }

        // if we are running on the client then we need to output the tree name into the top level tree <div> tag
        if (_trs.runAtClient) {
            _divState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, "netui:treeName",
                    ((INameable) treeRoot).getObjectName());
        }

        TagRenderingBase divRenderer = TagRenderingBase.Factory.getRendering(TagRenderingBase.DIV_TAG, request);
        divRenderer.doStartTag(writer, _divState);
        sb.append("\n");

        // Render the tree.
        AttributeRenderer extraAttrs = new AttributeRenderer();
        TagTreeRenderer ttr = new TagTreeRenderer(this, _trs, request, response, pageContext.getServletContext());
        ttr.render(sb, treeRoot, 0, extraAttrs, _iState);
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // finish the tree representation and write it
        divRenderer.doEndTag(writer);
        sb.append("\n");
        write(sb.toString());

        if (!(treeRoot instanceof ITreeRootElement)) {
            boolean error = false;
            if (_rootNodeExpandedImage != null) {
                String s = Bundle.getString("Tags_TreeRootImageError", null);
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

        while (true) {
            int index = template.indexOf(placeholder);
            if (index < 0)
                break;
            InternalStringBuilder temp = new InternalStringBuilder(template.substring(0, index));
            temp.append(value);
            temp.append(template.substring(index + placeholder.length()));
            template = temp.toString();
        }
        return template;
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

     * @param error
     */
    public void collectChildError(String error)
    {
        if (_errorText == null) {
            _errorText = new InternalStringBuilder(32);
        }
        _errorText.append(error);
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

            return invokeActionMethod( actionMethod, inputForm, request, mapping );
        }
       
        if ( _log.isWarnEnabled() )
        {
            InternalStringBuilder msg = new InternalStringBuilder( "Could not find matching action method for action=" );
            msg.append( actionName ).append( ", form=" );
            msg.append( inputForm != null ? inputForm.getClass().getName() :"[none]" );
            _log.warn( msg.toString() );
        }

        PageFlowException ex = new NoMatchingActionMethodException( actionName, inputForm, this );
        InternalUtils.throwPageFlowException( ex, request );
        return null;
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

        return null;
    }

    private static String getFormQualifiedActionPath( Class formClass, String actionPath )
    {
        InternalStringBuilder ret = new InternalStringBuilder( actionPath );
        ret.append( '_' );
        ret.append( formClass.getName().replace( '.', '_' ).replace( '$', '_' ) );
        return ret.toString();
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

                        }
                    }
                   
                    Class actualType = actualActionOutput.getClass();
                    int actualArrayDims = 0;
                    InternalStringBuilder arraySuffix = new InternalStringBuilder();
                   
                    while ( actualType.isArray() && actualArrayDims <= expectedArrayDims )
                    {
                        ++actualArrayDims;
                        arraySuffix.append( "[]" );
                        actualType = actualType.getComponentType();
                    }
                       
                    if ( actualArrayDims != expectedArrayDims || ! expectedType.isAssignableFrom( actualType ) )
                    {
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

        {
            _queryString = null;
        }
        else if ( queryString.charAt( 0 ) == '?' )
        {
            _queryString = new InternalStringBuilder( queryString );
        }
        else
        {
            _queryString = new InternalStringBuilder( "?" ).append( queryString );
        }
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

     */
    public void addQueryParam( String paramName, String value )
    {
        if ( _queryString == null )
        {
            _queryString = new InternalStringBuilder( "?" );
        }
        else
        {
            _queryString.append( '&' );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.