2012-04-17 7 views
2

Alfresco Webクイックスタートを使用して、基本的なCMS Webサイトを作成しています。私はアップロードしたコンテンツにプロパティ/メタデータを追加する方法を誰かが説明できるかどうか疑問に思っていました。たとえば、画像のギャラリー(デフォルトのメタデータがAuthor、Published、Size、およびMime Type)を持ち、プロパティなどを取得したい場合、どうすれば実装できますか?Alfrescoのアップロードされたコンテンツにプロパティを追加する

私はいくつかの調査を行っていますが、まだ具体的な解決策を見つけるには至っていません。ありがとう!

答えて

1

それはお尻の王室の痛みです。

まず、モデルを作成する必要があります。そのモデルの中で、アスペクトを作成する必要があります。これらはすべてXMLファイル#1に入っています。

次に、アスペクトを登録するためのコンテキストファイルが必要です。これはXMLファイル#2です。

プロパティファイルは、アスペクトにフレンドリーな名前を付けます。

とWebサイト - カスタムコンフィグこれは、XMLファイル#3

であり、あなたが共有カスタム設定を必要とするXMLファイル1に挙げたすべてのプロパティを一覧表示します。これは、XMLファイル#3とは異なる形式ですが、同じ目的を果たします。

最後に、フォルダ内の各アイテムにアスペクトを自動的に適用するルールを作成する必要があります。

参考:返信用http://blogs.alfresco.com/wp/wabson/2010/02/25/adding-custom-aspect-support-in-alfresco-share/


シェアカスタム-config.xmlの

<alfresco-config> 

    <!-- Repository Library config section --> 
    <config evaluator="string-compare" condition="RepositoryLibrary" replace="true"> 
     <!-- 
     Whether the link to the Repository Library appears in the header component or not. 
     --> 
     <visible>true</visible> 
    </config> 

    <config evaluator="string-compare" condition="DocumentLibrary"> 

     <!-- 
     Used by the "Manage Aspects" action 

     For custom aspects, remember to also add the relevant i18n string(s) 
      cm_myaspect=My Aspect 
     --> 
     <aspects> 
      <!-- Aspects that a user can see --> 
      <visible> 
       <aspect name="my:sampleProps" /> 
       <aspect name="ac:androidContentProps" /> 
      </visible> 

      <!-- Aspects that a user can add. Same as "visible" if left empty --> 
      <addable> 
      </addable> 

      <!-- Aspects that a user can remove. Same as "visible" if left empty --> 
      <removeable> 
      </removeable> 
     </aspects> 
    </config> 

    <config evaluator="node-type" condition="cm:content"> 
     <forms> 
      <form> 
       <field-visibility> 
        <!-- fields from my example aspect --> 
        <show id="my:propOne" /> 
        <show id="my:propTwo" /> 
        <show id="my:propInt" /> 
        <show id="my:propFloat" /> 
        <show id="my:propDateTime" /> 
        <show id="my:propDate" /> 
        <show id="my:propBoolean" /> 
        <show id="my:propQName" /> 
        <show id="my:propCategory" /> 
        <show id="my:propNodeRef" /> 
        <show id="my:propPath" /> 
        <!-- fields for android content --> 
        <show id="ac:propNotify" /> 
        <show id="ac:propNotificationSummary" /> 
        <show id="ac:propArchiveDate" /> 
        <show id="ac:propPublishDate" /> 
        <show id="ac:propPriority" /> 
        <show id="ac:propRegion" /> 
        <show id="ac:propMarket" /> 
        <show id="ac:propDistrict" /> 
        <show id="ac:propStore" /> 
       </field-visibility> 
      </form> 
     </forms> 
    </config> 


    <config evaluator="string-compare" condition="Remote"> 
     <remote> 
      <endpoint> 
       <id>alfresco-noauth</id> 
       <name>Alfresco - unauthenticated access</name> 
       <description>Access to Alfresco Repository WebScripts that do not require authentication</description> 
       <connector-id>alfresco</connector-id> 
       <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url> 
       <identity>none</identity> 
      </endpoint> 

      <endpoint> 
       <id>alfresco</id> 
       <name>Alfresco - user access</name> 
       <description>Access to Alfresco Repository WebScripts that require user authentication</description> 
       <connector-id>alfresco</connector-id> 
       <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url> 
       <identity>user</identity> 
      </endpoint> 

      <endpoint> 
       <id>alfresco-feed</id> 
       <name>Alfresco Feed</name> 
       <description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description> 
       <connector-id>http</connector-id> 
       <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url> 
       <basic-auth>true</basic-auth> 
       <identity>user</identity> 
      </endpoint> 

      <endpoint> 
       <id>activiti-admin</id> 
       <name>Activiti Admin UI - user access</name> 
       <description>Access to Activiti Admin UI, that requires user authentication</description> 
       <connector-id>activiti-admin-connector</connector-id> 
       <endpoint-url>http://localhost:8080/alfresco/activiti-admin</endpoint-url> 
       <identity>user</identity> 
      </endpoint> 
     </remote> 
    </config> 

</alfresco-config> 
+0

また、Metadata Extractor Serviceを使用して、ファイルからそのデータを自動的に抽出する方法が望まれます。ただし、組み込みのアスペクトの1つ(exif:exifなど)を選択すると、ファイルからそのデータを抽出するためのすべての設定が既に存在します。 – Gagravarr

+0

ねえジョナサン:)素早い対応に感謝します。あなたの例に沿ってアスペクトを作成し、ルールを作成しました(アイテムが作成されたとき、またはこのフォルダを入力したとき、または更新されたとき、すべてのアイテムにアスペクトを追加します)。しかし、アスペクトが適用されるはずのフォルダ内の項目で[プロパティの編集]をクリックすると、新しいプロパティは表示されません。なぜこれが分かっていますか?あなたの助けが大変ありがとう! – sm4491

+0

共有またはエクスプローラを使用していますか?共有を使用する場合は、C:\ Alfresco \ tomcat \ shared \ classes \ alfresco \ web-extension \ share-config-custom.xmlのすべてのプロパティをリストする必要があります。私は自分の答えを編集して、私が使っていることを示します。 –

3

Alfrescoの特定ノードの利用可能なメタデータは、type and aspectsで示されます。

Alfrescoは、あなたのユースケースに使用したいかもしれないEXIFアスペクト(「exif:exif」と表示されます)を既に持っています。残念なことにWCM QSは非表示にします。 exif:exifの公開するすべてのフィールドを表示するshare-config-custom.xmlファイル(サンプルhere、公式docs)を作成する必要があります。次のような

何か作業をする必要があります:

<config evaluator="model-type" condition="exif:exif"> 
    <forms> 
     <form> 
      <field-visibility> 
       <show id="exif:dateTimeOriginal"/>     
      </field-visibility>    
     </form> 
    </forms> 
</config> 
+0

ありがとう!私が本当にやりたいことは、私のシステム内のさまざまなタイプのコンテンツのカスタムメタデータを作成することです。 exifのアスペクトでさまざまなフィールドを公開しても、この問題は解決されません。しかし、アドバイスありがとう:) – sm4491

+0

私の答えの最初のリンクを見て、それはコンテンツの種類と側面に関する全体の説明はどこです。この場合、あなたのニーズをモデル化するために、アスペクトを使用する可能性が最も高いはずです。 – skuro

関連する問題