pax_global_header 0000666 0000000 0000000 00000000064 11631100632 0014503 g ustar 00root root 0000000 0000000 52 comment=520bf5098ed9b27298776d7c4b8e9668e8fa8992
erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/ 0000775 0000000 0000000 00000000000 11631100632 0022756 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/ 0000775 0000000 0000000 00000000000 11631100632 0023450 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ 0000775 0000000 0000000 00000000000 11631100632 0026512 5 ustar 00root root 0000000 0000000 ActionTemplateItem/ 0000775 0000000 0000000 00000000000 11631100632 0032163 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir portal_types/ 0000775 0000000 0000000 00000000000 11631100632 0034710 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ActionTemplateItem Web%20Site/ 0000775 0000000 0000000 00000000000 11631100632 0036461 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ActionTemplateItem/portal_types web_post_shadir_view.xml 0000664 0000000 0000000 00000005637 11631100632 0043424 0 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ActionTemplateItem/portal_types/Web%20Site
-
action
AAAAAAAAAAI=
-
categories
action_type/object_web_view
-
category
object_web_view
-
condition
AAAAAAAAAAM=
-
description
-
icon
-
id
web_post_shadir_view
-
permissions
View
-
priority
0.8
-
title
Web Post Shacache View
-
visible
1
-
text
string:${object_url}/WebSite_viewAsWebPost
-
text
python: context.getSkinSelectionName() == \'SHADIR\' and request.method == \'POST\' and object is not None and object.isWebMode() and not object.isEditableMode()
DocumentTemplateItem/ 0000775 0000000 0000000 00000000000 11631100632 0032524 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir WebSite.py 0000664 0000000 0000000 00000003104 11631100632 0034436 0 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/DocumentTemplateItem # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved.
# Lucas Carvalho
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Products.ERP5.Document.WebSite import WebSite as SimpleWebSite
from Products.ERP5.mixin.virtual_folder import VirtualFolderMixin
class WebSite(VirtualFolderMixin, SimpleWebSite):
"""
XXX
"""
pass
ExtensionTemplateItem/ 0000775 0000000 0000000 00000000000 11631100632 0032722 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir ShaDir.py 0000664 0000000 0000000 00000010653 11631100632 0034453 0 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ExtensionTemplateItem ##############################################################################
#
# Copyright (c) 20011 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import hashlib
import json
import validictory
from Products.ERP5Type.Document import newTempFile
def WebSection_getDocumentValue(self, key, portal=None, language=None,\
validation_state=None, **kw):
"""
API SHADIR
- POST /
+ parameters required:
* file: the name of the file
* urlmd5: mdsum of orginal url
* sha512: the hash (sha512) of the file content
+ parameters not required:
* valid-until: the date which the file must be expired
* architecture: computer architecture
Used to add information on shadir server.
- GET /
Return list of information for a given key
Raise HTTP error (404) if key does not exist
"""
if self.REQUEST.get('REQUEST_METHOD') in ('PUT',):
return
if portal is None:
portal = self.getPortalObject()
data_set = portal.portal_catalog.getResultValue(portal_type='Data Set',
reference=key)
# Return the SIGNATURE file, if the document exists.
if data_set is not None:
document_list = [json.loads(document.getData()) \
for document in portal.portal_catalog(
follow_up_uid=data_set.getUid(),
validation_state='published')]
temp_file = newTempFile(self, '%s.txt' % key)
temp_file.setData(json.dumps(document_list))
temp_file.setContentType('application/json')
return temp_file.getObject()
return None
def WebSection_setObject(self, id, ob, **kw):
"""
Make any change related to the file uploaded.
"""
portal = self.getPortalObject()
data = self.REQUEST.get('BODY')
schema = self.WebSite_getJSONSchema()
structure = json.loads(data)
# 0 elementh in structure is json in json
# 1 elementh is just signature
structure = [json.loads(structure[0]), structure[1]]
validictory.validate(structure, schema)
file_name = structure[0].get('file', None)
expiration_date = structure[0].get('expiration_date', None)
data_set = portal.portal_catalog.getResultValue(portal_type='Data Set',
reference=id)
if data_set is None:
data_set = portal.data_set_module.newContent(portal_type='Data Set',
reference=id)
data_set.publish()
reference = hashlib.sha512(data).hexdigest()
ob.setFilename(file_name)
ob.setFollowUp(data_set.getRelativeUrl())
ob.setContentType('application/json')
ob.setReference(reference)
if expiration_date is not None:
ob.setExpirationDate(expiration_date)
ob.publish()
return ob
def WebSection_putFactory(self, name, typ, body):
"""
API SHACACHE
- PUT /
+ parameters required:
* data: it is the file content
The key is the file name.
"""
portal = self.getPortalObject()
if name is None:
name = 'shacache'
document = portal.portal_contributions.newContent(data=body,
filename=name,
discover_metadata=False)
return document
RegisteredSkinSelectionTemplateItem/ 0000775 0000000 0000000 00000000000 11631100632 0035536 5 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir registered_skin_selection.xml 0000664 0000000 0000000 00000000737 11631100632 0043515 0 ustar 00root root 0000000 0000000 erp5-520bf5098ed9b27298776d7c4b8e9668e8fa8992-bt5-erp5_web_shadir/bt5/erp5_web_shadir/RegisteredSkinSelectionTemplateItem
erp5_web_download_theme
SHADIR
erp5_web_shadir
SHADIR
erp5_xhtml_style
SHADIR