Trigger to publish a publish set when an asset is created

csaladores's Avatar

csaladores

23 Feb, 2015 08:31 PM

Hi,

Is there a way to trigger a publish set when an asset is created? For example, we created events block that are used from related pages. After we create an event, we want to trigger to publish a publish for all related pages after creating. Is this possible?

Thanks.

Christian

  1. 1 Posted by Ryan Griffith on 23 Feb, 2015 09:09 PM

    Ryan Griffith's Avatar

    Hi Christian,

    You may be able to use a custom Asset Factory plugin for this. In theory, you would add your custom plugin to the desired asset (ie event page) and, upon creation, you would publish a specified publish set. Let me do some testing to see if this is doable and I will be in touch as soon as I have additional information.

    In the meantime, I hope you don't mind I made this discussion public to see if any of our clients have implemented something similar already.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by csaladores on 23 Feb, 2015 09:37 PM

    csaladores's Avatar

    Great, thanks Ryan. Not at all.

    Christian

  3. 3 Posted by Ryan Griffith on 24 Feb, 2015 08:02 PM

    Ryan Griffith's Avatar

    Hi Christian,

    Good news, I was able to come up with a pretty simple Asset Factory plugin where you provide the ID of a Publish Set and when a user creates the asset it will publish that Publish Set.

    One snag I hit is that you can't perform a publish operation using a system user, so the assumption I made was you will attempt to publish the Publish Set using the user creating the asset. You could easily change that to a static value that is some "script" account that has administrative rights.

    Let me know if you would like the compiled version of the plugin, or if you would like the source code, which I added to our existing Asset Factory plugins project.

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by csaladores on 24 Feb, 2015 08:06 PM

    csaladores's Avatar

    This is awesome Ryan. I can try to compile the version of the plugin.

  5. 5 Posted by Ryan Griffith on 24 Feb, 2015 08:17 PM

    Ryan Griffith's Avatar

    Sounds good, Christian.

    The Asset Factory plugins repository is an Eclipse project that uses Maven for compiling, once you're environment is set up it's really simple.

    I've attached the Java class and the properties files you can drop in to the project. The Java file would be placed into the src/com/hannonhill/cascade/plugin/assetfactory directory and add the contents of the properties file to the properties file in src/resources/customer.properties.

    Note: Feel free to remove the existing plugins if you don't need them; otherwise, they'll be bundled into the jar file that is generated when you build the project.

    Once you have the compiled jar file, drop it into tomcat/webapps/ROOT/WEB-INF/lib and restart Cascade Server. Then register the Asset Factory plugin by going to the Global area's Administration -> Asset Factories -> Manage Plugins section and add the full class path.

    Now that the plugin has been registered, add it to your desired Asset Factory(ies) and specify the Publish Set's ID in the parameter field.

    Please let me know if you have any questions.

    Thanks!

  6. 6 Posted by csaladores on 24 Feb, 2015 08:19 PM

    csaladores's Avatar

    Ok, I’ll give this a shot. Thanks Ryan. Will let you know if I have any questions.

    Christian

  7. 7 Posted by Ryan Griffith on 24 Feb, 2015 08:21 PM

    Ryan Griffith's Avatar

    Not a problem at all, Christian. Keep me posted on how things go.

    Have a great day!

  8. 8 Posted by csaladores on 24 Feb, 2015 08:22 PM

    csaladores's Avatar

    Will do. You too. Thanks Ryan.

  9. Ryan Griffith closed this discussion on 05 Mar, 2015 07:54 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac