Ah cool, good to know, thanks Justin! That was indeed my problem with the thing 
that I wrote, I hate to have something this bloated in my pom.xml, but I find 
it too small to make an actual maven plugin for it

Greets,
Roy

> On 20 Dec 2017, at 14:47, Justin Edelson <[email protected]> wrote:
> 
> FWIW, it is possible to externalize that script into a file and then
> reference it as the source parameter. It's obviously a judgement call as to
> whether you put the script inline or in an external files, but the below
> would be enough lines of code for me to want to stick it in an external
> file :)
> 
> Justin
> 
> On Tue, Dec 19, 2017 at 5:40 PM Roy Teeuwen <[email protected]> wrote:
> 
>> Hey Jason,
>> 
>> Yup, thats what I got to at this point, maybe there was a cleaner way, but
>> I guess this will do :)
>> 
>> Just for ppl for future references, this is my final result (pretty long,
>> thats why I was looking for something less bulky, but could always make a
>> separate plugin if necessary
>> 
>> <plugin>
>>    <groupId>org.codehaus.groovy.maven</groupId>
>>    <artifactId>gmaven-plugin</artifactId>
>>    <executions>
>>        <execution>
>>            <id>disable-dam-workflows</id>
>>            <phase>pre-integration-test</phase>
>>            <goals>
>>                <goal>execute</goal>
>>            </goals>
>>            <configuration>
>>                <source><![CDATA[
>>                    import groovyx.net.http.HTTPBuilder
>>                    import static groovyx.net.http.Method.POST
>>                    import static groovyx.net.http.ContentType.*
>> 
>>                    def setWorkflowEnabled(String resourcePath, Object 
>> propertyValue) {
>>                        println "Setting path=${resourcePath} enabled 
>> property to value=${propertyValue}"
>> 
>>                        String url = 
>> "${cq.protocol}://${cq.user}:${cq.password}@${cq.host}:${cq.port}${cq.context_root}${resourcePath}"
>> 
>>                        println url
>>                        def http = new HTTPBuilder(url)
>> 
>>                        http.request(POST) {
>>                            requestContentType = URLENC
>>                            body = [enabled: "${propertyValue}", 
>> "enabled@TypeHint": "Boolean"]
>> 
>>                            response.success = { resp ->
>>                                println "POST response status: 
>> ${resp.statusLine}"
>>                                assert resp.statusLine.statusCode == 200
>>                            }
>>                        }
>>                    }
>> 
>>                    println "Disabling dam asset workflows"
>> 
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/dam_xmp_writeback", false)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_create", 
>> false)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_create_without_DM",
>>  false)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_mod", false)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_mod_without_DM",
>>  false)
>>                    ]]></source>
>>            </configuration>
>>        </execution>
>>        <execution>
>>            <id>enable-dam-workflows</id>
>>            <phase>post-integration-test</phase>
>>            <goals>
>>                <goal>execute</goal>
>>            </goals>
>>            <configuration>
>>                <source><![CDATA[
>>                    import groovyx.net.http.HTTPBuilder
>>                    import static groovyx.net.http.Method.POST
>>                    import static groovyx.net.http.ContentType.*
>> 
>>                    def setWorkflowEnabled(String resourcePath, Object 
>> propertyValue) {
>>                        println "Setting path=${resourcePath} enabled 
>> property to value=${propertyValue}"
>> 
>>                        String url = 
>> "${cq.protocol}://${cq.user}:${cq.password}@${cq.host}:${cq.port}${cq.context_root}${resourcePath}"
>> 
>>                        println url
>>                        def http = new HTTPBuilder(url)
>> 
>>                        http.request(POST) {
>>                            requestContentType = URLENC
>>                            body = [enabled: "${propertyValue}", 
>> "enabled@TypeHint": "Boolean"]
>> 
>>                            response.success = { resp ->
>>                                println "POST response status: 
>> ${resp.statusLine}"
>>                                assert resp.statusLine.statusCode == 200
>>                            }
>>                        }
>>                    }
>> 
>>                    println "Enabling dam asset workflows"
>> 
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/dam_xmp_writeback", true)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_create", true)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_create_without_DM",
>>  true)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_mod", true)
>>                    
>> setWorkflowEnabled("/etc/workflow/launcher/config/update_asset_mod_without_DM",
>>  true)
>>                    ]]></source>
>>            </configuration>
>>        </execution>
>>    </executions>
>> 
>> Greets,
>> Roy
>> 
>> On 19 Dec 2017, at 23:32, Jason E Bailey <[email protected]> wrote:
>> 
>> Maybe something like maven exec or maven antrun to perform a curl command?
>> 
>> --
>> Jason
>> 
>> On Tue, Dec 19, 2017, at 1:04 PM, Roy Teeuwen wrote:
>> 
>> Hey all,
>> 
>> I am searching for the fastest way to set and delete a property on a
>> resource of a specific path. I could use the gmaven-plugin and write a
>> groovy script to do this, but maybe there is already someone with a
>> better plugin for this and I don't have to write an ugly script for it
>> in my pom.xml.
>> 
>> Just for the people who want to know what I want to achieve: I am
>> installing my content package with test content(filevault xmls) and
>> images inside, but before I want to install it, I would like to disable
>> a workflow (more specifically the update dam asset workflow) because the
>> renditions are already in the test-content and it slows down the system
>> because of the heavy workflow/jobs triggering.
>> 
>> Greets,
>> Roy
>> Email had 1 attachment:
>> + signature.asc
>> 1k (application/pgp-signature)
>> 
>> 
>> 

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to