Method: CmisServer::CmisObject#remove_secondary_type

Defined in:
lib/cmis_server/cmis_object.rb

#remove_secondary_type(type_id) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/cmis_server/cmis_object.rb', line 58

def remove_secondary_type(type_id)
  # Trouver le type secondaire
  secondary_type = @secondary_types.find { |st| st.id == type_id }
  unless secondary_type
    raise InvalidType.new("#{type_id} is not a secondary type of this object")
  end
  
  # Supprimer le type secondaire
  @secondary_types.delete(secondary_type)
  
  # Supprimer les propriétés associées à ce type secondaire
  remove_secondary_type_properties(secondary_type)
  
  # Mettre à jour la propriété cmis:secondaryObjectTypeIds
  update_secondary_type_ids
  
  true
end