indexing description: "Project create message." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class O_PROJECT_CREATE_MESSAGE inherit O_SESSION_MESSAGE rename make as make_session redefine make_from_generic, arguments end O_PROJECT_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_session: like session; a_name: like name; a_description: like description; a_is_closed_source: like is_closed_source; is_a_hidden: like is_hidden) is -- Create. require a_session_ok: a_session /= Void and then not a_session.is_empty a_name_ok: a_name /= Void and then not a_name.is_empty a_description_ok: a_description /= Void and then not a_description.is_empty do make_session (a_session) name := a_name description := a_description is_closed_source := a_is_closed_source is_hidden := is_a_hidden ensure name_set: name = a_name description_set: description = a_description is_closed_source_set: is_closed_source = a_is_closed_source hidden_set: is_hidden = is_a_hidden end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] do Precursor (a_msg) l_args := a_msg.arguments name := l_args.item (name_argument) description := l_args.item (description_argument) is_closed_source := l_args.item (is_closed_source_argument).to_boolean is_hidden := l_args.item (is_hidden_argument).to_boolean end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := project_namespace end type: STRING is -- Type of the message. once Result := project_create_type end name: STRING -- Project name description: STRING -- Project description is_closed_source: BOOLEAN -- is this a closed source project? is_hidden: BOOLEAN -- is the project hidden? arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do Result := Precursor Result.force (name, name_argument) Result.force (description, description_argument) Result.force (is_closed_source.out, is_closed_source_argument) Result.force (is_hidden.out, is_hidden_argument) end feature {NONE} -- Implementation name_argument: STRING is "name" description_argument: STRING is "description" is_closed_source_argument: STRING is "is_closed_source" is_hidden_argument: STRING is "is_hidden" invariant name_ok: name /= Void and then not name.is_empty description_ok: description /= Void and then not description.is_empty end