TECHZEN Zenoss User Community ARCHIVE  

Zenoss 4.2.5 - Problems adding into Menu

Subject: Zenoss 4.2.5 - Problems adding into Menu
Author: Pheripheral Pheripheral
Posted: 2016-04-05 12:39

Problems / lack of knowledge in adding into the Zenoss primary and secondary Menus and GUI

Im attempting to add some new menu items in Zenoss 4.2.5 with the ultimate aim of having them simply call some URLs Ive patched on to the ZentinelPortal to run various functions in my ZenPack that process some XML files. E.g. zenoss:8080/zport/dmd/testMe

Calling the URL manually works fine and my zenpack functionality is working ok outside of my GUI problems. It returns the expected test results from my testMe method.

With the GUI, Ive managed to add a new primary menu item and a secondary item below it via adding some

The idea being that the secondary menu item will link to the URL I wish to call and the primary menu simply brings up the secondary menu and maybe show a simple info page or even blank page below the menus.

Where Im getting stuck is two fold really:

  1. Knowing how to add a fairly blank simple page to the zenpack / zenoss so that I can select the primary item menu and thus displays the secondary menu item
  2. Once I call the URL via the secondary menu, again how to take the return results from the url call and display it on the screen in a simple page / panel and still have the menu remain on the screen

At the moment when I click the url it simply displays the return results in its own full window without the zenoss menus.

The documentation and helpful papers out there go into lots of details on adding device component panels and other in depth features of Zenoss but Im struggling to work out how to do what (in theory! I think) is much simpler.

Any help or pointers in the right direction appreciated.



Subject: Update:
Author: Pheripheral Pheripheral
Posted: 2016-04-06 07:28

Update:

I'm now getting somewhere with this (i think):

Have added a browser:page stanzain the configure.zcml that points to a BrowserView class i've created.


ThisbrowserView class then points to the .pt template file.

class ConfigMainView(BrowserView):
"""
"""
__call__ = ZopeTwoPageTemplateFile('../skins/ZenPacks.SI.Config/configMain.pt')

This template file imports the base_new macro to provide the common look and feel elemnts - i.e. the navigation bar and footer bar.





test output

I've then put my content in the center_panel_contentslot whichgets pulled into the base-new template

Just having trouble at the moment getting my content to actually appear visible on the page (i can see it in the source of the page,... but all I get is a placholder for center_panel at the moment



Subject: Another Update!:
Author: Pheripheral Pheripheral
Posted: 2016-04-06 10:21

Another Update!:

The problem with getting the content to display was due to the base-new template using the 'script_layout' slot with the assumption that you'll use it to add in javascript to add some displaypanels to home your content rather than simply passing some basic output into the 'center_panel_content' slot.The various existing zenoss pages seem to use this and then link off to vaiorus javascript files that set up the actual page panels for the various pages.

...So my center_panel_content was being added in the div='center' but it was then being hidden by further divs generated by the Ext panel stuff, namely a div confusingly called 'center_panel', even though the slot center_apenl_content actually puts that content in a div called 'center'


As a quick and dirty solution at the moment Iadded a bit of javascript into the script_layout slot to simply hide the offending 'center_panel'div that was covering my content and now at least my text is displaying ok.

If anyone has any advice on a simple panel method to just display some text or any simpleexamples buried in the senoss code to take a look at to leaarn more on the panel setup etc.. then please let me know.

Thanks



Subject: Simple panel with text
Author: [Not Specified]
Posted: 2016-06-20 03:01

Hi!

Here is code sample with simple panel added to component.

It used to display text received from router.

https://github.com/zenoss/ZenPacks.zenoss.Layer2/commit/9dc472f76da5a8626f9a3c5e12098d00556d5ba3#diff-c7be05ae5d051b340c63c2e0ece24b5eR32

V.



Subject: Feel free to have a look at
Author: Jane Curry
Posted: 2016-06-22 09:02

Feel free to have a look at my MenuExamples ZenPack at https://github.com/ZenossDevGuide/ZenPacks.community.MenuExamples

It doesn't do exactly what you want but hopefully will give you more clues.

Cheers,

Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



< Previous
Multiple Device Classes and Properties in zenpack.yaml?
  Next
How to use DRBD Monitoring ZenPack?
>