public <T extends IRepositoryFileData> List<T> getDataForReadInBatch( List<RepositoryFile> files, Class<T> dataClass ) { Assert.notNull( files ); List<T> data = new ArrayList<T>( files.size() ); for ( RepositoryFile f : files ) { Assert.notNull( f ); data.add( repositoryFileDao.getData( f.getId(), f.getVersionId(), dataClass ) ); } return data; }
/** * {@inheritDoc} */ public List<VersionSummary> getVersionSummaryInBatch( final List<RepositoryFile> files ) { Assert.notNull( files ); List<VersionSummary> summaries = new ArrayList<VersionSummary>( files.size() ); for ( RepositoryFile file : files ) { Assert.notNull( file ); summaries.add( getVersionSummary( file.getId(), file.getVersionId() ) ); } return summaries; }
public List<VersionSummary> getVersionSummaryInBatch( List<RepositoryFile> files ) { Assert.notNull( files ); List<VersionSummary> versionSummaryList = new ArrayList<VersionSummary>( files.size() ); for(RepositoryFile file : files){ versionSummaryList.add( getVersionSummary( file.getId(), file.getVersionId() ) ); } return versionSummaryList; }
/** * {@inheritDoc} */ public <T extends IRepositoryFileData> List<T> getDataForReadInBatch( final List<RepositoryFile> files, final Class<T> dataClass ) { Assert.notNull( files ); List<T> data = new ArrayList<T>( files.size() ); for ( RepositoryFile f : files ) { Assert.notNull( f ); data.add( getDataAtVersionForRead( f.getId(), f.getVersionId(), dataClass ) ); } return data; }
private static void preventLostUpdate( final Session session, final PentahoJcrConstants pentahoJcrConstants, final RepositoryFile file ) throws RepositoryException { Node fileNode = session.getNodeByIdentifier( file.getId().toString() ); // guard against using a file retrieved from a more lenient session inside a more strict session Assert.notNull( fileNode ); if ( isVersioned( session, pentahoJcrConstants, fileNode ) ) { Assert.notNull( file.getVersionId(), "updating a versioned file requires a non-null version id" ); //$NON-NLS-1$ Assert.state( session.getWorkspace().getVersionManager().getBaseVersion( fileNode.getPath() ).getName().equals( file.getVersionId().toString() ), "update to this file has occurred since its last read" ); //$NON-NLS-1$ } }
@Override public <T extends IRepositoryFileData> List<T> getDataForExecuteInBatch( final List<RepositoryFile> files, final Class<T> dataClass ) { List<T> datas = new ArrayList<T>(); for ( RepositoryFile file : files ) { if ( file.getVersionId() != null ) { datas.add( getDataAtVersionForExecute( file.getId(), file.getVersionId(), dataClass ) ); } else { datas.add( getDataForExecute( file.getId(), dataClass ) ); } } return datas; }
@Override public <T extends IRepositoryFileData> List<T> getDataForReadInBatch( final List<RepositoryFile> files, final Class<T> dataClass ) { List<T> datas = new ArrayList<T>(); for ( RepositoryFile file : files ) { if ( file.getVersionId() != null ) { datas.add( getDataAtVersionForRead( file.getId(), file.getVersionId(), dataClass ) ); } else { datas.add( getDataForRead( file.getId(), dataClass ) ); } } return datas; }
if ( other.getVersionId() != null ) { return false; } else if ( !this.getVersionId().equals( other.getVersionId() ) ) { return false;
@Override public List<VersionSummary> getVersionSummaryInBatch( final List<RepositoryFile> files ) { List<VersionSummary> sums = new ArrayList<VersionSummary>(); for ( RepositoryFile file : files ) { if ( file.getVersionId() != null ) { sums.add( getVersionSummary( file.getId(), file.getVersionId() ) ); } else { sums.add( getVersionSummary( file.getId(), versionManager.getLatestVersion( file.getId() ).getVersionId() ) ); } } return sums; }
appended = true; if ( expectedFile.getVersionId() != null ) { description.appendText( appended ? "," : "" ); description.appendText( "versionId=" ); description.appendText( expectedFile.getVersionId().toString() ); appended = true;
@Override public boolean matchesSafely( final RepositoryFile file ) { return ( expectedFile.getId() != null ? expectedFile.getId().equals( file.getId() ) : true ) && ( expectedFile.getName() != null ? expectedFile.getName().equals( file.getName() ) : true ) && ( expectedFile.getTitle() != null ? expectedFile.getTitle().equals( file.getTitle() ) : true ) && ( expectedFile.getPath() != null ? expectedFile.getPath().equals( file.getPath() ) : true ) && ( expectedFile.getCreatedDate() != null ? expectedFile.getCreatedDate().equals( file.getCreatedDate() ) : true ) && ( expectedFile.getLastModifiedDate() != null ? expectedFile.getLastModifiedDate().equals( file.getLastModifiedDate() ) : true ) && ( expectedFile.getVersionId() != null ? expectedFile.getVersionId().equals( file.getVersionId() ) : true ) && ( expectedFile.getDeletedDate() != null ? expectedFile.getDeletedDate().equals( file.getDeletedDate() ) : true ); }
new RepositoryFile.Builder( file ).versionId( file.getVersionId() ).id( file.getId() ).title( RepositoryFile.DEFAULT_LOCALE, databaseConnection.getName() ).build(); file =
if ( v.getVersionId() != null ) { f.setVersionId( v.getVersionId().toString() );
public Builder( final RepositoryFile other ) { this( other.getName() ); synchronized ( other ) { this.id( other.getId() ).path( other.getPath() ).createdDate( other.getCreatedDate() ).creatorId( other.getCreatorId() ).fileSize( other.getFileSize() ).folder( other.isFolder() ).lastModificationDate( other.getLastModifiedDate() ).versioned( other.isVersioned() ).hidden( other.isHidden() ).schedulable( other.isSchedulable() ).versionId( other.getVersionId() ).locked( other.isLocked() ).lockDate( other.getLockDate() ).lockOwner( other.getLockOwner() ).lockMessage( other.getLockMessage() ).title( other.getTitle() ).description( other.getDescription() ).locale( other.getLocale() ).originalParentFolderPath( other.getOriginalParentFolderPath() ).deletedDate( other.getDeletedDate() ).localePropertiesMap( other.getLocalePropertiesMap() ).aclNode( other.isAclNode() ); } }