pax_global_header 0000666 0000000 0000000 00000000064 13456342174 0014523 g ustar 00root root 0000000 0000000 52 comment=b0d269b1f6f770be087f2139d81f05953d676c02
erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/ 0000775 0000000 0000000 00000000000 13456342174 0022721 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/ 0000775 0000000 0000000 00000000000 13456342174 0023413 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ 0000775 0000000 0000000 00000000000 13456342174 0026455 5 ustar 00root root 0000000 0000000 ActionTemplateItem/ 0000775 0000000 0000000 00000000000 13456342174 0032126 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir portal_types/ 0000775 0000000 0000000 00000000000 13456342174 0034653 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ActionTemplateItem Web%20Site/ 0000775 0000000 0000000 00000000000 13456342174 0036424 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ActionTemplateItem/portal_types web_post_shadir_view.xml 0000664 0000000 0000000 00000005637 13456342174 0043367 0 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ActionTemplateItem/portal_types/Web%20Site
actionAAAAAAAAAAI=categoriesaction_type/object_web_viewcategoryobject_web_viewconditionAAAAAAAAAAM=descriptioniconidweb_post_shadir_viewpermissionsViewpriority0.8titleWeb Post Shacache Viewvisible1textstring:${object_url}/WebSite_viewAsWebPosttextpython: context.getSkinSelectionName() == \'SHADIR\' and request.method == \'POST\' and object is not None and object.isWebMode() and not object.isEditableMode()
DocumentTemplateItem/ 0000775 0000000 0000000 00000000000 13456342174 0032467 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir portal_components/ 0000775 0000000 0000000 00000000000 13456342174 0036235 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/DocumentTemplateItem document.erp5.WebSite.py 0000664 0000000 0000000 00000003104 13456342174 0042636 0 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/DocumentTemplateItem/portal_components # -*- 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
document.erp5.WebSite.xml 0000664 0000000 0000000 00000006530 13456342174 0043014 0 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/DocumentTemplateItem/portal_components
default_referenceWebSiteiddocument.erp5.WebSiteportal_typeDocument Componentsidversionerp5workflow_historyAAAAAAAAAAI=datacomponent_validation_workflowAAAAAAAAAAM=actionvalidateactorERP5TypeTestCasecommenttimevalidation_statevalidated
ExtensionTemplateItem/ 0000775 0000000 0000000 00000000000 13456342174 0032665 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir portal_components/ 0000775 0000000 0000000 00000000000 13456342174 0036433 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ExtensionTemplateItem extension.erp5.ShaDir.py 0000664 0000000 0000000 00000011163 13456342174 0043046 0 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ExtensionTemplateItem/portal_components ##############################################################################
#
# 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
from Products.ERP5Type.UnrestrictedMethod import super_user
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)
with super_user():
# security check should be done already.
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)
with super_user():
# security check should be done already.
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
extension.erp5.ShaDir.xml 0000664 0000000 0000000 00000006531 13456342174 0043221 0 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/ExtensionTemplateItem/portal_components
default_referenceShaDiridextension.erp5.ShaDirportal_typeExtension Componentsidversionerp5workflow_historyAAAAAAAAAAI=datacomponent_validation_workflowAAAAAAAAAAM=actionvalidateactorERP5TypeTestCasecommenttimevalidation_statevalidated
RegisteredSkinSelectionTemplateItem/ 0000775 0000000 0000000 00000000000 13456342174 0035501 5 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir registered_skin_selection.xml 0000664 0000000 0000000 00000000737 13456342174 0043460 0 ustar 00root root 0000000 0000000 erp5-b0d269b1f6f770be087f2139d81f05953d676c02-bt5-erp5_web_shadir/bt5/erp5_web_shadir/RegisteredSkinSelectionTemplateItem erp5_web_download_themeSHADIRerp5_web_shadirSHADIRerp5_xhtml_styleSHADIR