Package org.pentaho.metadata.repository

Examples of org.pentaho.metadata.repository.IMetadataDomainRepository


        final String key = columnNames[i];
        final Object value = parameters.get(key);
        parameterMap.put(key, value);
      }

      final IMetadataDomainRepository domainRepository = getDomainRepository();

      Locale locale;
      if (resourceBundleFactory != null)
      {
        locale = resourceBundleFactory.getLocale();
View Full Code Here


        logger.error("Default SqlGenerator class " + sqlGeneratorClass + " not found."); //$NON-NLS-1$
        throw new ReportDataFactoryException("Failed to generate SQL. No valid SqlGenerator class found.");//$NON-NLS-1$
      }

      final Map<String, Object> parameterMap = convertDataRowToMap(parameters);
      final IMetadataDomainRepository domainRepository = getDomainRepository();
      Locale locale = computeLocale();
      return sqlGenerator.generateSql(queryObject, locale.toString(), domainRepository, databaseMeta, parameterMap, true);
    }
    catch (final ReportDataFactoryException e)
    {
View Full Code Here

            new LoadRepositoryRunnable(context, domainIdTextField.getText(), filenameField.getText());
        final Thread loadRepositoryThread = new Thread(loadRepositoryRunnable);

        BackgroundCancellableProcessHelper.executeProcessWithCancelDialog(loadRepositoryThread, null,
            PmdDataSourceEditor.this, Messages.getString("PmdDataSourceEditor.PreviewTask"));
        final IMetadataDomainRepository repository = loadRepositoryRunnable.getRepository();
        if (repository == null)
        {
          return;
        }
View Full Code Here

      {
        final LoadRepositoryRunnable loadRepositoryRunnable = new LoadRepositoryRunnable();
        final Thread loadRepositoryThread = new Thread(loadRepositoryRunnable);

        BackgroundCancellableProcessHelper.executeProcessWithCancelDialog(loadRepositoryThread, null, PmdDataSourceEditor.this);
        final IMetadataDomainRepository repository = loadRepositoryRunnable.getRepository();
        if (repository == null)
        {
          return;
        }
View Full Code Here

    // TODO: need to define the IDBDatasourceService.class
    microPlatform.define( IDBDatasourceService.class, JndiDatasourceService.class, Scope.GLOBAL );
    try {
      KettleEnvironment.init( false );
      IMetadataDomainRepository repo = PentahoSystem.get( IMetadataDomainRepository.class, null );
      Domain domain = getBasicDomain();
      Domain domain2 = getJdbcDomain();
      // System.out.println(new SerializationService().serializeDomain(domain));

      Domain domain3 = getJdbcDomain();
      domain3.setId( "JDBCDOMAIN2" );
      domain3.getLogicalModels().get( 0 ).setProperty( "max_rows", new BigDecimal( 10 ) );

      Domain domain4 = getBasicDomain();
      ( (SqlPhysicalModel) domain4.getPhysicalModels().get( 0 ) ).getDatasource().setDialectType( "MYSQL" );
      Map<String, String> attributes = new HashMap<String, String>();
      attributes.put( "QUOTE_ALL_FIELDS", "Y" );
      ( (SqlPhysicalModel) domain4.getPhysicalModels().get( 0 ) ).getDatasource().setAttributes( attributes );

      domain4.setId( "MYSQL_DOMAIN" );
      repo.storeDomain( domain, true );
      repo.storeDomain( domain2, true );
      repo.storeDomain( domain3, true );
      repo.storeDomain( domain4, true );
    } catch ( Exception e ) {
      e.printStackTrace();
    }

    // JNDI
View Full Code Here

      logger.error( "error", e ); //$NON-NLS-1$
      return false;
    }

    // parse the metadata query
    IMetadataDomainRepository repo = PentahoSystem.get( IMetadataDomainRepository.class, null );

    if ( queryObject == null ) {
      // there is no query model, so create one from the query string
      // apply templates to the query
      String templatedQuery = null;
View Full Code Here

    return doc;
  }

  private void addThinDomainModels( final String domain, final Element modelsNode, final Element root ) {

    IMetadataDomainRepository repo = getMetadataRepository();

    Domain domainObject = repo.getDomain( domain );

    String locale = LocaleHelper.getClosestLocale( LocaleHelper.getLocale().toString(), domainObject.getLocaleCodes() );

    Element modelNode;
    for ( LogicalModel model : domainObject.getLogicalModels() ) {
View Full Code Here

  public String publish( final IPentahoSession session ) {
    MetadataPublisher.numberUpdated = 0;
    List<String> messages = new ArrayList<String>();
    // refresh new metadata domains
    try {
      IMetadataDomainRepository repo = PentahoSystem.get( IMetadataDomainRepository.class, session );
      repo.reloadDomains();
      MetadataPublisher.numberUpdated = repo.getDomainIds().size();
      return Messages.getInstance().getString(
          "MetadataPublisher.USER_METADATA_RELOADED", Integer.toString( MetadataPublisher.numberUpdated ) ); //$NON-NLS-1$
    } catch ( Exception e ) {
      logger.error( Messages.getInstance().getErrorString( "MetadataPublisher.ERROR_0001_USER_IMPORT_META_FAILED" ), e ); //$NON-NLS-1$
      messages.add( Messages.getInstance().getString( "MetadataPublisher.ERROR_0001_USER_IMPORT_META_FAILED" ) ); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.pentaho.metadata.repository.IMetadataDomainRepository

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.