Module Cms
In: app/controllers/cms/error_handling.rb
app/helpers/cms/application_helper.rb
app/helpers/cms/form_tag_helper.rb
app/helpers/cms/menu_helper.rb
app/helpers/cms/page_helper.rb
app/helpers/cms/path_helper.rb
app/helpers/cms/rendering_helper.rb
app/helpers/cms/section_nodes_helper.rb
app/helpers/cms/template_support.rb
lib/cms/acts/content_block.rb
lib/cms/acts/content_page.rb
lib/cms/authentication/controller.rb
lib/cms/authentication/model.rb
lib/cms/behaviors/archiving.rb
lib/cms/behaviors/attaching.rb
lib/cms/behaviors/categorizing.rb
lib/cms/behaviors/connecting.rb
lib/cms/behaviors/dynamic_attributes.rb
lib/cms/behaviors/flush_cache_on_change.rb
lib/cms/behaviors/hiding.rb
lib/cms/behaviors/pagination.rb
lib/cms/behaviors/publishing.rb
lib/cms/behaviors/rendering.rb
lib/cms/behaviors/searching.rb
lib/cms/behaviors/soft_deleting.rb
lib/cms/behaviors/taggable.rb
lib/cms/behaviors/userstamping.rb
lib/cms/behaviors/versioning.rb
lib/cms/caching.rb
lib/cms/content_rendering_support.rb
lib/cms/data_loader.rb
lib/cms/domain_support.rb
lib/cms/extensions/action_view/base.rb
lib/cms/extensions/active_record/base.rb
lib/cms/extensions/active_record/errors.rb
lib/cms/extensions/hash.rb
lib/cms/extensions/integer.rb
lib/cms/extensions/nil.rb
lib/cms/extensions/string.rb
lib/cms/init.rb
lib/cms/version.rb

Allows the precise version of BrowserCMS to be determined programmatically.

Methods

Included Modules

Caching

Classes and Modules

Module Cms::Acts
Module Cms::ApplicationHelper
Module Cms::Authentication
Module Cms::Behaviors
Module Cms::Caching
Module Cms::ContentRenderingSupport
Module Cms::DataLoader
Module Cms::DomainSupport
Module Cms::ErrorHandling
Module Cms::Errors
Module Cms::Extensions
Module Cms::FormTagHelper
Module Cms::MenuHelper
Module Cms::PageHelper
Module Cms::PathHelper
Module Cms::RenderingHelper
Module Cms::Routes
Module Cms::SectionNodesHelper
Module Cms::TemplateSupport
Class Cms::ApplicationController
Class Cms::AttachmentsController
Class Cms::BaseController
Class Cms::CacheController
Class Cms::CategoriesController
Class Cms::CategoryTypesController
Class Cms::ConnectorsController
Class Cms::ContentBlockController
Class Cms::ContentController
Class Cms::ContentTypesController
Class Cms::DashboardController
Class Cms::DynamicViewsController
Class Cms::EmailMessagesController
Class Cms::FileBlocksController
Class Cms::FormBuilder
Class Cms::GroupsController
Class Cms::HomeController
Class Cms::HtmlBlocksController
Class Cms::ImageBlocksController
Class Cms::LinksController
Class Cms::PageRouteConditionsController
Class Cms::PageRouteOptionsController
Class Cms::PageRouteRequirementsController
Class Cms::PageRoutesController
Class Cms::PagesController
Class Cms::PortletController
Class Cms::PortletsController
Class Cms::RedirectsController
Class Cms::ResourceController
Class Cms::RoutesController
Class Cms::SectionNodesController
Class Cms::SectionsController
Class Cms::SessionsController
Class Cms::TagsController
Class Cms::TasksController
Class Cms::ToolbarController
Class Cms::UsersController

Constants

SPEC = eval(File.read(__root__ + '/browsercms.gemspec'))
VERSION = "3.1.0"

Attributes

attachment_file_permission  [RW] 

Public Class methods

This is used by CMS modules to register with the CMS generator which files should be copied over to the app when the CMS generator is run. src_root is the absolute path to the root of the files, then each argument after that is a Dir.glob pattern string.

[Source]

    # File lib/cms/init.rb, line 44
44:     def add_generator_paths(src_root, *files)
45:       generator_paths << [src_root, files]
46:     end

[Source]

    # File lib/cms/init.rb, line 52
52:     def add_to_rails_paths(path)
53:       ActiveSupport::Dependencies.load_paths << File.join(path, "app", "portlets")
54:     end

[Source]

    # File lib/cms/init.rb, line 56
56:     def add_to_routes(route)
57:       routes << route
58:     end

[Source]

    # File lib/cms/init.rb, line 15
15:     def build_number; 252 end

[Source]

    # File lib/cms/init.rb, line 48
48:     def generator_paths
49:       @generator_paths ||= []
50:     end

This is called after the environment is ready

[Source]

    # File lib/cms/init.rb, line 22
22:     def init
23:       ActionController::Routing::RouteSet::Mapper.send :include, Cms::Routes
24:       ActiveSupport::Dependencies.load_paths += ??( #{RAILS_ROOT}/app/portlets )
25:       ActiveSupport::Dependencies.load_paths += ??( #{RAILS_ROOT}/app/portlets/helpers )      
26:       ActionController::Base.append_view_path DynamicView.base_path
27:       ActionView::Base.default_form_builder = Cms::FormBuilder
28:       
29:       # ActiveRecord JDBC adapter depends on no database connection having
30:       # been established to work properly.
31:       require 'jdbc_adapter' if defined?(JRUBY_VERSION)
32:       
33:       # This is just to be safe
34:       # dynamic views are stored in a tmp dir
35:       # so they could be blown away on a server restart or something
36:       # so this just makes sure they get written out
37:       DynamicView.write_all_to_disk! if DynamicView.table_exists?
38:     end

[Source]

    # File lib/cms/init.rb, line 17
17:     def load_rake_tasks
18:       load "#{Cms.root}/lib/tasks/cms.rake"
19:     end

[Source]

    # File lib/cms/init.rb, line 71
71:     def markdown?
72:       Object.const_defined?("Markdown")
73:     end

[Source]

    # File lib/cms/init.rb, line 75
75:     def reserved_paths
76:       @reserved_paths ||= ["/cms", "/cache"]
77:     end

[Source]

    # File lib/cms/init.rb, line 59
59:     def routes
60:       @routes ||=[]
61:     end

This next ‘hack’ is to allow script/generate browser_cms to work on Windows machines. I‘m not sure why this is necessary.

This Generator is adding an absolute file path to the manifest, which is file (like a .js or migration) in the gem directory on the developers‘s machine, rather than just a relative path with the rails_generator directory. On windows, this will mean you are basically doing this.

m.file "C:/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"

When the generator hits this command during playback, it will throw an error like this:

  Pattern 'c' matches more than one generator: content_block, controller

The generator then fails and stops copying. Stripping the C: off the front seems to fix this problem. I.e. This command correctly copies the file on Windows XP.

  m.file "/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"

[Source]

    # File lib/cms/init.rb, line 93
93:     def scrub_path(path)
94:       windows_drive_pattern =  /\b[A-Za-z]:\//    # Works on drives labeled A-Z:
95:       scrubbed_source_file_name = path.gsub(windows_drive_pattern, "/")
96:     end

[Source]

    # File lib/cms/init.rb, line 11
11:     def version
12:       @version = SPEC.version.version
13:     end

[Source]

    # File lib/cms/init.rb, line 63
63:     def wysiwig_js
64:       @wysiwig_js ||= ['/bcms/ckeditor/ckeditor.js', '/bcms/ckeditor/editor.js']
65:     end

[Source]

    # File lib/cms/init.rb, line 67
67:     def wysiwig_js=(path_array)
68:       @wysiwig_js = path_array
69:     end

[Validate]