Requested changes made (2)
MODIFY
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/ApplicationDeploymentImpl.java
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/ApplicationDeploymentImpl.java
@@ -378,11 +378,12 @@ public class ApplicationDeploymentImpl implements ApplicationDeployment {
}
@Override
- public List<ApplicationDeploymentDescription> getAllApplicationDeployements(String gatewayId) throws AppCatalogException {
+ public List<ApplicationDeploymentDescription> getAllApplicationDeployements(String gatewayId, List<String> accessibleAppIds) throws AppCatalogException {
List<ApplicationDeploymentDescription> deploymentDescriptions = new ArrayList<ApplicationDeploymentDescription>();
try {
AppDeploymentResource resource = new AppDeploymentResource();
resource.setGatewayId(gatewayId);
+ resource.setAccessibleAppIds(accessibleAppIds);
List<AppCatalogResource> resources = resource.getAll();
if (resources != null && !resources.isEmpty()){
deploymentDescriptions = AppCatalogThriftConversion.getAppDepDescList(resources);

MODIFY
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/ApplicationInterfaceImpl.java
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/ApplicationInterfaceImpl.java
@@ -323,11 +323,12 @@ public class ApplicationInterfaceImpl implements ApplicationInterface {
}
@Override
- public List<ApplicationModule> getAllApplicationModules(String gatewayId) throws AppCatalogException {
+ public List<ApplicationModule> getAllApplicationModules(String gatewayId, List<String> accessibleAppIds) throws AppCatalogException {
List<ApplicationModule> applicationModules = new ArrayList<ApplicationModule>();
try {
AppModuleResource resource = new AppModuleResource();
resource.setGatewayId(gatewayId);
+ resource.setAccessibleAppIds(accessibleAppIds);
List<AppCatalogResource> resources = resource.getAll();
if (resources != null && !resources.isEmpty()){
applicationModules = AppCatalogThriftConversion.getAppModules(resources);

MODIFY
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatAbstractResource.java
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatAbstractResource.java
* under the License.
*/
package org.apache.airavata.registry.core.app.catalog.resources;
+import java.util.ArrayList;
public abstract class AppCatAbstractResource implements AppCatalogResource {
// table names
@@ -203,6 +204,7 @@ public abstract class AppCatAbstractResource implements AppCatalogResource {
public static final String MODULE_NAME = "moduleName";
public static final String MODULE_VERSION = "moduleVersion";
public static final String MODULE_DESC = "moduleDesc";
+ public static final String ACCESSIBLE_APP_IDS = "accessibleAppIds";
}
public final class ApplicationDeploymentConstants {
@@ -214,6 +216,7 @@ public abstract class AppCatAbstractResource implements AppCatalogResource {
public static final String APPLICATION_DESC = "applicationDesc";
public static final String ENV_MODULE_LOAD_CMD = "envModuleLoaString";
public static final String PARALLELISM = "parallelism";
+ public static final String ACCESSIBLE_APP_IDS = "accessibleAppIds";
}
public final class LibraryPrepandPathConstants {

MODIFY
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppDeploymentResource.java
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppDeploymentResource.java
@@ -55,10 +55,13 @@ public class AppDeploymentResource extends AppCatAbstractResource {
private AppModuleResource moduleResource;
private Timestamp createdTime;
private Timestamp updatedTime;
+ private List<String> accessibleAppIds;
- public String getGatewayId() {
- return gatewayId;
- }
+ public List<String> getAccessibleAppIds() { return accessibleAppIds; }
+
+ public void setAccessibleAppIds(List<String> accessibleAppIds) { this.accessibleAppIds = accessibleAppIds; }
+
+ public String getGatewayId() { return gatewayId; }
public void setGatewayId(String gatewayId) {
this.gatewayId = gatewayId;
@@ -314,6 +317,7 @@ public class AppDeploymentResource extends AppCatAbstractResource {
em.getTransaction().begin();
AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
generator.setParameter(ApplicationDeploymentConstants.GATEWAY_ID, gatewayId);
+ generator.setParameter(ApplicationDeploymentConstants.ACCESSIBLE_APP_IDS, accessibleAppIds);
Query q = generator.selectQuery(em);
List results = q.getResultList();
if (results.size() != 0) {

MODIFY
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppModuleResource.java
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppModuleResource.java
@@ -44,6 +44,11 @@ public class AppModuleResource extends AppCatAbstractResource {
private Timestamp createdTime;
private Timestamp updatedTime;
private String gatewayId;
+ private List<String> accessibleAppIds;
+
+ public List<String> getAccessibleAppIds() { return accessibleAppIds; }
+
+ public void setAccessibleAppIds(List<String> accessibleAppIds) { this.accessibleAppIds = accessibleAppIds; }
public String getGatewayId() {
return gatewayId;
@@ -227,6 +232,7 @@ public class AppModuleResource extends AppCatAbstractResource {
em.getTransaction().begin();
AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_MODULE);
generator.setParameter(ApplicationModuleConstants.GATEWAY_ID, gatewayId);
+ generator.setParameter(ApplicationModuleConstants.ACCESSIBLE_APP_IDS, accessibleAppIds);
Query q = generator.selectQuery(em);
List<?> results = q.getResultList();
for (Object result : results) {

MODIFY
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogQueryGenerator.java
modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogQueryGenerator.java
@@ -21,6 +21,7 @@ package org.apache.airavata.registry.core.app.catalog.util;
import javax.persistence.EntityManager;
import javax.persistence.Query;
+import java.util.List;
import java.util.HashMap;
import java.util.Map;
@@ -74,7 +75,12 @@ public class AppCatalogQueryGenerator {
if (!matchString.equals("")){
matchString+=" AND ";
}
+ if (matches.get(colName) instanceof List){
+ matchString+=TABLE_OBJ+"."+colName+" IN :" + paramName;
+ }
+ else{
matchString+=TABLE_OBJ+"."+colName+" =:"+paramName;
+ }
paramCount++;
}
queryString+=" WHERE "+matchString;

Requested changes made (2)