Grouping buttons in Hippo CMS

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Grouping buttons in Hippo CMS

sammy
I have added two button using wicket:id and added worflow action for both of them.

The buttons appear but not grouped together.

Please guide me on how to group them.

P.S: I have tried various ways and followed comments in my previous thread. I was not successful
in those attempts.
You can refer this topic to have an idea of my attempts - http://hippo.2275632.n2.nabble.com/Adding-a-button-hippo-cms-td7579745.html
Sameera Thangudu
130 W 42nd Street | New York, NY 10036
sthangudu@northps.com | www.northps.com | WE LEAD WITH EXPERIENCE.
Reply | Threaded
Open this post in threaded view
|

Re: Grouping buttons in Hippo CMS

Frank van Lankvelt
could you give some detail on this last attempt?
If the two buttons are defined in the same plugin, the name of the
category will be shown in the bar as a button that expands to a menu.

Since your buttons are not grouped, are you using multiple workflow categories?

cheers, Frank

On Thu, Jan 31, 2013 at 6:51 PM, sammy <[hidden email]> wrote:

> I have added two button using wicket:id and added worflow action for both of
> them.
>
> The buttons appear but not grouped together.
>
> Please guide me on how to group them.
>
> P.S: I have tried various ways and followed comments in my previous thread.
> I was not successful
> in those attempts.
> You can refer this topic to have an idea of my attempts -
> http://hippo.2275632.n2.nabble.com/Adding-a-button-hippo-cms-td7579745.html
>
>
>
> -----
> Sameera Thangudu
> 130 W 42nd Street | New York, NY 10036
> [hidden email] | www.northps.com | WE LEAD WITH EXPERIENCE.
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/Grouping-buttons-in-Hippo-CMS-tp7580297.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Grouping buttons in Hippo CMS

sammy
Both the buttons are defined in the same plugin as  -

<html xmlns:wicket="http://wicket.apache.org/">
  <wicket:panel>
    <div wicket:id="publishtomobex">[ WORKFLOW ]</div>
    <div wicket:id="takeoffline">[ WORKFLOW ]</div> 
  </wicket:panel>
</html>


And I attached workflow-action this way -

public class MobexPublishActionsWorkflowPlugin extends CompatibilityWorkflowPlugin<MobexPublishActionsWorkflow> {
        private WorkflowAction mobexPublishAction;
    private WorkflowAction mobexUnpublishAction;

    public MobexPublishActionsWorkflowPlugin(IPluginContext context, IPluginConfig config) {
        super(context, config);
       
        add(mobexPublishAction = new WorkflowAction("publishtomobex", "Publish to Mobex", null) {

            @Override
            protected ResourceReference getIcon() {
                return new ResourceReference(getClass(), "m.png");
            }

            @Override
            protected String execute(MobexPublishActionsWorkflow workflow) {
                    workflow.publishToMobex();
                    return null;
            }
        });

        add(mobexUnpublishAction = new WorkflowAction("takeoffline", "Unpublish from Mobex", null) {

            @Override
            protected ResourceReference getIcon() {
                return new ResourceReference(getClass(), "m.png");
            }

            @Override
            protected String execute(MobexPublishActionsWorkflow workflow) {
                    workflow.takeOffline();
                    return null;
            }
        });

    }
   
    @Override
    protected void onModelChanged() {
        super.onModelChanged();
        try {
            WorkflowManager manager = ((UserSession) org.apache.wicket.Session.get()).getWorkflowManager();
            WorkflowDescriptor workflowDescriptor = (WorkflowDescriptor) getDefaultModelObject();
            if (workflowDescriptor != null) {
                Workflow workflow = manager.getWorkflow(workflowDescriptor);
                Map<String, Serializable> info = workflow.hints();

                if (info.containsKey("depublish") && info.get("depublish") instanceof Boolean && !((Boolean) info.get("depublish")).booleanValue()) {
                    mobexPublishAction.setVisible(false);
                    mobexUnpublishAction.setVisible(false);
                }

            }
        } catch (RepositoryException ex) {
            ex.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        } catch (WorkflowException e) {
            e.printStackTrace();
        }
    }
}

Where should the name of the category be defined ?

These buttons are defined under workflow category - "custom" in localhost/cms/console.


Frank van Lankvelt wrote
could you give some detail on this last attempt?
If the two buttons are defined in the same plugin, the name of the
category will be shown in the bar as a button that expands to a menu.

Since your buttons are not grouped, are you using multiple workflow categories?

cheers, Frank

On Thu, Jan 31, 2013 at 6:51 PM, sammy <[hidden email]> wrote:
> I have added two button using wicket:id and added worflow action for both of
> them.
>
> The buttons appear but not grouped together.
>
> Please guide me on how to group them.
>
> P.S: I have tried various ways and followed comments in my previous thread.
> I was not successful
> in those attempts.
> You can refer this topic to have an idea of my attempts -
> http://hippo.2275632.n2.nabble.com/Adding-a-button-hippo-cms-td7579745.html
>
>
>
> -----
> Sameera Thangudu
> 130 W 42nd Street | New York, NY 10036
> [hidden email] | www.northps.com | WE LEAD WITH EXPERIENCE.
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/Grouping-buttons-in-Hippo-CMS-tp7580297.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Sameera Thangudu
130 W 42nd Street | New York, NY 10036
sthangudu@northps.com | www.northps.com | WE LEAD WITH EXPERIENCE.
Reply | Threaded
Open this post in threaded view
|

Re: Grouping buttons in Hippo CMS

sammy
Here is my xml fil for custom workflow -

<?xml version="1.0" encoding="UTF-8"?>
<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="custom">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>hipposys:workflowcategory</sv:value>
  </sv:property>
  <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
    <sv:value>hippo:translated</sv:value>
  </sv:property>
  <sv:node sv:name="mobex">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>frontend:workflow</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:classname" sv:type="String">
      <sv:value>com.nps.code.MobexPublishActionsWorkflowImpl</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:display" sv:type="String">
      <sv:value>Mobex workflow</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:nodetype" sv:type="String">
      <sv:value>hippostdpubwf:document</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:privileges" sv:type="String" sv:multiple="true">
      <sv:value>hippo:editor</sv:value>
    </sv:property>
    <sv:node sv:name="hipposys:types">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hipposys:types</sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="frontend:renderer">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>frontend:plugin</sv:value>
      </sv:property>
      <sv:property sv:name="plugin.class" sv:type="String">
        <sv:value>com.nps.code.MobexPublishActionsWorkflowPlugin</sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
  <sv:node sv:name="hippo:translation">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hippo:translation</sv:value>
    </sv:property>
    </sv:property>
    <sv:property sv:name="hippo:language" sv:type="String">
      <sv:value>en</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:message" sv:type="String">
      <sv:value>MobexButton</sv:value>
    </sv:property>
  </sv:node>
</sv:node>
Sameera Thangudu
130 W 42nd Street | New York, NY 10036
sthangudu@northps.com | www.northps.com | WE LEAD WITH EXPERIENCE.
Reply | Threaded
Open this post in threaded view
|

Re: Grouping buttons in Hippo CMS

Frank van Lankvelt
In reply to this post by sammy
On Fri, Feb 1, 2013 at 3:52 PM, sammy <[hidden email]> wrote:

> Both the buttons are defined in the same plugin as  -
>
> /<html xmlns:wicket="http://wicket.apache.org/">
>   <wicket:panel>
>     <div wicket:id="publishtomobex">[ WORKFLOW ]</div>
>     <div wicket:id="takeoffline">[ WORKFLOW ]</div>
>   </wicket:panel>
> </html>/
>
> And I attached workflow-action this way -
>
> public class MobexPublishActionsWorkflowPlugin extends
> CompatibilityWorkflowPlugin<MobexPublishActionsWorkflow> {
>         private WorkflowAction mobexPublishAction;
>     private WorkflowAction mobexUnpublishAction;
>
>     public MobexPublishActionsWorkflowPlugin(IPluginContext context,
> IPluginConfig config) {
>         super(context, config);
>
>         add(mobexPublishAction = new WorkflowAction("publishtomobex",
> "Publish to Mobex", null) {
>
>             @Override
>             protected ResourceReference getIcon() {
>                 return new ResourceReference(getClass(), "m.png");
>             }
>
>             @Override
>             protected String execute(MobexPublishActionsWorkflow workflow) {
>                     workflow.publishToMobex();
>                     return null;
>             }
>         });
>
>         add(mobexUnpublishAction = new WorkflowAction("takeoffline",
> "Unpublish from Mobex", null) {
>
>             @Override
>             protected ResourceReference getIcon() {
>                 return new ResourceReference(getClass(), "m.png");
>             }
>
>             @Override
>             protected String execute(MobexPublishActionsWorkflow workflow) {
>                     workflow.takeOffline();
>                     return null;
>             }
>         });
>
>     }
>
>     @Override
>     protected void onModelChanged() {
>         super.onModelChanged();
>         try {
>             WorkflowManager manager = ((UserSession)
> org.apache.wicket.Session.get()).getWorkflowManager();
>             WorkflowDescriptor workflowDescriptor = (WorkflowDescriptor)
> getDefaultModelObject();
>             if (workflowDescriptor != null) {
>                 Workflow workflow = manager.getWorkflow(workflowDescriptor);
>                 Map<String, Serializable> info = workflow.hints();
>
>                 if (info.containsKey("depublish") && info.get("depublish")
> instanceof Boolean && !((Boolean) info.get("depublish")).booleanValue()) {
>                     mobexPublishAction.setVisible(false);
>                     mobexUnpublishAction.setVisible(false);
>                 }
>
>             }
>         } catch (RepositoryException ex) {
>             ex.printStackTrace();
>         } catch (RemoteException e) {
>             e.printStackTrace();
>         } catch (WorkflowException e) {
>             e.printStackTrace();
>         }
>     }
> }
>
> Where should the name of the category be defined ?
>
> These buttons are defined under workflow category - "custom" in
> localhost/cms/console.
>
>
I think you're doing everything correctly, but (looking at the
responsible MenuHierarchy code) the 'custom' category is treated
different from other (actual custom) categories.

What you can do is move the workflow configuration to a new category,
say 'mobex'.  Then, in the nodes
  /hippo:configuration/hippo:frontend/{cms-preview,cms-compare}/workflowPlugin
the property 'workflow.categories' should include this name (i.e. 'mobex').

The 'mobex' category will not be recognized by the menu-hierarchy and
it will be treated like other additional categories.

Almost there.

cheers, Frank

>
> Frank van Lankvelt wrote
>> could you give some detail on this last attempt?
>> If the two buttons are defined in the same plugin, the name of the
>> category will be shown in the bar as a button that expands to a menu.
>>
>> Since your buttons are not grouped, are you using multiple workflow
>> categories?
>>
>> cheers, Frank
>>
>> On Thu, Jan 31, 2013 at 6:51 PM, sammy &lt;
>
>> sameera.tangudu@
>
>> &gt; wrote:
>>> I have added two button using wicket:id and added worflow action for both
>>> of
>>> them.
>>>
>>> The buttons appear but not grouped together.
>>>
>>> Please guide me on how to group them.
>>>
>>> P.S: I have tried various ways and followed comments in my previous
>>> thread.
>>> I was not successful
>>> in those attempts.
>>> You can refer this topic to have an idea of my attempts -
>>> http://hippo.2275632.n2.nabble.com/Adding-a-button-hippo-cms-td7579745.html
>>>
>>>
>>>
>>> -----
>>> Sameera Thangudu
>>> 130 W 42nd Street | New York, NY 10036
>>>
>
>> sthangudu@
>
>>  | www.northps.com | WE LEAD WITH EXPERIENCE.
>>> --
>>> View this message in context:
>>> http://hippo.2275632.n2.nabble.com/Grouping-buttons-in-Hippo-CMS-tp7580297.html
>>> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Hippo-cms7-user mailing list and forums
>>> http://www.onehippo.org/cms7/support/forums.html
>>
>>
>>
>> --
>> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
>> Boston - 1 Broadway, Cambridge, MA 02142
>>
>> US +1 877 414 4776 (toll free)
>> Europe +31(0)20 522 4466
>> www.onehippo.com
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/forums.html
>
>
>
>
>
> -----
> Sameera Thangudu
> 130 W 42nd Street | New York, NY 10036
> [hidden email] | www.northps.com | WE LEAD WITH EXPERIENCE.
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/Grouping-buttons-in-Hippo-CMS-tp7580297p7580303.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Grouping buttons in Hippo CMS

sammy
Thanks Frank. Adding a new workflow category did the magic.

Sameera Thangudu
130 W 42nd Street | New York, NY 10036
sthangudu@northps.com | www.northps.com | WE LEAD WITH EXPERIENCE.