source: trunk/Material.py @ 1986

Revision 1762, 2.3 KB checked in by jukka, 12 years ago (diff)

Removed Toolbox-related stuff and lemill_eun skin. Also removed deprecated SectionFolder? and Story lots of methods and widgets that are not used anywhere. Hope our code is bit clearer now.

  • Property svn:eol-style set to native
Line 
1# Copyright 2006 by the LeMill Team (see AUTHORS)
2#
3# This file is part of LeMill.
4#
5# LeMill is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# LeMill is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with LeMill; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
19from urllib import urlencode
20
21from SharedMetadata import *
22from Products.Archetypes.public import *
23from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import ReferenceBrowserWidget
24from Globals import InitializeClass
25from Products.CMFCore.utils import getToolByName
26from AccessControl import ClassSecurityInfo, Unauthorized, getSecurityManager
27from config import PROJECTNAME, TEMPLATES, MODIFY_CONTENT, VIEW
28from LOM import LOMSchema
29from Products.Archetypes.ExtensibleMetadata import ExtensibleMetadata
30from ZODB.PersistentList import PersistentList
31from Resources import LearningResource
32
33# This is not used anywhere !!!!!!!!!!
34schema = BaseSchema + bodytext + no_description + tags + language_schema + target_group_schema + author_schema + license_schema + coverImage + lemill_metadata_mods + version_schema + contentFile + sourceFile + audioFile + deletionReason 
35schema = schema.copy()
36schema.moveField('rights', pos='bottom')
37
38
39class Material(LearningResource):
40    """Learning resource"""
41    schema = schema
42
43    meta_type = "Material"
44    archetype_name = "Material" 
45    security = ClassSecurityInfo()
46    security.declareObjectPublic()
47
48    aliases = {
49        '(Default)' : 'fullscreen_view',
50        'view'      : 'base_view',
51        'edit'      : 'base_edit'
52    }
53
54    def amIMaterial(self):
55        """ Returns True if it's a material """
56        return True
57
58    def manage_afterAdd(self, item, container):
59        LearningResource.manage_afterAdd(self, item, container)
60
61    def at_post_edit_script(self):
62        LearningResource.at_post_edit_script(self)
63
64
65registerType(Material, PROJECTNAME)
Note: See TracBrowser for help on using the repository browser.