@Override public String getRoleAliases( String roleName ) throws ModelerException { String aliasKey = GeoContext.GEO_PREFIX + roleName + GeoContext.ALIAS_SUFFIX; String aliases = props.getProperty( aliasKey ); if ( aliases == null || aliases.trim().length() == 0 ) { throw new ModelerException( "Error while building GeoContext from properties: No Aliases found for role " + roleName + ". Make sure there is a " + aliasKey + " property defined" ); } return aliases; }
@Override public void onDialogAccept( Domain domain ) { try { model.refresh( domain ); } catch ( ModelerException e ) { showErrorDialog( "Error", e.getMessage() ); } }
public void autoPopulate() { try { // TODO: GWT-ify switch ( workspace.getCurrentModelerPerspective() ) { case REPORTING: workspace.getWorkspaceHelper().autoModelRelationalFlatInBackground( this.workspace ); this.categoriesTree.expandAll(); break; case ANALYSIS: workspace.getWorkspaceHelper().autoModelFlatInBackground( this.workspace ); this.dimensionTree.expandAll(); break; } } catch ( ModelerException e ) { e.printStackTrace(); } }
e.getLocalizedMessage() ), e ); throw new DatasourceServiceException( Messages .getErrorString( "InMemoryDatasourceServiceImpl.ERROR_0015_UNABLE_TO_GENERATE_MODEL" ), e ); //$NON-NLS-1$
public Domain generateDomain( String connectionName, String tableName, String dbType, String query, String datasourceName ) throws Exception { try { DatabaseMeta database = new DatabaseMeta(); database.setDatabaseInterface( new MySQLDatabaseMeta() ); database.setDatabaseType( "mysql" ); database.setUsername( "root" ); database.setPassword( "" ); database.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE ); database.setHostname( "localhost" ); database.setDBName( "hibernate" ); database.setDBPort( "3306" ); TableModelerSource source = new TableModelerSource( database, tableName, null ); Domain d = null; try { d = source.generateDomain(); } catch ( ModelerException e ) { e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates. } return d; } catch ( Exception e ) { e.printStackTrace(); } return null; }
} catch ( ModelerException e ) { logger.error( Messages.getErrorString( "DatasourceServiceImpl.ERROR_0011_UNABLE_TO_GENERATE_MODEL", //$NON-NLS-1$ e.getLocalizedMessage() ), e ); throw new DatasourceServiceException( Messages .getErrorString( "DatasourceServiceImpl.ERROR_0011_UNABLE_TO_GENERATE_MODEL", e.getLocalizedMessage() ),
private Element getCalculatedMeasureNode( final String cubeName, final String measureName ) throws ModelerException { try { XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); String inlineWithHierarchy = String.format( "Schema/Cube[@name=\"%s\"]/CalculatedMember[@name=\"%s\" and @dimension=\"Measures\"]", cubeName, measureName ); return (Element) xPath.compile( inlineWithHierarchy ).evaluate( this.schema, XPathConstants.NODE ); } catch ( Exception e ) { throw new ModelerException( e ); } }
model.getWorkspaceHelper().populateDomain( model ); } catch ( ModelerException e ) { e.printStackTrace(); showErrorDialog( messages.getString( "ModelEditor.ERROR" ), messages.getString( "ModelEditor.ERROR_0001_SAVING_MODELS" ) );
@Override public void validate() throws ModelerException { if ( StringUtils.isBlank( measure ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "ModelAnnotation.UpdateMeasure.validation.MEASURE_NAME_REQUIRED" ) ); } }
controller.init(); } catch ( ModelerException e ) { e.printStackTrace();
@Override public String getRoleAliases( String roleName ) throws ModelerException { String aliasKey = "geo/" + roleName + "/aliases"; String aliases = PentahoSystem.getSystemSetting( settingsFile, aliasKey, null ); if ( aliases == null || aliases.trim().length() == 0 ) { throw new ModelerException( "Error while building GeoContext: No Aliases found for role " + roleName + ". Make sure there is a " + aliasKey + " element defined" ); } return aliases; }
private Element getCalculatedMeasureElement( String cubeName, String measureName ) throws ModelerException { measureName = getMeasureName( measureName ); try { String xPathExpr = String.format( "/Schema/Cube[@name=\"%s\"]/CalculatedMember[@name=\"%s\"]", cubeName, measureName ); XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); XPathExpression xPathExpression = xPath.compile( xPathExpr ); return (Element) xPathExpression.evaluate( this.schema, XPathConstants.NODE ); } catch ( Exception e ) { throw new ModelerException( e ); } }
@Override public void validate() throws ModelerException { if ( StringUtils.isBlank( getName() ) ) { // not ui facing, shouldn't happen throw new ModelerException( BaseMessages.getString( MSG_CLASS, "ModelAnnotation.CreateAttribute.validation.ATTRIBUTE_NAME_REQUIRED" ) ); } if ( StringUtils.isBlank( getDimension() ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "ModelAnnotation.CreateAttribute.validation.PARENT_PROVIDED_MISSING_DIMENSION" ) ); } }
@Override public void validate() throws ModelerException { if ( StringUtils.isBlank( getLevel() ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "ModelAnnotation.RemoveAttribute.validation.FIELD_NAME_REQUIRED" ) ); } }
@Override public void validate() throws ModelerException { if ( isBlank( getCube() ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "ModelAnnotation.ShowHide.validation.CUBE_NAME_REQUIRED" ) ); } if ( isBlank( getName() ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "ModelAnnotation.ShowHide.validation.MEASURE_NAME_REQUIRED" ) ); } }
@Override public void validate() throws ModelerException { if ( StringUtils.isBlank( getName() ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "Modeler.LinkDimension.validation.DIMENSION_NAME_REQUIRED" ) ); } if ( StringUtils.isBlank( getSharedDimension() ) ) { throw new ModelerException( BaseMessages.getString( MSG_CLASS, "Modeler.LinkDimension.validation.SHARED_DIMENSION_REQUIRED" ) ); } }
/** * Gets a measure node from a schema * @param cubeName * @param measureName * @return * @throws ModelerException */ private Node getMeasureNode( String cubeName, String measureName ) throws ModelerException { if ( StringUtils.isBlank( measureName ) ) { return null; } String cubeXPathPart = CUBE_XPATH_EXPR; if ( !StringUtils.isBlank( cubeName ) ) { cubeXPathPart += "[@name=\"" + cubeName + "\"]"; } measureName = getMeasureName( measureName ); // use XPath to get measure node and remove it from it's parent try { XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); StringBuffer xPathExpr = new StringBuffer(); xPathExpr.append( cubeXPathPart + "//" + MEASURE_DIMENSION + "[@name=\"" + measureName + "\"]" ); XPathExpression xPathExpression = xPath.compile( xPathExpr.toString() ); return (Node) xPathExpression.evaluate( this.schema, XPathConstants.NODE ); } catch ( Exception e ) { throw new ModelerException( e ); } }
@Override public Domain generateDomain( boolean dualModelingMode ) throws ModelerException { try { BusinessData bd = datasourceImpl.generateLogicalModel( datasourceName, connectionName, dbType, query, "10" ); Domain domain = bd.getDomain(); return domain; } catch ( DatasourceServiceException dce ) { throw new ModelerException( dce ); } }
throw new ModelerException( e );
throw new ModelerException( e );