定制 cntlscrut/drupal-eca-news-workflow 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cntlscrut/drupal-eca-news-workflow

最新稳定版本:v1.0.2

Composer 安装命令:

composer require cntlscrut/drupal-eca-news-workflow

包简介

Complete automated editorial workflow system for news organizations using ECA (Event Condition Action)

README 文档

README

Editorial Workflow ECA Version

A comprehensive automated editorial workflow system built with ECA (Event Condition Action) for news organizations, magazines, and content-driven websites using Drupal.

🚀 Features

📝 Editorial Workflow

  • Three-State Process: Draft → In Review → Published
  • Bidirectional Editing: Content can move back and forth between Draft and In Review
  • Smart Transitions: Automatic validation and checks during state changes
  • Bulk Operations: Manage multiple articles efficiently
  • Content Scheduling: Plan publication dates and times

📧 Intelligent Notifications

  • Role-Based Alerts: Targeted notifications based on user roles
  • Author Updates: Real-time feedback on content status
  • Editor Assignments: Automatic notification of pending reviews
  • Publication Alerts: Stakeholder updates on published content
  • Customizable Templates: Personalize notification messages

📊 Monitoring & Analytics

  • Activity Logging: Complete audit trail of all editorial actions
  • Performance Metrics: Track editorial efficiency
  • User Analytics: Monitor team productivity
  • Content Analytics: Publication success metrics
  • Workflow Optimization: Data-driven process improvements

⚡ Automation Engine

  • Content Validation: Automatic quality checks
  • SEO Compliance: Built-in optimization checks
  • Category Assignment: Smart content categorization
  • Publication Automation: Scheduled publishing
  • Workflow Rules: Customizable business logic

🛠️ Installation

Prerequisites

  • Drupal 11.0+
  • ECA module 2.1+
  • Content Moderation module
  • PHP 8.1+

Quick Install

# Using Drupal's recipe system
drush recipe recipes/news_editorial_workflow

# Or install manually
drush en eca_base eca_content eca_log eca_workflow content_moderation workflows
drush cim --partial --source=recipes/news_editorial_workflow/config

Composer Installation

# If installing from a repository
composer require drupal/news_editorial_workflow_recipe
drush recipe news_editorial_workflow

📖 Usage

1. Basic Workflow

// Content starts in Draft state
$node = Node::create([
  'type' => 'news',
  'title' => 'Breaking News Article',
  'moderation_state' => 'draft',
]);
$node->save();

// Submit for review
$node->set('moderation_state', 'in_review');
$node->save(); // Triggers notification to editors

// Publish content
$node->set('moderation_state', 'published');
$node->save(); // Triggers publication notifications

2. Customizing Notifications

Edit the ECA model to customize notification behavior:

# In eca.eca.news_editorial_workflow.yml
events:
  content_moderation_state_change:
    conditions:
      - workflow_id: basic_editorial
      - from_state: draft
      - to_state: in_review
    actions:
      - send_email:
          to: '[node:author:mail]'
          subject: 'Article submitted for review'

3. Adding Custom States

Extend the workflow by adding new states:

# In workflows.workflow.basic_editorial.yml
type_settings:
  states:
    fact_check:
      label: 'Fact Check'
      weight: 3
  transitions:
    fact_check_to_review:
      from: [fact_check]
      to: in_review

🏗️ Architecture

ECA Model Structure

News Editorial Workflow
├── Content Events
│   ├── State Change Triggers
│   ├── User Action Events
│   └── Scheduled Events
├── Conditions
│   ├── Role Checks
│   ├── Content Validation
│   └── Business Rules
└── Actions
    ├── Email Notifications
    ├── User Messages
    ├── Logging
    └── Content Operations

State Machine

graph LR
    A[Draft] -->|Submit| B[In Review]
    B -->|Approve| C[Published]
    B -->|Reject| A
    C -->|Unpublish| D[Unpublished]
    D -->|Republish| C
Loading

🎨 Customization

Adding New Roles

  1. Create new role: drush role:create fact_checker "Fact Checker"
  2. Update ECA conditions to include new role
  3. Modify notification templates

Custom Email Templates

email_templates:
  submission_notification:
    subject: '[site:name] - Article Submitted: [node:title]'
    body: |
      Dear Editor,
      
      A new article has been submitted for review:
      Title: [node:title]
      Author: [node:author:display-name]
      
      Review at: [node:url]

Integration Examples

With Views Bulk Operations

# Custom VBO action for bulk state changes
views_bulk_operations:
  actions:
    bulk_moderate_content:
      plugin_id: node_moderation_action
      configuration:
        state: published

With Scheduler Integration

# Automatic publication scheduling
scheduler_integration:
  publish_on: '[node:field_publish_date:value]'
  unpublish_on: '[node:field_unpublish_date:value]'

🧪 Testing

Running Tests

# Unit tests
phpunit --group news_editorial_workflow

# Functional tests
drush test-run --group EditorialWorkflow

# Behat scenarios
behat features/editorial-workflow.feature

Test Scenarios Included

  • ✅ Basic state transitions
  • ✅ Role-based permissions
  • ✅ Email notification delivery
  • ✅ Bulk operations
  • ✅ Content validation
  • ✅ Performance under load

🔧 Configuration

Environment Variables

# Email configuration
EDITORIAL_SMTP_HOST=smtp.example.com
EDITORIAL_FROM_EMAIL=editorial@example.com

# Notification settings
EDITORIAL_ENABLE_SLACK=true
EDITORIAL_SLACK_WEBHOOK=https://hooks.slack.com/...

Configuration Files

  • workflows.workflow.basic_editorial.yml - Workflow definition
  • eca.eca.news_editorial_workflow.yml - ECA configuration
  • eca.model.news_editorial_workflow.yml - ECA model definition

📚 Examples

1. News Website Setup

Perfect for online newspapers with multiple reporters and editors:

drush recipe news_editorial_workflow
drush role:create reporter "Reporter"
drush role:create editor "Editor"
drush role:create publisher "Publisher"

2. Magazine Integration

Ideal for monthly/weekly magazines with longer review cycles:

# Extended review process
workflow_modifications:
  additional_states:
    - copy_edit
    - fact_check
    - legal_review

3. Corporate Blog

Streamlined workflow for corporate content:

# Simplified two-state workflow
simple_workflow:
  states: [draft, published]
  auto_publish: true

🤝 Contributing

We welcome contributions! Here's how to get involved:

Development Setup

git clone https://github.com/your-org/news-editorial-workflow-recipe.git
cd news-editorial-workflow-recipe
composer install
ddev start

Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Follow Drupal coding standards
  • Write comprehensive tests
  • Document all changes
  • Update README as needed

📄 License

This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.

🆘 Support

🎖️ Credits

  • Built with ❤️ by the ECA Team
  • Inspired by real-world newsroom workflows
  • Community contributions from editorial professionals

🗺️ Roadmap

Version 1.1 (Planned)

  • AI-powered content suggestions
  • Advanced analytics dashboard
  • Multi-site workflow synchronization
  • Mobile editorial app integration

Version 1.2 (Future)

  • Video/multimedia workflow support
  • Social media integration
  • Real-time collaborative editing
  • Advanced permission granularity

Made with ❤️ for the Drupal Community

Drupal ECA Community

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-06-11