Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ public List<HookNotificationMessage> getNotificationMessages() throws Exception
return ret;
}

AtlasEntityWithExtInfo oldTableEntity = toTableEntity(oldTable);
AtlasEntityWithExtInfo oldTableEntity = toTableEntity(oldTable);
AtlasEntityWithExtInfo renamedTableEntity = toTableEntity(newTable);

if (oldTableEntity == null || renamedTableEntity == null) {
return ret;
}

// first update with oldTable info, so that the table will be created if it is not present in Atlas
ret.add(new EntityUpdateRequestV2(getUserName(), new AtlasEntitiesWithExtInfo(oldTableEntity)));

AtlasEntityWithExtInfo renamedTableEntity = toTableEntity(newTable);

// update qualifiedName for all columns, partitionKeys, storageDesc
String renamedTableQualifiedName = (String) renamedTableEntity.getEntity().getAttribute(ATTRIBUTE_QUALIFIED_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.atlas.hive.hook.events;

import org.apache.atlas.hive.hook.AtlasHiveHookContext;
import org.apache.atlas.hive.hook.HiveHook.PreprocessAction;
import org.apache.atlas.model.instance.AtlasEntity;
import org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo;
import org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo;
Expand All @@ -41,6 +42,7 @@
import org.apache.hadoop.hive.ql.hooks.WriteEntity;
import org.apache.hadoop.hive.ql.metadata.Hive;
import org.apache.hadoop.hive.ql.metadata.Table;
import org.apache.hadoop.hive.ql.parse.SemanticAnalyzer;
import org.apache.hadoop.hive.ql.plan.HiveOperation;
import org.apache.hadoop.security.UserGroupInformation;
import org.slf4j.Logger;
Expand Down Expand Up @@ -124,6 +126,7 @@ public abstract class BaseHiveEvent {
public static final String ATTRIBUTE_EXPRESSION = "expression";
public static final String ATTRIBUTE_ALIASES = "aliases";

public static final String HDFS_PATH_PREFIX = "hdfs://";

public static final long MILLIS_CONVERT_FACTOR = 1000;

Expand Down Expand Up @@ -213,19 +216,31 @@ protected AtlasEntity toAtlasEntity(Entity entity, AtlasEntityExtInfo entityExtI

switch (entity.getType()) {
case DATABASE: {
Database db = getHive().getDatabase(entity.getDatabase().getName());

ret = toDbEntity(db);
if (!context.getIgnoreDummyDatabaseName().contains(entity.getDatabase().getName())) {
Database db = getHive().getDatabase(entity.getDatabase().getName());
ret = toDbEntity(db);
}
}
break;

case TABLE:
case PARTITION: {
Table table = getHive().getTable(entity.getTable().getDbName(), entity.getTable().getTableName());

ret = toTableEntity(table, entityExtInfo);
}
break;
String dbName = entity.getTable().getDbName();
String tableName = entity.getTable().getTableName();
boolean skipTable = StringUtils.isNotEmpty(context.getIgnoreValuesTmpTableNamePrefix()) && tableName.toLowerCase().startsWith(context.getIgnoreValuesTmpTableNamePrefix());

if (!skipTable) {
skipTable = context.getIgnoreDummyTableName().contains(tableName) && context.getIgnoreDummyDatabaseName().contains(dbName);
}

if (!skipTable) {
Table table = getHive().getTable(dbName, tableName);

ret = toTableEntity(table, entityExtInfo);
}
}
break;

case DFS_DIR: {
URI location = entity.getLocation();
Expand All @@ -237,7 +252,7 @@ protected AtlasEntity toAtlasEntity(Entity entity, AtlasEntityExtInfo entityExtI
break;

default:
break;
break;
}

return ret;
Expand Down Expand Up @@ -283,15 +298,21 @@ protected AtlasEntityWithExtInfo toTableEntity(Table table) throws Exception {

AtlasEntity entity = toTableEntity(table, ret);

ret.setEntity(entity);
if (entity != null) {
ret.setEntity(entity);
} else {
ret = null;
}

return ret;
}

protected AtlasEntity toTableEntity(Table table, AtlasEntitiesWithExtInfo entities) throws Exception {
AtlasEntity ret = toTableEntity(table, (AtlasEntityExtInfo) entities);

entities.addEntity(ret);
if (ret != null) {
entities.addEntity(ret);
}

return ret;
}
Expand All @@ -317,64 +338,76 @@ protected AtlasEntity toTableEntity(AtlasObjectId dbId, Table table, AtlasEntity
AtlasEntity ret = context.getEntity(tblQualifiedName);

if (ret == null) {
ret = new AtlasEntity(HIVE_TYPE_TABLE);
PreprocessAction action = context.getPreprocessActionForHiveTable(tblQualifiedName);

// if this table was sent in an earlier notification, set 'guid' to null - which will:
// - result in this entity to be not included in 'referredEntities'
// - cause Atlas server to resolve the entity by its qualifiedName
if (isKnownTable && !isAlterTableOperation()) {
ret.setGuid(null);
}
if (action == PreprocessAction.IGNORE) {
LOG.info("ignoring table {}", tblQualifiedName);
} else {
ret = new AtlasEntity(HIVE_TYPE_TABLE);

long createTime = getTableCreateTime(table);
long lastAccessTime = table.getLastAccessTime() > 0 ? (table.getLastAccessTime() * MILLIS_CONVERT_FACTOR) : createTime;

ret.setAttribute(ATTRIBUTE_DB, dbId);
ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, tblQualifiedName);
ret.setAttribute(ATTRIBUTE_NAME, table.getTableName().toLowerCase());
ret.setAttribute(ATTRIBUTE_OWNER, table.getOwner());
ret.setAttribute(ATTRIBUTE_CREATE_TIME, createTime);
ret.setAttribute(ATTRIBUTE_LAST_ACCESS_TIME, lastAccessTime);
ret.setAttribute(ATTRIBUTE_RETENTION, table.getRetention());
ret.setAttribute(ATTRIBUTE_PARAMETERS, table.getParameters());
ret.setAttribute(ATTRIBUTE_COMMENT, table.getParameters().get(ATTRIBUTE_COMMENT));
ret.setAttribute(ATTRIBUTE_TABLE_TYPE, table.getTableType().name());
ret.setAttribute(ATTRIBUTE_TEMPORARY, table.isTemporary());

if (table.getViewOriginalText() != null) {
ret.setAttribute(ATTRIBUTE_VIEW_ORIGINAL_TEXT, table.getViewOriginalText());
}
// if this table was sent in an earlier notification, set 'guid' to null - which will:
// - result in this entity to be not included in 'referredEntities'
// - cause Atlas server to resolve the entity by its qualifiedName
if (isKnownTable && !isAlterTableOperation()) {
ret.setGuid(null);
}

if (table.getViewExpandedText() != null) {
ret.setAttribute(ATTRIBUTE_VIEW_EXPANDED_TEXT, table.getViewExpandedText());
}
long createTime = getTableCreateTime(table);
long lastAccessTime = table.getLastAccessTime() > 0 ? (table.getLastAccessTime() * MILLIS_CONVERT_FACTOR) : createTime;

ret.setAttribute(ATTRIBUTE_DB, dbId);
ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, tblQualifiedName);
ret.setAttribute(ATTRIBUTE_NAME, table.getTableName().toLowerCase());
ret.setAttribute(ATTRIBUTE_OWNER, table.getOwner());
ret.setAttribute(ATTRIBUTE_CREATE_TIME, createTime);
ret.setAttribute(ATTRIBUTE_LAST_ACCESS_TIME, lastAccessTime);
ret.setAttribute(ATTRIBUTE_RETENTION, table.getRetention());
ret.setAttribute(ATTRIBUTE_PARAMETERS, table.getParameters());
ret.setAttribute(ATTRIBUTE_COMMENT, table.getParameters().get(ATTRIBUTE_COMMENT));
ret.setAttribute(ATTRIBUTE_TABLE_TYPE, table.getTableType().name());
ret.setAttribute(ATTRIBUTE_TEMPORARY, table.isTemporary());

if (table.getViewOriginalText() != null) {
ret.setAttribute(ATTRIBUTE_VIEW_ORIGINAL_TEXT, table.getViewOriginalText());
}

AtlasObjectId tableId = getObjectId(ret);
AtlasEntity sd = getStorageDescEntity(tableId, table);
List<AtlasEntity> partitionKeys = getColumnEntities(tableId, table, table.getPartitionKeys());
List<AtlasEntity> columns = getColumnEntities(tableId, table, table.getCols());
if (table.getViewExpandedText() != null) {
ret.setAttribute(ATTRIBUTE_VIEW_EXPANDED_TEXT, table.getViewExpandedText());
}

if (entityExtInfo != null) {
entityExtInfo.addReferredEntity(sd);
boolean pruneTable = table.isTemporary() || action == PreprocessAction.PRUNE;

if (partitionKeys != null) {
for (AtlasEntity partitionKey : partitionKeys) {
entityExtInfo.addReferredEntity(partitionKey);
if (pruneTable) {
LOG.info("ignoring details of table {}", tblQualifiedName);
} else {
AtlasObjectId tableId = getObjectId(ret);
AtlasEntity sd = getStorageDescEntity(tableId, table);
List<AtlasEntity> partitionKeys = getColumnEntities(tableId, table, table.getPartitionKeys());
List<AtlasEntity> columns = getColumnEntities(tableId, table, table.getCols());

if (entityExtInfo != null) {
entityExtInfo.addReferredEntity(sd);

if (partitionKeys != null) {
for (AtlasEntity partitionKey : partitionKeys) {
entityExtInfo.addReferredEntity(partitionKey);
}
}

if (columns != null) {
for (AtlasEntity column : columns) {
entityExtInfo.addReferredEntity(column);
}
}
}
}

if (columns != null) {
for (AtlasEntity column : columns) {
entityExtInfo.addReferredEntity(column);
}
ret.setAttribute(ATTRIBUTE_STORAGEDESC, getObjectId(sd));
ret.setAttribute(ATTRIBUTE_PARTITION_KEYS, getObjectIds(partitionKeys));
ret.setAttribute(ATTRIBUTE_COLUMNS, getObjectIds(columns));
}
}

ret.setAttribute(ATTRIBUTE_STORAGEDESC, getObjectId(sd));
ret.setAttribute(ATTRIBUTE_PARTITION_KEYS, getObjectIds(partitionKeys));
ret.setAttribute(ATTRIBUTE_COLUMNS, getObjectIds(columns));

context.putEntity(tblQualifiedName, ret);
context.putEntity(tblQualifiedName, ret);
}
}

return ret;
Expand Down Expand Up @@ -481,7 +514,14 @@ protected List<AtlasEntity> getColumnEntities(AtlasObjectId tableId, Table table
}

protected AtlasEntity getHDFSPathEntity(Path path) {
String strPath = path.toString().toLowerCase();
String strPath = path.toString();
String name = Path.getPathWithoutSchemeAndAuthority(path).toString();

if (strPath.startsWith(HDFS_PATH_PREFIX) && context.isConvertHdfsPathToLowerCase()) {
strPath = strPath.toLowerCase();
name = name.toLowerCase();
}

String pathQualifiedName = getQualifiedName(strPath);
AtlasEntity ret = context.getEntity(pathQualifiedName);

Expand All @@ -490,7 +530,7 @@ protected AtlasEntity getHDFSPathEntity(Path path) {

ret.setAttribute(ATTRIBUTE_PATH, strPath);
ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, pathQualifiedName);
ret.setAttribute(ATTRIBUTE_NAME, Path.getPathWithoutSchemeAndAuthority(path).toString().toLowerCase());
ret.setAttribute(ATTRIBUTE_NAME, name);
ret.setAttribute(ATTRIBUTE_CLUSTER_NAME, getClusterName());

context.putEntity(pathQualifiedName, ret);
Expand Down Expand Up @@ -625,14 +665,18 @@ protected String getQualifiedName(String dbName, String tableName, String colNam
}

protected String getQualifiedName(URI location) {
String strPath = new Path(location).toString().toLowerCase();
String strPath = new Path(location).toString();

if (strPath.startsWith(HDFS_PATH_PREFIX) && context.isConvertHdfsPathToLowerCase()) {
strPath = strPath.toLowerCase();
}

return getQualifiedName(strPath);
}

protected String getQualifiedName(String path) {
if (path.startsWith("hdfs://")) {
return (path + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName();
if (path.startsWith(HDFS_PATH_PREFIX)) {
return path + QNAME_SEP_CLUSTER_NAME + getClusterName();
}

return path.toLowerCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ private void processColumnLineage(AtlasEntity hiveProcess, AtlasEntitiesWithExtI
return;
}

final List<AtlasEntity> columnLineages = new ArrayList<>();
int lineageInputsCount = 0;
final List<AtlasEntity> columnLineages = new ArrayList<>();
int lineageInputsCount = 0;
final Set<String> processedOutputCols = new HashSet<>();

for (Map.Entry<DependencyKey, Dependency> entry : lineageInfo.entrySet()) {
String outputColName = getQualifiedName(entry.getKey());
Expand All @@ -149,6 +150,14 @@ private void processColumnLineage(AtlasEntity hiveProcess, AtlasEntitiesWithExtI
continue;
}

if (processedOutputCols.contains(outputColName)) {
LOG.warn("column-lineage: duplicate for output-column {}", outputColName);

continue;
} else {
processedOutputCols.add(outputColName);
}

List<AtlasEntity> inputColumns = new ArrayList<>();

for (BaseColumnInfo baseColumn : getBaseCols(entry.getValue())) {
Expand All @@ -172,7 +181,7 @@ private void processColumnLineage(AtlasEntity hiveProcess, AtlasEntitiesWithExtI

AtlasEntity columnLineageProcess = new AtlasEntity(HIVE_TYPE_COLUMN_LINEAGE);

columnLineageProcess.setAttribute(ATTRIBUTE_NAME, hiveProcess.getAttribute(ATTRIBUTE_NAME) + ":" + outputColumn.getAttribute(ATTRIBUTE_NAME));
columnLineageProcess.setAttribute(ATTRIBUTE_NAME, hiveProcess.getAttribute(ATTRIBUTE_QUALIFIED_NAME) + ":" + outputColumn.getAttribute(ATTRIBUTE_NAME));
columnLineageProcess.setAttribute(ATTRIBUTE_QUALIFIED_NAME, hiveProcess.getAttribute(ATTRIBUTE_QUALIFIED_NAME) + ":" + outputColumn.getAttribute(ATTRIBUTE_NAME));
columnLineageProcess.setAttribute(ATTRIBUTE_INPUTS, getObjectIds(inputColumns));
columnLineageProcess.setAttribute(ATTRIBUTE_OUTPUTS, Collections.singletonList(getObjectId(outputColumn)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public AtlasEntitiesWithExtInfo getEntities() throws Exception {
if (table != null) {
AtlasEntity tblEntity = toTableEntity(table, ret);

if (TableType.EXTERNAL_TABLE.equals(table.getTableType())) {
if (tblEntity != null && TableType.EXTERNAL_TABLE.equals(table.getTableType())) {
AtlasEntity hdfsPathEntity = getHDFSPathEntity(table.getDataLocation());
AtlasEntity processEntity = getHiveProcessEntity(Collections.singletonList(hdfsPathEntity), Collections.singletonList(tblEntity));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ public void testTruncateTable() throws Exception {
Map<String, AtlasEntityHeader> entityMap = atlasLineageInfoInput.getGuidEntityMap();

//Below should be assertTrue - Fix https://issues.apache.org/jira/browse/ATLAS-653
Assert.assertFalse(entityMap.containsKey(tableId));
Assert.assertTrue(entityMap.containsKey(tableId));
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion addons/sqoop-bridge-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
<relativePath>../../</relativePath>
</parent>
<artifactId>sqoop-bridge-shim</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion addons/sqoop-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
<relativePath>../../</relativePath>
</parent>
<artifactId>sqoop-bridge</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion addons/storm-bridge-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
<relativePath>../../</relativePath>
</parent>
<artifactId>storm-bridge-shim</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion addons/storm-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
<relativePath>../../</relativePath>
</parent>
<artifactId>storm-bridge</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion authorization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.atlas</groupId>
<artifactId>apache-atlas</artifactId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>
<artifactId>atlas-authorization</artifactId>
<name>Apache Atlas Authorization</name>
Expand Down
2 changes: 1 addition & 1 deletion catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.atlas</groupId>
<artifactId>apache-atlas</artifactId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>
<artifactId>atlas-catalog</artifactId>
<description>Apache Atlas Business Catalog Module</description>
Expand Down
2 changes: 1 addition & 1 deletion client/client-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>atlas-client</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion client/client-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>atlas-client</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion client/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>atlas-client</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
13 changes: 11 additions & 2 deletions client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public abstract class AtlasBaseClient {
private boolean retryEnabled = false;
private Cookie cookie = null;

private SecureClientUtils clientUtils;

protected AtlasBaseClient() {
}

Expand Down Expand Up @@ -279,14 +281,15 @@ protected Client getClient(Configuration configuration, UserGroupInformation ugi
}

final URLConnectionClientHandler handler;
clientUtils = new SecureClientUtils();

boolean isKerberosEnabled = AuthenticationUtil.isKerberosAuthenticationEnabled(ugi);

if (isKerberosEnabled) {
handler = SecureClientUtils.getClientConnectionHandler(config, configuration, doAsUser, ugi);
handler = clientUtils.getClientConnectionHandler(config, configuration, doAsUser, ugi);
} else {
if (configuration.getBoolean(TLS_ENABLED, false)) {
handler = SecureClientUtils.getUrlConnectionClientHandler();
handler = clientUtils.getUrlConnectionClientHandler();
} else {
handler = new URLConnectionClientHandler();
}
Expand All @@ -297,6 +300,12 @@ protected Client getClient(Configuration configuration, UserGroupInformation ugi
return client;
}

public void close() {
if (clientUtils != null) {
clientUtils.destroyFactory();
}
}

@VisibleForTesting
protected String determineActiveServiceURL(String[] baseUrls, Client client) {
if (baseUrls.length == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public class SecureClientUtils {

public final static int DEFAULT_SOCKET_TIMEOUT_IN_MSECS = 1 * 60 * 1000; // 1 minute
private static final Logger LOG = LoggerFactory.getLogger(SecureClientUtils.class);
private SSLFactory factory = null;


public static URLConnectionClientHandler getClientConnectionHandler(DefaultClientConfig config,
public URLConnectionClientHandler getClientConnectionHandler(DefaultClientConfig config,
org.apache.commons.configuration.Configuration clientConfig, String doAsUser,
final UserGroupInformation ugi) {
config.getProperties().put(URLConnectionClientHandler.PROPERTY_HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND, true);
Expand All @@ -80,9 +81,10 @@ public static URLConnectionClientHandler getClientConnectionHandler(DefaultClien
(ugiToUse.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.PROXY)
? ugiToUse.getRealUser() : ugiToUse;
LOG.info("Real User: {}, is from ticket cache? {}", actualUgi, actualUgi.isLoginTicketBased());
if (StringUtils.isEmpty(doAsUser)) {
doAsUser = actualUgi.getShortUserName();
if (StringUtils.isEmpty(doAsUser) || StringUtils.equals(doAsUser, actualUgi.getShortUserName())) {
doAsUser = null;
}

LOG.info("doAsUser: {}", doAsUser);
final String finalDoAsUser = doAsUser;
httpURLConnectionFactory = new HttpURLConnectionFactory() {
Expand Down Expand Up @@ -124,7 +126,7 @@ public HttpURLConnection configure(HttpURLConnection conn) throws IOException {
}
};

private static ConnectionConfigurator newConnConfigurator(Configuration conf) {
private ConnectionConfigurator newConnConfigurator(Configuration conf) {
try {
return newSslConnConfigurator(DEFAULT_SOCKET_TIMEOUT_IN_MSECS, conf);
} catch (Exception e) {
Expand All @@ -133,14 +135,12 @@ private static ConnectionConfigurator newConnConfigurator(Configuration conf) {
}
}

private static ConnectionConfigurator newSslConnConfigurator(final int timeout, Configuration conf)
private ConnectionConfigurator newSslConnConfigurator(final int timeout, Configuration conf)
throws IOException, GeneralSecurityException {
final SSLFactory factory;
final SSLSocketFactory sf;
final HostnameVerifier hv;

factory = new SSLFactory(SSLFactory.Mode.CLIENT, conf);
factory.init();
factory = getSSLFactory(conf);
sf = factory.createSSLSocketFactory();
hv = factory.getHostnameVerifier();

Expand All @@ -158,6 +158,22 @@ public HttpURLConnection configure(HttpURLConnection conn) throws IOException {
};
}

public SSLFactory getSSLFactory(Configuration conf) throws IOException, GeneralSecurityException {
if (factory == null) {
factory = new SSLFactory(SSLFactory.Mode.CLIENT, conf);
factory.init();
}
return factory;
}

public void destroyFactory() {
if (factory != null) {
factory.destroy();
factory = null;
}
}


private static void setTimeouts(URLConnection connection, int socketTimeout) {
connection.setConnectTimeout(socketTimeout);
connection.setReadTimeout(socketTimeout);
Expand Down Expand Up @@ -209,7 +225,7 @@ public static void persistSSLClientConfiguration(org.apache.commons.configuratio
}
}

public static URLConnectionClientHandler getUrlConnectionClientHandler() {
public URLConnectionClientHandler getUrlConnectionClientHandler() {
return new URLConnectionClientHandler(new HttpURLConnectionFactory() {
@Override
public HttpURLConnection getHttpURLConnection(URL url)
Expand All @@ -229,8 +245,7 @@ public HttpURLConnection getHttpURLConnection(URL url)
UserGroupInformation.setConfiguration(conf);

HttpsURLConnection c = (HttpsURLConnection) connection;
factory = new SSLFactory(SSLFactory.Mode.CLIENT, conf);
factory.init();
factory = getSSLFactory(conf);
sf = factory.createSSLSocketFactory();
hv = factory.getHostnameVerifier();
c.setSSLSocketFactory(sf);
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>

<!-- Sub modules -->
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>
<artifactId>atlas-common</artifactId>
<description>Apache Atlas Common</description>
Expand Down
5 changes: 5 additions & 0 deletions common/src/main/java/org/apache/atlas/AtlasConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public enum AtlasConfiguration {

QUERY_PARAM_MAX_LENGTH("atlas.query.param.max.length", 4*1024),

REST_API_ENABLE_DELETE_TYPE_OVERRIDE("atlas.rest.enable.delete.type.override", false),

NOTIFICATION_HOOK_TOPIC_NAME("atlas.notification.hook.topic.name", "ATLAS_HOOK"),
NOTIFICATION_ENTITIES_TOPIC_NAME("atlas.notification.entities.topic.name", "ATLAS_ENTITIES"),

NOTIFICATION_MESSAGE_MAX_LENGTH_BYTES("atlas.notification.message.max.length.bytes", (1000 * 1000)),
NOTIFICATION_MESSAGE_COMPRESSION_ENABLED("atlas.notification.message.compression.enabled", true),
NOTIFICATION_SPLIT_MESSAGE_SEGMENTS_WAIT_TIME_SECONDS("atlas.notification.split.message.segments.wait.time.seconds", 15 * 60),
Expand Down
6 changes: 4 additions & 2 deletions dashboardv2/gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ module.exports = function(grunt) {
},
'query-builder.default.min.css': { 'jQuery-QueryBuilder/dist/css': 'jQueryQueryBuilder/css' },
'daterangepicker.css': { 'bootstrap-daterangepicker': 'bootstrap-daterangepicker/css' },
'nv.d3.min.css': { 'nvd3/build': 'nvd3/css' }
'nv.d3.min.css': { 'nvd3/build': 'nvd3/css' },
'pretty-checkbox.min.css': { 'pretty-checkbox/dist': 'pretty-checkbox/css' }
}

},
Expand All @@ -158,7 +159,8 @@ module.exports = function(grunt) {
{ 'd3-tip': 'd3/' },
{ 'dagre-d3': 'dagre-d3' },
{ 'platform': 'platform/' },
{ 'jQuery-QueryBuilder': 'jQueryQueryBuilder/' }
{ 'jQuery-QueryBuilder': 'jQueryQueryBuilder/' },
{ 'pretty-checkbox': 'pretty-checkbox' }
],
'LICENSE.md': [{ 'backbone.babysitter': 'backbone-babysitter' },
{ 'backbone.wreqr': 'backbone-wreqr' },
Expand Down
10 changes: 6 additions & 4 deletions dashboardv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"repository": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/incubator-atlas.git"
"url": "https://gitbox.apache.org/repos/asf/incubator-atlas.git"
},
"scripts": {
"dev": "grunt dev",
Expand Down Expand Up @@ -35,18 +35,19 @@
"dagre-d3": "0.4.17",
"font-awesome": "4.7.0",
"jQuery-QueryBuilder": "2.4.3",
"jquery": "^3.2.1",
"jquery": "3.3.1",
"jquery-asBreadcrumbs": "0.2.2",
"jquery-placeholder": "2.3.1",
"jquery-sparkline": "2.4.0",
"moment": "2.18.1",
"moment": "2.21.0",
"nvd3": "1.8.5",
"platform": "1.3.4",
"pnotify": "3.2.0",
"pretty-checkbox": "3.0.3",
"requirejs": "2.3.3",
"requirejs-text": "2.0.15",
"select2": "4.0.3",
"table-dragger": "^1.0.2",
"table-dragger": "1.0.2",
"underscore": "1.8.3"
},
"devDependencies": {
Expand All @@ -57,6 +58,7 @@
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-cssmin": "2.0.0",
"grunt-contrib-htmlmin": "2.2.0",
"grunt-contrib-rename": "0.2.0",
"grunt-contrib-uglify": "2.1.0",
"grunt-contrib-watch": "1.0.0",
"grunt-middleware-proxy": "1.0.7",
Expand Down
2 changes: 1 addition & 1 deletion dashboardv2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.atlas</groupId>
<artifactId>apache-atlas</artifactId>
<version>0.8.3-SNAPSHOT</version>
<version>0.8.4</version>
</parent>

<artifactId>atlas-dashboardv2</artifactId>
Expand Down
42 changes: 42 additions & 0 deletions dashboardv2/public/css/scss/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,43 @@
/* common.scss */

.readOnly {

span,
button,
a {
i {
&.fa-trash[data-guid] {
display: none;
}

&.fa-trash[data-id="delete"] {
display: none;
}
}

&.btn[data-id="addTag"] {
display: none;
}

&.editbutton[data-id="editButton"] {
display: none !important;
}

&[data-id="delete"],
&[data-id="edit"] {
display: none;
}

&.btn[data-id="addTerm"] {
display: none;
}

&.btn[data-id="tagClick"] {
span {
display: block;
padding: 3px 5px 3px 5px;
}

i.fa-close[data-id="deleteTag"],
i.fa-times[data-id="deleteTag"],
i.fa-times[data-id="delete"] {
Expand All @@ -58,6 +66,26 @@
}
}

.details-backbutton {
display: none !important;
}

.full-screen {
#sidebar-wrapper {
left: 0;
}

#wrapper {
padding-left: 0px;
}
}

.detail-page {
.details-backbutton {
display: block !important;
}
}

pre {
background-color: ghostwhite;
border: 1px solid silver;
Expand All @@ -71,6 +99,7 @@ pre {
white-space: pre-wrap;
/* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word;

/* IE 5.5+ */
&.code-block {
code {
Expand All @@ -79,8 +108,10 @@ pre {
display: block;
overflow: auto;
}

position: relative;
overflow: hidden;

&.shrink {
height: 40px;
white-space: -moz-pre-wrap;
Expand All @@ -92,44 +123,55 @@ pre {
white-space: pre-wrap;
/* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word;

/* IE 5.5+ */
code {
height: 40px;
}

&.fixed-height {
height: 75px;

code {
height: 54px;
}
}

&.medium-height {
height: 100px;
}

.expand-collapse-button {
i:before {
content: "\f107";
}
}
}

.expand-collapse-button {
position: absolute;
right: 3px;
top: 4px;
z-index: 1;

i:before {
content: "\f106";
}
}

.json-key {
color: brown;
}

.json-value {
color: navy;
}

.json-string {
color: olive;
}
}

code {
font-family: monospace;
}
Expand Down
7 changes: 7 additions & 0 deletions dashboardv2/public/css/scss/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ button:focus {
}
}

.btn-group {
.btn-atlas,
.btn-action {
margin: 0px;
}
}

.pagination>.active {
>a {
background-color: $color_curious_blue_approx;
Expand Down
364 changes: 302 additions & 62 deletions dashboardv2/public/css/scss/graph.scss

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dashboardv2/public/css/scss/override.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
.modal-body {
position: relative;
padding: 15px;
max-height: 400px;
max-height: 72vh;
min-height: 70px;
overflow: auto;
.btn+.btn {
Expand Down
71 changes: 64 additions & 7 deletions dashboardv2/public/css/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,32 @@ header {
.header-menu {
.dropdown-menu>li>a {
color: $color_ironside_gray_approx;

&:hover {
color: $color_jungle_green_approx;
}

i {
padding-right: 3px;
}
}

>a {
display: inline-block;
color: $color_ironside_gray_approx;
padding: 16px 14px;
padding: 15px 14px;

&:hover {
border-bottom: 2px solid $color_jungle_green_approx;
padding: 14px 14px;
color: $color_jungle_green_approx;
}

span {
padding: 5px;
}

i {
margin-top: 7px;
font-size: 18px;
}
}
Expand All @@ -69,6 +74,7 @@ header {
font-size: 18px;
font-style: italic;
}

.input-group-addon {
font-size: 20px;
color: $color_bombay_approx;
Expand All @@ -85,6 +91,7 @@ header {
#sideNav-wrapper {
color: $white;
font-size: 16px !important;

.well {
background-color: $color_tuna_approx;
border: 1px solid #666363;
Expand All @@ -94,15 +101,26 @@ header {
}

.page-title {
background-color: $white;
padding: 25px;
background-color: $color_white_lilac_approx;
padding: 10px 15px 0px 15px;

.title {
padding-top: 0;
margin-top: 0;
}

h1 {
&.title {
word-break: break-all;
}

// margin-top: 50px;
margin-bottom: 10px;
font-weight: 600;
@include ellipsis();
max-width: 91%;
display: inline-block;

small {
position: relative;
bottom: 5px;
Expand All @@ -115,6 +133,7 @@ header {
text-transform: uppercase;
}
}

.sub-title {
margin-bottom: 40px;
}
Expand All @@ -134,14 +153,19 @@ header {

a {
color: $color_jungle_green_approx;
cursor: pointer;

&:focus {
color: $color_puerto_rico_approx;
text-decoration: none;
outline: none;
cursor: pointer;
}

&:hover {
color: $color_puerto_rico_approx;
text-decoration: none;
cursor: pointer;
}
}

Expand All @@ -152,11 +176,13 @@ a {

.blue-link {
color: $color_havelock_blue_approx;

&:focus {
color: $color_havelock_blue_approx;
text-decoration: none;
outline: none;
}

&:hover {
color: $color_havelock_blue_approx;
text-decoration: underline;
Expand Down Expand Up @@ -184,16 +210,17 @@ hr[size="10"] {
margin-bottom: 2px;
background-color: $white;
max-width: none;

.table {
width: auto;
}
}


.table-quickMenu>tbody>tr>td {
&.searchTerm {
overflow: visible;
}

&.searchTag {}
}

Expand All @@ -214,8 +241,7 @@ hr[size="10"] {
}

.gray-bg {
background-color: #f6f7fb;
padding-bottom: 4%;
background-color: $color_white_lilac_approx
}


Expand All @@ -230,13 +256,16 @@ hr[size="10"] {
padding: 25px 0;
margin-top: 25px;
border-top: 1px $color_mystic_approx solid;

.comment {
margin-bottom: 25px;
}

.author {
color: $color_keppel_approx;
margin-bottom: 0;
}

.date {
color: $color_star_dust_approx;
}
Expand Down Expand Up @@ -302,6 +331,10 @@ hr[size="10"] {
margin-right: 0px !important;
}

.no-border {
border: none !important;
}

.position-relative {
position: relative;
}
Expand All @@ -317,9 +350,11 @@ hr[size="10"] {

.readOnlyLink {
@include ellipsis();

.deleteBtn {
padding: 0px 5px;
}

a {
color: $delete_link !important;
}
Expand Down Expand Up @@ -347,6 +382,7 @@ fieldset.fieldset-child-pd>div {
.inline-content {
>.inline {
display: inline-block;

&+.inline {
margin-left: 5px;
}
Expand All @@ -355,6 +391,7 @@ fieldset.fieldset-child-pd>div {

.inline-content-fl {
@extend .inline-content;

>.inline {
display: block;
float: left;
Expand All @@ -363,15 +400,18 @@ fieldset.fieldset-child-pd>div {

.inline-content-fr {
@extend .inline-content-fl;

>.inline {
float: right;

&+.inline {
margin-right: 5px;
}
}
}

.has-error {

.select2-selection--single,
.select2-selection--multiple {
border-color: $color_apple_blossom_approx;
Expand All @@ -381,4 +421,21 @@ fieldset.fieldset-child-pd>div {
.table-action-btn {
position: absolute;
right: 0px;
}

.entity-icon-box {
display: inline-block;
background: #cee0fa;
padding: 10px;
border-radius: 50%;
min-width: 76.25px;
min-height: 70px;

&.disabled {
background: #e3e3e3;
}

img {
height: 50px;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboardv2/public/img/entity-icon/DataSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboardv2/public/img/entity-icon/avro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboardv2/public/img/entity-icon/aws.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboardv2/public/img/entity-icon/db.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboardv2/public/img/entity-icon/falcon.png
Binary file added dashboardv2/public/img/entity-icon/hadoop.png
Binary file added dashboardv2/public/img/entity-icon/hbase.png
Binary file added dashboardv2/public/img/entity-icon/hdfs_path.png
Binary file added dashboardv2/public/img/entity-icon/hive.png
Binary file added dashboardv2/public/img/entity-icon/hive_db.png
Binary file added dashboardv2/public/img/entity-icon/hive_table.png
Binary file added dashboardv2/public/img/entity-icon/impala.png
Binary file added dashboardv2/public/img/entity-icon/jms_topic.png
Binary file added dashboardv2/public/img/entity-icon/kafka.png
Binary file added dashboardv2/public/img/entity-icon/process.png
Binary file added dashboardv2/public/img/entity-icon/rdbms.png
Binary file added dashboardv2/public/img/entity-icon/rdbms_db.png
Binary file added dashboardv2/public/img/entity-icon/sqoop.png
Binary file added dashboardv2/public/img/entity-icon/sqoop_db.png
Binary file added dashboardv2/public/img/entity-icon/storm.png
Binary file added dashboardv2/public/img/entity-icon/storm_bolt.png
Binary file added dashboardv2/public/img/entity-icon/table.png
Binary file removed dashboardv2/public/img/icon-gear-active.png
Diff not rendered.
Binary file removed dashboardv2/public/img/icon-gear-delete.png
Diff not rendered.
Binary file removed dashboardv2/public/img/icon-gear.png
Diff not rendered.
Binary file removed dashboardv2/public/img/icon-table-active.png
Diff not rendered.
Binary file removed dashboardv2/public/img/icon-table-delete.png
Diff not rendered.
Binary file removed dashboardv2/public/img/icon-table.png
Diff not rendered.
1 change: 1 addition & 0 deletions dashboardv2/public/index.html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<link href="js/libs/jQueryQueryBuilder/css/query-builder.default.min.css?bust=<%- bust %>" rel="stylesheet">
<link href="js/libs/bootstrap-daterangepicker/css/daterangepicker.css?bust=<%- bust %>" rel="stylesheet">
<link rel="stylesheet" href="js/libs/nvd3/css/nv.d3.min.css?bust=<%- bust %>">
<link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet">
<link href="css/style.css?bust=<%- bust %>" rel="stylesheet">
</head>

Expand Down
3 changes: 2 additions & 1 deletion dashboardv2/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ require.config({

require(['App',
'router/Router',
'utils/Helper',
'utils/CommonViewFunction',
'utils/Globals',
'utils/UrlLinks',
Expand All @@ -183,7 +184,7 @@ require(['App',
'bootstrap',
'd3',
'select2'
], function(App, Router, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList) {
], function(App, Router, Helper, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList) {
var that = this;
this.asyncFetchCounter = 5;
this.entityDefCollection = new VEntityList();
Expand Down
10 changes: 8 additions & 2 deletions dashboardv2/public/js/modules/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ define(['require',

Handlebars.registerHelper('toHumanDate', function(val) {
if (!val) return "";
return val;//localization.formatDate(val, 'f');
return val; //localization.formatDate(val, 'f');
});
Handlebars.registerHelper('tt', function(str) {
//return localization.tt(str);
Expand All @@ -70,6 +70,12 @@ define(['require',
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
break;
case '!=':
return (v1 !== v2) ? options.fn(this) : options.inverse(this);
break;
case '!==':
return (v1 !== v2) ? options.fn(this) : options.inverse(this);
break;
case '<':
return (v1 < v2) ? options.fn(this) : options.inverse(this);
break;
Expand All @@ -90,4 +96,4 @@ define(['require',
});

return HHelpers;
});
});
1 change: 1 addition & 0 deletions dashboardv2/public/js/router/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ define([
this.postRouteExecute();
},
preRouteExecute: function() {
$(".tooltip").tooltip("hide");
// console.log("Pre-Route Change Operations can be performed here !!");
},
postRouteExecute: function(name, args) {
Expand Down
14 changes: 12 additions & 2 deletions dashboardv2/public/js/templates/common/TableLayout_tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,20 @@
<div class="row clearfix banded pagination-box">
<div class="col-sm-offset-4 col-sm-8">
<div class="inline-content-fr">
<div data-id="r_pagination" class="inline"></div>
<div data-id="r_pagination" data-id="paginationDiv" class="inline"></div>
{{#if includeGotoPage}}
<div class="inline col-sm-4" data-id="paginationDiv" style="display:none">
<div class="input-group" data-id="goToPageDiv">
<input type="text" class="form-control number-input" data-id="gotoPage" placeholder="Goto Page" />
<span class="input-group-btn">
<button class="btn btn-default" type="button" data-id="gotoPagebtn" title="Goto Page" disabled="disabled">Go!</button>
</span>
</div>
</div>
{{/if}}
{{#if includePageSize}}
<div class="inline">
<div class="form-group inline-content">
<div class="inline-content">
<span class="control-label-sm inline ">Page Limit :</span>
<div class="select inline" style="width: 80px;">
<select data-id="pageSize" class="form-control"></select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="entityDetail form-horizontal col-sm-12">
<div class="row">
<a href="javascript:void(0);" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a>
</div>
<h1 class="form-group"><span data-id="title"></span></h1> {{#if entityUpdate}}
<h1 class="title row">
<div data-id="entityIcon" class="entity-icon-box"></div>
<span data-id="title"></span>
</h1> {{#if entityUpdate}}
<div data-id="editButtonContainer" class="pull-right"></div>
{{/if}}
<div class="form-group">
Expand All @@ -42,112 +42,78 @@ <h1 class="form-group"><span data-id="title"></span></h1> {{#if entityUpdate}}
</div>
{{/if}}
</div>
</div>
<div class="container-fluid gray-bg">
<div class="row">
<div class="col-sm-custom">
<div class="">
<!-- <h4 class="lineageLabel"></h4> -->
<div class="lineageLayout">
<div class="panel panel-default" id="panel">
<div class="panel-heading clearfix">
<h4 class="panel-title pull-left"> LINEAGE & IMPACT</h4>
<div class="btn-group pull-right">
<button type="button" class="fullscreen_panel" id="fullscreen_panel" title="Fullscreen"><i class="fa fa-expand" aria-hidden="true"></i></button>
<button type="button" id="expand_collapse_panel" class="expand_collapse_panel" title="Collapse"><i class="fa fa-chevron-up" aria-hidden="true"></i></button>
</div>
</div>
<div id="panel_body" class="panel-body graph-bg resize-graph animated" align="center">
<div id="r_lineageLayoutView">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<ul class="nav nav-tabs ">
<li role="properties" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
<li role="lineage" class="tab lineageGraph" style="display:none"><a href="#tab-lineage" aria-controls="tab-lineage" role="tab" data-toggle="tab">Lineage</a></li>
<li role="tags"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li>
{{#if taxonomy}}
<li role="terms"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li>
{{/if}}
<li role="audits" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="raudits" class="tab replicationTab" style="display:none"><a href="#tab-raudit" aria-controls="tab-raudit" role="tab" data-toggle="tab">Export/Import Audits</a></li>
<li role="schema" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li>
<li role="profile" class="tab profileTab" style="display:none"><a href="#tab-profile" aria-controls="tab-profile" role="tab" data-toggle="tab">Profile</a></li>
</ul>
</div>
</div>
</div>
<div class="tab-content">
<div id="tab-details" role="properties" class="tab-pane active">
<div id="r_entityDetailTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-custom">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading clearfix">
<h4 class="panel-title pull-left">DETAILS</h4>
<div class="btn-group pull-right">
<button type="button" class="expand_collapse_panel" title="Collapse"><i class="fa fa-chevron-up" aria-hidden="true"></i></button>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12">
<ul class="nav nav-tabs ">
<li role="properties" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
<li role="tags"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li>
{{#if taxonomy}}
<li role="terms"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li>
{{/if}}
<li role="audits" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="raudits" class="tab replicationTab" style="display:none"><a href="#tab-raudit" aria-controls="tab-raudit" role="tab" data-toggle="tab">Export/Import Audits</a></li>
<li role="schema" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li>
<li role="profile" class="tab profileTab" style="display:none"><a href="#tab-profile" aria-controls="tab-profile" role="tab" data-toggle="tab">Profile</a></li>
</ul>
</div>
</div>
<div class="tab-content">
<div id="tab-details" role="properties" class="tab-pane active">
<div id="r_entityDetailTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-tagTable" role="tags" class="tab-pane fade">
<div id="r_tagTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-termTable" role="terms" class="tab-pane">
<div id="r_termTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-audit" role="audits" class="tab-pane">
<div id="r_auditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-raudit" role="raudits" class="tab-pane">
<div id="r_replicationAuditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-schema" role="schema" class="tab-pane">
<div id="r_schemaTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-profile" role="profile" class="tab-pane">
<div id="r_profileLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
</div>
</div>
<div id="tab-lineage" role="lineage" class="tab-pane">
<div id="r_lineageLayoutView" class="resizeGraph animated position-relative" align="center">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-tagTable" role="tags" class="tab-pane fade">
<div id="r_tagTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-termTable" role="terms" class="tab-pane">
<div id="r_termTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-audit" role="audits" class="tab-pane">
<div id="r_auditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-raudit" role="raudits" class="tab-pane">
<div id="r_replicationAuditTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-schema" role="schema" class="tab-pane">
<div id="r_schemaTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-profile" role="profile" class="tab-pane">
<div id="r_profileLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
</div>
</div>
142 changes: 123 additions & 19 deletions dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,133 @@
* limitations under the License.
-->
<!-- <div class="graph-toolbar clearfix"></div> -->
<!-- for 0.8 we used position of lineage-box - Relative -->
<div style="position: relative;height:100%;width:100%;" class="white-bg no-padding lineage-box">
<div class="lineage-filter-box clearfix">
<div class="hideProcessContainer">
<span class="pull-left"><b>Load Process:</b>&nbsp</span>
<span class="pull-left">Show</span>
<label class="switch pull-left">
<input type="checkbox" class="switch-input" data-id="checkHideProcess" value="" />
<span class="switch-slider"></span>
</label>
<span class="pull-left">Hide</span>
</div>
<div class="zoomButtonGroup pull-right">
<span type="button" id="zoom_in" class="btn btn-atlas btn-md lineageZoomButton" title="Zoom In" data-id="refreshBtn"> <i class="fa fa-search-plus"></i></span>
<span type="button" id="zoom_out" class="btn btn-atlas btn-md lineageZoomButton" title="Zoom Out" data-id="refreshBtn"> <i class="fa fa-search-minus"></i></span>
<div class="white-bg no-padding lineage-box">
<div class="box-panel filter-box">
<div class="header clearfix">
<h4>Filters</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="hideProcessContainer form-group text-left col-sm-12">
<div class="pretty p-switch p-fill">
<input type="checkbox" class="pull-left" data-id="checkHideProcess" value="" />
<div class="state p-primary">
<label>Hide Process</label>
</div>
</div>
</div>
<div class="hideDeletedContainer form-group text-left col-sm-12">
<div class="pretty p-switch p-fill">
<input type="checkbox" data-id="checkDeletedEntity" value="" />
<div class="state p-primary">
<label>Hide Deleted Entity</label>
</div>
</div>
</div>
<div class="depth-container form-group select2-mini">
<label class="control-label col-sm-4">Depth:</label>
<div class="col-sm-4 no-padding">
<select data-id="selectDepth" class="form-control"></select>
</div>
</div>
</div>
</div>
<div class="box-panel search-box">
<div class="header clearfix">
<h4>Search</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="col-sm-12 no-padding">
<div class="srchType clearfix">
<label class="srchTitle">Search Lineage Entity: </label>
<div class="">
<div class="col-sm-12 no-padding temFilter">
<select data-id="typeSearch"></select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box-panel setting-box">
<div class="header clearfix">
<h4>Settings</h4>
<span data-id="box-close" class="btn btn-sm btn-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<div class="showOnlyHoverPath form-group text-left col-sm-12">
<div class="pretty p-switch p-fill">
<input type="checkbox" checked class="pull-left" data-id="showOnlyHoverPath" value="" />
<div class="state p-primary">
<label>On hover show current path</label>
</div>
</div>
</div>
<div class="showTooltip form-group text-left col-sm-12">
<div class="pretty p-switch p-fill">
<input type="checkbox" class="pull-left" data-id="showTooltip" value="" />
<div class="state p-primary">
<label>Show node details on hover</label>
</div>
</div>
</div>
</div>
</div>
<div class="graph-button-group pull-right">
<div>
<button data-id="resetLineage" class="btn btn-action btn-gray btn-sm" title="Realign Lineage">
<i class="fa fa-retweet"></i>
</button>
</div>
<div>
<button data-id="saveSvg" class="btn btn-action btn-gray btn-sm" title="Export to PNG">
<i class="fa fa-camera"></i>
</button>
</div>
<div>
<button type="button" data-id="setting-toggler" title="Settings" class="btn btn-action btn-gray btn-sm"><i class="fa fa-gear"></i></button>
</div>
<div>
<button type="button" data-id="filter-toggler" title="Filter" class="btn btn-action btn-gray btn-sm"><i class="fa fa-filter"></i></button>
</div>
<div>
<button type="button" data-id="search-toggler" title="Search" class="btn btn-action btn-gray btn-sm"><i class="fa fa-search"></i></button>
</div>
<div class="btn-group">
<button type="button" id="zoom_in" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom In" data-id="refreshBtn"> <i class="fa fa-search-plus"></i></button>
<button type="button" id="zoom_out" class="btn btn-action btn-gray btn-sm lineageZoomButton" title="Zoom Out" data-id="refreshBtn"> <i class="fa fa-search-minus"></i></button>
</div>
<div>
<button type="button" data-id="fullScreen-toggler" title="Full screen" class="btn btn-action btn-gray btn-sm fullscreen_lineage"><i class="fa fa-expand"></i></button>
</div>
</div>
<div class="box-panel size-lg node-details slide-from-left lineage-node-detail">
<div class="header clearfix">
<h4><span data-id="typeName"></span></h4>
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
<span data-id="box-close" class="btn btn-sm btn-close lineage-node-detail-close"><i class="fa fa-close"></i></span>
</div>
<div class="body">
<table class='table table-quickMenu'>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody data-id="nodeDetailTable"></tbody>
</table>
</div>
</div>
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<svg width="100%" height="calc(100% - 80px)" viewBox="0 0 854 330" enable-background="new 0 0 854 330" xml:space="preserve"></svg>
<div class="legends" style="height: 20px">
<i class="fa fa-long-arrow-right" aria-hidden="true" style="margin-right: 12px; color:#8bc152;">&nbsp<span>Lineage</span></i>
<i class="fa fa-long-arrow-right" aria-hidden="true" style="color:#fb4200;">&nbsp<span>Impact</span></i>
<div class="legends pull-left" style="height: 25px; padding: 2px;">
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-circle-o fa-fw"></i>Current Entity</span>
<span style="margin-right: 8px; color:#df9b00;"><i class="fa fa-long-arrow-right fa-fw"></i>Lineage</span>
<span style="margin-right: 8px; color:#fb4200;"><i class="fa fa-long-arrow-right fa-fw"></i>Impact</span>
</div>
<svg width="{{width}}" height="{{height}}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"></svg>
</div>
<div class="hidden-svg"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ <h4>Use DSL (Domain Specific Language) to build queries</h4>
</li>
</ul>
<h5 style="padding-left: 22.5px;">
<a href="http://atlas.apache.org/Search.html" target="_blank"><i class="fa fa-info-circle" aria-hidden="true"></i> &nbsp; More sample queries and use-cases</a>
<a href="http://atlas.apache.org/Search-Advanced.html" target="_blank"><i class="fa fa-info-circle" aria-hidden="true"></i> &nbsp; More sample queries and use-cases</a>
</h5>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@
</div>
<div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="inputLabel">
<input type="checkbox" data-id="checkSubClassification" data-value="excludeSC"/>
<input type="checkbox" data-id="checkSubClassification" data-value="excludeSC" />
<b>Exclude sub-classification</b></label>
</div>
{{#ifCond fromView '!==' "tag"}}
<div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="inputLabel">
<input type="checkbox" data-id="checkSubType" data-value="excludeST"/>
<input type="checkbox" data-id="checkSubType" data-value="excludeST" />
<b>Exclude sub-type</b></label>
</div>
{{/ifCond}}
<div class="inline">
{{#if taxonomy}}
<a href="javascript:void(0)" class=" multiSelectTerm btn btn-action btn-sm inline" style="display:none" data-id="addTerm"><i class="fa fa-plus"></i> Assign Term</a> {{/if}}
Expand All @@ -53,7 +55,7 @@
</div>
</div>
<div id="r_searchResultTableLayoutView">
<h1><b>{{searchType}}</b></h1>
{{#if isSearchTab}}<h1><b>{{searchType}}</b></h1>{{/if}}
{{#if entityCreate}}
<div class="entityLink" style="display:none">
<p class="entityLink">Search Atlas for existing entities or
Expand Down Expand Up @@ -86,7 +88,7 @@ <h1><b>{{searchType}}</b></h1>
<div class="input-group" data-id="goToPageDiv">
<input type="text" class="form-control number-input" data-id="gotoPage" placeholder="Goto Page" />
<span class="input-group-btn">
<button class="btn btn-secondary" type="button" data-id="gotoPagebtn" title="Goto Page" disabled="disabled">Go!</button>
<button class="btn btn-default" type="button" data-id="gotoPagebtn" title="Goto Page" disabled="disabled">Go!</button>
</span>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion dashboardv2/public/js/templates/site/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
* limitations under the License.
-->
<header class="clearfix">
<ul class="nav navbar-nav">
<li>
<a href="javascript:void(0);" data-id="menuHamburger"><i class="fa fa-bars"></i></a>
</li>
<li class="details-backbutton"><a href="javascript:void(0);" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a></li>
</ul>
<div class="btn-group pull-right header-menu ">
<a target="_blank" href="http://atlas.apache.org/"><i class="fa fa-question-circle"></i></a>
<a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="user-dropdown"><i class="fa fa-user user-circle "></i><span class="userName"></span></a>
Expand All @@ -26,4 +32,4 @@
</li>
</ul>
</div>
</header>
</header>
63 changes: 31 additions & 32 deletions dashboardv2/public/js/utils/CommonViewFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,34 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
urlObj = options.value,
formatDate = options.formatDate,
spliter = 1,
apiObj = options.apiObj; //if apiObj then create object for API call else for QueryBuilder.
if (urlObj && urlObj.length) {
attrObj = createObject(urlObj);

function createObject(urlObj) {
apiObj = options.apiObj,
mapUiOperatorToAPI = function(oper) {
if (oper == "=") {
return "eq";
} else if (oper == "!=") {
return "neq";
} else if (oper == "<") {
return "lt";
} else if (oper == "<=") {
return "lte";
} else if (oper == ">") {
return "gt";
} else if (oper == ">=") {
return "gte";
} else if (oper == "begins_with") {
return "startsWith";
} else if (oper == "ends_with") {
return "endsWith";
} else if (oper == "contains") {
return "contains";
} else if (oper == "not_null") {
return "notNull";
} else if (oper == "is_null") {
return "isNull";
}
return oper;
},
createObject = function(urlObj) {
var finalObj = {};
finalObj['condition'] = /^AND\(/.test(urlObj) ? "AND" : "OR";
urlObj = finalObj.condition === "AND" ? urlObj.substr(4).slice(0, -1) : urlObj.substr(3).slice(0, -1);
Expand Down Expand Up @@ -663,37 +686,13 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
});
return finalObj;
}
//if apiObj then create object for API call else for QueryBuilder.
if (urlObj && urlObj.length) {
attrObj = createObject(urlObj);
} else {
return null;
}
return attrObj;

function mapUiOperatorToAPI(oper) {
if (oper == "=") {
return "eq";
} else if (oper == "!=") {
return "neq";
} else if (oper == "<") {
return "lt";
} else if (oper == "<=") {
return "lte";
} else if (oper == ">") {
return "gt";
} else if (oper == ">=") {
return "gte";
} else if (oper == "begins_with") {
return "startsWith";
} else if (oper == "ends_with") {
return "endsWith";
} else if (oper == "contains") {
return "contains";
} else if (oper == "not_null") {
return "notNull";
} else if (oper == "is_null") {
return "isNull";
}
return oper;
}
},
generateAPIObj: function(url) {
if (url && url.length) {
Expand Down
3 changes: 2 additions & 1 deletion dashboardv2/public/js/utils/Globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ define(['require'], function(require) {
Globals.userLogedIn = {
status: false,
response: {}
}
};
Globals.entityImgPath = "/img/entity-icon/";
return Globals;
});
135 changes: 135 additions & 0 deletions dashboardv2/public/js/utils/Helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'utils/Utils',
'marionette'
], function(require, Utils) {
'use strict';
_.mixin({
isEmptyArray: function(val) {
if (val && _.isArray(val)) {
return _.isEmpty(val);
} else {
return false;
}
},
toArrayifObject: function(val) {
return _.isObject(val) ? [val] : val;
},
startsWith: function(str, matchStr) {
if (str && matchStr && _.isString(str) && _.isString(matchStr)) {
return str.lastIndexOf(matchStr, 0) === 0
} else {
return;
}
},
isUndefinedNull: function(val) {
if (_.isUndefined(val) || _.isNull(val)) {
return true
} else {
return false;
}
},
trim: function(val) {
if (val && val.trim) {
return val.trim();
} else {
return val;
}
},
isTypePrimitive: function(type) {
if (type === "int" || type === "byte" || type === "short" || type === "long" || type === "float" || type === "double" || type === "string" || type === "boolean" || type === "date") {
return true;
}
return false;
}
});
var getPopoverEl = function(e) {
return $(e.target).parent().data("bs.popover") || $(e.target).data("bs.popover") || $(e.target).parents('.popover').length;
}
$(document).on('click DOMMouseScroll mousewheel', function(e) {
if (e.originalEvent) {
// Do action if it is triggered by a human.
//e.isImmediatePropagationStopped();
var isPopOverEl = getPopoverEl(e)
if (!isPopOverEl) {
$('.popover').popover('hide');
} else if (isPopOverEl.$tip) {
$('.popover').not(isPopOverEl.$tip).popover('hide');
}
}
});
$('body').on('hidden.bs.popover', function(e) {
$(e.target).data("bs.popover").inState = { click: false, hover: false, focus: false }
});
$('body').on('show.bs.popover', '[data-js="popover"]', function() {
$('.popover').not(this).popover('hide');
});
$('body').on('keypress', 'input.number-input,.number-input .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
$('body').on('keypress', 'input.number-input-negative,.number-input-negative .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
if (e.which == 45) {
if (this.value.length) {
return false;
}
} else {
return false;
}
}
});
$('body').on('keypress', 'input.number-input-exponential,.number-input-exponential .select2-search__field', function(e) {
if ((e.which != 8 && e.which != 0) && (e.which < 48 || e.which > 57) && (e.which != 69 && e.which != 101 && e.which != 43 && e.which != 45 && e.which != 46 && e.which != 190)) {
return false;
}
});
$("body").on('click', '.dropdown-menu.dropdown-changetitle li a', function() {
$(this).parents('li').find(".btn:first-child").html($(this).text() + ' <span class="caret"></span>');
});
$("body").on('click', '.btn', function() {
$(this).blur();
});

// For placeholder support
if (!('placeholder' in HTMLInputElement.prototype)) {
var originalRender = Backbone.Marionette.LayoutView.prototype.render;
Backbone.Marionette.LayoutView.prototype.render = function() {
originalRender.apply(this, arguments);
this.$('input, textarea').placeholder();
}
}
$('body').on('click', 'pre.code-block .expand-collapse-button', function(e) {
var $el = $(this).parents('.code-block');
if ($el.hasClass('shrink')) {
$el.removeClass('shrink');
} else {
$el.addClass('shrink');
}
});

// For adding tooltip globally
$('body').tooltip({
selector: '[title]',
placement: 'bottom',
container: 'body'
});

})
102 changes: 26 additions & 76 deletions dashboardv2/public/js/utils/Overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
var oldBackboneSync = Backbone.sync;
Backbone.sync = function(method, model, options) {
var that = this;
if (options.queryParam) {
var generateQueryParam = $.param(options.queryParam);
if (options.url.indexOf('?') !== -1) {
options.url = options.url + "&" + generateQueryParam;
} else {
options.url = options.url + "?" + generateQueryParam;
}
}
return oldBackboneSync.apply(this, [method, model,
_.extend(options, {
error: function(response) {
Expand All @@ -40,80 +48,6 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
})
]);
}
_.mixin({
isEmptyArray: function(val) {
if (val && _.isArray(val)) {
return _.isEmpty(val);
} else {
return false;
}
},
isUndefinedNull: function(val) {
if (_.isUndefined(val) || _.isNull(val)) {
return true
} else {
return false;
}
},
trim: function(val) {
if (val && val.trim) {
return val.trim();
} else {
return val;
}
}
});
var getPopoverEl = function(e) {
return $(e.target).parent().data("bs.popover") || $(e.target).data("bs.popover") || $(e.target).parents('.popover').length;
}
$('body').on('click DOMMouseScroll mousewheel', function(e) {
if (e.originalEvent) {
// Do action if it is triggered by a human.
//e.isImmediatePropagationStopped();
var isPopOverEl = getPopoverEl(e)
if (!isPopOverEl) {
$('.popover').popover('hide');
} else if (isPopOverEl.$tip) {
$('.popover').not(isPopOverEl.$tip).popover('hide');
}
}
});
$('body').on('hidden.bs.popover', function(e) {
$(e.target).data("bs.popover").inState = { click: false, hover: false, focus: false }
});
$('body').on('show.bs.popover', '[data-js="popover"]', function() {
$('.popover').not(this).popover('hide');
});
$('body').on('keypress', 'input.number-input,.number-input .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
$('body').on('keypress', 'input.number-input-negative,.number-input-negative .select2-search__field', function(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
if (e.which == 45) {
if (this.value.length) {
return false;
}
} else {
return false;
}
}
});
$('body').on('keypress', 'input.number-input-exponential,.number-input-exponential .select2-search__field', function(e) {
if ((e.which != 8 && e.which != 0) && (e.which < 48 || e.which > 57) && (e.which != 69 && e.which != 101 && e.which != 43 && e.which != 45 && e.which != 46 && e.which != 190)) {
return false;
}
});

// For placeholder support
if (!('placeholder' in HTMLInputElement.prototype)) {
var originalRender = Backbone.Marionette.LayoutView.prototype.render;
Backbone.Marionette.LayoutView.prototype.render = function() {
originalRender.apply(this, arguments);
this.$('input, textarea').placeholder();
}
}

String.prototype.trunc = String.prototype.trunc ||
function(n) {
Expand Down Expand Up @@ -144,8 +78,24 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
var that = this;
Backgrid.HeaderRow.__super__.render.apply(this, arguments);
_.each(this.columns.models, function(modelValue) {
if (modelValue.get('width')) that.$el.find('.' + modelValue.get('name')).css('min-width', modelValue.get('width') + 'px')
if (modelValue.get('toolTip')) that.$el.find('.' + modelValue.get('name')).attr('title', modelValue.get('toolTip'))
var elAttr = modelValue.get('elAttr'),
elAttrObj = null;
if (elAttr) {
if (_.isFunction(elAttr)) {
elAttrObj = elAttr(modelValue);
} else if (_.isObject(elAttr)) {
if (!_.isArray(elAttr)) {
elAttrObj = [elAttr];
} else {
elAttrObj = elAttr;
}
}
_.each(elAttrObj, function(val) {
that.$el.find('.' + modelValue.get('name')).data(val);
});
}
if (modelValue.get('width')) that.$el.find('.' + modelValue.get('name')).css('min-width', modelValue.get('width') + 'px');
if (modelValue.get('toolTip')) that.$el.find('.' + modelValue.get('name')).attr('title', modelValue.get('toolTip'));
});
return this;
}
Expand Down
126 changes: 88 additions & 38 deletions dashboardv2/public/js/utils/TableLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ define(['require',
'hbs!tmpl/common/TableLayout_tmpl',
'utils/Messages',
'utils/Utils',
'utils/Globals',
'utils/CommonViewFunction',
'backgrid-filter',
'backgrid-paginator',
'backgrid-sizeable',
'backgrid-orderable',
'backgrid-select-all',
'backgrid-columnmanager'
], function(require, Backbone, FSTablelayoutTmpl, Messages, Utils) {
], function(require, Backbone, FSTablelayoutTmpl, Messages, Utils, Globals, CommonViewFunction) {
'use strict';

var FSTableLayout = Backbone.Marionette.LayoutView.extend(
Expand Down Expand Up @@ -125,12 +127,16 @@ define(['require',

includeAtlasPagination: false,

includeAtlasPageSize: false,

includeFilter: false,

includeHeaderSearch: false,

includePageSize: false,

includeGotoPage: false,

includeFooterRecords: true,

includeColumnManager: false,
Expand All @@ -147,6 +153,7 @@ define(['require',
var events = {},
that = this;
events['change ' + this.ui.selectPageSize] = 'onPageSizeChange';
events['change ' + this.ui.showPage] = 'changePageLimit';
events["click " + this.ui.nextData] = "onClicknextData";
events["click " + this.ui.previousData] = "onClickpreviousData";
events["click " + this.ui.gotoPagebtn] = 'gotoPagebtn';
Expand Down Expand Up @@ -174,15 +181,9 @@ define(['require',
initialize: function(options) {
this.limit = 25;
this.offset = 0;
_.extend(this, _.pick(options, 'collection', 'columns', 'includePagination', 'includeHeaderSearch', 'includeFilter', 'includePageSize',
'includeFooterRecords', 'includeColumnManager', 'includeSizeAbleColumns', 'includeOrderAbleColumns', 'includeTableLoader', 'includeAtlasPagination', 'atlasPaginationOpts'));
_.extend(this, this.atlasPaginationOpts);
_.extend(this, _.omit(options, 'gridOpts', 'atlasPaginationOpts'));
_.extend(this, options.atlasPaginationOpts);
_.extend(this.gridOpts, options.gridOpts, { collection: this.collection, columns: this.columns });
_.extend(this.filterOpts, options.filterOpts);
_.extend(this.paginatorOpts, options.paginatorOpts);
_.extend(this.controlOpts, options.controlOpts);
_.extend(this.columnOpts, options.columnOpts);

this.bindEvents();
},

Expand All @@ -197,14 +198,17 @@ define(['require',

this.listenTo(this.collection, 'reset', function(collection, options) {
this.$('div[data-id="r_tableSpinner"]').removeClass('show');
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
this.ui.gotoPagebtn.prop("disabled", true);
if (this.includePagination) {
this.renderPagination();
}
if (this.includeFooterRecords) {
this.renderFooterRecords(this.collection.state);
}
if (this.includeAtlasPagination) {
this.renderAtlasPagination(options);
this.renderAtlasPagination(collection, options);
}
}, this);

Expand Down Expand Up @@ -261,14 +265,24 @@ define(['require',
if (this.includeColumnManager) {
this.renderColumnManager();
}
var pageSizeEl = null;
if (this.includePageSize) {
this.ui.selectPageSize.select2({
pageSizeEl = this.ui.selectPageSize;
} else if (this.includeAtlasPageSize) {
pageSizeEl = this.ui.showPage;
}
if (pageSizeEl) {
pageSizeEl.select2({
data: _.sortBy(_.union([25, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500], [this.collection.state.pageSize])),
tags: true,
dropdownCssClass: "number-input",
multiple: false
});
this.ui.selectPageSize.val(this.collection.state.pageSize).trigger('change', { "skipViewChange": true });
var val = this.collection.state.pageSize;
if (this.value && this.value.pageLimit) {
val = this.limit;
}
pageSizeEl.val(val).trigger('change', { "skipViewChange": true });
}

},
Expand Down Expand Up @@ -305,6 +319,7 @@ define(['require',
this.rPagination.show(new Backgrid.Extension.Paginator(options));
} else if (this.regions.rPagination) {
this.$('div[data-id="r_pagination"]').show(new Backgrid.Extension.Paginator(options));
this.showHideGoToPage();
}
},

Expand Down Expand Up @@ -392,6 +407,14 @@ define(['require',
}
},

showHideGoToPage: function() {
if (this.collection.state.pageSize > this.collection.fullCollection.length) {
this.ui.paginationDiv.hide();
} else {
this.ui.paginationDiv.show();
}
},

/**
* show/hide filter of the grid
*/
Expand Down Expand Up @@ -423,6 +446,9 @@ define(['require',
* ColumnManager for the table
*/
renderColumnManager: function() {
if (!this.columns) {
return;
}
var that = this,
$el = this.columnOpts.el || this.$("[data-id='control']"),
colManager = new Backgrid.Extension.ColumnManager(this.columns, this.columnOpts.opts),
Expand All @@ -446,7 +472,6 @@ define(['require',
that.collection.trigger("state-changed");
});
},

renderSizeAbleColumns: function() {
// Add sizeable columns
var that = this,
Expand Down Expand Up @@ -507,11 +532,17 @@ define(['require',
onPageSizeChange: function(e, options) {
if (!options || !options.skipViewChange) {
var pagesize = $(e.currentTarget).val();
if (pagesize == 0) {
this.ui.selectPageSize.data('select2').$container.addClass('has-error');
return;
} else {
this.ui.selectPageSize.data('select2').$container.removeClass('has-error');
}
this.collection.state.pageSize = parseInt(pagesize, 10);

this.collection.state.currentPage = this.collection.state.firstPage;
this.showHideGoToPage();
if (this.collection.mode == "client") {
this.collection.reset(this.collection.toJSON());
this.collection.fullCollection.reset(this.collection.fullCollection.toJSON());
} else {
this.collection.fetch({
sort: false,
Expand All @@ -521,6 +552,9 @@ define(['require',
}
}
},
/**
atlasNextBtn
**/
onClicknextData: function() {
this.offset = this.offset + this.limit;
_.extend(this.collection.queryParams, {
Expand All @@ -532,14 +566,15 @@ define(['require',
this.triggerUrl();
}
}
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
if (this.fetchCollection) {
this.fetchCollection({
next: true
});
}
},
/**
atlasPrevBtn
**/
onClickpreviousData: function() {
this.offset = this.offset - this.limit;
if (this.offset <= -1) {
Expand All @@ -554,15 +589,15 @@ define(['require',
this.triggerUrl();
}
}
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
if (this.fetchCollection) {
this.fetchCollection({
previous: true
});
}
},
// TODO : Need to add pageLimit for atlasPagination
/**
atlasPageLimit
**/
changePageLimit: function(e, obj) {
if (!obj || (obj && !obj.skipViewChange)) {
var limit = parseInt(this.ui.showPage.val());
Expand All @@ -581,35 +616,50 @@ define(['require',
this.triggerUrl();
}
}
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
_.extend(this.collection.queryParams, { limit: this.limit, offset: this.offset });
this.fetchCollection();
}
},
/**
atlasGotoBtn & Local Goto Btn
**/
gotoPagebtn: function(e) {
var that = this;
var goToPage = parseInt(this.ui.gotoPage.val());
if (!_.isNaN(goToPage) && ((goToPage == 0) || (this.collection.state.totalPages < goToPage))) {
Utils.notifyInfo({
content: Messages.search.noRecordForPage + "page " + goToPage
});
this.ui.gotoPage.val('')
that.ui.gotoPagebtn.attr('disabled', true);
return;
}
if (!(_.isNaN(goToPage) || goToPage <= -1)) {
this.offset = (goToPage - 1) * this.limit;
if (this.offset <= -1) {
this.offset = 0;
}
_.extend(this.collection.queryParams, { limit: this.limit, offset: this.offset });
if (this.offset == (this.pageFrom - 1)) {
Utils.notifyInfo({
content: Messages.search.onSamePage
if (this.collection.mode == "client") {
return this.collection.getPage((goToPage - 1), {
reset: true
});
} else {
if (this.value) {
this.value.pageOffset = this.offset;
if (this.triggerUrl) {
this.triggerUrl();
}
this.offset = (goToPage - 1) * this.limit;
if (this.offset <= -1) {
this.offset = 0;
}
// this.offset is updated in gotoPagebtn function so use next button calculation.
if (this.fetchCollection) {
this.fetchCollection({ 'next': true });
_.extend(this.collection.queryParams, { limit: this.limit, offset: this.offset });
if (this.offset == (this.pageFrom - 1)) {
Utils.notifyInfo({
content: Messages.search.onSamePage
});
} else {
if (this.value) {
this.value.pageOffset = this.offset;
if (this.triggerUrl) {
this.triggerUrl();
}
}
// this.offset is updated in gotoPagebtn function so use next button calculation.
if (this.fetchCollection) {
this.fetchCollection({ 'next': true });
}
}
}
}
Expand Down
97 changes: 51 additions & 46 deletions dashboardv2/public/js/utils/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,57 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
Utils.getBaseUrl = function(url) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, '');
};

Utils.getEntityIconPath = function(options) {
var entityData = options && options.entityData,
serviceType,
status,
typeName,
iconBasePath = Utils.getBaseUrl(window.location.pathname) + Globals.entityImgPath;
if (entityData) {
typeName = entityData.typeName;
serviceType = entityData && entityData.serviceType;
status = entityData && entityData.status;
}

function getImgPath(imageName) {
return iconBasePath + (Enums.entityStateReadOnly[status] ? "disabled/" + imageName : imageName);
}

function getDefaultImgPath() {
if (entityData.isProcess) {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + 'disabled/process.png';
} else {
return iconBasePath + 'process.png';
}
} else {
if (Enums.entityStateReadOnly[status]) {
return iconBasePath + 'disabled/table.png';
} else {
return iconBasePath + 'table.png';
}
}
}

if (entityData) {
if (options.errorUrl) {
var isErrorInTypeName = (options.errorUrl && options.errorUrl.match("entity-icon/" + typeName + ".png|disabled/" + typeName + ".png") ? true : false);
if (serviceType && isErrorInTypeName) {
var imageName = serviceType + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
} else if (entityData.typeName) {
var imageName = entityData.typeName + ".png";
return getImgPath(imageName);
} else {
return getDefaultImgPath();
}
}
}

pnotify.prototype.options.styling = "fontawesome";
var notify = function(options) {
return new pnotify(_.extend({
Expand Down Expand Up @@ -717,51 +768,5 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
this.attr(attributeName, firstString);
}
}
$('body').on('click', '.expand_collapse_panel', function() {
var icon = $(this).find('i'),
panel = $(this).parents('.panel').first(),
panelBody = panel.find('.panel-body');
icon.toggleClass('fa-chevron-up fa-chevron-down');
$(this).toggleAttribute('title', 'Collapse', 'Expand');
panelBody.toggle();
$(this).trigger('expand_collapse_panel', [$(this).parents('.panel')]);
});
$('body').on('click', '.fullscreen_panel', function() {
var icon = $(this).find('i'),
panel = $(this).parents('.panel').first(),
panelBody = panel.find('.panel-body');
icon.toggleClass('fa-expand fa-compress');
$(this).toggleAttribute('title', 'Fullscreen', 'Exit Fullscreen');
panel.toggleClass('panel-fullscreen');
panel.find('.expand_collapse_panel').toggle();
// Condition if user clicks on fullscree button and body is in collapse mode.
if (panel.hasClass('panel-fullscreen')) {
$('body').css("position", "fixed");
if (!panelBody.is(':visible')) {
panelBody.show();
panelBody.addClass('full-visible');
}
//first show body to get width and height for postion then trigger the event.
$(this).trigger('fullscreen_done', [$(this).parents('.panel')]);
} else if (panelBody.hasClass('full-visible')) {
$('body').removeAttr("style");
$(this).trigger('fullscreen_done', [$(this).parents('.panel')]);
//first trigger the event to getwidth and height for postion then hide body.
panelBody.hide();
panelBody.removeClass('full-visible');
} else {
$('body').removeAttr("style");
$(this).trigger('fullscreen_done', [$(this).parents('.panel')]);
}
});

$('body').on('click', 'pre.code-block .expand-collapse-button', function(e) {
var $el = $(this).parents('.code-block');
if ($el.hasClass('shrink')) {
$el.removeClass('shrink');
} else {
$el.addClass('shrink');
}
});
return Utils;
});
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ define(['require',
var name = _.escape(parseDetailsObject[0]);
}
}
var values = parseDetailsObject.values;
var values = parseDetailsObject && parseDetailsObject.values;
var name = ((name ? name : this.entityName));
this.ui.name.text(name);
if (parseDetailsObject && parseDetailsObject.values) {
if (values) {
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
table = CommonViewFunction.propertyTable({ scope: this, valueObject: values, attributeDefs: this.attributeDefs, extractJSON: { extractKey: 'value' } });
table = CommonViewFunction.propertyTable({ scope: this, valueObject: values, attributeDefs: this.attributeDefs });
if (table.length) {
this.ui.noData.hide();
this.ui.tableAudit.show();
Expand Down
Loading