Package elisa :: Package plugins :: Package bad :: Package xmlmenu :: Package xmlmenu_components :: Module menu_entry_builder :: Class MenuEntryBuilder
[hide private]
[frames] | no frames]

Class MenuEntryBuilder




Create elisa.core.base_components.model.Model for specific MenuEntry XML tags.

Nested Classes [hide private]

Inherited from core.component.Component: __metaclass__

Instance Methods [hide private]
 
_make_config(self, node, default)
Read the configuration node and return a new ModelConfig, that contains the configuration for this subpart.
 
_make_label(self, label_tag)
make a label out of the label_tag.
 
_set_icon(self, model, icon_tag, fallback='frontend')
Set the icon on the model according to the icon_tag
twisted.internet.defer.Deferred
build_menu_entry(self, parent, xml_node)
Fills in parent with models created from the XML description xml_node.
 
menu_entry_identifiers__get(self)

Inherited from core.component.Component: __init__, clean, initialize, load_config, save_config

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods [hide private]

Inherited from core.component.Component: __classinit__

Class Variables [hide private]
string name = 'menu_entry_builder'
Component's name

Inherited from core.component.Component: checked, config_doc, default_config, id, plugin

Inherited from extern.log.log.Loggable: logCategory

Instance Variables [hide private]
elisa.core.base_components.activity.Activity activity
activity which instantiated self
  menu_entry_identifiers
MenuEntry identifiers it can handle; in the XML it is the attribute 'type' of the 'MenuEntry' tags
weakref.WeakKeyDirectory model_configs
the cache of the models.

Inherited from core.component.Component: config, path

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_make_config(self, node, default)

 
Read the configuration node and return a new ModelConfig, that contains the configuration for this subpart. This is a mix of the default configuration it got and the new it read. The new ones are priorized.

_make_label(self, label_tag)

 
make a label out of the label_tag. The return is something that can be used in in the menu_node_model-label directly

build_menu_entry(self, parent, xml_node)

 

Fills in parent with models created from the XML description xml_node.

If the created models have an attribute 'xml_tag' containing a cElementTree, the activity is trying to find a suitable menu_component for its children again at loadmore. Don't forget that in that case the models needs to be marked as having children.
Parameters:
Returns: twisted.internet.defer.Deferred
the callback of this Deferred is a list of the created models

Instance Variable Details [hide private]

menu_entry_identifiers

MenuEntry identifiers it can handle; in the XML it is the attribute 'type' of the 'MenuEntry' tags
Get Method:
elisa.plugins.bad.xmlmenu.xmlmenu_components.menu_entry_builder.MenuEntryBuilder.menu_entry_identifiers__get(self)
Set Method:
'frontend'
Delete Method:
'frontend'

model_configs

the cache of the models. each model should be referenced there with a key
Type:
weakref.WeakKeyDirectory