[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-30 Thread mcgilman
Github user mcgilman commented on the pull request:

https://github.com/apache/nifi/pull/424#issuecomment-222531466
  
@YolandaMDavis I'm having some issues saving the JSON specification in the 
Custom UI while running in a clustered instance. When I click save, the value 
for the specification is reset to the previous value and I do not get any 
message indicating an issue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-17 Thread YolandaMDavis
Github user YolandaMDavis commented on the pull request:

https://github.com/apache/nifi/pull/424#issuecomment-219902820
  
@mcgilman no problem. will refer to just codemirror in nifi-web-ui for 0.x  
and both angular and codemiror in 1.0 (since angular is only available in that 
module in 1.0)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-17 Thread YolandaMDavis
Github user YolandaMDavis commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r63629669
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/processor/ProcessorResource.java
 ---
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nifi.web.standard.api.processor;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.nifi.web.ComponentDetails;
+import org.apache.nifi.web.ComponentDescriptor;
+import org.apache.nifi.web.NiFiWebConfigurationContext;
+
+import org.apache.nifi.web.NiFiWebConfigurationRequestContext;
+import org.apache.nifi.web.standard.api.AbstractStandardResource;
+import org.apache.nifi.web.util.CustomUIUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Path("/standard/processor")
+public class ProcessorResource extends AbstractStandardResource {
--- End diff --

Started off using get type, properties and descriptors but ended up using 
details. I'll remove these.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-17 Thread YolandaMDavis
Github user YolandaMDavis commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r63624220
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 ---
@@ -1670,6 +1670,49 @@ public ProcessorDTO getConfiguration() {
 }
 
 @Override
+public ConfigurationSnapshot 
setProcessorProperties(final Revision revision, final String processorId, final 
Map properties) {
--- End diff --

@mcgilman no worries, agreed on the change for 1.x.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-17 Thread mcgilman
Github user mcgilman commented on the pull request:

https://github.com/apache/nifi/pull/424#issuecomment-219881237
  
@YolandaMDavis Yep. We're definitely on the same page here. However, we 
currently have not formally established any APIs/components/widgets for UI 
extensions to consume. Because of this I think we're ok. In this case 
referencing stuff bundled in nifi-web-ui is fair game with the understanding 
that they may change with any release. During that release would we would also 
need to update this custom UI appropriately.

Going forward, we should establish APIs/components/widgets for custom UIs 
to consume with guarantees around their APIs. However, we need to be mindful 
that when we do this we won't be able to freely break those APIs. I would 
prefer to decouple these from any particular framework/versions so we're not 
'stuck' with anything. We can obviously discuss this in more details as custom 
UIs become more prominent.   


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-17 Thread YolandaMDavis
Github user YolandaMDavis commented on the pull request:

https://github.com/apache/nifi/pull/424#issuecomment-219871908
  
@mcgilman had same conversation with @scottyaslan last week concerning 
referencing js in nifi-web-ui.  My main concern was versioning e.g. changes 
happening at that level that a custom ui wouldn't be ready for.  I can switch 
it without issue just think that in the future will have to manage that 
somehow. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-17 Thread YolandaMDavis
Github user YolandaMDavis commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r63613822
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-transform-json-ui/src/main/webapp/app/components/processor/processor.service.js
 ---
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+'use strict';
+
+angular.module('standardUI').factory('ProcessorService', function 
ProcessorService($http) {
--- End diff --

@scottyaslan thanks you'll see the annotations on the next update


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-16 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r63453123
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/processor/ProcessorResource.java
 ---
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nifi.web.standard.api.processor;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.nifi.web.ComponentDetails;
+import org.apache.nifi.web.ComponentDescriptor;
+import org.apache.nifi.web.NiFiWebConfigurationContext;
+
+import org.apache.nifi.web.NiFiWebConfigurationRequestContext;
+import org.apache.nifi.web.standard.api.AbstractStandardResource;
+import org.apache.nifi.web.util.CustomUIUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Path("/standard/processor")
+public class ProcessorResource extends AbstractStandardResource {
+
+private static final Logger logger = 
LoggerFactory.getLogger(ProcessorResource.class);
+
+@GET
+@Produces({MediaType.APPLICATION_JSON})
+@Path("/properties")
+public Response getProperties(@QueryParam("processorId") final String 
processorId) {
+final NiFiWebConfigurationContext nifiWebContext = 
getWebConfigurationContext();
+final ComponentDetails componentDetails = 
CustomUIUtils.getComponentDetails(nifiWebContext, processorId, request);
+final Response.ResponseBuilder response = 
CustomUIUtils.applyCacheControl(Response.ok(componentDetails.getProperties()));
+return response.build();
+}
+
+@GET
+@Produces({MediaType.APPLICATION_JSON})
+@Path("/type")
+public Response getType(@QueryParam("processorId") final String 
processorId) {
+final NiFiWebConfigurationContext nifiWebContext = 
getWebConfigurationContext();
+final ComponentDetails componentDetails = 
CustomUIUtils.getComponentDetails(nifiWebContext, processorId, request);
+final Response.ResponseBuilder response = 
CustomUIUtils.applyCacheControl(Response.ok(componentDetails.getType()));
+return response.build();
+}
+
+@GET
+@Produces({MediaType.APPLICATION_JSON})
+@Path("/descriptors")
+public Response getDescriptors(@QueryParam("processorId") final String 
processorId) {
+final NiFiWebConfigurationContext nifiWebContext = 
getWebConfigurationContext();
+final ComponentDetails componentDetails = 
CustomUIUtils.getComponentDetails(nifiWebContext, processorId, request);
+final Map descriptors = 
componentDetails.getDescriptors();
+final Response.ResponseBuilder response = 
CustomUIUtils.applyCacheControl(Response.ok(descriptors));
+return response.build();
+}
+
+@GET
+@Produces({MediaType.APPLICATION_JSON})
+@Path("/details")
+public Response getDetails(@QueryParam("processorId") final String 
processorId) {
+final NiFiWebConfigurationContext nifiWebContext = 
getWebConfigurationContext();
+final ComponentDetails componentDetails = 
CustomUIUtils.getComponentDetails(nifiWebContext, processorId, request);
+final Response.ResponseBuilder response = 
CustomUIUtils.applyCacheControl(Response.ok(componentDetails));
+return response.build();
+}
+
+@POST
--- End diff --

Is this endpoint creating a single new property? Or is it updating the 
specified processor's properties with those listing? Assuming the latter, this 
should probably be a PUT.


---
If your project is set up for it, you can reply to this email and have your
reply appear on 

[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-16 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r63452681
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 ---
@@ -1670,6 +1670,49 @@ public ProcessorDTO getConfiguration() {
 }
 
 @Override
+public ConfigurationSnapshot 
setProcessorProperties(final Revision revision, final String processorId, final 
Map properties) {
--- End diff --

I think it may make sense to just use updateProcessor(...) instead 
introducing setProcessorProperties(...). We should probably even get rid of 
setProcessorAnnotationData(...) in favor of updateProcessor(...). In earlier 
version of NiFi, these values were setting differently which is why there was 
two different method. However, now I think we can consolidate these.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-11 Thread scottyaslan
Github user scottyaslan commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r62881828
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-transform-json-ui/src/main/webapp/app/transformjson/transformjson.controller.js
 ---
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+'use strict';
+
+angular.module('standardUI')
+.controller('TransformJsonController', function ($scope, $state, $q, 
TransformJsonService, ProcessorService) {
--- End diff --

Please annotate


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-11 Thread scottyaslan
Github user scottyaslan commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r62881783
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-transform-json-ui/src/main/webapp/app/main/main.controller.js
 ---
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+'use strict';
+
+angular.module('standardUI')
+.controller('MainController', function ($scope, $state, 
ProcessorService) {
--- End diff --

Please annotate


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-11 Thread scottyaslan
Github user scottyaslan commented on a diff in the pull request:

https://github.com/apache/nifi/pull/424#discussion_r62866557
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-transform-json-ui/src/main/webapp/app/components/processor/processor.service.js
 ---
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+'use strict';
+
+angular.module('standardUI').factory('ProcessorService', function 
ProcessorService($http) {
--- End diff --

Angular invokes certain functions (like service factories and controllers) 
via the injector. You need to annotate these functions so that the injector 
knows what services to inject into the function. Here you have chosen to do so 
implicitly... If you plan to minify your code and have used implicit 
annotations then your service names will get renamed and your angular app will 
be broken. To allow the minifiers to rename the function parameters and still 
be able to inject the right services, the function needs to be annotated with 
the $inject property. You can read more about it here: 
https://docs.angularjs.org/guide/di 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1850 - Initial Commit for JSON-to-JSON Sch...

2016-05-09 Thread YolandaMDavis
GitHub user YolandaMDavis opened a pull request:

https://github.com/apache/nifi/pull/424

NIFI-1850 - Initial Commit for JSON-to-JSON Schema Converter Editor

This is an initial commit for review of the TransformJson Advanced Editor. 
Please see https://issues.apache.org/jira/browse/NIFI-1850 for details.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/YolandaMDavis/nifi NIFI-1850-0.x

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/424.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #424


commit 9d0b2efdcddb9e629e64067a5266df44ee8eb06c
Author: Yolanda M. Davis 
Date:   2016-05-09T12:20:10Z

NIFI-1850 - Initial Commit for JSON-to-JSON Schema Converter Editor
(cherry picked from commit 2f7a95a)




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---