@Test public void testSetLocalPathFromParameter() { DrillDownParameter drillDownParameterSolution = new DrillDownParameter( "solution" ); DrillDownParameter drillDownParameterPath = new DrillDownParameter( "path" ); DrillDownParameter drillDownParameterName = new DrillDownParameter( "name" ); drillDownParameterSolution.setFormulaFragment( "mySolution" ); drillDownParameterPath.setFormulaFragment( "path/to/my/file" ); drillDownParameterName.setFormulaFragment( "myFileName" ); DrillDownParameter[] parameters = { drillDownParameterSolution, drillDownParameterPath, drillDownParameterName }; PentahoPathModel model = new PentahoPathModel( reportDesignerContext ); assertNotNull( model ); model.setLocalPathFromParameter( parameters ); assertNull( model.getLocalPath() ); }
public void setLocalPathFromParameter( final DrillDownParameter[] params ) { String solution = null; String path = null; String name = null; String localPath = null; for ( int i = 0; i < params.length; i++ ) { final DrillDownParameter drillDownParameter = params[i]; if ( "solution".equals( drillDownParameter.getName() ) ) { solution = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "path".equals( drillDownParameter.getName() ) ) { path = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "name".equals( drillDownParameter.getName() ) ) { name = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { localPath = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } } if ( StringUtils.isEmpty( localPath ) == false ) { setLocalPath( localPath ); } else { final StringBuilder b = new StringBuilder(); if ( StringUtils.isEmpty( solution ) == false ) { b.append( solution ); } if ( StringUtils.isEmpty( path ) == false ) { b.append( "/" ); b.append( path ); } if ( StringUtils.isEmpty( name ) == false ) { b.append( "/" ); b.append( name ); } if ( b.length() == 0 ) { setLocalPath( null ); } else { setLocalPath( b.toString() ); } } }
PentahoPathModel implements XulEventSource { public void setLocalPathFromParameter( final DrillDownParameter[] params ) { String solution = null; String path = null; String name = null; String localPath = null; for ( int i = 0; i < params.length; i++ ) { final DrillDownParameter drillDownParameter = params[i]; if ( "solution".equals( drillDownParameter.getName() ) ) { solution = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "path".equals( drillDownParameter.getName() ) ) { path = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "name".equals( drillDownParameter.getName() ) ) { name = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { localPath = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } } if ( StringUtils.isEmpty( localPath ) == false ) { setLocalPath( localPath ); } else { final StringBuilder b = new StringBuilder(); if ( StringUtils.isEmpty( solution ) == false ) { b.append( solution ); } if ( StringUtils.isEmpty( path ) == false ) { b.append( "/" ); b.append( path ); } if ( StringUtils.isEmpty( name ) == false ) { b.append( "/" ); b.append( name ); } if ( b.length() == 0 ) { setLocalPath( null ); } else { setLocalPath( b.toString() ); } } } }
PentahoPathModel implements XulEventSource { public void setLocalPathFromParameter( final DrillDownParameter[] params ) { String solution = null; String path = null; String name = null; String localPath = null; for ( int i = 0; i < params.length; i++ ) { final DrillDownParameter drillDownParameter = params[i]; if ( "solution".equals( drillDownParameter.getName() ) ) { solution = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "path".equals( drillDownParameter.getName() ) ) { path = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "name".equals( drillDownParameter.getName() ) ) { name = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { localPath = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } } if ( StringUtils.isEmpty( localPath ) == false ) { setLocalPath( localPath ); } else { final StringBuilder b = new StringBuilder(); if ( StringUtils.isEmpty( solution ) == false ) { b.append( solution ); } if ( StringUtils.isEmpty( path ) == false ) { b.append( "/" ); b.append( path ); } if ( StringUtils.isEmpty( name ) == false ) { b.append( "/" ); b.append( name ); } if ( b.length() == 0 ) { setLocalPath( null ); } else { setLocalPath( b.toString() ); } } } PentahoPathModel( final ReportDesignerContext reportDesignerContext ); }
PentahoPathModel implements XulEventSource { public void setLocalPathFromParameter( final DrillDownParameter[] params ) { String solution = null; String path = null; String name = null; String localPath = null; for ( int i = 0; i < params.length; i++ ) { final DrillDownParameter drillDownParameter = params[i]; if ( "solution".equals( drillDownParameter.getName() ) ) { solution = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "path".equals( drillDownParameter.getName() ) ) { path = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "name".equals( drillDownParameter.getName() ) ) { name = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { localPath = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } } if ( StringUtils.isEmpty( localPath ) == false ) { setLocalPath( localPath ); } else { final StringBuilder b = new StringBuilder(); if ( StringUtils.isEmpty( solution ) == false ) { b.append( solution ); } if ( StringUtils.isEmpty( path ) == false ) { b.append( "/" ); b.append( path ); } if ( StringUtils.isEmpty( name ) == false ) { b.append( "/" ); b.append( name ); } if ( b.length() == 0 ) { setLocalPath( null ); } else { setLocalPath( b.toString() ); } } } PentahoPathModel( final ReportDesignerContext reportDesignerContext ); void registerExtension( final String extension, final boolean local, final boolean noParameter,
      final String profileName ); AuthenticationData getLoginData(); void setLoginData( final AuthenticationData loginData ); String getServerPath(); void setServerPath( final String serverPath ); boolean isUseRemoteServer(); void setUseRemoteServer( final boolean useRemoteServer ); boolean isHideParameterUi(); void setHideParameterUi( final boolean hideParameterUi ); String getLocalPath(); void setLocalPath( final String localPath ); void setLocalPathFromParameter( final DrillDownParameter[] params ); String getPath(); String getName(); String getSolution(); void addPropertyChangeListener( final String propertyName, final PropertyChangeListener listener ); void removePropertyChangeListener( final String propertyName, final PropertyChangeListener listener ); void addPropertyChangeListener( final PropertyChangeListener listener ); void removePropertyChangeListener( final PropertyChangeListener listener ); String getDrillDownProfile(); String[] getExtensions(); }
PentahoPathModel implements XulEventSource { public void setLocalPathFromParameter( final DrillDownParameter[] params ) { String solution = null; String path = null; String name = null; String localPath = null; for ( int i = 0; i < params.length; i++ ) { final DrillDownParameter drillDownParameter = params[i]; if ( "solution".equals( drillDownParameter.getName() ) ) { solution = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "path".equals( drillDownParameter.getName() ) ) { path = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "name".equals( drillDownParameter.getName() ) ) { name = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { localPath = FormulaUtil.extractStaticTextFromFormulaFragment( drillDownParameter.getFormulaFragment() ); } } if ( StringUtils.isEmpty( localPath ) == false ) { setLocalPath( localPath ); } else { final StringBuilder b = new StringBuilder(); if ( StringUtils.isEmpty( solution ) == false ) { b.append( solution ); } if ( StringUtils.isEmpty( path ) == false ) { b.append( "/" ); b.append( path ); } if ( StringUtils.isEmpty( name ) == false ) { b.append( "/" ); b.append( name ); } if ( b.length() == 0 ) { setLocalPath( null ); } else { setLocalPath( b.toString() ); } } } PentahoPathModel( final ReportDesignerContext reportDesignerContext ); void registerExtension( final String extension, final boolean local, final boolean noParameter,
      final String profileName ); AuthenticationData getLoginData(); void setLoginData( final AuthenticationData loginData ); String getServerPath(); void setServerPath( final String serverPath ); boolean isUseRemoteServer(); void setUseRemoteServer( final boolean useRemoteServer ); boolean isHideParameterUi(); void setHideParameterUi( final boolean hideParameterUi ); String getLocalPath(); void setLocalPath( final String localPath ); void setLocalPathFromParameter( final DrillDownParameter[] params ); String getPath(); String getName(); String getSolution(); void addPropertyChangeListener( final String propertyName, final PropertyChangeListener listener ); void removePropertyChangeListener( final String propertyName, final PropertyChangeListener listener ); void addPropertyChangeListener( final PropertyChangeListener listener ); void removePropertyChangeListener( final PropertyChangeListener listener ); String getDrillDownProfile(); String[] getExtensions(); static final String USE_REMOTE_SERVER_PROPERTY; static final String HIDE_PARAMETER_UI_PROPERTY; static final String SERVER_PATH_PROPERTY; static final String LOGIN_DATA_PROPERTY; static final String LOCAL_PATH_PROPERTY; }