定制 punktde/archivist 二次开发

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

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

punktde/archivist

Composer 安装命令:

composer require punktde/archivist

包简介

A Neos CMS package that automatically sorts nodes into a predefined structure which is created on the fly.

README 文档

README

Travis Build Status Latest Stable Version Total Downloads

Purpose of this package: Automatically sorts nodes into a predefined structure which is created on the fly.

Neos has some drawbacks, if you store lots of Node - like news for example - on the same hierarchical level. Especially the backend trees are getting slow and confusing. This package automatically sorts this nodes in a configured and automatically created hierarchy.

Configuration

You can configure the behavior differently for every triggering node type. The configuration options are best explained by example. These examples are taken from Configuration/Testing/Settings.yaml and are thus automatically tested.

Simple Example

Configuration for the nodeType 'PunktDe.Archivist.TriggerNode'. The sorting is triggered if a node of this type is created or if a property on this node is changed. This node is then available as 'node' in the other parts of the configuration

PunktDe:
  Archivist:
    sortingInstructions:

      'PunktDe.Archivist.TriggerNode':

        # The query selecting the root node of the automatically created hierarchy
        hierarchyRoot: "${q(site).find('[instanceof Neos.ContentRepository.Testing:Page]').get(0)}"

        # Optional: The sorting of the nodes inside the target hierarchy. Can be the name of a property
        # or an eel expression like seen below
        sorting: title

        # Optional: Trigger sorting only, when condition is met. Can be used to make sure that required properties are set as expected.
        condition: "${node.properties.date != null}"

        # In the context is evaluated first. You can define variables here which you can use in
        # the remaining configuration
        context:
          publishDate: "${node.properties.date}"

        # Automatically publish the created document hierarchy
        publishHierarchy: true

        # Definition of the auto-generated hierarchy
        hierarchy:
          -
            # The type of the hierarchy-node
            type: 'PunktDe.Archivist.HierarchyNode'

            # Properties of the new created node.
            properties:
              name: "${Date.year(publishDate)}"
              title: "${Date.year(publishDate)}"
              hiddenInIndex: "${true}"

            # The property which is identical throughout all nodes of this level
            identity: title

            # An eel query that describes the sorting condition
            sorting: "${q(a).property('title') < q(b).property('title')}"
          -
            type: 'PunktDe.Archivist.HierarchyNode'
            properties:
              name: "${Date.month(publishDate)}"
              title: "${Date.month(publishDate)}"
            identity: title

            # Simple sorting on a property
            sorting: title

Example with a triggering content node

A content node triggers the move of its parent document node. For example, if you have a title node which should be considered to move the page.

PunktDe:
  Archivist:
    sortingInstructions:
      'PunktDe.Archivist.TriggerContentNode':

        # The query selecting the root node of the automatically created hierarchy
        hierarchyRoot: "${q(site).find('[instanceof Neos.ContentRepository.Testing:Page]').get(0)}"

        # Optional: The node to be moved, described by an Eel query.
        # This defaults to the triggering node if not set. The triggering node is available as "node".
        # If the affected node is not found by the operation is skipped.
        # This can for example be used if a change in a content node should move its parent document node
        #
        affectedNode: "${q(node).parent('[instanceof Neos.ContentRepository.Testing:Document]').get(0)}"

        # Definition of the auto-generated hierarchy
        hierarchy:
          -
            # The type of the hierarchy-node
            type: 'PunktDe.Archivist.HierarchyNode'

            # Properties of the new created node.
            properties:
              name: "${Archivist.buildSortingCharacter(title)}"
              title: "${Archivist.buildSortingCharacter(title)}"

Define multiple configurations for the same NodeType

In addition to

PunktDe:
  Archivist:
    sortingInstructions:
      MyNode.Type:
        hierarchyRoot: # ...

you can now do this:

PunktDe:
  Archivist:
    sortingInstructions:
      MyNode.Type:
        foo1:
          hierarchyRoot:  # ...
        foo2:
          hierarchyRoot:  # ...

Make sure, to define a conditon to not run several configurations on the same Node action.

Archivist Eel Helper

Archivist.buildSortingCharacter(string, position = 0, length = 1) Generates upper case sorting characters from the given string. Starting position and length can be defined.

punktde/archivist 适用场景与选型建议

punktde/archivist 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 40.96k 次下载、GitHub Stars 达 18, 最近一次更新时间为 2018 年 01 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 punktde/archivist 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 punktde/archivist 我们能提供哪些服务?
定制开发 / 二次开发

基于 punktde/archivist 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 18
  • Watchers: 7
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-23