Retrieve a person from the catalog

Introduced properties

private var _person: nullable Person

nitc :: CmdCatalogPerson :: _person

Person to retrieve
private var _person_name: nullable String

nitc :: CmdCatalogPerson :: _person_name

Name of the person to retrieve
init defaultinit(model: Model, catalog: Catalog, filter: nullable ModelFilter, person: nullable Person, person_name: nullable String)

nitc :: CmdCatalogPerson :: defaultinit

fun init_person: CmdMessage

nitc :: CmdCatalogPerson :: init_person

Initialize the person result
fun person: nullable Person

nitc :: CmdCatalogPerson :: person

Person to retrieve
fun person=(person: nullable Person)

nitc :: CmdCatalogPerson :: person=

Person to retrieve
fun person_name: nullable String

nitc :: CmdCatalogPerson :: person_name

Name of the person to retrieve
fun person_name=(person_name: nullable String)

nitc :: CmdCatalogPerson :: person_name=

Name of the person to retrieve

Redefined properties

redef type SELF: CmdCatalogPerson

nitc $ CmdCatalogPerson :: SELF

Type of this instance, automatically specialized in every class
redef fun http_init(req: HttpRequest): CmdMessage

nitc :: commands_http $ CmdCatalogPerson :: http_init

Init the command from an HTTPRequest
redef fun init_command: CmdMessage

nitc $ CmdCatalogPerson :: init_command

Initialize the command
redef fun parser_init(mentity_name: String, options: CmdOptions): CmdMessage

nitc :: commands_parser $ CmdCatalogPerson :: parser_init

Initialize the command from the CommandParser data
redef fun to_json: nullable Serializable

nitc :: json_commands $ CmdCatalogPerson :: to_json

Return a JSON Serializable representation of self results

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _catalog: Catalog

nitc :: CmdCatalog :: _catalog

Catalog to query at
private var _filter: nullable ModelFilter

nitc :: DocCommand :: _filter

ModelFilter to apply if any
private var _model: Model

nitc :: DocCommand :: _model

Model to retrieve data for
private var _person: nullable Person

nitc :: CmdCatalogPerson :: _person

Person to retrieve
private var _person_name: nullable String

nitc :: CmdCatalogPerson :: _person_name

Name of the person to retrieve
fun catalog: Catalog

nitc :: CmdCatalog :: catalog

Catalog to query at
protected fun catalog=(catalog: Catalog)

nitc :: CmdCatalog :: catalog=

Catalog to query at
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun cmd_filter: ModelFilter

nitc :: DocCommand :: cmd_filter

Return a new filter for that command execution.
init defaultinit(model: Model, catalog: Catalog, filter: nullable ModelFilter, person: nullable Person, person_name: nullable String)

nitc :: CmdCatalogPerson :: defaultinit

init defaultinit(model: Model, catalog: Catalog, filter: nullable ModelFilter)

nitc :: CmdCatalog :: defaultinit

init defaultinit(model: Model, filter: nullable ModelFilter)

nitc :: DocCommand :: defaultinit

abstract fun execute(no_color: nullable Bool)

nitc :: DocCommand :: execute

fun filter: nullable ModelFilter

nitc :: DocCommand :: filter

ModelFilter to apply if any
protected fun filter=(filter: nullable ModelFilter)

nitc :: DocCommand :: filter=

ModelFilter to apply if any
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun http_init(req: HttpRequest): CmdMessage

nitc :: DocCommand :: http_init

Init the command from an HTTPRequest
init init

core :: Object :: init

fun init_command: CmdMessage

nitc :: DocCommand :: init_command

Initialize the command
fun init_person: CmdMessage

nitc :: CmdCatalogPerson :: init_person

Initialize the person result
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun model: Model

nitc :: DocCommand :: model

Model to retrieve data for
protected fun model=(model: Model)

nitc :: DocCommand :: model=

Model to retrieve data for
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun parser_init(arg: String, options: CmdOptions): CmdMessage

nitc :: DocCommand :: parser_init

Initialize the command from the CommandParser data
fun person: nullable Person

nitc :: CmdCatalogPerson :: person

Person to retrieve
fun person=(person: nullable Person)

nitc :: CmdCatalogPerson :: person=

Person to retrieve
fun person_name: nullable String

nitc :: CmdCatalogPerson :: person_name

Name of the person to retrieve
fun person_name=(person_name: nullable String)

nitc :: CmdCatalogPerson :: person_name=

Name of the person to retrieve
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_html: Writable

nitc :: DocCommand :: to_html

Render results as a HTML string
abstract fun to_json: nullable Serializable

nitc :: DocCommand :: to_json

Return a JSON Serializable representation of self results
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_md: Writable

nitc :: DocCommand :: to_md

Render results as a Markdown string
fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram nitc::CmdCatalogPerson CmdCatalogPerson nitc::CmdCatalog CmdCatalog nitc::CmdCatalogPerson->nitc::CmdCatalog nitc::DocCommand DocCommand nitc::CmdCatalog->nitc::DocCommand ...nitc::DocCommand ... ...nitc::DocCommand->nitc::DocCommand nitc::CmdCatalogMaintaining CmdCatalogMaintaining nitc::CmdCatalogMaintaining->nitc::CmdCatalogPerson nitc::CmdCatalogContributing CmdCatalogContributing nitc::CmdCatalogContributing->nitc::CmdCatalogPerson

Ancestors

abstract class DocCommand

nitc :: DocCommand

Documentation command
interface Object

core :: Object

The root of the class hierarchy.

Parents

abstract class CmdCatalog

nitc :: CmdCatalog

A DocCommand based on a Catalog

Children

class CmdCatalogContributing

nitc :: CmdCatalogContributing

Retrieve the packages contributed by a person
class CmdCatalogMaintaining

nitc :: CmdCatalogMaintaining

Retrieve the packages maintained by a person

Class definitions

nitc $ CmdCatalogPerson
# Retrieve a person from the catalog
class CmdCatalogPerson
	super CmdCatalog

	# Person to retrieve
	#
	# You can also pass a `person_name`.
	var person: nullable Person = null is optional, writable

	# Name of the person to retrieve
	#
	# You can also pass a `person` instance.
	var person_name: nullable String = null is optional, writable

	# Initialize the `person` result
	fun init_person: CmdMessage do
		var person = self.person
		if person != null then
			person_name = person.name
			return new CmdSuccess
		end

		var name = self.person_name
		if name == null then return new ErrorNoPerson
		if not catalog.name2person.has_key(name) then return new ErrorPersonNotFound(name)
		self.person = catalog.name2person[name]
		return new CmdSuccess
	end

	redef fun init_command do
		init_person
		return super
	end
end
src/doc/commands/commands_catalog.nit:236,1--269,3

nitc :: commands_parser $ CmdCatalogPerson
redef class CmdCatalogPerson
	redef fun parser_init(mentity_name, options) do
		person_name = mentity_name
		return super
	end
end
src/doc/commands/commands_parser.nit:390,1--395,3

nitc :: commands_http $ CmdCatalogPerson
redef class CmdCatalogPerson
	redef fun http_init(req) do
		var name = req.param("pid")
		if name != null then name = name.from_percent_encoding
		self.person_name = name
		return super
	end
end
src/doc/commands/commands_http.nit:219,1--226,3

nitc :: json_commands $ CmdCatalogPerson
redef class CmdCatalogPerson
	redef fun to_json do return person
end
src/doc/templates/json_commands.nit:134,1--136,3