diff --git a/Products/zms/conf/metacmd_manager/manage_css_classes/__init__.py b/Products/zms/conf/metacmd_manager/manage_css_classes/__init__.py new file mode 100644 index 000000000..681c35ff9 --- /dev/null +++ b/Products/zms/conf/metacmd_manager/manage_css_classes/__init__.py @@ -0,0 +1,51 @@ +class manage_css_classes: + """ + python-representation of manage_css_classes + """ + + # Acquired + acquired = 0 + + # Action + action = "%smanage_executeMetacmd?id=manage_css_classes" + + # Description + description = "" + + # Execution + execution = 0 + + # Icon_clazz + icon_clazz = "fab fa-css3 text-primary" + + # Id + id = "manage_css_classes" + + # Meta_types + meta_types = ["ZMSTextarea"] + + # Name + name = "CSS Specials" + + # Nodes + nodes = "{$}" + + # Package + package = "" + + # Revision + revision = "5.0.0" + + # Roles + roles = ["ZMSAdministrator"] + + # Stereotype + stereotype = "" + + # Title + title = "Add special CSS class names to object's internal_dict" + + # Impl + class Impl: + manage_css_classes = {"id":"manage_css_classes" + ,"type":"External Method"} diff --git a/Products/zms/import/manage_css_classes-1.0.0.metacmd.xml b/Products/zms/conf/metacmd_manager/manage_css_classes/manage_css_classes.py similarity index 51% rename from Products/zms/import/manage_css_classes-1.0.0.metacmd.xml rename to Products/zms/conf/metacmd_manager/manage_css_classes/manage_css_classes.py index b27b62f3f..bfe4145fb 100644 --- a/Products/zms/import/manage_css_classes-1.0.0.metacmd.xml +++ b/Products/zms/conf/metacmd_manager/manage_css_classes/manage_css_classes.py @@ -1,117 +1,90 @@ - - - - - - ' - html += '' - html += self.zmi_html_head(self,request) - html += ''%(' '.join(['zmi',request['lang'],'transition',self.meta_id])) - html += self.zmi_body_header(self,request,options=[{'action':'#','label':'CSS Classes'}]) - html += '
' - html += self.zmi_breadcrumbs(self,request) - html += '
' - html += '' - html += ''%request['lang'] - html += 'Add Special CSS Classes:' - - # --- Insert css_classes. - # --------------------------------- - if request.form.get('btn')==self.getZMILangStr('BTN_INSERT'): - message = [] - css_classes = request.get('css_classes',[]) - if css_classes: - set_css_classes(self,css_classes) - message.append('CSS classes added: %s'%(css_classes)) - else: - set_css_classes(self,[]) - message.append('No CSS classes added, existing CSS classes removed') - request.response.redirect(standard.url_append_params('%s/manage_main'%self.absolute_url(),{'lang':request['lang'],'manage_tabs_message':'
'.join(message)})) - - # --- Display initial insert form. - # --------------------------------- - else: - - # GENERATE CSS LIST (Example Code) - css_classes = self.getRootElement().getSecurityRoles().keys() - css_classes.extend(['ZMSAdministrator','ZMSEditor','ZMSAuthor','ZMSSubscriber','ZMSUserAdministrator']) - css_classes = [[str(r)+'_special',str(r)+'_special'] for x in css_classes] - # /GENERATE CSS LIST - - html += '
' - html += '
' - html += self.zmi_input_multiselect(self,name='css_classes',value=get_css_classes(self),lang_str='CSS Classes',options=css_classes) - html += '
' - html += '
' - html += '
' - html += '
' - html += ' '%(self.getZMILangStr('BTN_INSERT'),self.getZMILangStr('BTN_INSERT')) - html += ' '%(self.getZMILangStr('BTN_CANCEL'),self.getZMILangStr('BTN_CANCEL')) - html += '
' - html += '
' - - # --------------------------------- - - html += '
' - html += '
' - html += self.zmi_body_footer(self,request) - html += '' - html += '' - - return html]]> -
- - 0 - - - - - - - - - - - - - - - - -
-
-
\ No newline at end of file +# README ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# This ZMS action adds a list of strings to the ZMS multidict attribute named +# internal_dict. The list values may be rendered into element the elements html +# output as additional CSS classes: +# ----------------------------------------------------------------------------------- +# tal:attributes="class python:' '.join(zmscontext.attr('internal_dict').get('css_classes',[]))" +# ----------------------------------------------------------------------------------- +# This allows special GUI modifications of any individual ZMS object corresponding +# to the selected class values. The example code uses the list of ZMS roles for +# specific class names. You can change the code to other name lists fitting to your needs. +# Hint: You can use the function get_css_classes() to add the css classes to +# the third view templates (standard_html) +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +def get_css_classes(ob): + internal_dict = ob.attr('internal_dict') + css_classes = internal_dict.get('css_classes',[]) + return (css_classes) + +def set_css_classes(ob,css_classes): + internal_dict = ob.attr('internal_dict') + internal_dict['css_classes'] = css_classes + ob.setObjStateModified(ob.REQUEST) + ob.setObjProperty('internal_dict',internal_dict) + ob.onChangeObj(ob.REQUEST) + # Workflow: Auto-Commit + ob.commitObj(ob.REQUEST) + # return ob.attr('internal_dict')['css_classes'] + return True + + +def manage_css_classes(self): + request = self.REQUEST + html = '' + html += '' + html += '' + html += self.zmi_html_head(self,request) + html += ''%(' '.join(['zmi',request['lang'],'transition',self.meta_id])) + html += self.zmi_body_header(self,request,options=[{'action':'#','label':'CSS Classes'}]) + html += '
' + html += self.zmi_breadcrumbs(self,request) + html += '
' + html += '' + html += ''%request['lang'] + html += 'Add Special CSS Classes:' + + # --- Insert css_classes. + # --------------------------------- + if request.form.get('btn')=='BTN_INSERT': + message = [] + css_classes = request.get('css_classes',[]) + if css_classes: + set_css_classes(self,css_classes) + message.append('CSS classes added: %s'%(css_classes)) + else: + set_css_classes(self,[]) + message.append('No CSS classes added, existing CSS classes removed') + request.response.redirect(self.url_append_params('%s/manage_main'%self.absolute_url(),{'lang':request['lang'],'manage_tabs_message':'
'.join(message)})) + + # --- Display initial insert form. + # --------------------------------- + else: + + # GENERATE CSS LIST (Example Code) + css_classes = list(self.getRootElement().getSecurityRoles().keys()) + css_classes.extend(['ZMSAdministrator','ZMSEditor','ZMSAuthor','ZMSSubscriber','ZMSUserAdministrator']) + css_classes = map(lambda r: [str(r)+'_special',str(r)+'_special'],css_classes) + # /GENERATE CSS LIST + + html += '
' + html += '
' + html += self.zmi_input_multiselect(self,name='css_classes',value=get_css_classes(self),lang_str='CSS Classes',options=css_classes) + html += '
' + html += '
' + html += '
' + html += '
' + html += ''%(self.getZMILangStr('BTN_INSERT')) + html += ' '%(self.getZMILangStr('BTN_CANCEL')) + html += ' 
' + html += '
' + + # --------------------------------- + + html += '
' + html += '
' + html += self.zmi_body_footer(self,request) + html += '' + html += '' + + return html \ No newline at end of file diff --git a/Products/zms/import/com.zms.search.content.xml b/Products/zms/import/com.zms.search.content.xml index 304335a03..06f646237 100644 --- a/Products/zms/import/com.zms.search.content.xml +++ b/Products/zms/import/com.zms.search.content.xml @@ -18,42 +18,55 @@ - + - - - - - Search header -
-
-
- the value -
- + + + + + Search header +
+
+
+ the value + + +
-
-
+
+
+
+ + + +
+
- @@ -258,6 +258,29 @@ The diff-perspective can be changed between the working modes Export vs. Import: _ZMS Repository Manager menu: code files containg differences can be synct by "Export" (ZODB to file-system) or "Import" (file-system to ZODB)_ +### ZMSRepositoryManager Properties + +1. **System Path**: location of the source-code in the file system +2. **Working Mode**: export vs. import +3. **Ignore Orphans**: ignore unilateral files +4. **Auto-Sync**: implicit export on ZMS model changes (needs ZMS config parameter `ZMS.debug = True`) +5. **Last-Update**: logs the date/time of the last sync + + +The *System Path* entry of the ZMS Repository Manager allows to define the target folder where the ZMS code is replicated into the file system. The default path is located in the var-folder of the Zope instance following the pattern: `$INSTANCE_HOME/var/$my_zms_id`. +The variable `$INSTANCE_HOME` actually can be used to set the path to the Zope instance folder. The path itself can contain _path components_ to declare relative paths. This is illustrated by the following picture: + +![ZMSRepositoryManager Properties](images/admin_repo_properties.png) + +The path of the used repository is stored as system property `ZMS.conf.path`. Hint: The system property `ZMS.conf.paths` can be preset with a comma-separated list of repository paths for selection. + +The *Working Mode* allows to switch between the two working modes _Export_ and _Import_. In code diff blocks the Export-mode marks new code edited in ZODB as green whereas the Import-View will marks newer code from filesystem as green (indicating the it will get overwritten on import). Removed code is marked as red. + +The option *Ignore Orphans* allows to ignore unilateral files which are not managed by the version control system. + +The *Auto-Sync* option allows to automatically export the ZMS code on changes of the ZMS model. This is very useful for development and testing purposes. The Auto-Sync option is only available if the ZMS config parameter `ZMS.debug = True` is set. +By default it works only along with the _Export_ mode. If the _Import_ mode is selected, the Auto-Sync option still needs the users interaction to be triggered. + ### ZMS Git Bridge The ZMS Git bridge is a very simple approach to establish Git-based collaboration to the code management in ZMS. Thus the TTW-coding, which is very efficient for many project setups, still can be applied while combined with a professional code version management and deployment. diff --git a/docs/images/admin_repo_properties.png b/docs/images/admin_repo_properties.png new file mode 100644 index 000000000..ba2f30910 Binary files /dev/null and b/docs/images/admin_repo_properties.png differ