Commit 2abd0e97 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Remove factory_type_information, because it is now handled by ERP5 Core. Add...

Remove factory_type_information, because it is now handled by ERP5 Core. Add getInstalledBusinessTemplate to find an older installed business template. Do not build a business template automatically when exporting.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1826 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5cd3ff4
...@@ -80,38 +80,18 @@ class TemplateTool (BaseTool): ...@@ -80,38 +80,18 @@ class TemplateTool (BaseTool):
security.declareProtected( Permissions.ManagePortal, 'manage_overview' ) security.declareProtected( Permissions.ManagePortal, 'manage_overview' )
manage_overview = DTMLFile( 'explainRuleTool', _dtmldir ) manage_overview = DTMLFile( 'explainRuleTool', _dtmldir )
# Factory Type Information def getInstalledBusinessTemplate(self, title, **kw):
factory_type_information = \ """
{ 'id' : portal_type Return a installed business template if any.
, 'meta_type' : meta_type """
, 'description' : """\ # This can be slow if, say, 10000 business templates are present.
TemplateTool manages Business Templates.""" # However, that unlikely happens, and using a Z SQL Method has a potential danger
, 'icon' : 'folder_icon.gif' # because business templates may exchange catalog methods, so the database could be
, 'product' : 'ERP5Type' # broken temporarily.
, 'factory' : 'addFolder' for bt in self.contentValues(filter={'portal_type':'Business Template'}):
, 'immediate_view' : 'Folder_viewContentList' if bt.getInstallationState() == 'installed' and bt.getTitle() == title:
, 'allow_discussion' : 1 return bt
, 'allowed_content_types': ('Business Template', return None
)
, 'filter_content_types' : 1
, 'global_allow' : 1
, 'actions' :
( { 'id' : 'view'
, 'name' : 'View'
, 'category' : 'object_view'
, 'action' : 'Folder_viewContentList'
, 'permissions' : (
Permissions.View, )
}
, { 'id' : 'search'
, 'name' : 'Search'
, 'category' : 'object_search'
, 'action' : 'BusinessTemplate_search'
, 'permissions' : (
Permissions.View, )
}
)
}
# Import a business template # Import a business template
def importURL(self, url): def importURL(self, url):
...@@ -141,7 +121,7 @@ TemplateTool manages Business Templates.""" ...@@ -141,7 +121,7 @@ TemplateTool manages Business Templates."""
""" """
Save in a format or another Save in a format or another
""" """
business_template.build() #business_template.build()
self.manage_exportObject(id=business_template.getId(), toxml=toxml) self.manage_exportObject(id=business_template.getId(), toxml=toxml)
suffix = toxml and 'xml' or 'zexp' suffix = toxml and 'xml' or 'zexp'
cfg = getConfiguration() cfg = getConfiguration()
...@@ -179,6 +159,7 @@ TemplateTool manages Business Templates.""" ...@@ -179,6 +159,7 @@ TemplateTool manages Business Templates."""
self._importObjectFromFile(file, id=id) self._importObjectFromFile(file, id=id)
bt = self[id] bt = self[id]
bt.id = id # Make sure id is consistent bt.id = id # Make sure id is consistent
#LOG('Template Tool', 0, 'Indexing %r, isIndexable = %r' % (bt, bt.isIndexable))
bt.immediateReindexObject() bt.immediateReindexObject()
if REQUEST is not None: if REQUEST is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment