diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ComponentDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ComponentDTO.java index 0ef7fef4e4..f85adf5731 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ComponentDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ComponentDTO.java @@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlType; public class ComponentDTO { private String id; - private String uri; + private String parentGroupId; private PositionDTO position; @@ -60,22 +60,6 @@ public class ComponentDTO { this.parentGroupId = parentGroupId; } - /** - * The uri for linking to this component in this NiFi. - * - * @return The uri - */ - @ApiModelProperty( - value = "The URI for futures requests to the component." - ) - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - /** * The position of this component in the UI if applicable, null otherwise. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ComponentEntity.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ComponentEntity.java index f09880baba..8d625edf72 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ComponentEntity.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ComponentEntity.java @@ -34,6 +34,7 @@ public class ComponentEntity extends Entity { private RevisionDTO revision; private String id; + private String uri; private PositionDTO position; private PermissionsDTO permissions; private List bulletins; @@ -68,6 +69,22 @@ public class ComponentEntity extends Entity { this.id = id; } + /** + * The uri for linking to this component in this NiFi. + * + * @return The uri + */ + @ApiModelProperty( + value = "The URI for futures requests to the component." + ) + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + /** * The position of this component in the UI if applicable, null otherwise. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/StandardFlowServiceTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/StandardFlowServiceTest.java index 9dd9762657..15611afaa9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/StandardFlowServiceTest.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/StandardFlowServiceTest.java @@ -237,7 +237,6 @@ public class StandardFlowServiceTest { Assert.assertEquals(expected.getParentGroupId(), actual.getParentGroupId()); Assert.assertEquals(expected.getSelectedRelationships(), actual.getSelectedRelationships()); assertEquals(expected.getSource(), actual.getSource()); - Assert.assertEquals(expected.getUri(), actual.getUri()); } private void assertEquals(ConnectableDTO expected, ConnectableDTO actual) { @@ -259,7 +258,6 @@ public class StandardFlowServiceTest { Assert.assertEquals(expected.getId(), actual.getId()); Assert.assertEquals(expected.getName(), actual.getName()); Assert.assertEquals(expected.getParentGroupId(), actual.getParentGroupId()); - Assert.assertEquals(expected.getUri(), actual.getUri()); } private void assertEquals(LabelDTO expected, LabelDTO actual) { @@ -271,7 +269,6 @@ public class StandardFlowServiceTest { Assert.assertEquals(expected.getLabel(), actual.getLabel()); Assert.assertEquals(expected.getParentGroupId(), actual.getParentGroupId()); Assert.assertEquals(expected.getStyle(), actual.getStyle()); - Assert.assertEquals(expected.getUri(), actual.getUri()); } private void assertEquals(ProcessorDTO expected, ProcessorDTO actual) { @@ -283,7 +280,6 @@ public class StandardFlowServiceTest { Assert.assertEquals(expected.getName(), actual.getName()); Assert.assertEquals(expected.getParentGroupId(), actual.getParentGroupId()); Assert.assertEquals(expected.getStyle(), actual.getStyle()); - Assert.assertEquals(expected.getUri(), actual.getUri()); Assert.assertEquals(expected.getType(), actual.getType()); Assert.assertEquals(expected.getState(), actual.getState()); Assert.assertEquals(expected.getRelationships(), actual.getRelationships()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessPolicyResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessPolicyResource.java index 2344a5ca2f..c77ed659e9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessPolicyResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessPolicyResource.java @@ -84,20 +84,11 @@ public class AccessPolicyResource extends ApplicationResource { */ public AccessPolicyEntity populateRemainingAccessPolicyEntityContent(AccessPolicyEntity accessPolicyEntity) { if (accessPolicyEntity.getComponent() != null) { - populateRemainingAccessPolicyContent(accessPolicyEntity.getComponent()); + accessPolicyEntity.setUri(generateResourceUri("policies", accessPolicyEntity.getId())); } return accessPolicyEntity; } - /** - * Populates the uri for the specified accessPolicy. - */ - public AccessPolicyDTO populateRemainingAccessPolicyContent(AccessPolicyDTO accessPolicy) { - // populate the access policy href - accessPolicy.setUri(generateResourceUri("policies", accessPolicy.getId())); - return accessPolicy; - } - // ----------------- // get access policy // ----------------- @@ -249,7 +240,7 @@ public class AccessPolicyResource extends ApplicationResource { populateRemainingAccessPolicyEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java index 6cd1dea00c..4cbd3affdb 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java @@ -30,8 +30,6 @@ import org.apache.nifi.authorization.user.NiFiUserUtils; import org.apache.nifi.web.NiFiServiceFacade; import org.apache.nifi.web.Revision; import org.apache.nifi.web.api.dto.ConnectionDTO; -import org.apache.nifi.web.api.dto.FlowFileSummaryDTO; -import org.apache.nifi.web.api.dto.ListingRequestDTO; import org.apache.nifi.web.api.entity.ConnectionEntity; import org.apache.nifi.web.api.request.ClientIdParameter; import org.apache.nifi.web.api.request.LongParameter; @@ -85,69 +83,10 @@ public class ConnectionResource extends ApplicationResource { * @return dto */ public ConnectionEntity populateRemainingConnectionEntityContent(ConnectionEntity connectionEntity) { - if (connectionEntity.getComponent() != null) { - populateRemainingConnectionContent(connectionEntity.getComponent()); - } + connectionEntity.setUri(generateResourceUri("connections", connectionEntity.getId())); return connectionEntity; } - /** - * Populate the URIs for the specified connections. - * - * @param connections connections - * @return dtos - */ - public Set populateRemainingConnectionsContent(Set connections) { - for (ConnectionDTO connection : connections) { - populateRemainingConnectionContent(connection); - } - return connections; - } - - /** - * Populate the URIs for the specified connection. - * - * @param connection connection - * @return dto - */ - public ConnectionDTO populateRemainingConnectionContent(ConnectionDTO connection) { - // populate the remaining properties - connection.setUri(generateResourceUri("connections", connection.getId())); - return connection; - } - - /** - * Populate the URIs for the specified flowfile listing. - * - * @param connectionId connection - * @param flowFileListing flowfile listing - * @return dto - */ - public ListingRequestDTO populateRemainingFlowFileListingContent(final String connectionId, final ListingRequestDTO flowFileListing) { - // uri of the listing - flowFileListing.setUri(generateResourceUri("connections", connectionId, "listing-requests", flowFileListing.getId())); - - // uri of each flowfile - if (flowFileListing.getFlowFileSummaries() != null) { - for (FlowFileSummaryDTO flowFile : flowFileListing.getFlowFileSummaries()) { - populateRemainingFlowFileContent(connectionId, flowFile); - } - } - return flowFileListing; - } - - /** - * Populate the URIs for the specified flowfile. - * - * @param connectionId the connection id - * @param flowFile the flowfile - * @return the dto - */ - public FlowFileSummaryDTO populateRemainingFlowFileContent(final String connectionId, final FlowFileSummaryDTO flowFile) { - flowFile.setUri(generateResourceUri("connections", connectionId, "flowfiles", flowFile.getUuid())); - return flowFile; - } - /** * Retrieves the specified connection. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java index 836d25490c..70514acef4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java @@ -358,7 +358,7 @@ public class ControllerResource extends ApplicationResource { reportingTaskResource.populateRemainingReportingTaskEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } // ------------------- @@ -440,7 +440,7 @@ public class ControllerResource extends ApplicationResource { controllerServiceResource.populateRemainingControllerServiceContent(entity.getComponent()); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } // ------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java index 10cf9bf573..fc3524f7f2 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java @@ -16,29 +16,12 @@ */ package org.apache.nifi.web.api; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; +import com.wordnik.swagger.annotations.ApiParam; +import com.wordnik.swagger.annotations.ApiResponse; +import com.wordnik.swagger.annotations.ApiResponses; +import com.wordnik.swagger.annotations.Authorization; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.authorization.Authorizer; import org.apache.nifi.authorization.RequestAction; @@ -65,12 +48,27 @@ import org.apache.nifi.web.api.request.LongParameter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.wordnik.swagger.annotations.Api; -import com.wordnik.swagger.annotations.ApiOperation; -import com.wordnik.swagger.annotations.ApiParam; -import com.wordnik.swagger.annotations.ApiResponse; -import com.wordnik.swagger.annotations.ApiResponses; -import com.wordnik.swagger.annotations.Authorization; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; +import javax.ws.rs.HttpMethod; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * RESTful endpoint for managing a Controller Service. @@ -112,32 +110,20 @@ public class ControllerServiceResource extends ApplicationResource { * @return dtos */ public ControllerServiceEntity populateRemainingControllerServiceEntityContent(final ControllerServiceEntity controllerServiceEntity) { + // populate the controller service href + controllerServiceEntity.setUri(generateResourceUri("controller-services", controllerServiceEntity.getId())); + + // populate the remaining content if (controllerServiceEntity.getComponent() != null) { populateRemainingControllerServiceContent(controllerServiceEntity.getComponent()); } return controllerServiceEntity; } - /** - * Populates the uri for the specified controller service. - * - * @param controllerServices services - * @return dtos - */ - public Set populateRemainingControllerServicesContent(final Set controllerServices) { - for (ControllerServiceDTO controllerService : controllerServices) { - populateRemainingControllerServiceContent(controllerService); - } - return controllerServices; - } - /** * Populates the uri for the specified controller service. */ public ControllerServiceDTO populateRemainingControllerServiceContent(final ControllerServiceDTO controllerService) { - // populate the controller service href - controllerService.setUri(generateResourceUri("controller-services", controllerService.getId())); - // see if this processor has any ui extensions final UiExtensionMapping uiExtensionMapping = (UiExtensionMapping) servletContext.getAttribute("nifi-ui-extensions"); if (uiExtensionMapping.hasUiExtension(controllerService.getType())) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FunnelResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FunnelResource.java index 51e8d7b9c0..42c8932c9a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FunnelResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FunnelResource.java @@ -83,34 +83,10 @@ public class FunnelResource extends ApplicationResource { * @return funnel */ public FunnelEntity populateRemainingFunnelEntityContent(FunnelEntity funnelEntity) { - if (funnelEntity.getComponent() != null) { - populateRemainingFunnelContent(funnelEntity.getComponent()); - } + funnelEntity.setUri(generateResourceUri("funnels", funnelEntity.getId())); return funnelEntity; } - /** - * Populates the uri for the specified funnels. - * - * @param funnels funnels - * @return funnels - */ - public Set populateRemainingFunnelsContent(Set funnels) { - for (FunnelDTO funnel : funnels) { - populateRemainingFunnelContent(funnel); - } - return funnels; - } - - /** - * Populates the uri for the specified funnel. - */ - public FunnelDTO populateRemainingFunnelContent(FunnelDTO funnel) { - // populate the funnel href - funnel.setUri(generateResourceUri("funnels", funnel.getId())); - return funnel; - } - /** * Retrieves the specified funnel. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java index 997838e96d..ee4cc4ade9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java @@ -83,34 +83,10 @@ public class InputPortResource extends ApplicationResource { * @return ports */ public PortEntity populateRemainingInputPortEntityContent(PortEntity inputPortEntity) { - if (inputPortEntity.getComponent() != null) { - populateRemainingInputPortContent(inputPortEntity.getComponent()); - } + inputPortEntity.setUri(generateResourceUri("input-ports", inputPortEntity.getId())); return inputPortEntity; } - /** - * Populates the uri for the specified input ports. - * - * @param inputPorts ports - * @return ports - */ - public Set populateRemainingInputPortsContent(Set inputPorts) { - for (PortDTO inputPort : inputPorts) { - populateRemainingInputPortContent(inputPort); - } - return inputPorts; - } - - /** - * Populates the uri for the specified input ports. - */ - public PortDTO populateRemainingInputPortContent(PortDTO inputPort) { - // populate the input port uri - inputPort.setUri(generateResourceUri("input-ports", inputPort.getId())); - return inputPort; - } - /** * Retrieves the specified input port. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java index f1ec5064fa..1742218062 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/LabelResource.java @@ -83,34 +83,10 @@ public class LabelResource extends ApplicationResource { * @return entities */ public LabelEntity populateRemainingLabelEntityContent(LabelEntity labelEntity) { - if (labelEntity.getComponent() != null) { - populateRemainingLabelContent(labelEntity.getComponent()); - } + labelEntity.setUri(generateResourceUri("labels", labelEntity.getId())); return labelEntity; } - /** - * Populates the uri for the specified labels. - * - * @param labels labels - * @return dtos - */ - public Set populateRemainingLabelsContent(Set labels) { - for (LabelDTO label : labels) { - populateRemainingLabelContent(label); - } - return labels; - } - - /** - * Populates the uri for the specified label. - */ - public LabelDTO populateRemainingLabelContent(LabelDTO label) { - // populate the label href - label.setUri(generateResourceUri("labels", label.getId())); - return label; - } - /** * Retrieves the specified label. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java index c99896c93c..55681dc673 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java @@ -83,34 +83,10 @@ public class OutputPortResource extends ApplicationResource { * @return dtos */ public PortEntity populateRemainingOutputPortEntityContent(PortEntity outputPortEntity) { - if (outputPortEntity.getComponent() != null) { - populateRemainingOutputPortContent(outputPortEntity.getComponent()); - } + outputPortEntity.setUri(generateResourceUri("output-ports", outputPortEntity.getId())); return outputPortEntity; } - /** - * Populates the uri for the specified output ports. - * - * @param outputPorts ports - * @return dtos - */ - public Set populateRemainingOutputPortsContent(Set outputPorts) { - for (PortDTO outputPort : outputPorts) { - populateRemainingOutputPortContent(outputPort); - } - return outputPorts; - } - - /** - * Populates the uri for the specified output ports. - */ - public PortDTO populateRemainingOutputPortContent(PortDTO outputPort) { - // populate the output port uri - outputPort.setUri(generateResourceUri("output-ports", outputPort.getId())); - return outputPort; - } - /** * Retrieves the specified output port. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java index 624937f4e3..7074379c92 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java @@ -16,36 +16,14 @@ */ package org.apache.nifi.web.api; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.stream.StreamSource; - +import com.sun.jersey.api.core.ResourceContext; +import com.sun.jersey.multipart.FormDataParam; +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; +import com.wordnik.swagger.annotations.ApiParam; +import com.wordnik.swagger.annotations.ApiResponse; +import com.wordnik.swagger.annotations.ApiResponses; +import com.wordnik.swagger.annotations.Authorization; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.authorization.Authorizer; import org.apache.nifi.authorization.RequestAction; @@ -88,14 +66,34 @@ import org.apache.nifi.web.api.request.LongParameter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.sun.jersey.api.core.ResourceContext; -import com.sun.jersey.multipart.FormDataParam; -import com.wordnik.swagger.annotations.Api; -import com.wordnik.swagger.annotations.ApiOperation; -import com.wordnik.swagger.annotations.ApiParam; -import com.wordnik.swagger.annotations.ApiResponse; -import com.wordnik.swagger.annotations.ApiResponses; -import com.wordnik.swagger.annotations.Authorization; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; +import javax.ws.rs.HttpMethod; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * RESTful endpoint for managing a Group. @@ -147,36 +145,10 @@ public class ProcessGroupResource extends ApplicationResource { * @return group dto */ public ProcessGroupEntity populateRemainingProcessGroupEntityContent(ProcessGroupEntity processGroupEntity) { - if (processGroupEntity.getComponent() != null) { - populateRemainingProcessGroupContent(processGroupEntity.getComponent()); - } + processGroupEntity.setUri(generateResourceUri("process-groups", processGroupEntity.getId())); return processGroupEntity; } - /** - * Populates the remaining fields in the specified process groups. - * - * @param processGroups groups - * @return group dto - */ - public Set populateRemainingProcessGroupsContent(Set processGroups) { - for (ProcessGroupDTO processGroup : processGroups) { - populateRemainingProcessGroupContent(processGroup); - } - return processGroups; - } - - /** - * Populates the remaining fields in the specified process group. - * - * @param processGroup group - * @return group dto - */ - private ProcessGroupDTO populateRemainingProcessGroupContent(ProcessGroupDTO processGroup) { - processGroup.setUri(generateResourceUri("process-groups", processGroup.getId())); - return processGroup; - } - /** * Populates the remaining content of the specified snippet. */ @@ -492,7 +464,7 @@ public class ProcessGroupResource extends ApplicationResource { populateRemainingProcessGroupEntityContent(entity); // generate a 201 created response - String uri = entity.getComponent().getUri(); + String uri = entity.getUri(); return clusterContext(generateCreatedResponse(URI.create(uri), entity)).build(); } @@ -652,7 +624,7 @@ public class ProcessGroupResource extends ApplicationResource { processorResource.populateRemainingProcessorEntityContent(entity); // generate a 201 created response - String uri = entity.getComponent().getUri(); + String uri = entity.getUri(); return clusterContext(generateCreatedResponse(URI.create(uri), entity)).build(); } @@ -802,7 +774,7 @@ public class ProcessGroupResource extends ApplicationResource { inputPortResource.populateRemainingInputPortEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** @@ -949,7 +921,7 @@ public class ProcessGroupResource extends ApplicationResource { outputPortResource.populateRemainingOutputPortEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** @@ -1097,7 +1069,7 @@ public class ProcessGroupResource extends ApplicationResource { funnelResource.populateRemainingFunnelEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** @@ -1245,7 +1217,7 @@ public class ProcessGroupResource extends ApplicationResource { labelResource.populateRemainingLabelEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** @@ -1424,7 +1396,7 @@ public class ProcessGroupResource extends ApplicationResource { final RemoteProcessGroupEntity entity = serviceFacade.createRemoteProcessGroup(revision, groupId, requestProcessGroupDTO); remoteProcessGroupResource.populateRemainingRemoteProcessGroupEntityContent(entity); - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** @@ -1591,7 +1563,7 @@ public class ProcessGroupResource extends ApplicationResource { connectionResource.populateRemainingConnectionEntityContent(entity); // extract the href and build the response - String uri = entity.getComponent().getUri(); + String uri = entity.getUri(); return clusterContext(generateCreatedResponse(URI.create(uri), entity)).build(); } @@ -2156,7 +2128,7 @@ public class ProcessGroupResource extends ApplicationResource { controllerServiceResource.populateRemainingControllerServiceContent(entity.getComponent()); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } // setters diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java index a6169aa750..bf104f5034 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java @@ -84,9 +84,7 @@ public class ProcessorResource extends ApplicationResource { */ public Set populateRemainingProcessorEntitiesContent(Set processorEntities) { for (ProcessorEntity processorEntity : processorEntities) { - if (processorEntity.getComponent() != null) { - populateRemainingProcessorContent(processorEntity.getComponent()); - } + populateRemainingProcessorEntityContent(processorEntity); } return processorEntities; } @@ -98,32 +96,19 @@ public class ProcessorResource extends ApplicationResource { * @return dtos */ public ProcessorEntity populateRemainingProcessorEntityContent(ProcessorEntity processorEntity) { + processorEntity.setUri(generateResourceUri("processors", processorEntity.getId())); + + // populate remaining content if (processorEntity.getComponent() != null) { populateRemainingProcessorContent(processorEntity.getComponent()); } return processorEntity; } - /** - * Populate the uri's for the specified processors and their relationships. - * - * @param processors processors - * @return dtos - */ - public Set populateRemainingProcessorsContent(Set processors) { - for (ProcessorDTO processor : processors) { - populateRemainingProcessorContent(processor); - } - return processors; - } - /** * Populate the uri's for the specified processor and its relationships. */ public ProcessorDTO populateRemainingProcessorContent(ProcessorDTO processor) { - // populate the remaining properties - processor.setUri(generateResourceUri("processors", processor.getId())); - // get the config details and see if there is a custom ui for this processor type ProcessorConfigDTO config = processor.getConfig(); if (config != null) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java index e6669d9f63..6bb999f8b2 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java @@ -89,38 +89,10 @@ public class RemoteProcessGroupResource extends ApplicationResource { * @return dtos */ public RemoteProcessGroupEntity populateRemainingRemoteProcessGroupEntityContent(RemoteProcessGroupEntity remoteProcessGroupEntity) { - if (remoteProcessGroupEntity.getComponent() != null) { - populateRemainingRemoteProcessGroupContent(remoteProcessGroupEntity.getComponent()); - } + remoteProcessGroupEntity.setUri(generateResourceUri("remote-process-groups", remoteProcessGroupEntity.getId())); return remoteProcessGroupEntity; } - /** - * Populates the remaining content for each remote process group. The uri must be generated and the remote process groups name must be retrieved. - * - * @param remoteProcessGroups groups - * @return dtos - */ - public Set populateRemainingRemoteProcessGroupsContent(Set remoteProcessGroups) { - for (RemoteProcessGroupDTO remoteProcessGroup : remoteProcessGroups) { - populateRemainingRemoteProcessGroupContent(remoteProcessGroup); - } - return remoteProcessGroups; - } - - /** - * Populates the remaining content for the specified remote process group. The uri must be generated and the remote process groups name must be retrieved. - * - * @param remoteProcessGroup group - * @return dto - */ - public RemoteProcessGroupDTO populateRemainingRemoteProcessGroupContent(RemoteProcessGroupDTO remoteProcessGroup) { - // populate the remaining content - remoteProcessGroup.setUri(generateResourceUri("remote-process-groups", remoteProcessGroup.getId())); - - return remoteProcessGroup; - } - /** * Retrieves the specified remote process group. * diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java index 0bf2c19023..1025de2bf7 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java @@ -98,32 +98,19 @@ public class ReportingTaskResource extends ApplicationResource { * @return dtos */ public ReportingTaskEntity populateRemainingReportingTaskEntityContent(final ReportingTaskEntity reportingTaskEntity) { + reportingTaskEntity.setUri(generateResourceUri("reporting-tasks", reportingTaskEntity.getId())); + + // populate the remaining content if (reportingTaskEntity.getComponent() != null) { populateRemainingReportingTaskContent(reportingTaskEntity.getComponent()); } return reportingTaskEntity; } - /** - * Populates the uri for the specified reporting task. - * - * @param reportingTasks tasks - * @return tasks - */ - public Set populateRemainingReportingTasksContent(final Set reportingTasks) { - for (ReportingTaskDTO reportingTask : reportingTasks) { - populateRemainingReportingTaskContent(reportingTask); - } - return reportingTasks; - } - /** * Populates the uri for the specified reporting task. */ public ReportingTaskDTO populateRemainingReportingTaskContent(final ReportingTaskDTO reportingTask) { - // populate the reporting task href - reportingTask.setUri(generateResourceUri("reporting-tasks", reportingTask.getId())); - // see if this processor has any ui extensions final UiExtensionMapping uiExtensionMapping = (UiExtensionMapping) servletContext.getAttribute("nifi-ui-extensions"); if (uiExtensionMapping.hasUiExtension(reportingTask.getType())) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TenantsResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TenantsResource.java index 353e4841c1..860bf7f7cd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TenantsResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TenantsResource.java @@ -105,34 +105,10 @@ public class TenantsResource extends ApplicationResource { * @return userEntity */ public UserEntity populateRemainingUserEntityContent(UserEntity userEntity) { - if (userEntity.getComponent() != null) { - populateRemainingUserContent(userEntity.getComponent()); - } + userEntity.setUri(generateResourceUri("tenants/users", userEntity.getId())); return userEntity; } - /** - * Populates the uri for the specified user. - */ - public UserDTO populateRemainingUserContent(UserDTO user) { - // populate the user href - user.setUri(generateResourceUri("tenants/users", user.getId())); - return user; - } - - /** - * Populates the uri for the specified users. - * - * @param users users - * @return user data transfer objects - */ - public Set populateRemainingUsersContent(Set users) { - for (UserDTO userDTO : users) { - populateRemainingUserContent(userDTO); - } - return users; - } - /** * Creates a new user. * @@ -209,7 +185,7 @@ public class TenantsResource extends ApplicationResource { populateRemainingUserEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** @@ -490,35 +466,10 @@ public class TenantsResource extends ApplicationResource { * @return userGroupEntity */ public UserGroupEntity populateRemainingUserGroupEntityContent(UserGroupEntity userGroupEntity) { - if (userGroupEntity.getComponent() != null) { - populateRemainingUserGroupContent(userGroupEntity.getComponent()); - } + userGroupEntity.setUri(generateResourceUri("tenants/user-groups", userGroupEntity.getId())); return userGroupEntity; } - /** - * Populates the uri for the specified userGroup. - */ - public UserGroupDTO populateRemainingUserGroupContent(UserGroupDTO userGroup) { - // populate the user group href - userGroup.setUri(generateResourceUri("tenants/user-groups", userGroup.getId())); - return userGroup; - } - - /** - * Populates the uri for the specified user groups. - * - * @param userGroups user groups - * @return user group data transfer objects - */ - public Set populateRemainingUserGroupsContent(Set userGroups) { - for (UserGroupDTO userGroup : userGroups) { - populateRemainingUserGroupContent(userGroup); - } - return userGroups; - } - - /** * Creates a new user group. * @@ -595,7 +546,7 @@ public class TenantsResource extends ApplicationResource { populateRemainingUserGroupEntityContent(entity); // build the response - return clusterContext(generateCreatedResponse(URI.create(entity.getComponent().getUri()), entity)).build(); + return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build(); } /** diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITConnectionAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITConnectionAccessControl.java index 0f5fe92fb2..4be0bb95ba 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITConnectionAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITConnectionAccessControl.java @@ -414,7 +414,7 @@ public class ITConnectionAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITFunnelAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITFunnelAccessControl.java index b66a667d31..a87b63e237 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITFunnelAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITFunnelAccessControl.java @@ -348,7 +348,7 @@ public class ITFunnelAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITInputPortAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITInputPortAccessControl.java index 1e67333a06..cd4f3ce825 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITInputPortAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITInputPortAccessControl.java @@ -392,7 +392,7 @@ public class ITInputPortAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITLabelAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITLabelAccessControl.java index d581946aa7..2404c77671 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITLabelAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITLabelAccessControl.java @@ -389,7 +389,7 @@ public class ITLabelAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java index 58bc3df377..6ec0846fb7 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java @@ -392,7 +392,7 @@ public class ITOutputPortAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessGroupAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessGroupAccessControl.java index 326a120aab..5f1c72bc94 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessGroupAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessGroupAccessControl.java @@ -392,7 +392,7 @@ public class ITProcessGroupAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessorAccessControl.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessorAccessControl.java index 7c59083ec0..0dec268e2a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessorAccessControl.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessorAccessControl.java @@ -476,7 +476,7 @@ public class ITProcessorAccessControl { queryParams.put("clientId", clientId); // perform the request - ClientResponse response = user.testDelete(entity.getComponent().getUri(), queryParams); + ClientResponse response = user.testDelete(entity.getUri(), queryParams); // ensure the request is failed with a forbidden status code assertEquals(responseCode, response.getStatus()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js index d860d5247b..d6c2831efc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js @@ -288,7 +288,7 @@ nf.ng.Canvas.OperateCtrl = function () { // update the style for the specified component $.ajax({ type: 'PUT', - url: selectedData.component.uri, + url: selectedData.uri, data: JSON.stringify(entity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js index 854f974fc9..b35f209f16 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js @@ -98,17 +98,15 @@ nf.ng.FunnelComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the funnel to the graph - nf.Graph.add({ - 'funnels': [response] - }, { - 'selectAll': true - }); + // add the funnel to the graph + nf.Graph.add({ + 'funnels': [response] + }, { + 'selectAll': true + }); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(nf.Common.handleAjaxError); } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js index 99ced1792e..01a1194759 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js @@ -50,20 +50,18 @@ nf.ng.GroupComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the process group to the graph - nf.Graph.add({ - 'processGroups': [response] - }, { - 'selectAll': true - }); + // add the process group to the graph + nf.Graph.add({ + 'processGroups': [response] + }, { + 'selectAll': true + }); - // update component visibility - nf.Canvas.View.updateVisibility(); + // update component visibility + nf.Canvas.View.updateVisibility(); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(nf.Common.handleAjaxError); }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js index 57292361c0..6ec1d6c274 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js @@ -50,20 +50,18 @@ nf.ng.InputPortComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the port to the graph - nf.Graph.add({ - 'inputPorts': [response] - }, { - 'selectAll': true - }); + // add the port to the graph + nf.Graph.add({ + 'inputPorts': [response] + }, { + 'selectAll': true + }); - // update component visibility - nf.Canvas.View.updateVisibility(); + // update component visibility + nf.Canvas.View.updateVisibility(); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(nf.Common.handleAjaxError); }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js index 5558a40108..a0fabb37c2 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js @@ -100,17 +100,15 @@ nf.ng.LabelComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the label to the graph - nf.Graph.add({ - 'labels': [response] - }, { - 'selectAll': true - }); + // add the label to the graph + nf.Graph.add({ + 'labels': [response] + }, { + 'selectAll': true + }); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(nf.Common.handleAjaxError); } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js index e77aeaa92e..7c37bfa7f9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js @@ -50,20 +50,18 @@ nf.ng.OutputPortComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the port to the graph - nf.Graph.add({ - 'outputPorts': [response] - }, { - 'selectAll': true - }); + // add the port to the graph + nf.Graph.add({ + 'outputPorts': [response] + }, { + 'selectAll': true + }); - // update component visibility - nf.Canvas.View.updateVisibility(); + // update component visibility + nf.Canvas.View.updateVisibility(); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(nf.Common.handleAjaxError); }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js index 30f644ef5d..abd4402754 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js @@ -225,20 +225,18 @@ nf.ng.ProcessorComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the processor to the graph - nf.Graph.add({ - 'processors': [response] - }, { - 'selectAll': true - }); + // add the processor to the graph + nf.Graph.add({ + 'processors': [response] + }, { + 'selectAll': true + }); - // update component visibility - nf.Canvas.View.updateVisibility(); + // update component visibility + nf.Canvas.View.updateVisibility(); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(nf.Common.handleAjaxError); }; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js index 15964fa19a..7bf2633df7 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js @@ -57,23 +57,21 @@ nf.ng.RemoteProcessGroupComponent = function (serviceProvider) { dataType: 'json', contentType: 'application/json' }).done(function (response) { - if (nf.Common.isDefinedAndNotNull(response.component)) { - // add the processor to the graph - nf.Graph.add({ - 'remoteProcessGroups': [response] - }, { - 'selectAll': true - }); + // add the processor to the graph + nf.Graph.add({ + 'remoteProcessGroups': [response] + }, { + 'selectAll': true + }); - // hide the dialog - $('#new-remote-process-group-dialog').modal('hide'); + // hide the dialog + $('#new-remote-process-group-dialog').modal('hide'); - // update component visibility - nf.Canvas.View.updateVisibility(); + // update component visibility + nf.Canvas.View.updateVisibility(); - // update the birdseye - nf.Birdseye.refresh(); - } + // update the birdseye + nf.Birdseye.refresh(); }).fail(function (xhr, status, error) { if (xhr.status === 400) { var errors = xhr.responseText.split('\n'); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js index aa99cf7c3a..30242fa6cc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js @@ -133,7 +133,7 @@ nf.Actions = (function () { var poll = function (nextDelay) { $.ajax({ type: 'GET', - url: d.component.uri, + url: d.uri, dataType: 'json' }).done(function (response) { var remoteProcessGroup = response.component; @@ -398,7 +398,7 @@ nf.Actions = (function () { } }; - enableRequests.push(updateResource(d.component.uri, entity).done(function (response) { + enableRequests.push(updateResource(d.uri, entity).done(function (response) { nf[d.type].set(response); })); }); @@ -441,7 +441,7 @@ nf.Actions = (function () { } }; - disableRequests.push(updateResource(d.component.uri, entity).done(function (response) { + disableRequests.push(updateResource(d.uri, entity).done(function (response) { nf[d.type].set(response); })); }); @@ -512,7 +512,7 @@ nf.Actions = (function () { 'state': 'RUNNING' } } else { - uri = d.component.uri; + uri = d.uri; entity = { 'revision': nf.Client.getRevision(d), 'component': { @@ -582,7 +582,7 @@ nf.Actions = (function () { 'state': 'STOPPED' }; } else { - uri = d.component.uri; + uri = d.uri; entity = { 'revision': nf.Client.getRevision(d), 'component': { @@ -633,7 +633,7 @@ nf.Actions = (function () { }; // start transmitting - updateResource(d.component.uri, entity).done(function (response) { + updateResource(d.uri, entity).done(function (response) { nf.RemoteProcessGroup.set(response); }); }); @@ -660,7 +660,7 @@ nf.Actions = (function () { } }; - updateResource(d.component.uri, entity).done(function (response) { + updateResource(d.uri, entity).done(function (response) { nf.RemoteProcessGroup.set(response); }); }); @@ -795,7 +795,7 @@ nf.Actions = (function () { $.ajax({ type: 'DELETE', - url: selectionData.component.uri + '?' + $.param({ + url: selectionData.uri + '?' + $.param({ version: revision.version, clientId: revision.clientId }), @@ -1083,7 +1083,7 @@ nf.Actions = (function () { var processor = selection.datum(); // view the state for the selected processor - nf.ComponentState.showState(processor.component, nf.CanvasUtils.supportsModification(selection)); + nf.ComponentState.showState(processor, nf.CanvasUtils.supportsModification(selection)); }, /** @@ -1425,7 +1425,7 @@ nf.Actions = (function () { // update the edge in question $.ajax({ type: 'PUT', - url: connection.component.uri, + url: connection.uri, data: JSON.stringify(connectionEntity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-component-state.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-component-state.js index f3118423b4..ce659d7849 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-component-state.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-component-state.js @@ -256,10 +256,10 @@ nf.ComponentState = (function () { var stateEntryCount = componentStateGrid.getDataLength(); if (stateEntryCount > 0) { - var component = componentStateTable.data('component'); + var componentEntity = componentStateTable.data('component'); $.ajax({ type: 'POST', - url: component.uri + '/state/clear-requests', + url: componentEntity.uri + '/state/clear-requests', dataType: 'json' }).done(function (response) { // clear the table @@ -356,13 +356,13 @@ nf.ComponentState = (function () { /** * Shows the state for a given component. * - * @param {object} component + * @param {object} componentEntity * @param {boolean} canClear */ - showState: function (component, canClear) { + showState: function (componentEntity, canClear) { return $.ajax({ type: 'GET', - url: component.uri + '/state', + url: componentEntity.uri + '/state', dataType: 'json' }).done(function (response) { var componentState = response.componentState; @@ -372,11 +372,11 @@ nf.ComponentState = (function () { loadComponentState(componentState.localState, componentState.clusterState); // populate the name/description - $('#component-state-name').text(component.name); + $('#component-state-name').text(componentEntity.component.name); $('#component-state-description').text(componentState.stateDescription).ellipsis(); // store the component - componentStateTable.data('component', component); + componentStateTable.data('component', componentEntity); // show the dialog $('#component-state-dialog').modal('show'); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js index 81e9dc7fc9..c1fc9561ad 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js @@ -352,7 +352,7 @@ nf.ConnectionConfiguration = (function () { $.ajax({ type: 'GET', - url: remoteProcessGroupData.component.uri, + url: remoteProcessGroupData.uri, data: { verbose: true }, @@ -578,7 +578,7 @@ nf.ConnectionConfiguration = (function () { $.ajax({ type: 'GET', - url: remoteProcessGroupData.component.uri, + url: remoteProcessGroupData.uri, data: { verbose: true }, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js index b85f8c7801..7e071ea83d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js @@ -1188,7 +1188,7 @@ nf.Connection = (function () { return $.ajax({ type: 'PUT', - url: d.component.uri, + url: d.uri, data: JSON.stringify(entity), dataType: 'json', contentType: 'application/json' @@ -1397,7 +1397,7 @@ nf.Connection = (function () { $.ajax({ type: 'PUT', - url: connectionData.component.uri, + url: connectionData.uri, data: JSON.stringify(connectionEntity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js index 7735b7380b..7413c0a89f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js @@ -132,7 +132,7 @@ nf.ControllerService = (function () { return $.ajax({ type: 'GET', - url: controllerServiceEntity.component.uri, + url: controllerServiceEntity.uri, dataType: 'json' }).done(function (response) { renderControllerService(serviceTable, response); @@ -602,7 +602,7 @@ nf.ControllerService = (function () { var updated = $.ajax({ type: 'PUT', - url: controllerServiceEntity.component.uri, + url: controllerServiceEntity.uri, data: JSON.stringify(updateControllerServiceEntity), dataType: 'json', contentType: 'application/json' @@ -697,7 +697,7 @@ nf.ControllerService = (function () { // issue the request to update the referencing components var updated = $.ajax({ type: 'PUT', - url: controllerServiceEntity.component.uri + '/references', + url: controllerServiceEntity.uri + '/references', data: JSON.stringify(referenceEntity), dataType: 'json', contentType: 'application/json' @@ -969,7 +969,7 @@ nf.ControllerService = (function () { // issue the request to update the referencing components var updated = $.ajax({ type: 'PUT', - url: controllerServiceEntity.component.uri + '/references', + url: controllerServiceEntity.uri + '/references', data: JSON.stringify(referenceEntity), dataType: 'json', contentType: 'application/json' @@ -1398,7 +1398,7 @@ nf.ControllerService = (function () { var controllerServiceEntity = $('#controller-service-configuration').data('controllerServiceDetails'); return $.ajax({ type: 'GET', - url: controllerServiceEntity.component.uri + '/descriptors', + url: controllerServiceEntity.uri + '/descriptors', data: { propertyName: propertyName }, @@ -1465,7 +1465,7 @@ nf.ControllerService = (function () { return $.ajax({ type: 'PUT', data: JSON.stringify(updatedControllerService), - url: controllerServiceEntity.component.uri, + url: controllerServiceEntity.uri, dataType: 'json', contentType: 'application/json' }).done(function (response) { @@ -1698,7 +1698,7 @@ nf.ControllerService = (function () { // reload the service in case the property descriptors have changed var reloadService = $.ajax({ type: 'GET', - url: controllerServiceEntity.component.uri, + url: controllerServiceEntity.uri, dataType: 'json' }); @@ -1863,7 +1863,7 @@ nf.ControllerService = (function () { // reload the service in case the property descriptors have changed var reloadService = $.ajax({ type: 'GET', - url: controllerServiceEntity.component.uri, + url: controllerServiceEntity.uri, dataType: 'json' }); @@ -1999,7 +1999,7 @@ nf.ControllerService = (function () { var revision = nf.Client.getRevision(controllerServiceEntity); $.ajax({ type: 'DELETE', - url: controllerServiceEntity.component.uri + '?' + $.param({ + url: controllerServiceEntity.uri + '?' + $.param({ version: revision.version, clientId: revision.clientId }), diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js index e76e48836a..eae368b2da 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js @@ -631,7 +631,7 @@ nf.ControllerServices = (function () { } else if (target.hasClass('delete-controller-service')) { nf.ControllerService.remove(serviceTable, controllerServiceEntity); } else if (target.hasClass('view-state-controller-service')) { - nf.ComponentState.showState(controllerServiceEntity.component, controllerServiceEntity.state === 'DISABLED'); + nf.ComponentState.showState(controllerServiceEntity, controllerServiceEntity.state === 'DISABLED'); } else if (target.hasClass('edit-access-policies')) { // show the policies for this service nf.PolicyManagement.showControllerServicePolicy(controllerServiceEntity); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js index 8919ece34e..c2ab8ebf2d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js @@ -60,7 +60,7 @@ nf.Draggable = (function () { return $.Deferred(function (deferred) { $.ajax({ type: 'PUT', - url: d.component.uri, + url: d.uri, data: JSON.stringify(entity), dataType: 'json', contentType: 'application/json' @@ -114,7 +114,7 @@ nf.Draggable = (function () { return $.Deferred(function (deferred) { $.ajax({ type: 'PUT', - url: d.component.uri, + url: d.uri, data: JSON.stringify(entity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js index ca2b39b854..8963fa4157 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js @@ -61,7 +61,7 @@ nf.LabelConfiguration = (function () { // save the new label value $.ajax({ type: 'PUT', - url: labelData.component.uri, + url: labelData.uri, data: JSON.stringify(labelEntity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js index dbcb5a0de5..bde87d5051 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js @@ -315,7 +315,7 @@ nf.Label = (function () { $.ajax({ type: 'PUT', - url: labelData.component.uri, + url: labelData.uri, data: JSON.stringify(labelEntity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js index 652290aa67..dbadf00ecd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js @@ -515,7 +515,7 @@ nf.PolicyManagement = (function () { if (nf.Common.isDefinedAndNotNull(currentEntity)) { $.ajax({ type: 'DELETE', - url: currentEntity.component.uri + '?' + $.param(nf.Client.getRevision(currentEntity)), + url: currentEntity.uri + '?' + $.param(nf.Client.getRevision(currentEntity)), dataType: 'json' }).done(function () { loadPolicy(); @@ -749,7 +749,7 @@ nf.PolicyManagement = (function () { $.ajax({ type: 'PUT', - url: currentEntity.component.uri, + url: currentEntity.uri, data: JSON.stringify(entity), dataType: 'json', contentType: 'application/json' diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js index a50ff19a9d..420febb1a5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js @@ -68,7 +68,7 @@ nf.PortConfiguration = (function () { $.ajax({ type: 'PUT', data: JSON.stringify(portEntity), - url: portData.component.uri, + url: portData.uri, dataType: 'json', contentType: 'application/json' }).done(function (response) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-configuration.js index 6eea7a7bb8..6a33af7950 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-configuration.js @@ -54,7 +54,7 @@ nf.RemoteProcessGroupConfiguration = (function () { $.ajax({ type: 'PUT', data: JSON.stringify(remoteProcessGroupEntity), - url: remoteProcessGroupData.component.uri, + url: remoteProcessGroupData.uri, dataType: 'json', contentType: 'application/json' }).done(function (response) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-ports.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-ports.js index 30daa5ab92..2c949aaed8 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-ports.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-ports.js @@ -64,7 +64,7 @@ nf.RemoteProcessGroupPorts = (function () { $.ajax({ type: 'PUT', data: JSON.stringify(remoteProcessGroupPortEntity), - url: remoteProcessGroupData.component.uri + portContextPath + encodeURIComponent(remotePortId), + url: remoteProcessGroupData.uri + portContextPath + encodeURIComponent(remotePortId), dataType: 'json', contentType: 'application/json' }).done(function (response) { @@ -294,7 +294,7 @@ nf.RemoteProcessGroupPorts = (function () { $.ajax({ type: 'PUT', data: JSON.stringify(remoteProcessGroupPortEntity), - url: remoteProcessGroupData.component.uri + portContextPath + encodeURIComponent(port.id), + url: remoteProcessGroupData.uri + portContextPath + encodeURIComponent(port.id), dataType: 'json', contentType: 'application/json' }).done(function (response) { @@ -470,7 +470,7 @@ nf.RemoteProcessGroupPorts = (function () { // load the properties for the specified component $.ajax({ type: 'GET', - url: selectionData.component.uri, + url: selectionData.uri, data: { verbose: true }, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js index 2cf66abaf6..61633eed76 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js @@ -205,7 +205,7 @@ nf.ReportingTask = (function () { return $.ajax({ type: 'PUT', - url: reportingTaskEntity.component.uri, + url: reportingTaskEntity.uri, data: JSON.stringify(entity), dataType: 'json', contentType: 'application/json' @@ -265,7 +265,7 @@ nf.ReportingTask = (function () { return $.ajax({ type: 'PUT', data: JSON.stringify(updatedReportingTask), - url: reportingTaskEntity.component.uri, + url: reportingTaskEntity.uri, dataType: 'json', contentType: 'application/json' }).done(function (response) { @@ -390,7 +390,7 @@ nf.ReportingTask = (function () { // reload the task in case the property descriptors have changed var reloadTask = $.ajax({ type: 'GET', - url: reportingTaskEntity.component.uri, + url: reportingTaskEntity.uri, dataType: 'json' }); @@ -595,7 +595,7 @@ nf.ReportingTask = (function () { // reload the task in case the property descriptors have changed var reloadTask = $.ajax({ type: 'GET', - url: reportingTaskEntity.component.uri, + url: reportingTaskEntity.uri, dataType: 'json' }); @@ -715,7 +715,7 @@ nf.ReportingTask = (function () { return $.ajax({ type: 'GET', - url: reportingTaskEntity.component.uri, + url: reportingTaskEntity.uri, dataType: 'json' }).done(function (response) { renderReportingTask(response); @@ -733,7 +733,7 @@ nf.ReportingTask = (function () { var revision = nf.Client.getRevision(reportingTaskEntity); $.ajax({ type: 'DELETE', - url: reportingTaskEntity.component.uri + '?' + $.param({ + url: reportingTaskEntity.uri + '?' + $.param({ version: revision.version, clientId: revision.clientId }), diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js index 8db7bf9362..305469b242 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js @@ -732,7 +732,7 @@ nf.Settings = (function () { nf.ReportingTask.remove(reportingTaskEntity); } else if (target.hasClass('view-state-reporting-task')) { var canClear = reportingTaskEntity.component.state === 'STOPPED' && reportingTaskEntity.component.activeThreadCount === 0; - nf.ComponentState.showState(reportingTaskEntity.component, canClear); + nf.ComponentState.showState(reportingTaskEntity, canClear); } else if (target.hasClass('edit-access-policies')) { // show the policies for this service nf.PolicyManagement.showReportingTaskPolicy(reportingTaskEntity); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js index 5707f52adc..c58a38adac 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js @@ -55,7 +55,7 @@ nf.UsersTable = (function () { // update the user $.ajax({ type: 'DELETE', - url: user.component.uri + '?' + $.param(nf.Client.getRevision(user)), + url: user.uri + '?' + $.param(nf.Client.getRevision(user)), dataType: 'json' }).done(function () { nf.UsersTable.loadUsersTable(); @@ -157,7 +157,7 @@ nf.UsersTable = (function () { // update the group return $.ajax({ type: 'PUT', - url: groupEntity.component.uri, + url: groupEntity.uri, data: JSON.stringify(updatedGroupEntity), dataType: 'json', contentType: 'application/json' @@ -195,7 +195,7 @@ nf.UsersTable = (function () { // update the group return $.ajax({ type: 'PUT', - url: groupEntity.component.uri, + url: groupEntity.uri, data: JSON.stringify(updatedGroupEntity), dataType: 'json', contentType: 'application/json' @@ -265,7 +265,7 @@ nf.UsersTable = (function () { // update the user var userXhr = $.ajax({ type: 'PUT', - url: userEntity.component.uri, + url: userEntity.uri, data: JSON.stringify(updatedUserEntity), dataType: 'json', contentType: 'application/json' @@ -359,7 +359,7 @@ nf.UsersTable = (function () { // update the user $.ajax({ type: 'PUT', - url: groupEntity.component.uri, + url: groupEntity.uri, data: JSON.stringify(updatedGroupoEntity), dataType: 'json', contentType: 'application/json'