Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Integration of Content Workflow API #6115

Open
3 of 4 tasks
tvatavuk opened this issue Aug 20, 2024 · 0 comments
Open
3 of 4 tasks

[Enhancement]: Integration of Content Workflow API #6115

tvatavuk opened this issue Aug 20, 2024 · 0 comments

Comments

@tvatavuk
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description of problem

The Content Workflow API within DNN Platform has been developed but remains underutilized because it is not fully integrated and user interface is missing. This limits the ability of Content Editors and Content Managers to efficiently manage and publish content.

Description of solution

@iJungleboy and @tvatavuk have been analyzing the current state of the Content Workflow API within the DNN Platform and determining what is needed for minimal integration to allow users to utilize the Content Workflow API, enhancing the overall content management experience within DNN Platform.

Key aspects of the solution include:

  1. Workflow Configuration:

    • Enable the configuration of workflows at both the portal and tab levels through the UI.
    • Provide options for enabling/disabling workflows and setting default workflows for specific content types.
  2. TabActions - Implement IWorkflowAction:

    • StartWorkflow
    • CompleteState
    • DiscardState
    • CompleteWorkflow
    • DiscardWorkflow
  3. Web API

    • Configuration
    • Info
    • TabActions
  4. User Interface Development:

    • Design and implement a user-friendly UI that allows Content Editors and Managers to interact with the Content Workflow API.
    • Integrate workflow management features directly into the DNN PersonaBar, ensuring easy access and intuitive controls.
    • Configuration UI
    • Info UI
    • TabActions UI
    • Localization

The proposed enhancement focuses on making the Content Workflow API accessible and usable by Content Editors and Content Managers through a user interface within DNN Platform. This will empower these users to effectively manage and publish pages, streamlining the content management process.

Description of alternatives considered

No response

Anything else?

Here is some info related to Content Workflow API implemented in DNN Platform.

Introduction

DNN Platorm includes a content workflow system primarily reliant on a ContentItem that may be associated with a Tab, Module, or File. Additionally, there is a standalone workflow engine in the Html module, which currently does not integrate with the general DNN workflow system and needs to be integrated.

Standard Workflows

Three primary workflows are pre-configured in DNN for immediate use in any new portal setup:

  1. Direct Publish: Instantly publishes content (default).
  2. Save Draft: Saves content as a draft for later publication.
  3. Content Approval: Requires content to undergo a review process before publication.

Workflow Management Classes

System and Workflow Managers

  • ISystemWorkflowManager: Provides methods to create and retrieve all system workflows, tailoring them to the portal’s needs.
  • IWorkflowManager: Allows for comprehensive CRUD operations on workflows and provides insights into their usage across the portal.

Detailed Workflow Types

Direct Publish

Enables immediate content publication without intermediate steps.

States:

  1. Published

Save Draft

Allows content to be saved as a draft, undergoing further edits before final publication.

States:

  1. Draft
  2. Published

Content Approval

Allows an author to manage content and then have it reviewed by other users before it is published.

States:

  1. Draft
  2. Ready For Review
  3. Published

Workflow Engine Features

Core Classes and Interfaces

  • IWorkflowEngine: Manages the progression and regression of content through its lifecycle.
  • IWorkflowStateManager: Oversees state transitions within workflows, ensuring that each move is logged and executed according to predefined rules.
  • IWorkflowSecurity: Ensures that workflow transitions and actions adhere to the assigned permissions and security protocols.
  • IWorkflowLogger: Captures and logs all workflow-related activities for auditing and troubleshooting purposes.

Workflow Actions and Extensions

  • IWorkflowAction: Allows for the extension of workflow functionalities, where third-party developers can implement custom actions for state and workflow management.
  • IWorkflowActionManager: Manages the registration and execution of custom workflow actions, enhancing the workflow capabilities through third-party integration.

Workflow Action Types

WorkflowActionTypes Enum

Represents the workflow action types.

  • StartWorkflow = 4: Starts a workflow for a Content Item.
  • CompleteState = 3: Completes a state, moving the workflow forward to the next state. If the next state is not the last one, it sends notifications to the reviewers of the next state; otherwise, it sends a notification to the user who submitted the draft once the workflow is complete.
  • DiscardState = 2: Discards a state, moving the workflow backward to the previous state. If the previous state is not the first one, it sends notifications to the reviewers of the previous state; otherwise, it sends a notification to the user who submitted the draft when the workflow is in the draft state.
  • CompleteWorkflow = 1: Completes the workflow, no matter what the current state is. It also sends a system notification to the user who submitted the workflow to inform them about the complete workflow action.
  • DiscardWorkflow = 0: Discards the workflow, no matter what the current state is. It also sends a system notification to the user who submitted the workflow to inform them about the discard workflow action.

Tab Workflow Settings

ITabWorkflowSettings

Manages workflow settings at the tab level, providing methods to enable/disable workflows and set default workflows for specific tabs or the entire portal.

  • SetWorkflowEnabled (int portalId, bool enabled): Enables or disables the tab workflow for the entire portal. Corresponds to TabWorkflowEnableKey in Portal Settings.
  • SetWorkflowEnabled (int portalId, int tabId, bool enabled): Enables or disables the tab workflow for a specific tab. This won't enable the workflow of a tab if the tab workflow is disabled at the portal level. Corresponds to TabWorkflowEnableKey in Tab Settings.
  • SetDefaultTabWorkflowId (int portalId, int workflowId): Sets the default workflow for a portal. Corresponds to DefaultTabWorkflowKey in Portal Settings.
  • GetDefaultTabWorkflowId: Returns the default tab workflow of the portal. If no default workflow is defined for a portal, the method returns the Direct Publish system workflow.
  • IsWorkflowEnabled (int portalId)
  • IsWorkflowEnabled (int portalId, int tabId)

Tab Workflow Tracker

ITabChangeTracker

  • TrackModuleAddition: Tracks a change when a module is added to a page.
  • TrackModuleModification: Tracks a change when a module is modified on a page.
  • TrackModuleDeletion: Tracks a change when a module is deleted from a page.
  • TrackModuleCopy: Tracks a change when a module is copied from an existing page.
  • TrackModuleUncopy: Tracks a change when a copied module is deleted from an existing page.

Tab Version Builder

ITabVersionBuilder

  • CreateNewVersion: Creates a new Tab Version, checking current portal settings.
  • Publish: Publishes a Tab Version.
  • Discard: Discards a Tab Version. If the tab only has an unpublished version, the page will keep it but with no content and not published.
  • RollBackVersion: Rolls back an existing version.
  • DeleteVersion: Deletes an existing Tab Version.
  • SetupFirstVersionForExistingTab: Sets up a first version for an existing tab with modules. This method is used to create version 1 for pages created when versioning was not enabled.
  • GetVersionModules: Gets all Modules Info associated with a specific version.
  • GetCurrentVersion: Gets the current published version of the page.
  • GetCurrentModules: Gets all Modules Info associated with the last published version of the page.
  • GetUnPublishedVersion: Gets the unpublished version or Null if the Tab has no unpublished version.
  • GetUnPublishedVersionModules: Gets all ModuleInfo objects associated with the unpublished version of a page.
  • GetModuleContentLatestVersion: Gets the latest version or 1 if the module is not versionable.

Content Workflow Service Controller

  • Approve (NotificationDTO postData)
  • Reject (NotificationDTO postData)

Note: This controller is not very useful due to complications related to Notification.

Model

ContentItems

  • StateID
  • TabID
  • ModuleID

Tabs

  • ContentItemID
  • HasBeenPublished

Modules

  • ContentItemID

Files

  • ContentItemID
  • HasBeenPublished

Data Model and Database Schema

A comprehensive data model supports the workflow system, detailing the associations between ContentItems and their respective Tabs, Modules, or Files, including publication states.

dnn-content-workflow

Future Enhancements and Research

To fully realize the potential of the DNN workflow system, further enhancements are necessary, particularly in UI development and the integration of orchestrated job functions. These would provide a more intuitive and automated workflow experience.

Other Info

Do you be plan to contribute code for this enhancement?

  • Yes

Would you be interested in sponsoring this enhancement?

  • Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct
tvatavuk added a commit to tvatavuk/Dnn.Platform that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant