import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.content.Artifact;
import org.apache.archiva.repository.content.ContentItem;
+import org.apache.archiva.repository.content.DataItem;
import org.apache.archiva.repository.content.ItemNotFoundException;
import org.apache.archiva.repository.content.ItemSelector;
import org.apache.archiva.repository.content.Namespace;
/// ***************** New generation interface **********************
+
/**
* Returns the namespace for the given selected coordinates. The selector must specify a namespace. All other
* coordinates are ignored.
*/
void addArtifact( Path sourceFile, Artifact destination ) throws IllegalArgumentException, ContentAccessException;
+ /**
+ * Returns the metadata file for the given version.
+ *
+ * @param version the version
+ * @return the metadata file
+ */
+ DataItem getMetadataItem( Version version );
+
/// ***************** End of new generation interface **********************
*/
String toMetadataPath( ProjectReference reference );
- /**
- * Given a {@link VersionedReference}, return the path to the metadata for
- * the specific version of the project.
- *
- * @param reference the reference to use.
- * @return the path to the metadata file, or null if no metadata is appropriate.
- */
- String toMetadataPath( VersionedReference reference );
-
- /**
- * Given an {@link ArchivaArtifact}, return the relative path to the artifact.
- *
- * @param reference the archiva artifact to use.
- * @return the relative path to the artifact.
- */
- String toPath( ArchivaArtifact reference );
-
}
/**
* @author Martin Stockhammer <martin_s@apache.org>
*/
-public interface ManagedRepositoryContent
+public interface ManagedRepositoryContent extends RepositoryContent
{
String toPath( ContentItem item );
-
/**
* <p>
* Convenience method to get the repository id.
* under the License.
*/
+import org.apache.archiva.repository.content.ContentItem;
+import org.apache.archiva.repository.content.DataItem;
+
/**
*
* Basic interface for content layouts.
*/
public interface ManagedRepositoryContentLayout
{
+
+ /**
+ * Returns the repository content, that this layout is attached to.
+ * @return the content instance
+ */
ManagedRepositoryContent getGenericContent();
+
+ /**
+ * Adapts a generic content item to a specific implementation class.
+ *
+ * @param clazz the target implementation
+ * @param item the content item
+ * @param <T> the target class
+ * @return the adapted instance
+ * @throws LayoutException if the conversion is not possible
+ */
+ <T extends ContentItem> T adaptItem( Class<T> clazz, ContentItem item ) throws LayoutException;
}
import org.apache.archiva.repository.BaseRepositoryContentLayout;
import org.apache.archiva.repository.ManagedRepositoryContentLayout;
import org.apache.archiva.repository.content.Artifact;
+import org.apache.archiva.repository.content.BaseDataItemTypes;
import org.apache.archiva.repository.content.ContentItem;
+import org.apache.archiva.repository.content.DataItem;
import org.apache.archiva.repository.content.ItemNotFoundException;
import org.apache.archiva.repository.content.ItemSelector;
import org.apache.archiva.repository.content.Namespace;
import org.apache.archiva.repository.content.Project;
import org.apache.archiva.repository.content.Version;
+import org.apache.archiva.repository.content.base.ArchivaContentItem;
+import org.apache.archiva.repository.content.base.ArchivaDataItem;
+import org.apache.archiva.repository.content.base.ArchivaNamespace;
+import org.apache.archiva.repository.content.base.ArchivaProject;
+import org.apache.archiva.repository.content.base.ArchivaVersion;
import org.apache.archiva.repository.storage.StorageAsset;
import org.springframework.stereotype.Service;
}
+ @Override
+ public <T extends ContentItem> T adaptItem( Class<T> clazz, ContentItem item ) throws LayoutException
+ {
+ if (clazz.isAssignableFrom( Version.class ))
+ {
+ if ( !item.hasCharacteristic( Version.class ) )
+ {
+ item.setCharacteristic( Version.class, createVersionFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Version.class );
+ } else if ( clazz.isAssignableFrom( Project.class )) {
+ if ( !item.hasCharacteristic( Project.class ) )
+ {
+ item.setCharacteristic( Project.class, createProjectFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Project.class );
+ } else if ( clazz.isAssignableFrom( Namespace.class )) {
+ if ( !item.hasCharacteristic( Namespace.class ) )
+ {
+ item.setCharacteristic( Namespace.class, createNamespaceFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Namespace.class );
+ }
+ throw new LayoutException( "Could not convert item to class " + clazz);
+ }
+
+ private Version createVersionFromPath( StorageAsset asset )
+ {
+ Project proj = createProjectFromPath( asset.getParent( ) );
+ return ArchivaVersion.withRepository( this ).withAsset( asset )
+ .withProject( proj ).withVersion( asset.getName( ) ).build();
+ }
+
+ private Project createProjectFromPath( StorageAsset asset) {
+ Namespace ns = createNamespaceFromPath( asset );
+ return ArchivaProject.withRepository( this ).withAsset( asset )
+ .withNamespace( ns ).withId( asset.getName( ) ).build( );
+ }
+
+ private Namespace createNamespaceFromPath( StorageAsset asset) {
+ String namespace = asset.getPath( ).replace( "/", "." );
+ return ArchivaNamespace.withRepository( this )
+ .withAsset( asset ).withNamespace( namespace ).build();
+ }
+
+
@Override
public void deleteItem( ContentItem item ) throws ItemNotFoundException, ContentAccessException
{
@Override
public ContentItem getParent( ContentItem item )
{
- return null;
+ try
+ {
+ return toItem( item.getAsset( ).getParent( ) );
+ }
+ catch ( LayoutException e )
+ {
+ throw new RuntimeException( "Bad layout error " + e.getMessage( ) );
+ }
}
@Override
}
+ @Override
+ public DataItem getMetadataItem( Version version )
+ {
+ return ArchivaDataItem.withAsset( version.getAsset( ).resolve( "maven-metadata.xml" ) ).withId( "maven-metadata.xml" )
+ .withDataType( BaseDataItemTypes.METADATA ).build();
+ }
+
@Override
public ContentItem toItem( String path ) throws LayoutException
{
- return null;
+ StorageAsset asset = repository.getAsset( "" ).resolve( path );
+ return toItem( asset );
}
@Override
- public ContentItem toItem( StorageAsset assetPath ) throws LayoutException
+ public ContentItem toItem( StorageAsset asset ) throws LayoutException
{
- return null;
+ if (asset.isLeaf()) {
+ return ArchivaDataItem.withAsset( asset ).withId( asset.getName() ).build();
+ } else
+ {
+ return ArchivaContentItem.withRepository( this )
+ .withAsset( asset ).build( );
+ }
}
return null;
}
- @Override
- public String toMetadataPath( VersionedReference reference )
- {
- return null;
- }
-
@Override
public String toPath( ArtifactReference reference )
{
return null;
}
- @Override
- public String toPath( ArchivaArtifact reference )
- {
- return null;
- }
-
@Override
public ManagedRepositoryContent getGenericContent( )
{
import org.apache.archiva.repository.*;
import org.apache.archiva.repository.content.Artifact;
import org.apache.archiva.repository.content.ContentItem;
+import org.apache.archiva.repository.content.DataItem;
import org.apache.archiva.repository.content.ItemNotFoundException;
import org.apache.archiva.repository.content.ItemSelector;
import org.apache.archiva.repository.content.Namespace;
import org.apache.archiva.repository.content.Project;
import org.apache.archiva.repository.content.Version;
+import org.apache.archiva.repository.content.base.ArchivaNamespace;
+import org.apache.archiva.repository.content.base.ArchivaProject;
+import org.apache.archiva.repository.content.base.ArchivaVersion;
import org.apache.archiva.repository.storage.fs.FilesystemStorage;
import org.apache.archiva.repository.storage.StorageAsset;
import org.apache.commons.lang3.StringUtils;
return null;
}
+ @Override
+ public <T extends ContentItem> T adaptItem( Class<T> clazz, ContentItem item ) throws LayoutException
+ {
+ if (clazz.isAssignableFrom( Version.class ))
+ {
+ if ( !item.hasCharacteristic( Version.class ) )
+ {
+ item.setCharacteristic( Version.class, createVersionFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Version.class );
+ } else if ( clazz.isAssignableFrom( Project.class )) {
+ if ( !item.hasCharacteristic( Project.class ) )
+ {
+ item.setCharacteristic( Project.class, createProjectFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Project.class );
+ } else if ( clazz.isAssignableFrom( Namespace.class )) {
+ if ( !item.hasCharacteristic( Namespace.class ) )
+ {
+ item.setCharacteristic( Namespace.class, createNamespaceFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Namespace.class );
+ }
+ throw new LayoutException( "Could not convert item to class " + clazz);
+ }
+
+ private Version createVersionFromPath( StorageAsset asset )
+ {
+ Project proj = createProjectFromPath( asset.getParent( ) );
+ return ArchivaVersion.withRepository( this ).withAsset( asset )
+ .withProject( proj ).withVersion( asset.getName( ) ).build();
+ }
+
+ private Project createProjectFromPath( StorageAsset asset) {
+ Namespace ns = createNamespaceFromPath( asset );
+ return ArchivaProject.withRepository( this ).withAsset( asset )
+ .withNamespace( ns ).withId( asset.getName( ) ).build( );
+ }
+
+ private Namespace createNamespaceFromPath( StorageAsset asset) {
+ String namespace = asset.getPath( ).replace( "/", "." );
+ return ArchivaNamespace.withRepository( this )
+ .withAsset( asset ).withNamespace( namespace ).build();
+ }
+
+
@Override
public void deleteAllItems( ItemSelector selector, Consumer<ItemDeleteStatus> consumer ) throws ContentAccessException, IllegalArgumentException
{
@Override
public ContentItem getParent( ContentItem item )
{
- return null;
+ try
+ {
+ return toItem( item.getAsset( ).getParent( ) );
+ }
+ catch ( LayoutException e )
+ {
+ throw new RuntimeException( "Bad layout conversion " + e.getMessage( ) );
+ }
}
@Override
}
+ @Override
+ public DataItem getMetadataItem( Version version )
+ {
+ return null;
+ }
+
@Override
public ContentItem toItem( String path ) throws LayoutException
{
return path.toString();
}
- public String toMetadataPath( VersionedReference reference )
- {
- StringBuilder path = new StringBuilder();
-
- path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR );
- path.append( reference.getArtifactId() ).append( PATH_SEPARATOR );
- if ( reference.getVersion() != null )
- {
- // add the version only if it is present
- path.append( VersionUtil.getBaseVersion( reference.getVersion() ) ).append( PATH_SEPARATOR );
- }
- path.append( MAVEN_METADATA );
-
- return path.toString();
- }
-
@Override
public String toPath( ArtifactReference reference )
{
return null;
}
- @Override
- public String toPath( ArchivaArtifact reference )
- {
- return null;
- }
-
@Override
public ManagedRepositoryContent getGenericContent( )
{
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.archiva.policies.SnapshotsPolicy;
import org.apache.archiva.repository.BaseRepositoryContentLayout;
+import org.apache.archiva.repository.content.ContentItem;
+import org.apache.archiva.repository.content.DataItem;
+import org.apache.archiva.repository.content.Version;
import org.apache.archiva.repository.metadata.base.MetadataTools;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter;
{
Path expectedFile = managedDefaultDir.resolve(requestedResource);
- VersionedReference metadata = createVersionedReference( requestedResource );
-
+ ContentItem item = managedDefaultRepository.toItem( requestedResource );
+ if (item instanceof DataItem) {
+ item = managedDefaultRepository.getParent( item );
+ }
+ assertNotNull( item );
BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class );
+ Version version = layout.adaptItem( Version.class, item );
+ assertNotNull( version );
+ String metaPath = managedDefaultRepository.toPath( layout.getMetadataItem(
+ version ) );
+
StorageAsset downloadedFile = proxyHandler.fetchMetadataFromProxies( managedDefaultRepository.getRepository(),
- layout.toMetadataPath(
- metadata ) ).getFile();
+ metaPath).getFile();
assertNotNull( "Should have downloaded a file.", downloadedFile );
assertNoTempFiles( expectedFile );
throws Exception
{
Path expectedFile = managedDefaultDir.resolve(requestedResource);
- VersionedReference metadata = createVersionedReference( requestedResource );
-
+ ContentItem item = managedDefaultRepository.toItem( requestedResource );
+ assertNotNull( item );
BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class );
+ Version version = layout.adaptItem( Version.class, item );
+ assertNotNull( version );
+ String metaPath = managedDefaultRepository.toPath( layout.getMetadataItem(
+ version ) );
+ assertNotNull( metaPath );
StorageAsset downloadedFile = proxyHandler.fetchMetadataFromProxies( managedDefaultRepository.getRepository(),
- layout.toMetadataPath(
- metadata ) ).getFile();
+ metaPath ).getFile();
assertNull( downloadedFile );
assertNoTempFiles( expectedFile );
import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.*;
import org.apache.archiva.repository.content.Artifact;
+import org.apache.archiva.repository.content.BaseDataItemTypes;
import org.apache.archiva.repository.content.ContentItem;
+import org.apache.archiva.repository.content.DataItem;
import org.apache.archiva.repository.content.ItemNotFoundException;
import org.apache.archiva.repository.content.ItemSelector;
import org.apache.archiva.repository.content.Namespace;
import org.apache.archiva.repository.content.Project;
import org.apache.archiva.repository.content.Version;
+import org.apache.archiva.repository.content.base.ArchivaContentItem;
+import org.apache.archiva.repository.content.base.ArchivaDataItem;
+import org.apache.archiva.repository.content.base.ArchivaNamespace;
+import org.apache.archiva.repository.content.base.ArchivaProject;
+import org.apache.archiva.repository.content.base.ArchivaVersion;
import org.apache.archiva.repository.storage.fs.FilesystemStorage;
import org.apache.archiva.repository.storage.RepositoryStorage;
import org.apache.archiva.repository.storage.StorageAsset;
return null;
}
+ @Override
+ public <T extends ContentItem> T adaptItem( Class<T> clazz, ContentItem item ) throws LayoutException
+ {
+ if (clazz.isAssignableFrom( Version.class ))
+ {
+ if ( !item.hasCharacteristic( Version.class ) )
+ {
+ item.setCharacteristic( Version.class, createVersionFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Version.class );
+ } else if ( clazz.isAssignableFrom( Project.class )) {
+ if ( !item.hasCharacteristic( Project.class ) )
+ {
+ item.setCharacteristic( Project.class, createProjectFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Project.class );
+ } else if ( clazz.isAssignableFrom( Namespace.class )) {
+ if ( !item.hasCharacteristic( Namespace.class ) )
+ {
+ item.setCharacteristic( Namespace.class, createNamespaceFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Namespace.class );
+ }
+ throw new LayoutException( "Could not convert item to class " + clazz);
+ }
+
+ private Version createVersionFromPath( StorageAsset asset )
+ {
+ Project proj = createProjectFromPath( asset.getParent( ) );
+ return ArchivaVersion.withRepository( this ).withAsset( asset )
+ .withProject( proj ).withVersion( asset.getName( ) ).build();
+ }
+
+ private Project createProjectFromPath( StorageAsset asset) {
+ Namespace ns = createNamespaceFromPath( asset );
+ return ArchivaProject.withRepository( this ).withAsset( asset )
+ .withNamespace( ns ).withId( asset.getName( ) ).build( );
+ }
+
+ private Namespace createNamespaceFromPath( StorageAsset asset) {
+ String namespace = asset.getPath( ).replace( "/", "." );
+ return ArchivaNamespace.withRepository( this )
+ .withAsset( asset ).withNamespace( namespace ).build();
+ }
+
@Override
public void deleteAllItems( ItemSelector selector, Consumer<ItemDeleteStatus> consumer ) throws ContentAccessException, IllegalArgumentException
{
@Override
public ContentItem getParent( ContentItem item )
{
- return null;
+ try
+ {
+ return toItem( item.getAsset( ).getParent( ) );
+ }
+ catch ( LayoutException e )
+ {
+ throw new RuntimeException( "Bad layout conversion " + e.getMessage( ) );
+ }
}
@Override
}
+ @Override
+ public DataItem getMetadataItem( Version version )
+ {
+ return ArchivaDataItem.withAsset( version.getAsset( ).resolve( "maven-metadata.xml" ) ).withId( "maven-metadata.xml" )
+ .withDataType( BaseDataItemTypes.METADATA ).build();
+ }
+
@Override
public ContentItem toItem( String path ) throws LayoutException
{
- return null;
+ StorageAsset asset = repository.getAsset( "" ).resolve( path );
+ return toItem( asset );
}
@Override
- public ContentItem toItem( StorageAsset assetPath ) throws LayoutException
+ public ContentItem toItem( StorageAsset asset ) throws LayoutException
{
- return null;
+ if (asset.isLeaf()) {
+ return ArchivaDataItem.withAsset( asset ).withId( asset.getName( ) ).build();
+ } else
+ {
+ return ArchivaContentItem.withRepository( this )
+ .withAsset( asset )
+ .build( );
+ }
}
@Override
@Override
public String toPath( ContentItem item )
{
- return null;
+ return item.getAsset( ).getPath( );
}
@Override
return path.toString();
}
- public String toMetadataPath( VersionedReference reference )
- {
- StringBuilder path = new StringBuilder();
-
- path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR );
- path.append( reference.getArtifactId() ).append( PATH_SEPARATOR );
- if ( reference.getVersion() != null )
- {
- // add the version only if it is present
- path.append( VersionUtil.getBaseVersion( reference.getVersion() ) ).append( PATH_SEPARATOR );
- }
- path.append( MAVEN_METADATA );
-
- return path.toString();
- }
-
@Override
public String toPath( ArtifactReference reference )
{
return null;
}
- @Override
- public String toPath( ArchivaArtifact reference )
- {
- return null;
- }
-
@Override
public ManagedRepositoryContent getGenericContent( )
{
import org.apache.archiva.common.utils.VersionUtil;
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
-import org.apache.archiva.repository.content.ContentItem;
import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
import org.apache.archiva.repository.maven.metadata.storage.Maven2RepositoryPathTranslator;
import org.apache.archiva.model.ArchivaArtifact;
}
+
public String toMetadataPath( ProjectReference reference )
{
final StringBuilder path = new StringBuilder();
import org.apache.archiva.common.filelock.FileLockManager;
import org.apache.archiva.common.utils.FileUtils;
+import org.apache.archiva.common.utils.VersionUtil;
import org.apache.archiva.configuration.FileTypes;
import org.apache.archiva.metadata.maven.MavenMetadataReader;
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
/// ************* Start of new generation interface ******************
+ @Override
+ public <T extends ContentItem> T adaptItem( Class<T> clazz, ContentItem item ) throws LayoutException
+ {
+ if (clazz.isAssignableFrom( Version.class ))
+ {
+ if ( !item.hasCharacteristic( Version.class ) )
+ {
+ item.setCharacteristic( Version.class, createVersionFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Version.class );
+ } else if ( clazz.isAssignableFrom( Project.class )) {
+ if ( !item.hasCharacteristic( Project.class ) )
+ {
+ item.setCharacteristic( Project.class, createProjectFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Project.class );
+ } else if ( clazz.isAssignableFrom( Namespace.class )) {
+ if ( !item.hasCharacteristic( Namespace.class ) )
+ {
+ item.setCharacteristic( Namespace.class, createNamespaceFromPath( item.getAsset() ) );
+ }
+ return (T) item.adapt( Namespace.class );
+ } else if ( clazz.isAssignableFrom( Artifact.class )) {
+ if (!item.hasCharacteristic( Artifact.class )) {
+ item.setCharacteristic( Artifact.class, createArtifactFromPath( item.getAsset( ) ) );
+ }
+ return (T) item.adapt( Artifact.class );
+ }
+ throw new LayoutException( "Could not convert item to class " + clazz);
+ }
+
+
@Override
public void deleteAllItems( ItemSelector selector, Consumer<ItemDeleteStatus> consumer ) throws ContentAccessException, IllegalArgumentException
{
return item.getAsset( ).getPath( );
}
+ @Override
+ public DataItem getMetadataItem( Version version ) {
+ StorageAsset metaPath = version.getAsset( ).resolve( MAVEN_METADATA );
+ return getDataItemFromPath( metaPath );
+ }
+
+
@Override
public void deleteVersion( VersionedReference ref ) throws ContentNotFoundException, ContentAccessException
{
assertTrue( new String( content ).startsWith( "test.test.test" ) );
}
+ @Test
+ public void getExistingMetadataItem() {
+ // org/apache/maven/some-ejb/1.0
+ ArchivaItemSelector versionSelector = ArchivaItemSelector.builder( )
+ .withNamespace( "org.apache.maven" )
+ .withProjectId( "some-ejb" )
+ .withVersion( "1.0" ).build( );
+ Version version = repoContent.getVersion( versionSelector );
+ DataItem metaData = repoContent.getMetadataItem( version );
+ assertTrue( metaData.exists( ) );
+ assertEquals( "/org/apache/maven/some-ejb/1.0/maven-metadata.xml", metaData.getAsset( ).getPath( ) );
+ }
+
+ @Test
+ public void getNonExistingMetadataItem() {
+ // org/apache/maven/some-ejb/1.0
+ ArchivaItemSelector versionSelector = ArchivaItemSelector.builder( )
+ .withNamespace( "javax.sql" )
+ .withProjectId( "jdbc" )
+ .withVersion( "2.0" ).build( );
+ Version version = repoContent.getVersion( versionSelector );
+ DataItem metaData = repoContent.getMetadataItem( version );
+ assertFalse( metaData.exists( ) );
+ assertEquals( "/javax/sql/jdbc/2.0/maven-metadata.xml", metaData.getAsset( ).getPath( ) );
+ }
}
fmt.setTimeZone( timezone );
ManagedRepository repo = repositoryRegistry.getManagedRepository( repositoryId );
- VersionedReference ref = new VersionedReference();
- ref.setArtifactId( artifact.getArtifactId() );
- ref.setGroupId( artifact.getGroupId() );
- ref.setVersion( artifact.getVersion() );
-
ManagedRepositoryContent repository = getManagedRepositoryContent( repositoryId );
BaseRepositoryContentLayout layout = repository.getLayout( BaseRepositoryContentLayout.class );
+ ArchivaItemSelector versionSelector = ArchivaItemSelector.builder( ).withNamespace( artifact.getGroupId( ) )
+ .withProjectId( artifact.getArtifactId( ) )
+ .withVersion( artifact.getVersion( ) ).build( );
+
+ Version version1 = layout.getVersion( versionSelector );
+ String path = layout.toPath( version1 );
+
ArtifactReference artifactReference = new ArtifactReference();
artifactReference.setArtifactId( artifact.getArtifactId() );
artifactReference.setGroupId( artifact.getGroupId() );
MetadataRepository metadataRepository = repositorySession.getRepository();
- String path = layout.toMetadataPath( ref );
-
if ( StringUtils.isNotBlank( artifact.getClassifier() ) )
{
if ( StringUtils.isBlank( artifact.getPackaging() ) )
// TODO: this should be in the storage mechanism so that it is all tied together
// delete from file system
- if ( !snapshotVersion )
+ if ( !snapshotVersion && version1.exists() )
{
- layout.deleteVersion( ref );
+ try
+ {
+ layout.deleteItem( version1 );
+ }
+ catch ( ItemNotFoundException e )
+ {
+ log.error( "Could not delete version item {}", e.getMessage( ) );
+ }
}
else
{