[jira] [Created] (SLING-11391) Sling Pipes to support Output paramenter with hyphen

2022-06-13 Thread Mariia Lukianets (Jira)
Mariia Lukianets created SLING-11391:


 Summary: Sling Pipes to support Output paramenter with hyphen
 Key: SLING-11391
 URL: https://issues.apache.org/jira/browse/SLING-11391
 Project: Sling
  Issue Type: Improvement
  Components: pipes
Reporter: Mariia Lukianets


h4. Background

It's not possible to output a variable containing a hyphen, like 'api-type'.
{code:java}
pipe -u user:password \
-c \
-o apiType=content["api-type"] \
pipe.txt {code}
The 'apiType' will output empty value and in the logs pipe writes an error
{code:java}
Caused by: org.apache.commons.jexl3.JexlException$Variable: 
org.apache.sling.pipes.internal.bindings.JxltEngine.parse@1:15 undefined 
variable api
    at 
org.apache.sling.pipes.internal.bindings.JxltEngine.parse(JxltEngine.java:41)
    at 
org.apache.sling.pipes.PipeBindings.internalEvaluate(PipeBindings.java:253)
    at org.apache.sling.pipes.PipeBindings.evaluate(PipeBindings.java:234)
    ... 162 common frames omitted {code}
 

According to the 
[docu|https://people.apache.org/~henrib/jexl-3.0/reference/syntax.html] "JEXL 
does not support variables with hyphens in them, e.g.". Seems like this is the 
cause for the issue.

[https://github.com/apache/sling-org-apache-sling-pipes/blob/master/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java#L661]
 

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Updated] (SLING-10846) Sling Pipes to write metadata on modified resources

2021-09-30 Thread Mariia Lukianets (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-10846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mariia Lukianets updated SLING-10846:
-
Description: 
h4. Background

Sling Pipes modify content without leaving a trace in the repository. 
Developers should have the ability to mark resources modified by the Sling 
Pipe. While modifying the resource, the 'Write' Sling pipe could also set 
metadata info indicating the time of modification and the author of the change.
 *Example*: pipe 'enable-foo' sets the property foo=true on nodeA.
 without metadata:
 nodeA 
     foo=true

with metadata: 
 nodeA 
     foo = true 
     jcr:lastModified = 2021-08-09T11:06:56.753+02:00 
     jcr:lastModifiedBy = sling-pipe-enable-foo
h4.  
h4. Suggestion

To add a 'metadata' flag to content modification pipes. When set to true, the 
pipe will set 2 properties on each modified resource:
 *  'jcr:lastModified' - current server's DateTime.
 * 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name}'

By default, the metadata flag is set to false and will do nothing.


Q1. should we make 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name} on behalf of 
${user}'?
 Q2. what other pipes to adapt

  was:
h4. Background

Sling Pipes modify content without leaving a trace in the repository. 
Developers should have the ability to mark resources modified by the Sling 
Pipe. While modifying the resource, 'Write' Sling pipe could also set a 
metadata info indicating the time of modification and the author of the change.
*Example*: pipe 'enable-foo' sets the property foo=true on nodeA.
without metadata:
nodeA 
    foo=true

with metadata: 
nodeA 
    foo = true 
    jcr:lastModified = 2021-08-09T11:06:56.753+02:00 
    jcr:lastModifiedBy = sling-pipe-enable-foo
h4. 
Suggestion

To add a 'metadata' flag to the write pipe. When set to true, write pipe will 
set 2 properties on each modified resource:* 'jcr:lastModified' -  current 
server's datetime.* 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name}'
By default, the metadata flag is set to false and will do nothing.

Q1. should we make 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name} on behalf of 
${user}'?
Q2. what other pipes to adapt


> Sling Pipes to write metadata on modified resources
> ---
>
> Key: SLING-10846
> URL: https://issues.apache.org/jira/browse/SLING-10846
> Project: Sling
>  Issue Type: Improvement
>Reporter: Mariia Lukianets
>Priority: Minor
>
> h4. Background
> Sling Pipes modify content without leaving a trace in the repository. 
> Developers should have the ability to mark resources modified by the Sling 
> Pipe. While modifying the resource, the 'Write' Sling pipe could also set 
> metadata info indicating the time of modification and the author of the 
> change.
>  *Example*: pipe 'enable-foo' sets the property foo=true on nodeA.
>  without metadata:
>  nodeA 
>      foo=true
> with metadata: 
>  nodeA 
>      foo = true 
>      jcr:lastModified = 2021-08-09T11:06:56.753+02:00 
>      jcr:lastModifiedBy = sling-pipe-enable-foo
> h4.  
> h4. Suggestion
> To add a 'metadata' flag to content modification pipes. When set to true, the 
> pipe will set 2 properties on each modified resource:
>  *  'jcr:lastModified' - current server's DateTime.
>  * 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name}'
> By default, the metadata flag is set to false and will do nothing.
> Q1. should we make 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name} on behalf 
> of ${user}'?
>  Q2. what other pipes to adapt



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (SLING-10846) Sling Pipes to write metadata on modified resources

2021-09-30 Thread Mariia Lukianets (Jira)
Mariia Lukianets created SLING-10846:


 Summary: Sling Pipes to write metadata on modified resources
 Key: SLING-10846
 URL: https://issues.apache.org/jira/browse/SLING-10846
 Project: Sling
  Issue Type: Improvement
Reporter: Mariia Lukianets


h4. Background

Sling Pipes modify content without leaving a trace in the repository. 
Developers should have the ability to mark resources modified by the Sling 
Pipe. While modifying the resource, 'Write' Sling pipe could also set a 
metadata info indicating the time of modification and the author of the change.
*Example*: pipe 'enable-foo' sets the property foo=true on nodeA.
without metadata:
nodeA 
    foo=true

with metadata: 
nodeA 
    foo = true 
    jcr:lastModified = 2021-08-09T11:06:56.753+02:00 
    jcr:lastModifiedBy = sling-pipe-enable-foo
h4. 
Suggestion

To add a 'metadata' flag to the write pipe. When set to true, write pipe will 
set 2 properties on each modified resource:* 'jcr:lastModified' -  current 
server's datetime.* 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name}'
By default, the metadata flag is set to false and will do nothing.

Q1. should we make 'jcr:lastModifiedBy' - 'sling-pipe-${pipe_name} on behalf of 
${user}'?
Q2. what other pipes to adapt



--
This message was sent by Atlassian Jira
(v8.3.4#803005)