Examples of Mappings


Examples of org.andromda.core.mapping.Mappings

       
        if ( url != null )
        {
            String mappingFile = targetDir + "/" + sqlMappingUri.substring( sqlMappingUri.lastIndexOf( "/" ) + 1 );
            Mappings maps = getMappings( sqlMappingUri.substring( 0, sqlMappingUri.indexOf( "!" ) )
                    , sqlMappingUri.substring( sqlMappingUri.indexOf( "!" ) + 1 )
                    , mappingFile );
           
            if ( maps != null )
            {
                String datatype = "datatype::String";

                Mapping mapping = maps.getMapping( datatype );
               
                sqlType = mapping.getTo();
            }
        }
       
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

       
        if ( url != null )
        {
            String mappingFile = targetDir + "/" + sqlMappingUri.substring( sqlMappingUri.lastIndexOf( "/" ) + 1 );
            Mappings maps = getMappings( sqlMappingUri.substring( 0, sqlMappingUri.indexOf( "!" ) )
                    , sqlMappingUri.substring( sqlMappingUri.indexOf( "!" ) + 1 )
                    , mappingFile );
           
            if ( type != null && maps != null )
            {
                String name = type.getName();
                String pack = type.getPackage().getName();
               
                String datatype = pack+"::"+name;

                Mapping mapping = maps.getMapping( datatype );
               
                sqlType = mapping.getTo();
            }
        }
       
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

       
        if ( url != null )
        {
            String mappingFile = targetDir + "/" + jdbcMappingUri.substring( jdbcMappingUri.lastIndexOf( "/" ) + 1 );
            Mappings maps = getMappings( jdbcMappingUri.substring( 0, jdbcMappingUri.indexOf( "!" ) )
                    , jdbcMappingUri.substring( jdbcMappingUri.indexOf( "!" ) + 1 )
                    , mappingFile );
           
            if ( tempType != null && MAPPINGS != null )
            {
                String name = tempType.getName();
                String pack = tempType.getPackage().getName();
               
                String datatype = pack+"::"+name;

                Mapping mapping = maps.getMapping( datatype );
               
                jdbcType = mapping.getTo();
            }
        }
        return jdbcType;
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

    private static Mappings getMappings(String jarFileURL, String jarEntryName, String mappingsFile)
    {

        String mapsFile = mappingsFile.replace( '\\', '/' );
       
        Mappings maps = null;
       
        if ( MAPPINGS.containsKey( mapsFile ) )
        {
            maps = ( Mappings ) MAPPINGS.get( mapsFile );
        }
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

       
        if ( url != null )
        {
            String mappingFile = targetDir + "/" + sqlMappingUri.substring( sqlMappingUri.lastIndexOf( "/" ) + 1 );
            Mappings maps = getMappings( sqlMappingUri.substring( 0, sqlMappingUri.indexOf( "!" ) )
                    , sqlMappingUri.substring( sqlMappingUri.indexOf( "!" ) + 1 )
                    , mappingFile );
           
            if ( maps != null )
            {
                String datatype = "datatype::String";

                Mapping mapping = maps.getMapping( datatype );
               
                sqlType = mapping.getTo();
            }
        }
       
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

       
        if ( url != null )
        {
            String mappingFile = targetDir + "/" + sqlMappingUri.substring( sqlMappingUri.lastIndexOf( "/" ) + 1 );
            Mappings maps = getMappings( sqlMappingUri.substring( 0, sqlMappingUri.indexOf( "!" ) )
                    , sqlMappingUri.substring( sqlMappingUri.indexOf( "!" ) + 1 )
                    , mappingFile );
           
            if ( type != null && maps != null )
            {
                String name = type.getName();
                String pack = type.getPackage().getName();
               
                String datatype = pack+"::"+name;

                Mapping mapping = maps.getMapping( datatype );
               
                sqlType = mapping.getTo();
            }
        }
       
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

       
        if ( url != null )
        {
            String mappingFile = targetDir + "/" + jdbcMappingUri.substring( jdbcMappingUri.lastIndexOf( "/" ) + 1 );
            Mappings maps = getMappings( jdbcMappingUri.substring( 0, jdbcMappingUri.indexOf( "!" ) )
                    , jdbcMappingUri.substring( jdbcMappingUri.indexOf( "!" ) + 1 )
                    , mappingFile );
           
            if ( tempType != null && MAPPINGS != null )
            {
                String name = tempType.getName();
                String pack = tempType.getPackage().getName();
               
                String datatype = pack+"::"+name;

                Mapping mapping = maps.getMapping( datatype );
               
                jdbcType = mapping.getTo();
            }
        }
        return jdbcType;
View Full Code Here

Examples of org.andromda.core.mapping.Mappings

    private static Mappings getMappings(String jarFileURL, String jarEntryName, String mappingsFile)
    {

        String mapsFile = mappingsFile.replace( '\\', '/' );
       
        Mappings maps = null;
       
        if ( MAPPINGS.containsKey( mapsFile ) )
        {
            maps = ( Mappings ) MAPPINGS.get( mapsFile );
        }
View Full Code Here

Examples of org.apache.shale.remoting.Mappings

     *
     * @param context <code>FacesContext</code> for the current request
     */
    public Mappings getMappings(FacesContext context) {

        Mappings mappings = (Mappings)
            context.getExternalContext().getApplicationMap().
                get(Constants.MAPPINGS_ATTR);
        if (mappings == null) {
            mappings = createMappings(context);
            context.getExternalContext().getApplicationMap().
View Full Code Here

Examples of org.apache.shale.remoting.Mappings

     *  or configured
     */
    private Mappings createMappings(FacesContext context) {

        // Instantiate a Mappings instance to configure
        Mappings mappings = null;
        String mappingsClass = MappingsImpl.class.getName();
        String mappingsClassParam =
          context.getExternalContext().getInitParameter(Constants.MAPPINGS_CLASS);
        if (mappingsClassParam != null) {
            mappingsClass = mappingsClassParam;
        }
        Class clazz = null;
        try {
            if (log().isInfoEnabled()) {
                log().info(bundle.getString("mappings.configure"));
                log().info(mappingsClass);
            }
            clazz = loadClass(mappingsClass);
        } catch (Exception e) {
            throw new FacesException(e);
        }
        try {
            mappings = (Mappings) clazz.newInstance();
        } catch (Exception e) {
            throw new FacesException(e);
        }

        // Configure the Mapping instances for this Mappings instance
        configureMappings(context, mappings, Constants.CLASS_RESOURCES_PARAM,
                          Constants.CLASS_RESOURCES_EXCLUDES,
                          Constants.CLASS_RESOURCES_EXCLUDES_DEFAULT,
                          Constants.CLASS_RESOURCES_INCLUDES,
                          Constants.CLASS_RESOURCES_INCLUDES_DEFAULT,
                          Mechanism.CLASS_RESOURCE,
                          "/static/*:org.apache.shale.remoting.impl.ClassResourceProcessor");
        configureMappings(context, mappings, Constants.DYNAMIC_RESOURCES_PARAM,
                          Constants.DYNAMIC_RESOURCES_EXCLUDES,
                          Constants.DYNAMIC_RESOURCES_EXCLUDES_DEFAULT,
                          Constants.DYNAMIC_RESOURCES_INCLUDES,
                          Constants.DYNAMIC_RESOURCES_INCLUDES_DEFAULT,
                          Mechanism.DYNAMIC_RESOURCE,
                          "/dynamic/*:org.apache.shale.remoting.impl.MethodBindingProcessor");
        configureMappings(context, mappings, Constants.OTHER_RESOURCES_PARAM,
                          Constants.OTHER_RESOURCES_EXCLUDES,
                          Constants.OTHER_RESOURCES_EXCLUDES_DEFAULT,
                          Constants.OTHER_RESOURCES_INCLUDES,
                          Constants.OTHER_RESOURCES_INCLUDES_DEFAULT,
                          Mechanism.OTHER_RESOURCE,
                          null);
        configureMappings(context, mappings, Constants.WEBAPP_RESOURCES_PARAM,
                          Constants.WEBAPP_RESOURCES_EXCLUDES,
                          Constants.WEBAPP_RESOURCES_EXCLUDES_DEFAULT,
                          Constants.WEBAPP_RESOURCES_INCLUDES,
                          Constants.WEBAPP_RESOURCES_INCLUDES_DEFAULT,
                          Mechanism.WEBAPP_RESOURCE,
                          "/webapp/*:org.apache.shale.remoting.impl.WebResourceProcessor");

        // Calculate and set the replacement extension, to be used
        // if FacesServlet is extension mapped
        String extension = context.getExternalContext().
                getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME);
        if (extension == null) {
            extension = ViewHandler.DEFAULT_SUFFIX;
        }
        mappings.setExtension(extension);

        // Calculate and set the URL patterns that FacesServlet is mapped with
        // FIXME - hard coded to "*.faces" for now
        String[] patterns = patterns(context);
        if (log().isTraceEnabled()) {
            for (int i = 0; i < patterns.length; i++) {
                log().trace("FacesServlet is mapped with URL pattern '" + patterns[i] + "'");
            }
        }
        mappings.setPatterns(patterns);

        // Calculate the index of the pattern to use by default
        int patternIndex = 0;
        String patternIndexString =
          context.getExternalContext().getInitParameter(Constants.FACES_SERVLET_URL_PARAM);
        if (patternIndexString != null) {
            patternIndex = Integer.parseInt(patternIndexString.trim());
        }
        if (patternIndex >= patterns.length) {
            log.warn("FacesServlet pattern index of " + patternIndex
                     + " does not match any specified pattern");
        }
        mappings.setPatternIndex(patternIndex);

        // Return the configured Mappings instance
        return mappings;

    }
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.