Package org.dspace.app.xmlui.wing

Examples of org.dspace.app.xmlui.wing.AttributeMap


     *            to determine the correct prefix for a given namespace URI.
     */
    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        attributes.put(A_REPOSITORY_ID, this.repository);
        attributes.put(A_URL, this.url);
        if (type != null)
        {
            attributes.put(A_TYPE, type);
        }
       
        startElement(contentHandler, namespaces, E_REFERENCE, attributes);

        for (AbstractWingElement content : contents)
View Full Code Here


     */
    public void toSAX(ContentHandler contentHandler,
            LexicalHandler lexicalHandler, NamespaceSupport namespaces)
            throws SAXException
    {
        AttributeMap attributes = new AttributeMap();

        attributes.put(A_NAME, this.name);
        attributes.put(A_ID, this.context.generateID(E_FIELD, this.name));
        attributes.put(A_FIELD_TYPE, this.type);
        if (this.disabled)
        {
            attributes.put(A_DISABLED, this.disabled);
        }
        if (this.required)
        {
            attributes.put(A_REQUIRED, this.required);
        }
        if (this.rend != null)
        {
            attributes.put(A_RENDER, this.rend);
        }

        startElement(contentHandler, namespaces, E_FIELD, attributes);

        if (params != null)
View Full Code Here

    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        if (!merged)
        {
            AttributeMap divAttributes = new AttributeMap();
            divAttributes.put(A_NAME, name);
            divAttributes.put(A_ID, context.generateID(E_DIVISION, name));
            if (interactive)
            {
                divAttributes.put(A_INTERACTIVE, "yes");
                divAttributes.put(A_ACTION, action);
                divAttributes.put(A_METHOD, method);
               
                if (behaviorAJAXenabled)
                {
                    divAttributes.put(A_BEHAVIOR,"ajax");
                }
               
                if (behaviorSensitiveFields != null)
                {
                    divAttributes.put(A_BEHVIOR_SENSITIVE_FIELDS,behaviorSensitiveFields);
                }
            }

            if (PAGINATION_SIMPLE.equals(paginationType))
            {

                divAttributes.put(A_PAGINATION, paginationType);
                if (previousPage != null)
                {
                    divAttributes.put(A_PREVIOUS_PAGE, previousPage);
                }
                if (nextPage != null)
                {
                    divAttributes.put(A_NEXT_PAGE, nextPage);
                }
                divAttributes.put(A_ITEMS_TOTAL, itemsTotal);
                divAttributes.put(A_FIRST_ITEM_INDEX, firstItemIndex);
                divAttributes.put(A_LAST_ITEM_INDEX, lastItemIndex);
            }
            else if (PAGINATION_MASKED.equals(paginationType))
            {

                divAttributes.put(A_PAGINATION, paginationType);
                divAttributes.put(A_ITEMS_TOTAL, itemsTotal);
                divAttributes.put(A_FIRST_ITEM_INDEX, firstItemIndex);
                divAttributes.put(A_LAST_ITEM_INDEX, lastItemIndex);
                divAttributes.put(A_CURRENT_PAGE, currentPage);
                divAttributes.put(A_PAGES_TOTAL, pagesTotal);
                divAttributes.put(A_PAGE_URL_MASK, pageURLMask);
            }

            if (rend != null)
            {
                divAttributes.put(A_RENDER, rend);
            }

            startElement(contentHandler, namespaces, E_DIVISION, divAttributes);

            if (head != null)
View Full Code Here

     */

    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        if (name != null)
        {
            attributes.put(A_NAME, name);
            attributes.put(A_ID, context.generateID(E_PARA, name));
        }
        if (rend != null)
        {
            attributes.put("rend", rend);
        }

        startElement(contentHandler, namespaces, E_PARA, attributes);
        super.toSAX(contentHandler, lexicalHandler, namespaces);
        endElement(contentHandler, namespaces, E_PARA);
View Full Code Here

     *            to determine the correct prefix for a given namespace URI.
     */
    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        if (name != null)
        {
            attributes.put(A_NAME, name);
        }
        if (name != null)
        {
            attributes.put(A_ID, context.generateID(E_ITEM, name));
        }
        if (rend != null)
        {
            attributes.put(A_RENDER, rend);
        }

        startElement(contentHandler, namespaces, E_ITEM, attributes);
        super.toSAX(contentHandler, lexicalHandler, namespaces);
        endElement(contentHandler, namespaces, E_ITEM);
View Full Code Here

                    || dictionaryParameters.length == 0)
            {
                // No parameters, we can use the simple method
                // <i18n:text> Text to be translated </i18n:text>

                AttributeMap attributes = new AttributeMap();
                attributes.setNamespace(WingConstants.I18N);
                attributes.put(A_CATALOGUE, catalogue);

                startElement(contentHandler, namespaces, WingConstants.I18N,
                        E_TEXT, attributes);
                sendCharacters(contentHandler, message.getKey());
                endElement(contentHandler, namespaces, WingConstants.I18N,
                        E_TEXT);

            }
            else
            {
                // There are parameters, we need to us the complex method.
                // <i18n:translate>
                // <i18n:text> some {0} was inserted {1}. </i18n:text>
                // <i18n:param> text </i18n:param>
                // <i18n:param> here </i18n:param>
                // </i18n:translate>

                startElement(contentHandler, namespaces, WingConstants.I18N,
                        E_TRANSLATE, null);

                AttributeMap attributes = new AttributeMap();
                attributes.setNamespace(WingConstants.I18N);
                attributes.put(A_CATALOGUE, catalogue);

                startElement(contentHandler, namespaces, WingConstants.I18N,
                        E_TEXT, attributes);
                sendCharacters(contentHandler, message.getKey());
                endElement(contentHandler, namespaces, WingConstants.I18N,
View Full Code Here

     */
    private void toSAX(ContentHandler contentHandler,
            NamespaceSupport namespaces, Object dictionaryParameter)
            throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        attributes.setNamespace(WingConstants.I18N);

        if (dictionaryParameter instanceof Date)
        {
            Date date = (Date) dictionaryParameter;
            DateFormat dateFormater = DateFormat
                    .getDateInstance(DateFormat.DEFAULT);

            attributes.put(A_TYPE, TYPE_DATE);
            attributes.put(A_VALUE, dateFormater.format(date));
            // If no pattern is given then the default format is assumed.
        }
        else if (dictionaryParameter instanceof Integer)
        {
            Integer value = (Integer) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter instanceof Double)
        {
            Double value = (Double) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter instanceof Long)
        {
            Long value = (Long) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter instanceof Short)
        {
            Short value = (Short) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter instanceof Float)
        {
            Float value = (Float) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }

        startElement(contentHandler, namespaces, WingConstants.I18N, E_PARAM, attributes);

        // If the type is unknown then the value is not included as an attribute
View Full Code Here

     *            to determine the correct prefix for a given namespace URI.
     */
    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        if (name != null)
        {
            attributes.put(A_NAME, name);
        }
        if (name != null)
        {
            attributes.put(A_ID, context.generateID(E_REFERENCE_SET, name));
        }

        attributes.put(A_TYPE, type);
        if (orderBy != null)
        {
            attributes.put(A_ORDER_BY, orderBy);
        }
        if (rend != null)
        {
            attributes.put(A_RENDER, rend);
        }

        startElement(contentHandler, namespaces, E_REFERENCE_SET, attributes);

        if (head != null)
View Full Code Here

    public void toSAX(ContentHandler contentHandler,
            LexicalHandler lexicalHandler, NamespaceSupport namespaces)
            throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        attributes.put(A_RETURN_VALUE, this.returnValue);
       
        startElement(contentHandler, namespaces, E_OPTION, attributes);
        super.toSAX(contentHandler, lexicalHandler, namespaces);
        endElement(contentHandler, namespaces, E_OPTION);
    }
View Full Code Here

     *            to determine the correct prefix for a given namespace URI.
     */
    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        if (name != null)
        {
            attributes.put(A_NAME, name);
            attributes.put(A_ID, context.generateID(E_CELL, name));
        }

        if (role != null)
        {
            attributes.put(A_ROLE, role);
        }
        // else
        // attributes.put(A_ROLE, ROLE_DATA);
        if (rows > 0)
        {
            attributes.put(A_ROWS, rows);
        }
        if (cols > 0)
        {
            attributes.put(A_COLS, cols);
        }
        if (rend != null)
        {
            attributes.put(A_RENDER, rend);
        }

        startElement(contentHandler, namespaces, E_CELL, attributes);
        super.toSAX(contentHandler, lexicalHandler, namespaces);
        endElement(contentHandler, namespaces, E_CELL);
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.AttributeMap

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.