SCItem Class Reference
| Inherits from | NSObject |
| Declared in | SCItem.h |
Overview
The SCItem object identifies a Sitecore system item.
It provides getters for the parent and children items. And getters for the item’s fields.
Also it provides methods for asynchronous loading of children items and their fields.
Now you can load items using the only SCApiSession object, and all loaded items has a reference to his API session, which can be used to read a necessary data.
SCItem object will be automatically updated with a new data when you read the same item from the backend.
Tasks
-
apiSessionThe SCApiSession object this item was created/loaded from.
property
Can be used to load the necessary data. -
itemIdThe system item’s id.
property -
pathThe system item’s path.
property -
displayNameThe system item’s display name.
property -
hasChildrenIf the item has a children items.
property -
itemTemplateThe system item’s full template name, example: “Nicam/Item Types/Site Section”.
property -
longIDThe system item’s long id, example: “/{11111111-1111-1111-1111-111111111111}/{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}”
property -
languageThe system item’s language
property -
parentThe system item’s parent
property -
allChildrenThe system item’s children, it is nil if not all children was loaded for the item. If you want to get available children items - use readChildren property instead.
property -
readChildrenOnly loaded item’s children.
property -
readFieldsOnly loaded item’s fields.
property -
allFieldsAll item’s fields.
property -
– fieldWithName:Returns SCField object for the given field’s name if such field was loaded and the item has a field with such name
-
– fieldValueWithName:Returns SCField object’s value( [SCField fieldValue] ) for the given field’s name if such field was loaded and the item has a field with such name
-
– readFieldValueOperationForFieldName:Used to load the field’s value, see [SCField fieldValue] and [SCField readFieldValueOperation]
-
– readFieldsValuesOperationForFieldsNames:Used to load the fields and the field’s values of the item, see [SCField fieldValue] and [SCField readFieldValueOperation] for details.
-
– readFieldsOperationForFieldsNames:Used to load item’s fields. They can be later accessed using the [SCItem fieldWithName:] method.
-
– readChildrenOperationUsed to load all item’s children, see [SCItem allChildren]
-
– saveItemOperationUsed to save all item’s changed fields
-
– removeItemOperationUsed to remove given item
-
– isMediaItemChecks whether the item is in the media folder.
-
– isMediaImageChecks whether the item is a media image. Such items have image template and is stored in the media folder. See isMediaItem and isImage methods for details.
-
– isImageChecks whether the item has an image template.
-
– isFolderChecks whether the item has a folder template.
* “SYSTEM/MEDIA/MEDIA FOLDER"
* "COMMON/FOLDER” -
– mediaPathReturns a media path of items that have it.
-
– downloadMediaExtendedOperationWithOptions:Returns a media path of items that have it.
-
– recordItemSourceItem source if available. Default settings of the corresponding session otherwise.
Properties
allChildren
The system item’s children, it is nil if not all children was loaded for the item. If you want to get available children items - use readChildren property instead.
@property (nonatomic, readonly) NSArray *allChildrenDiscussion
The system item’s children, it is nil if not all children was loaded for the item. If you want to get available children items - use readChildren property instead.
All item’s children can be loaded using [SCItem readChildrenOperation] method
Declared In
SCItem.hallFields
All item’s fields.
@property (nonatomic, readonly) NSArray *allFieldsDiscussion
All item’s fields.
Declared In
SCItem.hapiSession
The SCApiSession object this item was created/loaded from.
Can be used to load the necessary data.
@property (nonatomic, readonly) SCExtendedApiSession *apiSessionDiscussion
The SCApiSession object this item was created/loaded from.
Can be used to load the necessary data.
Declared In
SCItem.hdisplayName
The system item’s display name.
@property (nonatomic, readonly) NSString *displayNameDiscussion
The system item’s display name.
Declared In
SCItem.hhasChildren
If the item has a children items.
@property (nonatomic, readonly) BOOL hasChildrenDiscussion
If the item has a children items.
Declared In
SCItem.hitemId
The system item’s id.
@property (nonatomic, readonly) NSString *itemIdDiscussion
The system item’s id.
Declared In
SCItem.hitemTemplate
The system item’s full template name, example: “Nicam/Item Types/Site Section”.
@property (nonatomic, readonly) NSString *itemTemplateDiscussion
The system item’s full template name, example: “Nicam/Item Types/Site Section”.
Declared In
SCItem.hlanguage
The system item’s language
@property (nonatomic, readonly) NSString *languageDiscussion
The system item’s language
Declared In
SCItem.hlongID
The system item’s long id, example: “/{11111111-1111-1111-1111-111111111111}/{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}”
@property (nonatomic, readonly) NSString *longIDDiscussion
The system item’s long id, example: “/{11111111-1111-1111-1111-111111111111}/{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}”
Declared In
SCItem.hparent
The system item’s parent
@property (nonatomic, weak, readonly) SCItem *parentDiscussion
The system item’s parent
Declared In
SCItem.hpath
The system item’s path.
@property (nonatomic, readonly) NSString *pathDiscussion
The system item’s path.
Declared In
SCItem.hInstance Methods
downloadMediaExtendedOperationWithOptions:
Returns a media path of items that have it.
- (SCExtendedAsyncOp)downloadMediaExtendedOperationWithOptions:(SCDownloadMediaOptions *)optionsParameters
- options
Resizing options for media files processing on the back end.
Discussion
Returns a media path of items that have it.
Declared In
SCItem.hfieldValueWithName:
Returns SCField object’s value( [SCField fieldValue] ) for the given field’s name if such field was loaded and the item has a field with such name
- (id)fieldValueWithName:(NSString *)fieldNameParameters
- fieldName
the name of the item’s field name, see [SCField name]
Return Value
SCField object’s value or nil if such field does not exists. See [SCField fieldValue]
Discussion
Returns SCField object’s value( [SCField fieldValue] ) for the given field’s name if such field was loaded and the item has a field with such name
Declared In
SCItem.hfieldWithName:
Returns SCField object for the given field’s name if such field was loaded and the item has a field with such name
- (SCField *)fieldWithName:(NSString *)fieldNameParameters
- fieldName
the name of the item’s field name, see [ SCField name ]
Return Value
SCField object or nil if such field does not exists.
Discussion
Returns SCField object for the given field’s name if such field was loaded and the item has a field with such name
Declared In
SCItem.hisFolder
Checks whether the item has a folder template.
* “SYSTEM/MEDIA/MEDIA FOLDER"
* "COMMON/FOLDER”
- (BOOL)isFolderReturn Value
YES if item’s template is among those listed above.
Discussion
Checks whether the item has a folder template.
* “SYSTEM/MEDIA/MEDIA FOLDER"
* "COMMON/FOLDER”
Declared In
SCItem.hisImage
Checks whether the item has an image template.
- (BOOL)isImageReturn Value
YES if item’s template is among those listed above.
Discussion
Checks whether the item has an image template.
- “SYSTEM/MEDIA/UNVERSIONED/IMAGE”
- “SYSTEM/MEDIA/UNVERSIONED/JPEG”
- “SYSTEM/MEDIA/VERSIONED/JPEG”
Declared In
SCItem.hisMediaImage
Checks whether the item is a media image. Such items have image template and is stored in the media folder. See isMediaItem and isImage methods for details.
- (BOOL)isMediaImageReturn Value
YES if the item is a media image.
Discussion
Checks whether the item is a media image. Such items have image template and is stored in the media folder. See isMediaItem and isImage methods for details.
Declared In
SCItem.hisMediaItem
Checks whether the item is in the media folder.
- (BOOL)isMediaItemReturn Value
YES if the item’s path is within the media folder. By default, it is “/sitecore/Media Library”.
Discussion
Checks whether the item is in the media folder.
Declared In
SCItem.hmediaPath
Returns a media path of items that have it.
- (NSString *)mediaPathDiscussion
Returns a media path of items that have it.
Declared In
SCItem.hreadChildrenOperation
Used to load all item’s children, see [SCItem allChildren]
- (SCAsyncOp)readChildrenOperationReturn Value
SCAsyncOp block. Call it to get the expected result. The SCAsyncOpResult handler’s result is NSArray of SCItem objects or SCApiError if error happens.
Discussion
Used to load all item’s children, see [SCItem allChildren]
Declared In
SCItem.hreadFieldValueOperationForFieldName:
Used to load the field’s value, see [SCField fieldValue] and [SCField readFieldValueOperation]
- (SCAsyncOp)readFieldValueOperationForFieldName:(NSString *)fieldNameParameters
- fieldName
the name of the item’s field name, see [SCField name]
Return Value
SCAsyncOp block. Call it to get the expected result. The SCAsyncOpResult handler’s result depends on type of SCField, see [SCField readFieldValueOperation] for details.
Discussion
Used to load the field’s value, see [SCField fieldValue] and [SCField readFieldValueOperation]
Declared In
SCItem.hreadFieldsOperationForFieldsNames:
Used to load item’s fields. They can be later accessed using the [SCItem fieldWithName:] method.
- (SCAsyncOp)readFieldsOperationForFieldsNames:(NSSet *)fieldNamesParameters
- fieldNames
the set of the field’s names which will be read for the item. Each field’s name in the set should be a string.
To read all fields choose nil or the empty set if you don’t need to read any field
Return Value
SCAsyncOp block. Call it to get the expected result. The SCAsyncOpResult handler’s result is NSDictionary of SCField objects by field’s names or SCApiError if error happens.
Discussion
Used to load item’s fields. They can be later accessed using the [SCItem fieldWithName:] method.
Declared In
SCItem.hreadFieldsValuesOperationForFieldsNames:
Used to load the fields and the field’s values of the item, see [SCField fieldValue] and [SCField readFieldValueOperation] for details.
- (SCAsyncOp)readFieldsValuesOperationForFieldsNames:(NSSet *)fieldNamesParameters
- fieldNames
the set of the field’s names which will be read with the field’s values. Each field’s name of the set should be a string.
To read all fields choose nil or the empty set if you don’t need to read any field
Return Value
SCAsyncOp block. Call it to get the expected result. The SCAsyncOpResult handler’s result is NSDictionary of field’s values by field’s names or SCApiError if error happens.
Discussion
Used to load the fields and the field’s values of the item, see [SCField fieldValue] and [SCField readFieldValueOperation] for details.
Declared In
SCItem.hrecordItemSource
Item source if available. Default settings of the corresponding session otherwise.
- (SCItemSourcePOD *)recordItemSourceReturn Value
Item source if available. Default settings of the corresponding session otherwise.
Declared In
SCItem.hremoveItemOperation
Used to remove given item
- (SCAsyncOp)removeItemOperationReturn Value
SCAsyncOp block. Call it to remove item. The SCAsyncOpResult handler’s result is NSNumber object( always equal to “1” ) or SCApiError if error happens.
Discussion
Used to remove given item
Declared In
SCItem.hsaveItemOperation
Used to save all item’s changed fields
- (SCAsyncOp)saveItemOperationReturn Value
SCAsyncOp block. Call it to save item. The SCAsyncOpResult handler’s result is SCItem object or SCApiError if error happens.
Discussion
Used to save all item’s changed fields
Declared In
SCItem.h