Module: SWS

Defined in:
lib/sws/parsers.rb,
lib/sws.rb,
lib/sws/slot.rb,
lib/sws/cookie.rb,
lib/sws/adaptor.rb,
lib/sws/session.rb,
lib/sws/response.rb,
lib/sws/component.rb,
lib/sws/application.rb,
lib/sws/direct_action.rb,
lib/sws/Core/components/Form/Form.rb,
lib/sws/Core/components/Link/Link.rb,
lib/sws/Core/components/Image/Image.rb,
lib/sws/Core/components/Select/Select.rb,
lib/sws/Core/components/String/String.rb,
lib/sws/Core/components/Content/Content.rb,
lib/sws/Core/components/CheckBox/CheckBox.rb,
lib/sws/Core/components/TextArea/TextArea.rb,
lib/sws/Core/components/Hyperlink/Hyperlink.rb,
lib/sws/Core/components/TextField/TextField.rb,
lib/sws/Core/components/FileUpload/FileUpload.rb,
lib/sws/Core/components/Repetition/Repetition.rb,
lib/sws/Core/components/Conditional/Conditional.rb,
lib/sws/Core/components/HiddenField/HiddenField.rb,
lib/sws/Core/components/ImageButton/ImageButton.rb,
lib/sws/Core/components/RadioButton/RadioButton.rb,
lib/sws/Core/components/ResetButton/ResetButton.rb,
lib/sws/Core/components/CheckBoxList/CheckBoxList.rb,
lib/sws/Core/components/SubmitButton/SubmitButton.rb,
lib/sws/Core/components/ExceptionPage/ExceptionPage.rb,
lib/sws/Core/components/PasswordField/PasswordField.rb,
lib/sws/Core/components/GenericElement/GenericElement.rb,
lib/sws/Core/components/RadioButtonList/RadioButtonList.rb,
lib/sws/Core/components/GenericContainer/GenericContainer.rb

Overview

Definition and template parser and helper classes

Defined Under Namespace

Modules: Adaptor Classes: Application, CheckBox, CheckBoxList, Component, ComponentCache, ComponentInfo, Conditional, Content, Cookie, DefinitionParser, DirectAction, ExceptionPage, FileUpload, Form, FormElement, Framework, GenericContainer, GenericElement, HiddenField, Hyperlink, Image, ImageButton, Link, ListElement, MultipleSelectionList, PasswordField, RadioButton, RadioButtonList, Repetition, ResetButton, Response, Select, Session, SessionCleaner, Slot, String, SubmitButton, TemplateParser, TemplateToken, TextArea, TextComponent, TextField

Constant Summary collapse

APP_CONFIG_FILE =
"application.yaml"
FRAMEWORK_CONFIG_FILE =
"framework.yaml"
CONFIG_COMPONENTS =
"components"
CONFIG_RESOURCES =
"resources"
CONFIG_FRAMEWORKS =
"frameworks"
CONFIG_LOAD_PATHS =
"load_paths"

Class Method Summary collapse

Class Method Details

.get_class(name) ⇒ Object



65
66
67
68
69
70
71
72
73
# File 'lib/sws.rb', line 65

def SWS.get_class (name)

	klass = SWS.get_const( name )
	unless ( klass.is_a?( Class ) )
		raise TypeError.new( "Constant #{name} is not a Class" )
	end
	return klass

end

.get_const(name) ⇒ Object

Retrieves const by its name - in opposition to Object.const_get() works for const contained within modules



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/sws.rb', line 47

def SWS.get_const( name )
	
	const = ::Object
	name.split( /::/ ).each do |name_elem|
		begin
			const = const.const_get( name_elem )
		rescue NameError
			return nil
		end
	end

	# Necessary to avoid finding const in parent namespace (eg. SWS::String and
	# String)
	return const.name == name ? const : nil

end

.get_module(name) ⇒ Object



76
77
78
79
80
81
82
83
84
# File 'lib/sws.rb', line 76

def SWS.get_module (name)

	mod = SWS.get_const( name )
	unless ( mod.is_a?( Module ) )
		raise TypeError.new( "Constant #{name} is not a Module" )
	end
	return mod

end

.init_log4rObject

Initializes log4r. Called when loading SWS.



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/sws.rb', line 30

def SWS.init_log4r()
	
	$log_sws = Log4r::Logger.new( "sws" )
	#		$log_sws.level = Log4r::INFO
	$log_sws.outputters = Log4r::Outputter.stderr
	$log_sws_component = Log4r::Logger.new( "sws::component", Log4r::INFO )
	$log_sws_parser = Log4r::Logger.new( "sws::parser", Log4r::INFO )
	$log_sws_request = Log4r::Logger.new( "sws::request", Log4r::INFO )
	$log_sws_profile = Log4r::Logger.new( "sws::profile", Log4r::INFO )
	$log_sws_handle = Log4r::Logger.new( "sws::handle", Log4r::INFO )
	$log_sws_mc = Log4r::Logger.new( "sws::mc", Log4r::INFO )

end