ImportManager.ImportTermSet Method
Imports a TermSet object into the parentGroup from a .csv file.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Function ImportTermSet ( _
parentGroup As Group, _
reader As TextReader, _
<OutAttribute> ByRef allTermsAdded As Boolean, _
<OutAttribute> ByRef errorMessage As String _
) As TermSet
'Usage
Dim instance As ImportManager
Dim parentGroup As Group
Dim reader As TextReader
Dim allTermsAdded As Boolean
Dim errorMessage As String
Dim returnValue As TermSet
returnValue = instance.ImportTermSet(parentGroup, _
reader, allTermsAdded, errorMessage)
public TermSet ImportTermSet(
Group parentGroup,
TextReader reader,
out bool allTermsAdded,
out string errorMessage
)
Parameters
parentGroup
Type: Microsoft.SharePoint.Taxonomy.GroupA Group object to be the parent group of the term set.
reader
Type: System.IO.TextReaderTextReader for a .csv file containing term set data
allTermsAdded
Type: System.BooleanA Boolean output parameter indicating whether all terms were added
errorMessage
Type: System.StringA string output parameter indicating all error messages occuring during the import operation
Return Value
Type: Microsoft.SharePoint.Taxonomy.TermSet
A TermSet object generated from the input data
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | parentGroup is a null reference (Nothing in Visual Basic) |
ArgumentNullException | reader is a null reference (Nothing in Visual Basic) |
TermStoreOperationException | Creating a term set in system Group is disallowed. |
ArgumentException | The term set .csv import file does not adhere to the correct format. |
Remarks
When this method returns, the allTermsAdded output parameter is set to true if true if all terms in the .csv file are added; otherwise, false.
When this method returns, the errorMessage output parameter will be empty if there were no errors during the import. If there were errors during the import, the parameter contains information about all of the errors that occurred.
The parentGroup parameter value cannot be the system group.The .csv file opened by the reader parameter should adhere to standard .csv file format.