NIFI-2249:

- Making the URI accessibility outside of the component.
This commit is contained in:
Matt Gilman 2016-07-12 22:10:21 -04:00 committed by Mark Payne
parent cfaacb1d5c
commit 9e2f52c8b5
47 changed files with 246 additions and 576 deletions

View File

@ -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.
*

View File

@ -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<BulletinDTO> 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.
*

View File

@ -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());

View File

@ -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();
}
/**

View File

@ -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<ConnectionDTO> populateRemainingConnectionsContent(Set<ConnectionDTO> 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.
*

View File

@ -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();
}
// -------

View File

@ -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<ControllerServiceDTO> populateRemainingControllerServicesContent(final Set<ControllerServiceDTO> 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())) {

View File

@ -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<FunnelDTO> populateRemainingFunnelsContent(Set<FunnelDTO> 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.
*

View File

@ -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<PortDTO> populateRemainingInputPortsContent(Set<PortDTO> 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.
*

View File

@ -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<LabelDTO> populateRemainingLabelsContent(Set<LabelDTO> 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.
*

View File

@ -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<PortDTO> populateRemainingOutputPortsContent(Set<PortDTO> 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.
*

View File

@ -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<ProcessGroupDTO> populateRemainingProcessGroupsContent(Set<ProcessGroupDTO> 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

View File

@ -84,9 +84,7 @@ public class ProcessorResource extends ApplicationResource {
*/
public Set<ProcessorEntity> populateRemainingProcessorEntitiesContent(Set<ProcessorEntity> 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<ProcessorDTO> populateRemainingProcessorsContent(Set<ProcessorDTO> 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) {

View File

@ -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<RemoteProcessGroupDTO> populateRemainingRemoteProcessGroupsContent(Set<RemoteProcessGroupDTO> 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.
*

View File

@ -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<ReportingTaskDTO> populateRemainingReportingTasksContent(final Set<ReportingTaskDTO> 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())) {

View File

@ -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<UserDTO> populateRemainingUsersContent(Set<UserDTO> 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<UserGroupDTO> populateRemainingUserGroupsContent(Set<UserGroupDTO> 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();
}
/**

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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'

View File

@ -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);
}
}

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
}
}

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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');

View File

@ -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'

View File

@ -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');

View File

@ -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
},

View File

@ -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'

View File

@ -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
}),

View File

@ -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);

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -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) {

View File

@ -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) {

View File

@ -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
},

View File

@ -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
}),

View File

@ -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);

View File

@ -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'