Examples of RepositoryFileTree


Examples of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree

import java.util.List;

public class RepositoryFileUtils {

  public static RepositoryFileTree convertToRepositoryFileTree( RepositoryFileTreeDto tree ) {
    RepositoryFileTree fileTree = new RepositoryFileTree();
    List<RepositoryFileTree> fileList = new ArrayList<RepositoryFileTree>();
    RepositoryFile file = convertToRepositoryFile( tree.getFile() );
    fileTree.setFile( file );
    for ( RepositoryFileTreeDto treeItem : tree.getChildren() ) {
      fileList.add( convertToRepositoryFileTree( treeItem ) );
    }
    fileTree.setChildren( fileList );
    return fileTree;
  }
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree

    if ( mode == COMMAND.PROPERTIES ) {
      new FilePropertiesCommand( repositoryFile ).execute();
    } else if ( mode == COMMAND.DELETE ) {
      TreeItem item = sbp.getSolutionTree().getSelectedItem();
      RepositoryFileTree tree = (RepositoryFileTree) item.getUserObject();
      new DeleteFolderCommand( tree.getFile() ).execute();
    } else if ( mode == COMMAND.CREATE_FOLDER ) {
      TreeItem item = sbp.getSolutionTree().getSelectedItem();
      RepositoryFileTree tree = (RepositoryFileTree) item.getUserObject();
      new NewFolderCommand( tree.getFile() ).execute();
    } else if ( mode == COMMAND.EXPORT ) {
      new ExportFileCommand( repositoryFile ).execute();
    } else if ( mode == COMMAND.IMPORT ) {
      new ImportFileCommand( repositoryFile ).execute();
    } else if ( mode == COMMAND.PASTE ) {
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree

   *
   */
  private void fixLeafNodes() {
    List<FileTreeItem> allNodes = getAllNodes();
    for ( FileTreeItem treeItem : allNodes ) {
      RepositoryFileTree userObject = (RepositoryFileTree) treeItem.getUserObject();
      if ( userObject != null && userObject.getChildren().size() == 0 ) { // This is a leaf node so change the
                                                                          // widget
        treeItem
            .setWidget( new LeafItemWidget( treeItem.getText(), "icon-tree-node", "icon-tree-leaf", "icon-folder" ) ); //$NON-NLS-1$
      } else {
        treeItem.setWidget( new LeafItemWidget( treeItem.getText(), "icon-tree-node", "icon-folder" ) ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree

    if ( item == solutionTree.getTrashItem() ) { // If we're populating from the trash then
      files = solutionTree.getTrashItems();
    } else {
      files = new ArrayList<RepositoryFile>();
      // Get the user object.
      RepositoryFileTree tree = (RepositoryFileTree) item.getUserObject();
      // Since we are only listing the files here. Get to each item of the tree and get the file from it
      for ( RepositoryFileTree treeItem : tree.getChildren() ) {
        String fileName = treeItem.getFile().getName();
        if ( filters != null ) {
          for ( int i = 0; i < filters.length(); i++ ) {
            if ( fileName.endsWith( filters.get( i ) ) ) {
              files.add( treeItem.getFile() );
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree

          }
          if ( callback != null ) {
            callback.onSuccess( fileTree );
          }
        } else {
          fileTree = new RepositoryFileTree();
          RepositoryFile errorFile = new RepositoryFile();
          errorFile.setFolder( true );
          errorFile.setName( "!ERROR!" );
          fileTree.setFile( errorFile );
        }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.RepositoryFileTree

   *
   * @see org.pentaho.platform.api.action.IAction#execute()
   */
  public void execute() throws Exception {
    // scan the repository for all files with a RESERVEDMAPKEY_LINEAGE_ID
    RepositoryFileTree tree = repository.getTree( ClientRepositoryPaths.getRootFolderPath(), -1, null, false );
    ArrayList<RepositoryFile> generatedContentList = new ArrayList<RepositoryFile>();
    findGeneratedContent( generatedContentList, tree );
    for ( RepositoryFile deleteMe : generatedContentList ) {
      repository.deleteFile( deleteMe.getId(), true, GeneratedContentCleaner.class.getName() );
      logger.info( "GeneratedContentCleaner deleting: " + deleteMe.getPath() );
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.RepositoryFileTree

   */
  @Test
  public void testBIServer7777() throws Exception {
    // file tree with empty children
    RepositoryFile empty = new RepositoryFile.Builder( "empty" ).build();
    RepositoryFileTree emptyDir = new RepositoryFileTree( empty, Collections.<RepositoryFileTree>emptyList() );
    RepositoryFile root = new RepositoryFile.Builder( "rootDir" ).build();
    ArrayList<RepositoryFileTree> children = new ArrayList<RepositoryFileTree>( 1 );
    children.add( emptyDir );
    RepositoryFileTree rootDir = new RepositoryFileTree( root, children );
    // to DTO
    RepositoryFileTreeAdapter adapter = new RepositoryFileTreeAdapter();
    RepositoryFileTreeDto dtoThere = adapter.marshal( rootDir );
    assertNotNull( dtoThere.getChildren().get( 0 ).getChildren() );
    // serialize
    final JAXBContext jaxbContext = JAXBContext.newInstance( RepositoryFileTreeDto.class );
    Marshaller marshaller = jaxbContext.createMarshaller();
    StringWriter sw = new StringWriter();
    marshaller.marshal( dtoThere, sw );
    // and bring it back
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    StringReader sr = new StringReader( sw.toString() );
    RepositoryFileTreeDto dtoBackAgain = (RepositoryFileTreeDto) unmarshaller.unmarshal( sr );
    assertNotNull( dtoBackAgain.getChildren().get( 0 ).getChildren() );
    // unmarshall
    RepositoryFileTree rootDir2 = adapter.unmarshal( dtoBackAgain );
    assertNotNull( rootDir2.getChildren().get( 0 ).getChildren() );
    assertEquals( rootDir, rootDir2 );
  }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.RepositoryFileTree

    RepositoryFile file1AtVersion = repo.getFileAtVersion( file1.getId(), versionSummary.getId() );
    assertNotNull( file1AtVersion );
    assertEquals( versionSummary.getId(), file1AtVersion.getVersionId() );

    logger.info( "getTree" );
    RepositoryFileTree tree = repo.getTree( new RepositoryRequest( ClientRepositoryPaths.getRootFolderPath(), true, -1, null ) );
    assertNotNull( tree.getFile().getId() );

    logger.info( "getDataForReadInBatch" );
    List<NodeRepositoryFileData> result =
        repo.getDataForReadInBatch( Arrays.asList( file1, copiedFile ), NodeRepositoryFileData.class );
    assertEquals( 2, result.size() );
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.RepositoryFileTree

      Collections.sort( children );
    } else {
      children = null;
    }
    return new RepositoryFileTree( rootFile, children );
  }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.RepositoryFileTree

    RepositoryFile file = nodeToFile( session, pentahoJcrConstants, pathConversionHelper, lockHelper, childNode );
    if ( isSupportedNodeType( pentahoJcrConstants, childNode )
        && ( accessVoterManager.hasAccess( file, RepositoryFilePermission.READ, JcrRepositoryFileAclUtils.getAcl(
            session, pentahoJcrConstants, file.getId() ), PentahoSessionHolder.getSession() ) ) ) {
      MutableBoolean foundFilteredAtomic = new MutableBoolean( !isPentahoFolder( pentahoJcrConstants, childNode ) );
      RepositoryFileTree repositoryFileTree =
          getTreeByNode( session, pentahoJcrConstants, pathConversionHelper, lockHelper, childNode, depth - 1,
              childNodeFilter, showHidden, accessVoterManager, types, foundFilteredAtomic );
      if ( repositoryFileTree != null && ( foundFilteredAtomic.booleanValue() || isRootFiltered ) ) {
        foundFiltered.setValue( true );
        children.add( repositoryFileTree );
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.