Files
ROC/src/cache/cms_file_object_cache.e
Jocelyn Fiat 463105f29f Added feed aggregation module.
Redesigned the CMS_BLOCK system,
   - added condition attribute. It can be set via configuration file
     with
     [blocks]
      {blockid}.region={region_name}
      {blockid}.conditions[]=is_front
      {blockid}.conditions[]=path:location-path/foo/bar
   - For backward compatibility, the CMS will check only conditions for block name prefixed by "?".
Improved the configuration library to support list and table properties.
Updated theme for now, to include the feed examples.
Added "cache" classes, to ease caching of html output for instance. (TODO: improve by providing a cache manager).
2015-10-08 13:56:31 +02:00

50 lines
1.0 KiB
Plaintext

note
description: "Cache for value conforming to formal {G}, and implemented using local file."
date: "$Date: 2014-10-30 12:13:25 +0100 (jeu., 30 oct. 2014) $"
revision: "$Revision: 96016 $"
class
CMS_FILE_OBJECT_CACHE [G -> ANY]
inherit
CMS_FILE_CACHE [G]
SED_STORABLE_FACILITIES
create
make
feature {NONE} -- Implementation
file_to_item (f: FILE): detachable G
local
retried: BOOLEAN
l_reader: SED_MEDIUM_READER_WRITER
l_void: detachable G
do
if retried then
Result := l_void
else
create l_reader.make_for_reading (f)
if attached {G} retrieved (l_reader, True) as l_data then
Result := l_data
end
end
rescue
retried := True
retry
end
item_to_file (a_data: G; f: FILE)
local
l_writer: SED_MEDIUM_READER_WRITER
do
create l_writer.make_for_writing (f)
basic_store (a_data, l_writer, True)
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end