} else {
props.setProperty("id", UUID.randomUUID().toString());
}
props.setProperty("advanced", "false");
return new SaikuDatasource(this.getConnectionname(), SaikuDatasource.Type.OLAP, props);
} else {
String name = null;
String[] lines = advanced.split("\\r?\\n");
for (String row : lines) {
if (row.startsWith("name=")) {
name = row.substring(5, row.length());
}
if (row.startsWith("driver=")) {
props.setProperty("driver", row.substring(7, row.length()));
}
if (row.startsWith("location=")) {
props.setProperty("location", row.substring(9, row.length()));
}
if (row.startsWith("username=")) {
if (row.length() > 9) {
props.setProperty("username", row.substring(9, row.length()));
} else {
props.setProperty("username", "");
}
}
if (row.startsWith("password=")) {
if (row.length() > 9) {
props.setProperty("password", row.substring(9, row.length()));
} else {
props.setProperty("password", "");
}
}
if (row.startsWith("security.type=")) {
props.setProperty("security.type", row.substring(14, row.length()));
}
if (row.startsWith("security.mapping=")) {
props.setProperty("security.mapping", row.substring(17, row.length()));
}
if (row.startsWith("security.enabled=")) {
props.setProperty("security.enabled", row.substring(17, row.length()));
}
if (row.startsWith("encrypt.password=")) {
props.setProperty("encrypt.password", row.substring(17, row.length()));
}
if (this.id != null) {
props.setProperty("id", this.id);
} else {
props.setProperty("id", UUID.randomUUID().toString());
}
}
props.setProperty("advanced", "true");
return new SaikuDatasource(name, SaikuDatasource.Type.OLAP, props);
}
}