Package org.apache.archiva.metadata.model

Examples of org.apache.archiva.metadata.model.MetadataFacetFactory


    private static final String TEST_METADATA_VALUE = "test-metadata";

    protected static Map<String, MetadataFacetFactory> createTestMetadataFacetFactories()
    {
        Map<String, MetadataFacetFactory> factories = new HashMap<String, MetadataFacetFactory>();
        factories.put( TEST_FACET_ID, new MetadataFacetFactory()
        {
            public MetadataFacet createMetadataFacet()
            {
                return new TestMetadataFacet( TEST_METADATA_VALUE );
            }

            public MetadataFacet createMetadataFacet( String repositoryId, String name )
            {
                return new TestMetadataFacet( TEST_METADATA_VALUE );
            }
        } );

        // add to ensure we don't accidentally create an empty facet ID.
        factories.put( "", new MetadataFacetFactory()
        {
            public MetadataFacet createMetadataFacet()
            {
                return new TestMetadataFacet( "", TEST_VALUE );
            }
View Full Code Here


            // TODO
            log.error( e.getMessage(), e );
            return null;
        }
        MetadataFacet metadataFacet = null;
        MetadataFacetFactory metadataFacetFactory = metadataFacetFactories.get( facetId );
        if ( metadataFacetFactory != null )
        {
            metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name );
            Map<String, String> map = new HashMap<String, String>();
            for ( Object key : new ArrayList( properties.keySet() ) )
            {
                String property = (String) key;
                map.put( property, properties.getProperty( property ) );
View Full Code Here

                    if ( value.length() > 0 )
                    {
                        String propertyPrefix = "artifact:facet:" + id + ":";
                        for ( String facetId : value.split( "," ) )
                        {
                            MetadataFacetFactory factory = metadataFacetFactories.get( facetId );
                            if ( factory == null )
                            {
                                log.error( "Attempted to load unknown artifact metadata facet: " + facetId );
                            }
                            else
                            {
                                MetadataFacet facet = factory.createMetadataFacet();
                                String prefix = propertyPrefix + facet.getFacetId();
                                Map<String, String> map = new HashMap<String, String>();
                                for ( Object key : new ArrayList( properties.keySet() ) )
                                {
                                    String property = (String) key;
View Full Code Here

            String facetIds = properties.getProperty( "facetIds", "" );
            if ( facetIds.length() > 0 )
            {
                for ( String facetId : facetIds.split( "," ) )
                {
                    MetadataFacetFactory factory = metadataFacetFactories.get( facetId );
                    if ( factory == null )
                    {
                        log.error( "Attempted to load unknown project version metadata facet: {}", facetId );
                    }
                    else
                    {
                        MetadataFacet facet = factory.createMetadataFacet();
                        Map<String, String> map = new HashMap<String, String>();
                        for ( Object key : new ArrayList( properties.keySet() ) )
                        {
                            String property = (String) key;
                            if ( property.startsWith( facet.getFacetId() ) )
View Full Code Here

        try
        {
            Node root = session.getRootNode();
            Node node = root.getNode( getFacetPath( repositoryId, facetId, name ) );

            MetadataFacetFactory metadataFacetFactory = metadataFacetFactories.get( facetId );
            if ( metadataFacetFactory != null )
            {
                metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name );
                Map<String, String> map = new HashMap<String, String>();
                for ( Property property : JcrUtils.getProperties( node ) )
                {
                    String p = property.getName();
                    if ( !p.startsWith( "jcr:" ) )
View Full Code Here

            for ( Node n : JcrUtils.getChildNodes( node ) )
            {
                if ( n.isNodeType( FACET_NODE_TYPE ) )
                {
                    String name = n.getName();
                    MetadataFacetFactory factory = metadataFacetFactories.get( name );
                    if ( factory == null )
                    {
                        log.error( "Attempted to load unknown project version metadata facet: {}", name );
                    }
                    else
                    {
                        MetadataFacet facet = factory.createMetadataFacet();
                        Map<String, String> map = new HashMap<String, String>();
                        for ( Property property : JcrUtils.getProperties( n ) )
                        {
                            String p = property.getName();
                            if ( !p.startsWith( "jcr:" ) )
View Full Code Here

        for ( Node n : JcrUtils.getChildNodes( artifactNode ) )
        {
            if ( n.isNodeType( FACET_NODE_TYPE ) )
            {
                String name = n.getName();
                MetadataFacetFactory factory = metadataFacetFactories.get( name );
                if ( factory == null )
                {
                    log.error( "Attempted to load unknown project version metadata facet: " + name );
                }
                else
                {
                    MetadataFacet facet = factory.createMetadataFacet();
                    Map<String, String> map = new HashMap<String, String>();
                    for ( Property p : JcrUtils.getProperties( n ) )
                    {
                        String property = p.getName();
                        if ( !property.startsWith( "jcr:" ) )
View Full Code Here

            // TODO
            log.error( e.getMessage(), e );
            return null;
        }
        MetadataFacet metadataFacet = null;
        MetadataFacetFactory metadataFacetFactory = metadataFacetFactories.get( facetId );
        if ( metadataFacetFactory != null )
        {
            metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name );
            Map<String, String> map = new HashMap<>();
            for ( Object key : new ArrayList( properties.keySet() ) )
            {
                String property = (String) key;
                map.put( property, properties.getProperty( property ) );
View Full Code Here

                    if ( value.length() > 0 )
                    {
                        String propertyPrefix = "artifact:facet:" + id + ":";
                        for ( String facetId : value.split( "," ) )
                        {
                            MetadataFacetFactory factory = metadataFacetFactories.get( facetId );
                            if ( factory == null )
                            {
                                log.error( "Attempted to load unknown artifact metadata facet: " + facetId );
                            }
                            else
                            {
                                MetadataFacet facet = factory.createMetadataFacet();
                                String prefix = propertyPrefix + facet.getFacetId();
                                Map<String, String> map = new HashMap<>();
                                for ( Object key : new ArrayList( properties.keySet() ) )
                                {
                                    String property = (String) key;
View Full Code Here

            String facetIds = properties.getProperty( "facetIds", "" );
            if ( facetIds.length() > 0 )
            {
                for ( String facetId : facetIds.split( "," ) )
                {
                    MetadataFacetFactory factory = metadataFacetFactories.get( facetId );
                    if ( factory == null )
                    {
                        log.error( "Attempted to load unknown project version metadata facet: {}", facetId );
                    }
                    else
                    {
                        MetadataFacet facet = factory.createMetadataFacet();
                        Map<String, String> map = new HashMap<>();
                        for ( Object key : new ArrayList( properties.keySet() ) )
                        {
                            String property = (String) key;
                            if ( property.startsWith( facet.getFacetId() ) )
View Full Code Here

TOP

Related Classes of org.apache.archiva.metadata.model.MetadataFacetFactory

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.