public synchronized void storeDomain( Domain domain, boolean overwrite ) throws DomainIdNullException, DomainAlreadyExistsException, DomainStorageException { // stores a domain to system/metadata/DOMAIN_ID.domain.xml // ISolutionRepository repo = PentahoSystem.get(ISolutionRepository.class, session); // repo.addSolutionFile(baseUrl, path, fileName, data, overwrite) if ( domain.getId() == null ) { // todo: replace with exception throw new DomainIdNullException( Messages.getErrorString( "IMetadataDomainRepository.ERROR_0001_DOMAIN_ID_NULL" ) ); //$NON-NLS-1$ } if ( !overwrite && domains != null && domains.get( domain.getId() ) != null ) { throw new DomainAlreadyExistsException( Messages.getErrorString( "IMetadataDomainRepository.ERROR_0002_DOMAIN_OBJECT_EXISTS", domain.getId() ) ); //$NON-NLS-1$ } // adds the domain to the domains list if ( domains == null ) { domains = new HashMap<String, Domain>(); } domains.put( domain.getId(), domain ); }
public void onDialogAccept( final Domain domain ) { refreshDatasources( domain.getId(), domain.getLogicalModels().get( 0 ).getId() ); }
fis = new FileInputStream( file ); Domain domain = service.deserializeDomain( fis ); localDomains.put( domain.getId(), domain ); } catch ( FileNotFoundException e ) { logger.error( Messages.getErrorString(
public void storeDomain( Domain domain, boolean overwrite ) throws DomainIdNullException, DomainAlreadyExistsException, DomainStorageException { if ( domain.getId() == null ) { throw new DomainIdNullException( Messages.getErrorString( "IMetadataDomainRepository.ERROR_0001_DOMAIN_ID_NULL" ) ); //$NON-NLS-1$ if ( !overwrite && domains.get( domain.getId() ) != null ) { throw new DomainAlreadyExistsException( Messages.getErrorString( "IMetadataDomainRepository.ERROR_0002_DOMAIN_OBJECT_EXISTS", domain.getId() ) ); //$NON-NLS-1$ File domainFile = new File( folder, getDomainFilename( domain.getId() ) ); "FileBasedMetadataDomainRepository.ERROR_0003_DOMAIN_FILE_EXISTS", domain.getId() ) ); //$NON-NLS-1$ domains.put( domain.getId(), domain );
public void onDialogAccept( final Domain domain ) { MessageHandler.getInstance().closeWaitingDialog(); wizard.removeDialogListener( this ); WAQRTransport transport = WAQRTransport.createFromMetadata( domain ); notifyCallbackSuccess( callback, true, transport ); notifyDialogCallbackSuccess( callback, domain.getId() ); }
"FileBasedMetadataDomainRepository.ERROR_0007_DOMAIN_ALREADY_EXISTS", domain.getId() ), e ); //$NON-NLS-1$
public static WAQRTransport createFromMetadata( Domain domain ) { // this assumes a single logical model with a single logical category LogicalModel model = domain.getLogicalModels().get( 0 ); Iterator<String> iter = model.getName().getLocales().iterator(); String locale = iter.next(); Category category = model.getCategories().get( 0 ); String domainId = domain.getId(); String modelId = model.getId(); String modelName = model.getName() != null ? model.getName().getString( locale ) : null; String categoryId = category.getId(); String categoryName = category.getName() != null ? category.getName().getString( locale ) : null; String schemaName = model.getName( locale ); return createDomain( domainId, modelId, modelName, categoryId, categoryName, schemaName ); }
String data = query.getDomain().getId(); if ( data != null ) { addTextElement( doc, mqlElement, "domain_id", data ); //$NON-NLS-1$
public boolean saveLogicalModel( Domain domain, boolean overwrite ) throws DatasourceServiceException { String domainName = domain.getId(); try { getMetadataDomainRepository().storeDomain( domain, overwrite ); return true; } catch ( DomainStorageException dse ) { logger.error( Messages.getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0017_UNABLE_TO_STORE_DOMAIN", domainName ), dse ); throw new DatasourceServiceException( Messages.getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0016_UNABLE_TO_STORE_DOMAIN", domainName ), dse ); //$NON-NLS-1$ } catch ( DomainAlreadyExistsException dae ) { logger.error( Messages.getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0018_DOMAIN_ALREADY_EXIST", domainName ), dae ); throw new DatasourceServiceException( Messages.getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0018_DOMAIN_ALREADY_EXIST", domainName ), dae ); //$NON-NLS-1$ } catch ( DomainIdNullException dne ) { logger.error( Messages.getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0019_DOMAIN_IS_NULL" ), dne ); throw new DatasourceServiceException( Messages .getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0019_DOMAIN_IS_NULL" ), dne ); //$NON-NLS-1$ } }
final String domainId = summary.getDomain().getId(); final EmbeddedWizard wizard = this;
public void removeDSW( String dswId ) throws PentahoAccessControlException { try { ensureDataAccessPermissionCheck(); } catch ( ConnectionServiceException e ) { throw new PentahoAccessControlException(); } Domain domain = metadataDomainRepository.getDomain( dswId ); ModelerWorkspace model = createModelerWorkspace(); model.setDomain( domain ); LogicalModel logicalModel = model.getLogicalModel( ModelerPerspective.ANALYSIS ); if ( logicalModel == null ) { logicalModel = model.getLogicalModel( ModelerPerspective.REPORTING ); } if ( logicalModel.getProperty( MONDRIAN_CATALOG_REF ) != null ) { String catalogRef = (String) logicalModel.getProperty( MONDRIAN_CATALOG_REF ); try { mondrianCatalogService.removeCatalog( catalogRef, getSession() ); } catch ( MondrianCatalogServiceException e ) { logger.warn( "Failed to remove mondrian catalog", e ); } } try { dswService.deleteLogicalModel( domain.getId(), logicalModel.getId() ); } catch ( DatasourceServiceException ex ) { logger.warn( "Failed to remove logical model", ex ); } metadataDomainRepository.removeDomain( dswId ); }
public boolean saveLogicalModel( Domain domain, boolean overwrite ) throws DatasourceServiceException { if ( !hasDataAccessPermission() ) { logger.error( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0001_PERMISSION_DENIED" ) ); //$NON-NLS-1$ throw new DatasourceServiceException( Messages .getErrorString( "DatasourceServiceImpl.ERROR_0001_PERMISSION_DENIED" ) ); //$NON-NLS-1$ } String domainName = domain.getId(); try { getMetadataDomainRepository().storeDomain( domain, overwrite ); return true; } catch ( DomainStorageException dse ) { logger.error( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0012_UNABLE_TO_STORE_DOMAIN", domainName, dse.getLocalizedMessage() ), dse ); //$NON-NLS-1$ throw new DatasourceServiceException( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0012_UNABLE_TO_STORE_DOMAIN", domainName, dse.getLocalizedMessage() ), dse ); //$NON-NLS-1$ } catch ( DomainAlreadyExistsException dae ) { logger.error( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0013_DOMAIN_ALREADY_EXIST", domainName, dae.getLocalizedMessage() ), dae ); //$NON-NLS-1$ throw new DatasourceServiceException( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0013_DOMAIN_ALREADY_EXIST", domainName, dae.getLocalizedMessage() ), dae ); //$NON-NLS-1$ } catch ( DomainIdNullException dne ) { logger.error( Messages .getErrorString( "DatasourceServiceImpl.ERROR_0014_DOMAIN_IS_NULL", dne.getLocalizedMessage() ), dne ); //$NON-NLS-1$ throw new DatasourceServiceException( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0014_DOMAIN_IS_NULL", dne.getLocalizedMessage() ), dne ); //$NON-NLS-1$ } }
protected IPlatformImportBundle createMetadataDswBundle( Domain domain, InputStream metadataIn, boolean overwrite, RepositoryFileAclDto acl ) { final RepositoryFileImportBundle.Builder builder = new RepositoryFileImportBundle.Builder() .input( metadataIn ) .charSet( ENCODING ) .hidden( false ) .overwriteFile( overwrite ) .mime( METADATA_MIME ) .withParam( IMPORT_DOMAIN_ID, domain.getId() ) .preserveDsw( true ); if ( acl != null ) { builder.acl( repositoryFileAclAdapter.unmarshal( acl ) ).applyAclSettings( true ); } return builder .build(); }
final String analysisDomainId = toAnalysisDomainId( domain.getId() ); final String dataSource = ModelerService.getMondrianDatasource( domain );
SchemaMeta schemaMeta = new SchemaMeta(); schemaMeta.setDomainName( domain.getId() );