MishkaCmsMigration.Targets.BlogTag (Mishka CMS Migration v0.0.1)

Copy Markdown View Source

The "tag" items of a source written as the Blog's tags (MishkaBlog.Tag), through the :create and :update an admin's own tag form runs, on the run's site and as the admin who pressed Import: the admin needs the Blog's admin:dashboard:blog:post, and the Blog's own rules decide the rest, such as one slug per site and how a slug is written (its slugify).

An item's title is the tag's name, its "slug" and "description" the tag's own (an empty description is none), and its parent, for a source whose tags nest, the tag's parent tag. A tag is in the language the item names (a site that runs Polylang or WPML names one), joined as one group with the tags that are its other editions, or, for an item that names none, in the language the site leads with (MishkaCmsMigration.Targets.Helpers.Editions). An item in a language the site does not publish in waits for an admin's decision.

A tag the run's site already has, with the slug as the Blog writes it, in any language, waits for an admin's decision ("slug_taken", MishkaCmsMigration.Targets.Helpers.BySlug). Connect to the existing record makes the item that tag: it is not written, the posts that name it are linked to it, the report says "connected", and the tag is kept as it is, now and on every later run. Import as new with another slug writes the item as a tag of its own, its slug followed by its source id, and the report says "another_slug".

Defined only where Mishka Blog is loaded, and supervised by MishkaCmsMigration.Application only then; on a node without the Blog its items wait for it ("blog_missing").

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for MishkaInstaller.Event.Hook.enable/0.

Callback implementation for MishkaInstaller.Event.Hook.get/0.

Optional. See MishkaInstaller.Event.Hook.health_check/0. Override to report health.

Callback implementation for MishkaInstaller.Event.Hook.register/0.

Callback implementation for MishkaInstaller.Event.Hook.restart/0.

Callback implementation for MishkaInstaller.Event.Hook.start/0.

Callback implementation for MishkaInstaller.Event.Hook.stop/0.

Types

error_return()

@type error_return() ::
  {:error, [%{action: atom(), field: atom(), message: String.t()}]}

okey_return()

@type okey_return() :: {:ok, struct() | map() | module() | [any()]}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

config()

@spec config() :: keyword()

config(key)

@spec config(atom()) :: any()

enable()

@spec enable() :: okey_return() | error_return()

Callback implementation for MishkaInstaller.Event.Hook.enable/0.

get()

@spec get() :: keyword()

Callback implementation for MishkaInstaller.Event.Hook.get/0.

health_check()

@spec health_check() :: :ok | {:degraded, term()} | {:error, term()}

Optional. See MishkaInstaller.Event.Hook.health_check/0. Override to report health.

on_dependency_error(error)

@spec on_dependency_error(term()) :: term()

Optional. See MishkaInstaller.Event.Hook.on_dependency_error/1. Override to react.

register()

@spec register() :: okey_return() | error_return()

Callback implementation for MishkaInstaller.Event.Hook.register/0.

restart()

@spec restart() :: okey_return() | error_return()

Callback implementation for MishkaInstaller.Event.Hook.restart/0.

start()

@spec start() :: okey_return() | error_return()

Callback implementation for MishkaInstaller.Event.Hook.start/0.

start_link(args \\ [])

stop()

@spec stop() :: okey_return() | error_return()

Callback implementation for MishkaInstaller.Event.Hook.stop/0.

unregister()

@spec unregister() :: okey_return() | error_return()

Callback implementation for MishkaInstaller.Event.Hook.unregister/0.