Dnn.Platform
Dnn.Platform copied to clipboard
[Enhancement]: Integration of Content Workflow API
Is there an existing issue for this?
- [X] 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:
-
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.
-
TabActions - Implement IWorkflowAction:
- StartWorkflow
- CompleteState
- DiscardState
- CompleteWorkflow
- DiscardWorkflow
-
Web API
- Configuration
- Info
- TabActions
-
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:
- Direct Publish: Instantly publishes content (default).
- Save Draft: Saves content as a draft for later publication.
- 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:
- Published
Save Draft
Allows content to be saved as a draft, undergoing further edits before final publication.
States:
- Draft
- Published
Content Approval
Allows an author to manage content and then have it reviewed by other users before it is published.
States:
- Draft
- Ready For Review
- 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 toTabWorkflowEnableKeyin 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 toTabWorkflowEnableKeyin Tab Settings. - SetDefaultTabWorkflowId (
int portalId, int workflowId): Sets the default workflow for a portal. Corresponds toDefaultTabWorkflowKeyin 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
Nullif the Tab has no unpublished version. - GetUnPublishedVersionModules: Gets all
ModuleInfoobjects 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.
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
- DNN Content Workflow Documentation
- RFC: Workflow Management UI (Not Implemented) #2434
- Workflow Administration - Prompt Commands #3074
Do you be plan to contribute code for this enhancement?
- [X] Yes
Would you be interested in sponsoring this enhancement?
- [ ] Yes
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
WIP. In the dnn-workflow feature branch, I’ve implemented minimal code to enable content workflow on the site:
- [X] TabActions implementation for content workflow.
- [X] Control content workflow settings in site settings.
- [X] Enable page search related to content workflow.
In Site Settings > Site Behavior > More, a new Workflow section has been added with options to:
- Enable versions.
- Set the maximum number of versions.
- Enable workflow.
- Select the default workflow type.
To demonstrate the Content Approval workflow, I’ve added a new HTML module with some text to the top of the Home page.
In View mode, the new HTML module is not visible to regular users until it's published.
Editors can now search for Draft pages using the advanced page search feature and filter results by Workflow type, Publish status, etc.
Workflow actions can be executed within notification messages.
Finally, the draft Home page was published, and the new text at the top of the page is now visible to all users.
TODO:
- [ ] Add content workflow settings per tab.
- [ ] Add content workflow tab action buttons in edit mode.
- [ ] Update UI wording and localization.
- [ ] Improve notification messages and localization.
- [ ] Submit pull request based on the latest v10 code.
This is really impressive, great work!
I love this, very useful. We are really looking forward to this.
One thought I had - it might be there already but I am not sure - a common use case (step) in most workflow processes is to be able to send a Preview Link of the not-yet-Published page to someone so they can see it even if they are not logged in. Is that covered somehow?
@jeremy-farrance as of now and very likely the MVP scope of this work, this will not be possible.
The workflows (relevant for publish a draft) are tightly coupled with the permission system.
The versioning system is I guess a separate topic. This could theoretically be done with a link, but there would be quite a bit of effort to ensure that such a link is secure and can't be guessed (like when switching skins in DNN), since that would leak potentially vulnerable data.
Imagine a company which is preparing an stock-relevant update info on their website, where the release of information must be timed according to regulatory rules. If people could just preview the next version of the page with a ?version=draft or something, this could lead to serious problems.
So basically I believe it can be done, but would need a lot of consideration to figure out what should be done and how. This will take time and discussions, so should not be in the initial release - and could also be contributed by others ;)
This is really impressive, great work!
Sharing DNN love ❤️ and respecting the work of @valadas and other giants 🏆 since the beginning of DNN time. 👏
WIP
In the dnn-workflow feature branch, I’ve implemented workflow buttons in the Edit Bar, as well as workflow information and settings at the tab level.
- [X] Add content workflow settings and info per tab.
- [X] Add content workflow tab action buttons in edit mode.
Here is a demonstration:
-
Log in as the editor user in the
Content Editorsrole. When content workflow is enabled, the current page's Publish Status is visible in the Edit Bar. -
The editor adds a new module at the top of the page. The Publish Status changes to
Draftin the Edit Bar. Workflow buttons [Submit] and [Discard] are visible to the editor. There is one new notification for the editor user. -
The editor clicks on [Submit] to request a review from the
Content Managers. The Publish Status remainsDraft, but the workflow buttons are now hidden. -
Log in as the manager user in the
Content Managersrole. The workflow buttons [Submit], [Discard], [Approve], and [Reject] are visible to the manager. -
Under
Page>Details, there is more information related to Publish Status, Versioning, and Workflow. -
Under
Page>Advanced>More, there are new Workflow settings to control it at the page level. -
The manager clicks on [Approve] to publish the new version to everyone. The Publish Status changes to
Published, and the workflow buttons are hidden in the Edit Bar.
TODO:
- [ ] Update UI wording and localization.
- [ ] Improve notification messages and localization.
- [ ] Submit pull request based on the latest v10 code.
This is AWESOME!
I would like to double down on @mitchelsellers comment - this is INSANE on so many levels (incl. the question: why did we wait so long!).
@tvatavuk this is amazing!
🎉 All planned tasks for this PR are complete! 🎉
The last three planned activities were:
- ✅ Updated UI wording and localization.
- ✅ Improved notification messages and localization.
- ✅ Submitted a pull request based on the latest v10 code.
🧪 Tested with:
- A clean installation of v10.
- An upgrade from v9.13.4 to v10.
📝 Side note:
During testing, I encountered an issue with the installation/upgrade zip, which includes an older version of DotNetNuke.ModulePipeline.dll. This version is incompatible with the latest v10 code. I resolved this by manually replacing it with the correct DotNetNuke.ModulePipeline.dll, but this should be addressed in the downstream build process to prevent future issues.
A huge thanks to everyone who helped with this PR! 🙌
@tvatavuk THANK YOU! for this amazing contribution! I will try to get things tested/reviewed as soon as I can, and I know others will as well
@tvatavuk I believe some of the buttons for approve etc. were still optimized. Any chance you could add some print-screens here?
This describes a typical use case of the "Content Approval" workflow on a page:
-
An Editor (user in the
Content Editorsrole) adds a new module to the page, placing the workflow into theDraftstate. The Editor sees Submit and Discard action buttons in the edit bar. -
Once the editing is complete, the Editor submits the draft for approval, moving the workflow to the
Ready For Reviewstate. -
A Manager (user in the
Content Managersrole) is presented with the Publish, Reject, and Discard action buttons. -
After the review process, the Manager publishes the page, transitioning the workflow to the
Publishedstate.
Additional Features:
Content Managers
-
Manager user has an additional Publish action button when the workflow is in Draft.
Advanced Page Search:
Users can utilize Advanced Page Search to find a list of all pages filtered by workflow state, type, and other criteria. This feature enhances the ability to manage and track pages throughout different stages of the workflow.
Administrator Workflow Settings:
An Administrator can control workflow settings for the entire site by navigating to:
Site Settings > Site Behavior > More.
This allows for site-wide configurations of the content approval process.
Page-Level Workflow Settings:
Workflow settings can also be adjusted on a per-page basis by going to:
Page > Advanced > More
This provides granular control over the workflow for individual pages.
@tvatavuk really looks great. I like it how you show what workflow it's in and the progress - really 😎!
ContentWorkflowDNNModule is example of DNN module with content workflow integration.
This module offers a straightforward implementation of a tab content workflow, facilitating content creation, editing, approval, and publishing within a DNN environment.
I think the core inner workings as implemented but we keep this issue to add a management UI right @tvatavuk
Absolutely! The core functionality is in place, making it already useful for daily work. However, a management UI is still needed to provide an overview of older page versions, along with options to restore them. Localization is also missing.
In addition, implementing general workflow administration for customizing default workflows or creating new ones on top of the existing three would greatly enhance its flexibility.