Examples of Href


Examples of org.displaytag.util.Href

    {
        if ((this.paginatedList == null && this.pagesize != 0 && this.listHelper != null)
            || (this.paginatedList != null))
        {
            // create a new href
            Href navigationHref = (Href) this.baseHref.clone();

            write(this.listHelper.getSearchResultsSummary());

            String pageParameter;
            if (paginatedList == null)
            {
                pageParameter = encodeParameter(TableTagParameters.PARAMETER_PAGE);
            }
            else
            {
                pageParameter = properties.getPaginationPageNumberParam();
                if ((paginatedList.getSearchId() != null)
                    && (!navigationHref.getParameterMap().containsKey(properties.getPaginationSearchIdParam())))
                {
                    navigationHref.addParameter(properties.getPaginationSearchIdParam(), paginatedList.getSearchId());
                }
            }
            write(this.listHelper.getPageNavigationBar(navigationHref, pageParameter));
        }
    }
View Full Code Here

Examples of org.displaytag.util.Href

     * Writes the formatted export links section.
     */
    private void writeExportLinks()
    {
        // Figure out what formats they want to export, make up a little string
        Href exportHref = (Href) this.baseHref.clone();

        StringBuffer buffer = new StringBuffer(200);
        Iterator iterator = MediaTypeEnum.iterator();

        while (iterator.hasNext())
        {
            MediaTypeEnum currentExportType = (MediaTypeEnum) iterator.next();

            if (this.properties.getAddExport(currentExportType))
            {

                if (buffer.length() > 0)
                {
                    buffer.append(this.properties.getExportBannerSeparator());
                }

                exportHref.addParameter(encodeParameter(TableTagParameters.PARAMETER_EXPORTTYPE), currentExportType
                    .getCode());

                // export marker
                exportHref.addParameter(TableTagParameters.PARAMETER_EXPORTING, "1");

                Anchor anchor = new Anchor(exportHref, this.properties.getExportLabel(currentExportType));
                buffer.append(anchor.toString());
            }
        }
View Full Code Here

Examples of org.displaytag.util.Href

        }

        if (this.header.getHref() != null)
        {
            // generates the href for the link
            Href colHref = getColumnHref(fullValue);
            Anchor anchor = new Anchor(colHref, choppedValue);
            choppedValue = anchor.toString();
        }

        return choppedValue;
View Full Code Here

Examples of org.displaytag.util.Href

     * @throws ObjectLookupException for errors in lookin up object properties
     */
    private Href getColumnHref(String columnContent) throws ObjectLookupException
    {
        // copy href
        Href colHref = (Href) this.header.getHref().clone();

        // do we need to add a param?
        if (this.header.getParamName() != null)
        {

            Object paramValue;

            if (this.header.getParamProperty() != null)
            {
                // different property, go get it
                paramValue = LookupUtil.getBeanProperty(this.row.getObject(), this.header.getParamProperty());

            }
            else
            {
                // same property as content
                paramValue = columnContent;
            }

            if (paramValue != null)
            {
                try
                {
                    colHref.addParameter(this.header.getParamName(), URLEncoder.encode(
                        paramValue.toString(),
                        StringUtils.defaultString(this.row.getParentTable().getEncoding(), "UTF8"))); //$NON-NLS-1$
                }
                catch (UnsupportedEncodingException e)
                {
View Full Code Here

Examples of org.displaytag.util.Href

        headerCell.setSortName(this.sortName);

        // href and parameter, create link
        if (this.href != null)
        {
            Href colHref;

            // empty base url, use href with parameters from parent table
            if (StringUtils.isEmpty(this.href.getBaseUrl()))
            {
                colHref = (Href) tableTag.getBaseHref().clone();
            }
            else
            {
                colHref = (Href) this.href.clone();
            }

            if (this.paramId != null)
            {
                // parameter value is in a different object than the iterated one
                if (this.paramName != null || this.paramScope != null)
                {
                    // create a complete string for compatibility with previous version before expression evaluation.
                    // this approach is optimized for new expressions, not for previous property/scope parameters
                    StringBuffer expression = new StringBuffer();

                    // append scope
                    if (StringUtils.isNotBlank(this.paramScope))
                    {
                        expression.append(this.paramScope).append("Scope.");
                    }

                    // base bean name
                    if (this.paramId != null)
                    {
                        expression.append(this.paramName);
                    }
                    else
                    {
                        expression.append(tableTag.getName());
                    }

                    // append property
                    if (StringUtils.isNotBlank(this.paramProperty))
                    {
                        expression.append('.').append(this.paramProperty);
                    }

                    // evaluate expression.
                    // note the value is fixed, not based on any object created during iteration
                    // this is here for compatibility with the old version mainly
                    Object paramValue = tableTag.evaluateExpression(expression.toString());

                    // add parameter
                    colHref.addParameter(this.paramId, paramValue);
                }
                else
                {
                    // set id
                    headerCell.setParamName(this.paramId);
View Full Code Here

Examples of org.haystack.tagval.HRef

    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        // get required point id
        if (req.isEmpty())
            throw new Exception("Request has no rows");
        HRow row = req.row(0);
        HRef id = valToId(db, row.get("id"));

        // check for write
        if (row.has("level")) {
            int level = row.getInt("level");
            String who = row.getStr("who"); // be nice to have user fallback
View Full Code Here

Examples of org.haystack.tagval.HRef

    @Override
    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        if (req.isEmpty())
            throw new Exception("Request has no rows");
        HRow row = req.row(0);
        HRef id = valToId(db, row.get("id"));

        String range = row.getStr("range");
        db.hisRead(id, range, writer);
    }
View Full Code Here

Examples of org.haystack.tagval.HRef

    @Override
    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        if (req.isEmpty())
            throw new Exception("Request has no rows");
        HRef id = valToId(db, req.meta().get("id"));

        HHisItem[] items = HHisItem.gridToItems(req);
        db.hisWrite(id, items);

        writeGrid(writer, HGrid.EMPTY);
View Full Code Here

Examples of org.haystack.tagval.HRef

        return "Invoke action on target entity";
    }

    @Override
    public void onService(HServer db, HGrid req, HGridWriter writer) throws Exception {
        HRef id = valToId(db, req.meta().get("id"));

        String action = req.meta().getStr("action");
        HDict args = HDict.EMPTY;
        if (req.numRows() > 0)
            args = req.row(0);
View Full Code Here

Examples of org.haystack.tagval.HRef

        verifyEq(client.readAll("site", 2).numRows(), 2);

        // readById
        HDict rec = client.readById(recA.id());
        verifyEq(rec.dis(), disA);
        HRef badId = HRef.make("badBadId");
        verifyEq(client.readById(badId, false), null);
        try {
            client.readById(badId);
            fail();
        }
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.