/** * Retrieve all the governance artifact paths which associated with the given lifecycle * * @param registry registry instance * @param lcName lifecycle name * @param mediaType mediatype of the artifacts * @return String array of all the artifact paths * @throws GovernanceException if the operation failed. */ public static String[] getAllArtifactPathsByLifecycle(Registry registry, String lcName, String mediaType) throws GovernanceException { String sql = "SELECT R.REG_PATH_ID, R.REG_NAME FROM REG_RESOURCE R, REG_PROPERTY PP, " + "REG_RESOURCE_PROPERTY RP WHERE R.REG_VERSION=RP.REG_VERSION AND RP.REG_PROPERTY_ID=PP.REG_ID " + "AND PP.REG_NAME = ? AND PP.REG_VALUE = ? AND R.REG_MEDIA_TYPE = ?"; Map<String, String> parameter = new HashMap<String, String>(); parameter.put("1", "registry.LC.name"); parameter.put("2", lcName); parameter.put("3", mediaType); parameter.put("query", sql); try { return (String[]) registry.executeQuery(null, parameter).getContent(); } catch (RegistryException e) { String msg = "Error occured while executing custom query"; throw new GovernanceException(msg, e); } }
Resource r = registry.executeQuery(null, paramMap); return (String[])r.getContent();
/** * Retrieve all the governance artifact paths which associated with the given lifecycle in the given lifecycle state * * @param registry registry instance * @param lcName lifecycle name * @param lcState lifecycle state * @param mediaType mediatype of the artifacts * @return String array of all the artifact paths * @throws GovernanceException if the operation failed. */ public static String[] getAllArtifactPathsByLifecycleState( Registry registry, String lcName, String lcState, String mediaType) throws GovernanceException { String sql = "SELECT R.REG_PATH_ID, R.REG_NAME FROM REG_RESOURCE R, REG_PROPERTY PP, " + "REG_RESOURCE_PROPERTY RP WHERE R.REG_VERSION=RP.REG_VERSION AND RP.REG_PROPERTY_ID=PP.REG_ID " + "AND PP.REG_NAME = ? AND PP.REG_VALUE = ? AND R.REG_MEDIA_TYPE = ?"; Map<String, String> parameter = new HashMap<String, String>(); parameter.put("1", "registry.lifecycle." + lcName + ".state"); parameter.put("2", lcState); parameter.put("3", mediaType); parameter.put("query", sql); try { return (String[]) registry.executeQuery(null, parameter).getContent(); } catch (RegistryException e) { String msg = "Error occured while executing custom query"; throw new GovernanceException(msg, e); } }
Resource r = registry.executeQuery(null, paramMap); return (String[])r.getContent();
parameters.put("query", sql1); Resource result = registry.executeQuery(null, parameters);
parameter.put("1", artifactId); parameter.put("query", sql); result = registry.executeQuery(null, parameter).getChildren();
params.put("1", propName); params.put("2", value); result = registry.executeQuery(getCustomQuery(), params); paths = (String[]) result.getContent();
params.put("1", propName); params.put("2", value); result = registry.executeQuery(getCustomQuery(), params); paths = (String[]) result.getContent();
params.put("1", propName); params.put("2", value); result = registry.executeQuery(getCustomQuery(), params); paths = (String[]) result.getContent();
parameters.put("query", sql); Resource result = registry.executeQuery(null, parameters);
org.wso2.carbon.registry.core.Collection collection = registry.executeQuery(tagsQueryPath, params); for (String fullTag : collection.getChildren()) {
parameters.put("query", sql1); Resource result = registry.executeQuery(null, parameters);
Collection collection = registry.executeQuery(resourceByTagQueryPath, params);
userRegistry = registry; Collection collection = userRegistry.executeQuery(tagsQueryPath, params); for (String fullTag : collection.getChildren()) {
params.put("1", propName); params.put("2", value); result = registry.executeQuery(CUSTOM_QUERY_GET_ALL_BY_PROP, params); paths = (String[]) result.getContent();
params.put("1", propName); params.put("2", value); result = registry.executeQuery(CUSTOM_QUERY_GET_ALL_BY_PROP, params); paths = (String[]) result.getContent();
params.put("1", propName); params.put("2", value); result = registry.executeQuery(CUSTOM_QUERY_GET_ALL_BY_PROP, params); paths = (String[]) result.getContent();
params.put(RegistryConstants.RESULT_TYPE_PROPERTY_NAME, RegistryConstants.RESOURCES_RESULT_TYPE); if (userRegistry != null) { Collection collection = userRegistry.executeQuery(latestAPIQueryPath, params); int resultSetSize = Math.min(limit, collection.getChildCount()); String[] recentlyAddedAPIPaths = new String[resultSetSize];
parameter.put("1", artifactId); parameter.put("query", sql); result = registry.executeQuery(null, parameter).getChildren();