Class Component

    • Constructor Detail

      • Component

        public Component()
        The logged User creates a new component.
    • Method Detail

      • register

        public static void register​(Class<?> c)
        Registers a new class has a component.
        Parameters:
        c - the class being registered as a component.
      • forType

        public static ComponentDescriptor forType​(String type)
        Searches for the class of a component with a given type.
        Parameters:
        type - the type of the component.
        Returns:
        the class of the component with the given type.
      • availableComponents

        public static com.google.gson.JsonArray availableComponents​(Site site)
      • getName

        public String getName()
        Returns:
        the name of the component.
      • getDescription

        public String getDescription()
        Returns:
        the description of the component.
      • handle

        public abstract void handle​(Page page,
                                    TemplateContext componentContext,
                                    TemplateContext globalContext)
        Provides the necessary info needed to render the component on a given page and context.
        Parameters:
        page - the page where the component will be rendered.
        componentContext - local context for the component.
        globalContext - global context where the component is being rendered.
      • delete

        public void delete()
      • componentType

        public Class<?> componentType()
      • json

        public abstract com.google.gson.JsonObject json()