Package org.pentaho.gwt.widgets.client.filechooser

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


    final SolutionFileActionEvent event = new SolutionFileActionEvent();
    event.setAction( this.getClass().getName() );

    if ( getRepositoryFile() != null ) {
      final RepositoryFile item = getRepositoryFile();

      // Checking if the user has access to manage permissions
      String url = contextURL + "api/repo/files/" + SolutionBrowserPanel.pathToId( item.getPath() )
          + "/canAccess?permissions=" + MANAGE_ACLS; //$NON-NLS-1$ //$NON-NLS-2$
      RequestBuilder builder = new RequestBuilder( RequestBuilder.GET, url );
      try {
        builder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
        builder.sendRequest( null, new RequestCallback() {
View Full Code Here


    final SolutionFileActionEvent event = new SolutionFileActionEvent();
    event.setAction( this.getClass().getName() );

    if ( selectedList != null && selectedList.size() == 1 ) {
      final RepositoryFile item = selectedList.get( 0 );

      // Checking if the user has access to manage permissions
      String url =
          contextURL
              + "api/repo/files/" + SolutionBrowserPanel.pathToId( item.getPath() ) + "/canAccess?permissions=" + MANAGE_ACLS; //$NON-NLS-1$ //$NON-NLS-2$
      RequestBuilder builder = new RequestBuilder( RequestBuilder.GET, url );
      try {
        builder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
        builder.sendRequest( null, new RequestCallback() {
View Full Code Here

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 );
View Full Code Here

    fileTree.setChildren( fileList );
    return fileTree;
  }

  public static RepositoryFile convertToRepositoryFile( RepositoryFileDto file ) {
    RepositoryFile repositoryFile = new RepositoryFile();
    repositoryFile.setCreatedDate( file.getCreatedDate() );
    repositoryFile.setDeletedDate( file.getDeletedDate() );
    repositoryFile.setDescription( file.getDescription() );
    repositoryFile.setFolder( file.isFolder() );
    repositoryFile.setHidden( file.isHidden() );
    repositoryFile.setId( file.getId() );
    repositoryFile.setLastModifiedDate( file.getLastModifiedDate() );
    repositoryFile.setLocale( file.getLocale() );
    repositoryFile.setLockDate( file.getLockDate() );
    repositoryFile.setLocked( file.isLocked() );
    repositoryFile.setLockMessage( file.getLockMessage() );
    repositoryFile.setLockOwner( file.getLockOwner() );
    repositoryFile.setName( file.getName() );
    repositoryFile.setOriginalParentFolderId( file.getOriginalParentFolderPath() );
    repositoryFile.setOriginalParentFolderPath( file.getOriginalParentFolderPath() );
    repositoryFile.setOwner( file.getOwner() );
    repositoryFile.setPath( file.getPath() );
    repositoryFile.setTitle( file.getTitle() );
    repositoryFile.setVersionId( file.getVersionId() );
    return repositoryFile;
  }
View Full Code Here

        }
        selectedItem = event.getSelectedItem();
        if ( selectedItem != null ) {
          Widget treeItemWidget = selectedItem.getWidget();
          if ( selectedItem instanceof FileTreeItem ) {
            RepositoryFile repositoryFile = ( (FileTreeItem) selectedItem ).getRepositoryFile();
            if ( repositoryFile != null && repositoryFile.isHidden() && !isShowHiddenFiles() ) {
              if ( treeItemWidget != null && treeItemWidget instanceof LeafItemWidget ) {
                ( (LeafItemWidget) treeItemWidget ).getParent().removeStyleName( "hidden" ); //$NON-NLS-1$
                ( (LeafItemWidget) treeItemWidget ).getParent().addStyleName( "selected" ); //$NON-NLS-1$
              } else {
                selectedItem.addStyleName( "hidden" ); //$NON-NLS-1$
View Full Code Here

    repositoryFileTree = fileTree;
    trashItems = repositoryTrashItems;
    // remember selectedItem, so we can reselect it after the tree is loaded
    clear();
    // get document root item
    RepositoryFile rootRepositoryFile = repositoryFileTree.getFile();
    if ( !rootRepositoryFile.isHidden() || isShowHiddenFiles() ) {
      FileTreeItem rootItem = null;
      if ( createRootNode ) {
        rootItem = new FileTreeItem();
        rootItem.setText( rootRepositoryFile.getPath() );
        rootItem.setTitle( rootRepositoryFile.getPath() );
        rootItem.getElement().setId( rootRepositoryFile.getPath() );
        // added so we can traverse the true names
        rootItem.setFileName( "/" ); //$NON-NLS-1$
        rootItem.setRepositoryFile( rootRepositoryFile );
        addItem( rootItem );
        buildSolutionTree( rootItem, repositoryFileTree );
View Full Code Here

            .getFile().getTitle() );
      }
    } );

    for ( RepositoryFileTree treeItem : children ) {
      RepositoryFile file = treeItem.getFile();
      boolean isDirectory = file.isFolder();
      String fileName = file.getName();
      if ( ( !file.isHidden() || isShowHiddenFiles() ) && !StringUtils.isEmpty( fileName ) ) {

        // TODO Mapping Title to LocalizedName
        String localizedName = file.getTitle();
        String description = file.getDescription();
        FileTreeItem childTreeItem = new FileTreeItem();
        childTreeItem.setStylePrimaryName( "leaf-widget" );
        childTreeItem.getElement().setAttribute( "id", file.getPath() ); //$NON-NLS-1$
        childTreeItem.setUserObject( treeItem );
        childTreeItem.setRepositoryFile( file );
        if ( file.isHidden() && file.isFolder() ) {
          childTreeItem.addStyleDependentName( "hidden" );
        }

        if ( treeItem != null && treeItem.getChildren() != null ) {
          for ( RepositoryFileTree childItem : treeItem.getChildren() ) {
View Full Code Here

  public void selectPreviousItem( List<FileItem> currentItems ) {
    if ( currentItems == null || currentItems.size() < 1 ) {
      return;
    }
    FileItem currentItem = currentItems.get( 0 );
    RepositoryFile currentRepositoryFile = currentItem.getRepositoryFile();
    int myIndex = -1;
    for ( int i = 0; i < getFileCount(); i++ ) {
      FileItem fileItem = getFileItem( i );
      if ( fileItem == currentItem ) {
        myIndex = i;
      }
    }
    if ( myIndex > 0 && myIndex < getFileCount() ) {
      if ( currentRepositoryFile.isHidden() ) {
        currentItem.setStyleName( "hiddenFileLabel" ); //$NON-NLS-1$
      } else {
        currentItem.setStyleName( "fileLabel" ); //$NON-NLS-1$ 
      }
      FileItem previousItem = getFileItem( myIndex - 1 );
      RepositoryFile previousCurrentRepositoryFile = previousItem.getRepositoryFile();
      if ( previousCurrentRepositoryFile.isHidden() ) {
        previousItem.setStyleName( "hiddenFileLabelSelected" ); //$NON-NLS-1$
      } else {
        previousItem.setStyleName( "fileLabelSelected" ); //$NON-NLS-1$ 
      }
View Full Code Here

        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == Response.SC_OK ) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put( "repositoryFileDto", (JSONObject) JSONParser.parseLenient( response.getText() ) );
            RepositoryFile repositoryFile = new RepositoryFile( jsonObject );
            handler.handle( repositoryFile );
          }
        }
      } );
    } catch ( RequestException e ) {
View Full Code Here

        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == Response.SC_OK ) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put( "repositoryFileDto", (JSONObject) JSONParser.parseLenient( response.getText() ) );
            RepositoryFile repositoryFile = new RepositoryFile( jsonObject );
            openFile( repositoryFile, mode );
          }
        }
      } );
    } catch ( RequestException e ) {
View Full Code Here

TOP

Related Classes of org.pentaho.gwt.widgets.client.filechooser.RepositoryFile

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.