indexing
	description: "Community remove project message"
	author: "Marco Zietzling <marco.zietzling@gmail.com>"
	date: "$Date$"
	revision: "$Revision$"

class
	O_COMMUNITY_REMOVE_PROJECT_MESSAGE

inherit
	O_SESSION_MESSAGE
		rename
			make as make_session
		redefine
			make_from_generic,
			arguments
		end

	O_COMMUNITY_CONSTANTS
		undefine
			out
		end

create
	make

create {O_MESSAGE_FACTORY}
	make_from_generic

feature {NONE} -- Initialization

	make (a_session: like session; a_community: like community; a_project: like project) is
			-- Create.
		require
			a_session_ok: a_session /= Void and then not a_session.is_empty
			a_community_ok: a_community /= Void and then not a_community.is_empty
			a_project_ok: a_project /= Void and then not a_project.is_empty
		do
			make_session (a_session)
			community := a_community
			project := a_project
		ensure
			community_set: community = a_community
			project_set: project = a_project
		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
			community := l_args.item (community_argument)
			project := l_args.item (project_argument)
		end

feature -- Access

	namespace: STRING is
			-- Namespace of the message type.
		once
			Result := community_namespace
		end

	type: STRING is
			-- Type of the message.
		once
			Result := community_remove_project_type
		end

	community: STRING
			-- Community name

	project: STRING
			-- Project name

	arguments: HASH_TABLE [STRING, STRING] is
			-- Named arguments.
		do
			Result := Precursor
			Result.force (community, community_argument)
			Result.force (project, project_argument)
		end

feature {NONE} -- Implementation

	community_argument: STRING is "community"
	project_argument: STRING is "project"

invariant
	community_ok: community /= Void and then not community.is_empty
	project_ok: project /= Void and then not project.is_empty
end