SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
CMIS輪読会#4
              Secondaryタイプを通じて学ぶ
                     Object Type
                      @linzhixing




                                    © 2013 aegif

13年1月30日水曜日
CMISとは

      n   Content Management Interoperability Service
      n   文書管理システムとアクセスするためのOASIS標準規格
            –   https://www.oasis-open.org/news/announcements/content-management-interoperability-services-cmis-version-1-1-
                approved-and-publis
            –   文書やリポジトリにWEBプロトコルを通じてアクセスできる
      n   仕様書
            –   http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.pdf
            –   このスライドでは、上記PDF版を前提とする。
      n   CMIS規格を実装したライブラリが各種プログラミング言語で存在する
            –   Java:Apache Chemistry(サーバライブラリ含む)
            –   Ruby:ActiveCMIS
      n   CMIS specificationは長らくVer1.0だったが、2012/12/07にVer1.1が承認された
            –   現時点ではまだVer1.1に対応したライブラリは存在していない
            –   Ver1.1での変更点としては、CMIS規格を拡張するためのエンドポイント新設が目立つ
      n   CMIS準拠した製品
            –   サーバ含む:Alfresco, Documentum, Nuexo, FileNet, OpenText, SAP NetWeaver, SharePoint......
            –   クライアント:Drupal, LibreOffice, Liferay, Wordpress......
            –   aegif自社製品:
                 • CmisSync - CMIS準拠のリポジトリをデスクトップからDropboxのように扱える
                 • NemakiWare - ライトウェイト&スケーラブルなCMISリポジトリ &クライアント群。バックエンドはCouchDB。


                                                                     2
13年1月30日水曜日
CMIS1.1での変更点 [1.5]

     n   オブジェクトタイプをクライアントから作成/変更/削除できる
     n   CMIS仕様外の機能がリポジトリでサポートされていれば、getRepositoryInfoで識別できる
     n   Itemオブジェクトタイプ
           –   ベースタイプ(document/folder/relationship/policy)以外のタイプを扱うための拡張ポイント
     n   Secondaryオブジェクトタイプ
           –   オブジェクトに動的にプロパティ項目を付加することができる
     n   Retention & Hold
           –   削除/変更からオブジェクトを保護するために使う
           –   Secondaryオブジェクトタイプのサブタイプとして定義されている
     n   ブラウザとのバインディング
           –   ブラウザ等からCMISリポジトリに対して、REST的にJSON形式でやり取りできる
     n   bulkUpdatePropertiesサービス
           –   複数のオブジェクトに対するプロパティ変更を、一度のサービス呼出でバルク処理できる
     n   appendContentStreamサービス
           –   ドキュメントに添付するContentStreamを、分割して追加していくことができる
           –   容量の大きなアップロードなどに役立つ




                                               3
13年1月30日水曜日
Secondaryオブジェクトタイプ [2.1.9]
     n   前回までのあらすじ
           –   各Base Object Typeの紹介:document/folder/relationship/policy/item
           –   最後のオブジェクトタイプ、secondary
           –   item/secondaryはCMIS specification ver1.1から登場


     n   Secondaryオブジェクトタイプとは?
           –   プロパティの集合体に名前が付いたもの(まあオブジェクトタイプなので……)
           –   他のオブジェクトに対して適用/解除を動的に行える


     n   SecondaryがあるならPrimaryもある
           –   document/folder/policy/relationship/itemをPrimaryオブジェクトタイプと呼ぶ。[2.1.2]
           –   オブジェクトは必ず1つだけPrimaryオブジェクトタイプを持つ
           –   オブジェクトには0以上のSecondaryオブジェクトタイプを適用できる




                                                       4
13年1月30日水曜日
Secondaryオブジェクトタイプ [2.1.9]

     n   ここでちょっと復習


     n   オブジェクトタイプの継承[2.1.2]
          –   すべてのオブジェクトタイプは、baseオブジェクトタイプ か そのサブタイプ(継承)のいずれか
          –   baseオブジェクトタイプは6つのみ
               • cmis:document/cmis:folder/cmis:relationship/cmis:policy/cmis:item/cmis:secondary
          –   サブタイプの例:cmis:documentのサブタイプ invoice (好きに定義できる)




                                                               5
13年1月30日水曜日
Secondaryオブジェクトタイプ [2.1.9]

     n   「Secondaryオブジェクトタイプ」は、プロパティの集合体
          –   cmis:secondaryというbaseオブジェクトタイプには、property definitionが存在しない
          –   cmis:secondaryのサブタイプである「Secondaryオブジェクトタイプ」には任意にproperty definitionを
              持たせることができる
          –   ↑「Secondaryオブジェクトタイプを適用する」というのは、このサブタイプを適用するの意
          –   Secondaryオブジェクトタイプ(サブタイプ)として、CMIS1.1ではRetentionとHoldという特別なタイ
              プを規定している[2.1.16]
               • それ以外にSecondaryオブジェクトタイプの セマンティクス はCMISでは規定していない


     n   Secondaryオブジェクトタイプの適用
          –   適用されたオブジェクトは、自身のPrimaryオブジェクトタイプで定義されたプロパティとは別に、
              Secondaryオブジェクトタイプのプロパティを自分自身の値として返す
          –   適用方法:
               • オブジェクトのcmis:secondaryObjectTypeIdsにSecondaryタイプのIDを追加/削除
               • updatePropertiesサービスから
               • checkInサービスから
          –   適用および適用の解除は、いつでも行える
               • 解除すると、Secondary由来のプロパティおよびその値はオブジェクトからすべて削除される
          –   適用/解除を制限するルールを実装してもよい(Repository-sepcific)




                                                   6
13年1月30日水曜日
Secondaryオブジェクトタイプ [2.1.9]

     n   プロパティと値のイメージ
          –   オブジェクトは、必ずPrimaryオブジェクトタイプを1つだけ持つ[2.1.2]
              • Secondaryオブジェクトタイプを持つオブジェクトを作成することはできない
          –   オブジェクトに適用されるのは「Secondaryオブジェクトタイプ」であって、Secondaryオブジェクトタ
              イプのオブジェクトではない(そんなものはない)
          –   各オブジェクトは自分が属するPrimaryオブジェクトタイプで定義されたプロパティを持つ
          –   それに加えて、各オブジェクトは自分に適用されたSecondaryオブジェクトタイプ由来のプロパティについ
              ても、オブジェクトごとに独自の値を持つ
          –   Policyタイプのオブジェクトのように、他のオブジェクトから共通して参照されるオブジェクトがあるわけ
              ではない
              • 逆に言えば、共通のSecondaryオブジェクトタイプを持っていても、適用先オブジェクト固有の値を反映できる。
                Policyタイプのオブジェクトを共有する場合、オブジェクト固有の値を反映するのは難しい


                   Primaryタイプ        Secondaryタイプ   Primaryタイプ      Secondaryタイプ

                      P1                   S1          P2               S1


                           オブジェクト A                     オブジェクト B

                                            ∼                プロパティ p2   ∼
                                プロパティ p1


                                プロパティ s1    a                プロパティ s1    b




13年1月30日水曜日
Secondaryオブジェクトタイプ [2.1.9]

     n   Alfrescoのaspectに似ている


     n   CMIS Ver1.1ではCMIS SQL QueryでSecondaryプロパティが取得できるようになる(想像)
           –   SELECT * FROM cmis:document WHERE ∼ で * の中にsecondary由来のプロパティが含まれている
           –   Primaryオブジェクトタイプのプロパティcmis:secondaryObjectTypeIdsからたどれば、secondary由来
               のプロパティを特定できる
           –   標準的なCMIS SQL Queryだけでaspects的なものが取得可能になる
           –   特定のCMISリポジトリでしか通用しない構文を使わなくてよくなる
                • SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId =
                  O.cmis:objectId http://wiki.alfresco.com/wiki/CMIS_Query_Language


     n   NemakiWareのカスタム属性も、将来的にはSecondaryオブジェクトタイプによる実装にしたい
           –   現在はChemistryのCmisExtensionを使用(XMLライクな階層構造を持ったデータ形式)
                • CMIS SQL Queryで扱えず、NemakiWare用に作ったクライアントでしかカスタム属性が表示できない
           –   そういえばCmisExtensionはChemistry以外のCMIS実装ライブラリでも使用可能なのだろうか……
                • Googleで調べた限り、Chemistryでしか使えなさそう。つまり、CMIS以前に実装依存。




                                                            8
13年1月30日水曜日
オブジェクトタイプの作成/変更/削除 [2.1.10]

     n   オブジェクトタイプとオブジェクトの違いを理解した上で……


     n   リポジトリは、(Primary/Secondary共に)オブジェクトタイプの作成/変更/削除をサポート「できる」
          –   A repository MAY support the creation, modification and deletion of primary and secondary
              object-types.
     n   オブジェクトタイプに、作成/変更/削除を許可するプロパティが存在する
          –   typeMutability.update/typeMutability.delete
          –   これらのフラグ(プロパティ)のONは、リポジトリとしてその機能をサポートしているという意味
               • 権限のないユーザはもちろん作成/変更/削除できない




                                                            9
13年1月30日水曜日
オブジェクトタイプの作成/変更/削除 [2.1.10]

     n   作成/変更/削除に関する制約
          –   オブジェクトタイプの作成/変更
              • 新規オブジェクトタイプ/プロパティのIDはクライアント側から要求する必要があるが、リポジトリ側は作成/変更に
                応じた上で、対応する新規プロパティIDを返す
                – 返り値は必ずしも同じIDとは限らないが、返り値はクライアント側が要求したものと同じ順序とする
                – 順序の制約はcreateType/updateTypeサービス時のみで、getTypeDefinitionサービスでは考慮不要
              • オブジェクトタイプ変更の際のプロパティに関する制約
                – 親オブジェクトタイプから継承したプロパティは変更できない
                  » したがって、継承関係において末端にあるオブジェクトタイプのみがプロパティの変更可能
                – CMIS仕様で定められているプロパティは変更できない
                – 必須プロパティはデフォルト値が必要。また必須→任意の変更はOKだが、任意→必須はNG
                – いま保有しているプロパティの範囲を狭めることはできない
                  » プロパティの削除はできない
                  » プロパティの値にmin/maxなどのバリデーションがある場合、範囲を広げる変更 or 既存の範囲と関係ない
                    変更はOK
                  » 自由選択肢型(Open Choice)のプロパティを通常型に戻すことはできない(逆はOK)。Open Choice型の選
                    択肢は追加/削除自由で、Open Choice型でない場合は選択肢の削除はNG
                – 既存プロパティのデータ型とカーディナリティは変更できない。たとえばInteger -> Stringは駄目
              • その他、createType/updateTypeサービスの結果、他のオブジェクトタイプやプロパティ定義に影響が発生しては
                ならない
                – 特に、共有しているプロパティ定義に影響の出る制約を追加する等




                                               10
13年1月30日水曜日
オブジェクトタイプの作成/変更/削除 [2.1.10]

     n   (つづき)
          –   オブジェクトタイプの削除
              • オブジェクトタイプを削除することができるのは、サブタイプが存在しない & そのタイプのオブジェクトが存在し
                ない ときに限る




                                       11
13年1月30日水曜日
オブジェクトタイプのまとめ [2.1.11]

     n   CMIS specificationにモデル図がある。(83p, 84p)
           –   あくまでCMISで定義される論理的な関係に基づくものであり、実際の実装とは少しずれるかも、という注
               意書きがある


     n   viewpoint
           –   (ここに書いていないが)オブジェクトタイプとオブジェクトの違い
                • オブジェクトタイプ自身の間にも継承関係がある(ベース/サブ……)
                • オブジェクトはオブジェクトタイプを雛形とし、雛形で定義されたプロパティを持つ
                • Java等のイメージでいう「継承」が2種類あるように見えるのが混乱のもと
           –   attributeとpropertyの違い
                • 83p: オブジェクトタイプで定義されたproperty(を受け継いだオブジェクトインスタンス)
                • 84p: オブジェクトタイプのattribute (e.g. queryableはこのタイプがクエリ可能かを定める)
           –   オブジェクトタイプ/プロパティの中での分類
                • Primary/Secondaryオブジェクトタイプ
                • ベースオブジェクトタイプとそれを継承したサブタイプ (84pにはベースタイプのみ)
                • プロパティとそのデータ型、選択肢(Choice)
           –   Relationship/Policy/Item/Secondary 何か面白いことに使えそうか?




                                                 12
13年1月30日水曜日
13年1月30日水曜日

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

CMIS輪読会#4 Secondaryタイプを通じて学ぶ Object Type

  • 1. CMIS輪読会#4 Secondaryタイプを通じて学ぶ Object Type @linzhixing © 2013 aegif 13年1月30日水曜日
  • 2. CMISとは n Content Management Interoperability Service n 文書管理システムとアクセスするためのOASIS標準規格 – https://www.oasis-open.org/news/announcements/content-management-interoperability-services-cmis-version-1-1- approved-and-publis – 文書やリポジトリにWEBプロトコルを通じてアクセスできる n 仕様書 – http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.pdf – このスライドでは、上記PDF版を前提とする。 n CMIS規格を実装したライブラリが各種プログラミング言語で存在する – Java:Apache Chemistry(サーバライブラリ含む) – Ruby:ActiveCMIS n CMIS specificationは長らくVer1.0だったが、2012/12/07にVer1.1が承認された – 現時点ではまだVer1.1に対応したライブラリは存在していない – Ver1.1での変更点としては、CMIS規格を拡張するためのエンドポイント新設が目立つ n CMIS準拠した製品 – サーバ含む:Alfresco, Documentum, Nuexo, FileNet, OpenText, SAP NetWeaver, SharePoint...... – クライアント:Drupal, LibreOffice, Liferay, Wordpress...... – aegif自社製品: • CmisSync - CMIS準拠のリポジトリをデスクトップからDropboxのように扱える • NemakiWare - ライトウェイト&スケーラブルなCMISリポジトリ &クライアント群。バックエンドはCouchDB。 2 13年1月30日水曜日
  • 3. CMIS1.1での変更点 [1.5] n オブジェクトタイプをクライアントから作成/変更/削除できる n CMIS仕様外の機能がリポジトリでサポートされていれば、getRepositoryInfoで識別できる n Itemオブジェクトタイプ – ベースタイプ(document/folder/relationship/policy)以外のタイプを扱うための拡張ポイント n Secondaryオブジェクトタイプ – オブジェクトに動的にプロパティ項目を付加することができる n Retention & Hold – 削除/変更からオブジェクトを保護するために使う – Secondaryオブジェクトタイプのサブタイプとして定義されている n ブラウザとのバインディング – ブラウザ等からCMISリポジトリに対して、REST的にJSON形式でやり取りできる n bulkUpdatePropertiesサービス – 複数のオブジェクトに対するプロパティ変更を、一度のサービス呼出でバルク処理できる n appendContentStreamサービス – ドキュメントに添付するContentStreamを、分割して追加していくことができる – 容量の大きなアップロードなどに役立つ 3 13年1月30日水曜日
  • 4. Secondaryオブジェクトタイプ [2.1.9] n 前回までのあらすじ – 各Base Object Typeの紹介:document/folder/relationship/policy/item – 最後のオブジェクトタイプ、secondary – item/secondaryはCMIS specification ver1.1から登場 n Secondaryオブジェクトタイプとは? – プロパティの集合体に名前が付いたもの(まあオブジェクトタイプなので……) – 他のオブジェクトに対して適用/解除を動的に行える n SecondaryがあるならPrimaryもある – document/folder/policy/relationship/itemをPrimaryオブジェクトタイプと呼ぶ。[2.1.2] – オブジェクトは必ず1つだけPrimaryオブジェクトタイプを持つ – オブジェクトには0以上のSecondaryオブジェクトタイプを適用できる 4 13年1月30日水曜日
  • 5. Secondaryオブジェクトタイプ [2.1.9] n ここでちょっと復習 n オブジェクトタイプの継承[2.1.2] – すべてのオブジェクトタイプは、baseオブジェクトタイプ か そのサブタイプ(継承)のいずれか – baseオブジェクトタイプは6つのみ • cmis:document/cmis:folder/cmis:relationship/cmis:policy/cmis:item/cmis:secondary – サブタイプの例:cmis:documentのサブタイプ invoice (好きに定義できる) 5 13年1月30日水曜日
  • 6. Secondaryオブジェクトタイプ [2.1.9] n 「Secondaryオブジェクトタイプ」は、プロパティの集合体 – cmis:secondaryというbaseオブジェクトタイプには、property definitionが存在しない – cmis:secondaryのサブタイプである「Secondaryオブジェクトタイプ」には任意にproperty definitionを 持たせることができる – ↑「Secondaryオブジェクトタイプを適用する」というのは、このサブタイプを適用するの意 – Secondaryオブジェクトタイプ(サブタイプ)として、CMIS1.1ではRetentionとHoldという特別なタイ プを規定している[2.1.16] • それ以外にSecondaryオブジェクトタイプの セマンティクス はCMISでは規定していない n Secondaryオブジェクトタイプの適用 – 適用されたオブジェクトは、自身のPrimaryオブジェクトタイプで定義されたプロパティとは別に、 Secondaryオブジェクトタイプのプロパティを自分自身の値として返す – 適用方法: • オブジェクトのcmis:secondaryObjectTypeIdsにSecondaryタイプのIDを追加/削除 • updatePropertiesサービスから • checkInサービスから – 適用および適用の解除は、いつでも行える • 解除すると、Secondary由来のプロパティおよびその値はオブジェクトからすべて削除される – 適用/解除を制限するルールを実装してもよい(Repository-sepcific) 6 13年1月30日水曜日
  • 7. Secondaryオブジェクトタイプ [2.1.9] n プロパティと値のイメージ – オブジェクトは、必ずPrimaryオブジェクトタイプを1つだけ持つ[2.1.2] • Secondaryオブジェクトタイプを持つオブジェクトを作成することはできない – オブジェクトに適用されるのは「Secondaryオブジェクトタイプ」であって、Secondaryオブジェクトタ イプのオブジェクトではない(そんなものはない) – 各オブジェクトは自分が属するPrimaryオブジェクトタイプで定義されたプロパティを持つ – それに加えて、各オブジェクトは自分に適用されたSecondaryオブジェクトタイプ由来のプロパティについ ても、オブジェクトごとに独自の値を持つ – Policyタイプのオブジェクトのように、他のオブジェクトから共通して参照されるオブジェクトがあるわけ ではない • 逆に言えば、共通のSecondaryオブジェクトタイプを持っていても、適用先オブジェクト固有の値を反映できる。 Policyタイプのオブジェクトを共有する場合、オブジェクト固有の値を反映するのは難しい Primaryタイプ Secondaryタイプ Primaryタイプ Secondaryタイプ P1 S1 P2 S1 オブジェクト A オブジェクト B ∼ プロパティ p2 ∼ プロパティ p1 プロパティ s1 a プロパティ s1 b 13年1月30日水曜日
  • 8. Secondaryオブジェクトタイプ [2.1.9] n Alfrescoのaspectに似ている n CMIS Ver1.1ではCMIS SQL QueryでSecondaryプロパティが取得できるようになる(想像) – SELECT * FROM cmis:document WHERE ∼ で * の中にsecondary由来のプロパティが含まれている – Primaryオブジェクトタイプのプロパティcmis:secondaryObjectTypeIdsからたどれば、secondary由来 のプロパティを特定できる – 標準的なCMIS SQL Queryだけでaspects的なものが取得可能になる – 特定のCMISリポジトリでしか通用しない構文を使わなくてよくなる • SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId http://wiki.alfresco.com/wiki/CMIS_Query_Language n NemakiWareのカスタム属性も、将来的にはSecondaryオブジェクトタイプによる実装にしたい – 現在はChemistryのCmisExtensionを使用(XMLライクな階層構造を持ったデータ形式) • CMIS SQL Queryで扱えず、NemakiWare用に作ったクライアントでしかカスタム属性が表示できない – そういえばCmisExtensionはChemistry以外のCMIS実装ライブラリでも使用可能なのだろうか…… • Googleで調べた限り、Chemistryでしか使えなさそう。つまり、CMIS以前に実装依存。 8 13年1月30日水曜日
  • 9. オブジェクトタイプの作成/変更/削除 [2.1.10] n オブジェクトタイプとオブジェクトの違いを理解した上で…… n リポジトリは、(Primary/Secondary共に)オブジェクトタイプの作成/変更/削除をサポート「できる」 – A repository MAY support the creation, modification and deletion of primary and secondary object-types. n オブジェクトタイプに、作成/変更/削除を許可するプロパティが存在する – typeMutability.update/typeMutability.delete – これらのフラグ(プロパティ)のONは、リポジトリとしてその機能をサポートしているという意味 • 権限のないユーザはもちろん作成/変更/削除できない 9 13年1月30日水曜日
  • 10. オブジェクトタイプの作成/変更/削除 [2.1.10] n 作成/変更/削除に関する制約 – オブジェクトタイプの作成/変更 • 新規オブジェクトタイプ/プロパティのIDはクライアント側から要求する必要があるが、リポジトリ側は作成/変更に 応じた上で、対応する新規プロパティIDを返す – 返り値は必ずしも同じIDとは限らないが、返り値はクライアント側が要求したものと同じ順序とする – 順序の制約はcreateType/updateTypeサービス時のみで、getTypeDefinitionサービスでは考慮不要 • オブジェクトタイプ変更の際のプロパティに関する制約 – 親オブジェクトタイプから継承したプロパティは変更できない » したがって、継承関係において末端にあるオブジェクトタイプのみがプロパティの変更可能 – CMIS仕様で定められているプロパティは変更できない – 必須プロパティはデフォルト値が必要。また必須→任意の変更はOKだが、任意→必須はNG – いま保有しているプロパティの範囲を狭めることはできない » プロパティの削除はできない » プロパティの値にmin/maxなどのバリデーションがある場合、範囲を広げる変更 or 既存の範囲と関係ない 変更はOK » 自由選択肢型(Open Choice)のプロパティを通常型に戻すことはできない(逆はOK)。Open Choice型の選 択肢は追加/削除自由で、Open Choice型でない場合は選択肢の削除はNG – 既存プロパティのデータ型とカーディナリティは変更できない。たとえばInteger -> Stringは駄目 • その他、createType/updateTypeサービスの結果、他のオブジェクトタイプやプロパティ定義に影響が発生しては ならない – 特に、共有しているプロパティ定義に影響の出る制約を追加する等 10 13年1月30日水曜日
  • 11. オブジェクトタイプの作成/変更/削除 [2.1.10] n (つづき) – オブジェクトタイプの削除 • オブジェクトタイプを削除することができるのは、サブタイプが存在しない & そのタイプのオブジェクトが存在し ない ときに限る 11 13年1月30日水曜日
  • 12. オブジェクトタイプのまとめ [2.1.11] n CMIS specificationにモデル図がある。(83p, 84p) – あくまでCMISで定義される論理的な関係に基づくものであり、実際の実装とは少しずれるかも、という注 意書きがある n viewpoint – (ここに書いていないが)オブジェクトタイプとオブジェクトの違い • オブジェクトタイプ自身の間にも継承関係がある(ベース/サブ……) • オブジェクトはオブジェクトタイプを雛形とし、雛形で定義されたプロパティを持つ • Java等のイメージでいう「継承」が2種類あるように見えるのが混乱のもと – attributeとpropertyの違い • 83p: オブジェクトタイプで定義されたproperty(を受け継いだオブジェクトインスタンス) • 84p: オブジェクトタイプのattribute (e.g. queryableはこのタイプがクエリ可能かを定める) – オブジェクトタイプ/プロパティの中での分類 • Primary/Secondaryオブジェクトタイプ • ベースオブジェクトタイプとそれを継承したサブタイプ (84pにはベースタイプのみ) • プロパティとそのデータ型、選択肢(Choice) – Relationship/Policy/Item/Secondary 何か面白いことに使えそうか? 12 13年1月30日水曜日