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();
        if (this.name != null)
        {
            attributes.put(A_NAME, name);
            attributes.put(A_ID, context.generateID(E_LABEL, name));
        }
        if (this.rend != null)
            attributes.put(A_RENDER, this.rend);

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


     */

    public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler,
            NamespaceSupport namespaces) throws SAXException
    {
        AttributeMap attributes = new AttributeMap();
        attributes.put(A_NAME, name);
        attributes.put(A_ID, context.generateID(E_TABLE, name));
        attributes.put(A_ROWS, rows);
        attributes.put(A_COLS, cols);
        if (rend != null)
            attributes.put(A_RENDER, rend);

        startElement(contentHandler, namespaces, E_TABLE, attributes);
        if (head != null)
            head.toSAX(contentHandler, lexicalHandler, namespaces);
        for (AbstractWingElement content : contents)
View Full Code Here

            NamespaceSupport namespaces) throws SAXException
    {

        if (this.merged == false)
        {
            AttributeMap attributes = new AttributeMap();
            attributes.put(A_NAME, this.name);
            attributes.put(A_ID, this.context.generateID(E_LIST, this.name));
            if (this.type != null)
                attributes.put(A_TYPE, this.type);
            if (this.rend != null)
                attributes.put(A_RENDER, this.rend);

            startElement(contentHandler, namespaces, E_LIST, attributes);
           
        }
           
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 (this.rend != null)
            attributes.put(A_RENDER, this.rend);

        startElement(contentHandler, namespaces, E_HIGHLIGHT, attributes);
        super.toSAX(contentHandler, lexicalHandler, namespaces);
        endElement(contentHandler, namespaces, E_HIGHLIGHT);
    }
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_ROW, name));
        }

        if (role != null)
            attributes.put(A_ROLE, role);

        if (rend != null)
            attributes.put(A_RENDER, rend);

        startElement(contentHandler, namespaces, E_ROW, attributes);
        for (AbstractWingElement content : contents)
            content.toSAX(contentHandler, lexicalHandler, namespaces);
        endElement(contentHandler, namespaces, E_ROW);
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);

        boolean unknownType = false;

        if (dictionaryParameter.getClass().equals(Date.class.getName()))
        {
            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.getClass().equals(Integer.class.getName()))
        {
            Integer value = (Integer) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter.getClass().equals(Double.class.getName()))
        {
            Double value = (Double) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter.getClass().equals(Long.class.getName()))
        {
            Long value = (Long) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter.getClass().equals(Short.class.getName()))
        {
            Short value = (Short) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else if (dictionaryParameter.getClass().equals(Float.class.getName()))
        {
            Float value = (Float) dictionaryParameter;
            attributes.put(A_TYPE, TYPE_NUMBER);
            attributes.put(A_VALUE, String.valueOf(value));
        }
        else
        {
            // Unknown types or String
            unknownType = true;
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)
            head.toSAX(contentHandler, lexicalHandler, namespaces);
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.