Skip to Content
author's profile photo Former Member
Former Member

Create and register new perspective in CMScockpit using yacceleratorcockpits

I have to add a new perspective in CMScockpit for a custom item type, I have followed below steps:

1) modulegen to generate accelerator extensions.

2) Followed https://wiki.hybris.com/display/release5/How+to+Create+and+Register+a+New+Perspective

3) Added xml file at location …usb2ccockpits\resources\usb2ccockpits\cmscockpit\spring\cmscockpit-messages-perspective.xml

4) Added step 3 file entry into import.xml file.

5) Content of cmscockpit-messages-perspective.xml

 <bean id="MessagePerspective" scope="session" class="com.test.MessagePerspective" parent="BasePerspective">
     <property name="uid" value="CMSCockpit.perspective.Message" />
     <property name="label" value="perspective.MessagePerspective" />
     <property name="customCsaURI" value="/cockpit/messagePerspective.zul" />
     <property name="navigationArea">
         <ref bean="MessageNavigationArea" />
     </property>
     <property name="browserArea">
         <bean class="de.hybris.platform.cockpit.session.impl.DefaultSearchBrowserArea">
             <property name="rootSearchTypeCode" value="MessageItem"/>
             <property name="viewURI" value="/cockpit/baseSearchBrowserArea.zul"/>
         </bean>
     </property>
     <property name="editorArea">
         <bean id="MessageEditorAreaModel" parent="BaseEditorAreaModel">
             <property name="editorAreaController">
                 <ref bean="MessageEditorAreaController"/>
             </property>
         </bean>
     </property>
     <property name="popupEditorArea">
         <bean id="MessagePopupEditor" parent="BasePopupEditor">
             <property name="editorAreaController">
                 <ref bean="MessagePopupEditorAreaController"/>
             </property>
         </bean>
     </property>
     <property name="cockpitTypeService" ref="cockpitTypeService"/>
 </bean>

 <bean id="MessageNavigationArea" scope="session" parent="BaseNavigationArea">
     <property name="sectionModel">
         <bean class="de.hybris.platform.cockpit.components.navigationarea.DefaultNavigationAreaModel" scope="session" />
     </property>
     <property name="infoSlotRenderer">
         <bean class="de.hybris.platform.cockpit.components.navigationarea.renderer.InfoBoxRenderer"/>
     </property>
     <property name="sections">
         <list>
             <ref bean="MediaUndoSection" />
         </list>
     </property>
     <property name="cockpitTypeService" ref="cockpitTypeService"/>
 </bean>
 
 <bean id="MediaUndoSection" class="de.hybris.platform.cockpit.components.navigationarea.NavigationPanelSection" scope="prototype">
     <property name="localizedLabel" value="navigationarea.history" />
     <property name="visible" value="true" />
     <property name="renderer">
         <bean class="de.hybris.platform.cockpit.components.navigationarea.renderer.UndoSectionRenderer" />
     </property>
 </bean>
 
 <bean id="MessageEditorAreaController" class="de.hybris.platform.cockpit.session.impl.DefaultEditorAreaController" scope="session">
     <property name="sectionRowRenderer">
         <bean id="MessageEditorSectionRowRenderer" parent="EditorSectionRowRenderer"/>
     </property>
     <property name="editorFactory">
         <ref bean="EditorFactory"/>
     </property>
 </bean>    
 
 <bean id="MessagePopupEditorAreaController" class="com.test.MessagePopupEditorAreaControllerImpl" scope="prototype">
     <property name="sectionRowRenderer">
         <bean id="MessagePopupEditorSectionRowRenderer" parent="EditorSectionRowRenderer"/>
     </property>
     <property name="editorFactory">
         <ref bean="EditorFactory"/>
     </property>
 </bean>


 <!--#### Messages perspective end #### -->
 
 <bean id="UICockpitSession" class="de.hybris.platform.cockpit.session.impl.UISessionImpl"
     scope="session">
     <property name="initialSessionListeners">
         <list></list>
     </property>
     <property name="availablePerspectives">
         <list>
             <ref bean="CatalogPerspective" />
             <ref bean="LiveEditPerspective" />
             <ref bean="NavigationNodePerspective"/>
             <ref bean="MessagePerspective"/>
             <!-- uncomment the following line if you want to enable external applications 
                 e.g. hMC -->
             <!-- <ref bean="CmsExtAppPerspective"/> -->
             
             <!-- uncomment the following line if you want an administration perspective -->

         </list>
     </property>                
     <property name="cachePerspectivesEnabled" value="true" />
     <property name="requestHandler" ref="CMSRequestHandler" />
     <property name="dragOverPerspectivesEnabled" value="true" />
     <property name="cockpitTypeService" ref="cockpitTypeService" />
     <property name="sendEventsImmediately" value="false" />
     <property name="pushContainers">
         <list value-type="de.hybris.platform.cockpit.session.impl.PushCreationContainer">
             <ref bean="WorkflowPushContainer" />
         </list>
     </property>
 </bean>


Build and start the server. Tried on access http://localhost:9001/cmscockpit/ but not able to see newly added perspective. Nothing in server logs.

Let me know what I missed and where to look to resolve the issue.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2015 at 02:07 PM

    Have you tried running a system update and include project data for all the cockpit extensions?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 07, 2015 at 05:33 PM

    Hi,

    You may not be seeing the new perspective in the cmscockpit as your bean definition of "UICockpitSession" is not used. For example: If you have btgcockpit in your localextensions.xml, then btgcockpit's UICockpitSession bean overrides the one from cmscockpit. Hence, you see a new perspective "Customer Segments" (from btgcockpit) added to the views toggle.

    You could make your custom extension dependent on btgcockpit and redefine UICockpitSession bean to suit your needs. Hope this helps.

    Regards, Shwetha

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.