Package zms :: Module ZMSGlobals :: Class ZMSGlobals
[frames] | no frames]

Class ZMSGlobals

Instance Methods
 
getPRODUCT_HOME(self)
 
createBlobInContext(self, id, blob, container)
 
FileFromData(self, data, filename='', content_type=None)
 
ImageFromData(self, data, filename='', content_type=None)
 
boolint(self, c, t=1, f=0)
 
nvl(self, a1, a2, n=None)
 
encrypt_schemes(self)
 
encrypt_password(self, pw, algorithm='md5', hex=False)
 
encrypt_ordtype(self, s)
 
rand_int(self, n)
 
string_maxlen(self, s, maxlen=20, etc='...', encoding=None)
 
url_quote(self, string, safe='/')
 
http_import(self, url, method='GET', auth=None, parse_qs=0)
 
url_append_params(self, url, dict, sep='&')
 
url_inherit_params(self, url, REQUEST, exclude=[], sep='&')
 
id_quote(self, s, mapping={'\x20': '_','-': '_','/': '_',})
 
get_id_prefix(self, s)
 
js_quote(self, text, charset=None)
 
isPreviewRequest(self, REQUEST)
 
getDataSizeStr(self, len)
 
getMimeTypeIconSrc(self, mt)
 
writeStdout(self, info)
 
tree_parents(self, l, i='id', r='idId', v='', deep=1, reverse=1)
 
str_json(self, i, encoding='ascii', errors='xmlcharrefreplace')
 
str_item(self, i)
 
pilutil(self)
 
getZipArchive(self, f)
 
extractZipArchive(self, f)
 
buildZipArchive(self, files, get_data=True)
 
set_response_headers(self, fn, mt='application/octet-stream')
 
getXmlHeader(self, encoding='utf-8')
 
toXmlString(self, v, xhtml=False, encoding='utf-8')
 
parseXmlString(self, xml, mediadbStorable=True)
 
xslProcess(self, xsl, xml)
 
processData(self, processId, data, trans=None)
 
xmlParse(self, xml)
 
xmlNodeSet(self, mNode, sTagName='', iDeep=0)
 
dt_exec(self, v)
 
dt_html(self, value, REQUEST)
 
dt_py(self, script, kw={})
 
getPlugin(self, path, options={})
 
getLangFmtDate(self, t, lang=None, fmt_str='SHORTDATETIME_FMT')
 
parseLangFmtDate(self, s, lang=None, fmt_str=None, recflag=None)
 
compareDate(self, t0, t1)
 
daysBetween(self, t0, t1)
 
sendMail(self, mto, msubject, mbody, REQUEST)
    Local File-System
 
localfs_package_home(self)
 
localfs_tempfile(self)
string or filestream_iterator
localfs_read(self, filename, mode='b', REQUEST=None)
Reads file from local file-system.
 
localfs_write(self, filename, v, mode='b', REQUEST=None)
 
localfs_remove(self, path, deep=0)
 
localfs_readPath(self, filename, data=False, recursive=False, REQUEST=None)
    Logging
 
writeLog(self, info)
 
writeBlock(self, info)
    Mappings
 
intersection_list(self, l1, l2)
 
difference_list(self, l1, l2)
 
concat_list(self, l1, l2)
 
dict_list(self, l)
 
distinct_list(self, l, i=None)
 
sort_list(self, l, qorder=None, qorderdir='asc', ignorecase=1)
 
string_list(self, s, sep='\n')
 
tree_list(self, l, i='id', r='idId', v='', deep=0)
 
filter_list(self, l, i, v, o='%')
 
copy_list(self, l)
 
sync_list(self, l, nl, i)
 
aggregate_list(self, l, i)
    Operators
 
operator_absattr(self, v)
 
operator_gettype(self, v)
 
operator_setitem(self, a, b, c)
 
operator_getitem(self, a, b, c=None, ignorecase=True)
 
operator_delitem(self, a, b)
 
operator_setattr(self, a, b, c)
 
operator_getattr(self, a, b, c=None)
 
operator_delattr(self, a, b)
    Styles / CSS
 
parse_stylesheet(self)
 
get_colormap(self)
    Regular Expressions
 
re_sub(self, pattern, replacement, subject, ignorecase=False)
 
re_search(self, pattern, subject, ignorecase=False)
Class Variables
  security = ClassSecurityInfo()
  PAGES = 0
virtual meta_type for all Pages (Containers)
  PAGEELEMENTS = 1
virtual meta_type for all Page-Elements
  NOREF = 4
virtual meta_type-flag for resolving meta-type of ZMSLinkElement-target-object.
  NORESOLVEREF = 5
Returns home-folder of this Product.
Method Details

localfs_read(self, filename, mode='b', REQUEST=None)

 

Reads file from local file-system. You must grant permissions for reading from local file-system to directories in Config-Tab / Miscelleaneous-Section.

Parameters:
  • filename (string) - Filepath
  • filename (string) - Access mode
  • REQUEST (ZPublisher.HTTPRequest) - the triggering request
Returns: string or filestream_iterator
Contents of file