2

Documentumベースのデータウェアハウスの一種のフロントエンドとして機能するセクションを企業ウィキに追加しようとしています(検索機能がなく、内部組織が貧弱であるため)。アイデアは、メタデータと直接リンクを使用して各ドキュメントの記事スタブを作成し、SemanticMediawikiを使用してシステム内の記事を追跡および整理することです。

セマンティックフォームを使用して記事の作成を管理していますが(APIを使用していくつかのスプレッドシートから最初にプッシュした後)、システムがユーザーの手を最初から最後まで保持できるように、記事の命名も自動化したいと思います。すべてのタイトルはMBMA-00001のようなものになるので、MBMAページのボタンを押すと、Category:MBMAを検索し、現在システムにあるMBMA-nの最大数を判別し、ユーザーを次のように誘導します。 MBMA-n+1がすでにタイトルとして入力されているセマンティックフォームテンプレート。

InputBoxCreateBoxCreateArticleなどの拡張機能はこの関数をサポートしていないようですが、追加できる別の拡張機能がありますか?それとも、自分で書く方法を理解する必要がありますか?

4

2 に答える 2

1

要件が非常に専門的であるように思われるため、おそらく独自の要件を作成する必要があると言うつもりでしたが、DPL Page Name S/N Maker拡張機能に出くわしました。

Semantic Forms を使用した拡張機能のバリアントもあります。

于 2013-03-20T15:20:25.337 に答える
1

上にリンクされたテンプレートはまさに私が必要としていたものでしたが、実際には書かれたとおりには機能しませんでした。将来この必要がある他の人のために、問題のある文字列関数を削除し、完全に機能する、クリーンアップおよび修正されたバージョンを次に示します。

{{#if: {{{form|}}}
  |  {{#ifexist: Form:{{{form|}}} 
       |
       | <strong class="error">Warning! The form "{{{form|}}}" may not be a valid form name!</strong>
     }}
  |
}}<!---
-->{{#if: {{{form|}}}
     | {{#ifeq: {{lc:{{NS:{{{namespace|}}} }} }} 
         | {{lc:{{{namespace|}}} }}
         | 
         | <strong class="error">Warning! "{{{namespace}}}" may not be a valid namespace name!</strong>
       }}
     |
   }}<!---
-->The next document number is '''<!--
-->{{#if: {{{namespace|}}} | {{{namespace|}}}: }}{{{prefix|}}}<!--
   -->{{padleft:<!----------- (X+1)                         =>  0000(X+1) 
      -->{{#expr:<!---------- 0000X+1                       =>  (X+1)
         -->{{replace|<!----- "Namespace:prefix0000X"       =>  "0000X" 
            -->{{replace|<!-- "*[[Namespace:prefix0000X]]"  =>  "Namespace:prefix0000X"
               -->{{#dpl:<!-- return pages named "*[[Namespace:prefix0000X]]"
                  -->titleregexp =^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!--
                  -->| namespace = {{{namespace|}}}<!--
                  -->| order = descending<!--
                  -->| mode = userformat<!--
                  -->| format = ,%PAGE%<!--
                  -->| noresultsheader = {{padleft:0|{{{pad|5}}}|0}}<!--
                  -->| count = 1
                  }}
               |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/  
               |\2
               }}
            | {{#if: {{{namespace|}}} | {{{namespace|}}}:}}{{{prefix|}}}
            |
            }}
         +1
         }}
     | {{{pad|5}}}
     | 0
     }}'''
----
{{#if: {{{form|}}}
  | {{#forminput: {{{form|}}}
      | {{{width|20}}}
      | {{{prefix|}}}<!--
      -->{{padleft:<!----------- (X+1)                         =>  0000(X+1) 
         -->{{#expr:<!---------- 0000X+1                       =>  (X+1)
            -->{{replace|<!----- "Namespace:prefix0000X"       =>  "0000X" 
               -->{{replace|<!-- "*[[Namespace:prefix0000X]]"  =>  "Namespace:prefix0000X"
                  -->{{#dpl:<!-- return pages named "*[[Namespace:prefix0000X]]"
                     -->titleregexp =^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!--
                     -->| namespace = {{{namespace|}}}<!--
                     -->| order = descending<!--
                     -->| mode = userformat<!--
                     -->| format = ,%PAGE%<!--
                     -->| noresultsheader = {{padleft:0|{{{pad|5}}}|0}}<!--
                     -->| count = 1
                     }}
                  |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/  
                  |\2
                  }}
               |{{#if: {{{namespace|}}} | {{{namespace|}}}:}}{{{prefix|}}}
               |
               }}
            +1
            }}
        | {{{pad|5}}}
        | 0
        }}
     | {{{buttonlabel|Add}}}
     | {{#if: {{{namespace|}}} | namespace = {{{namespace|}}} }}  
     }}
  | <includeonly><strong class="error">Warning! You haven't specified a SemanticForm for page creation! Please specify a SemanticForm name.</strong></includeonly>
}}<noinclude>{{documentation}}</noinclude>

ドキュメントのサブページ:

{{documentation subpage}}
{{intricate template}}
== Parameters ==

All parameters to the template are optional.

{| class="wikitable"
|- 
! form
| Specifies a SemanticForm name, which will handle the pages you create.
|- 
! namespace
| Specifies a Namespace, which the new page will belong to.
|- 
! prefix
| Specifies a title fragment, which will prefix the generated number
|- 
! pad
| The number of digits required in the page number. The default value is "5".
|- 
! width
| Sets the width of the input box. The default value is "20".
|- 
! buttonlabel
| Sets the text of the Create button. The default value is "Add".
|}

== Example ==

<pre><nowiki>{{DPLSNMakerSF
 | form        = MBMA Document
 | namespace   =
 | prefix      = MBMA-
 | pad         = 5
 | width       = 30
 | buttonlabel = Create
}}
</nowiki></pre>

== See also ==

[[mw:extension:DPL Page Name S/N Maker (using SemanticForms)]]
于 2013-03-29T17:28:23.993 に答える