CWIS Developer Documentation
|
Metadata schema (in effect a Factory class for MetadataField). More...
Public Member Functions | |
MetadataSchema ($SchemaId=self::SCHEMAID_DEFAULT) | |
Object constructor, used to load an existing schema. More... | |
Id () | |
Get schema ID. More... | |
Name ($NewValue=NULL) | |
Get/set name of schema. More... | |
ResourceName ($NewValue=NULL) | |
Get/set name of resources using this schema. More... | |
ViewPage ($NewValue=NULL) | |
Get/set name of page to go to for viewing resources using this schema. More... | |
AuthoringPrivileges (PrivilegeSet $NewValue=NULL) | |
Get/set privileges that allowing authoring resources with this schema. More... | |
EditingPrivileges (PrivilegeSet $NewValue=NULL) | |
Get/set privileges that allowing editing resources with this schema. More... | |
ViewingPrivileges (PrivilegeSet $NewValue=NULL) | |
Get/set privileges that allowing viewing resources with this schema. More... | |
UserCanAuthor ($User) | |
Determine if the given user can author resources using this schema. More... | |
GetViewPageIdParameter () | |
Get the resource ID GET parameter for the view page for the schema. More... | |
PathMatchesViewPage ($Path) | |
Determine if a path matches the view page path for the schema. More... | |
CacheData ($NewValue) | |
Enable/disable caching of metadata field info. More... | |
AddField ($FieldName, $FieldType, $Optional=TRUE, $DefaultValue=NULL) | |
Add new metadata field. More... | |
AddFieldsFromXmlFile ($FileName, $TestRun=FALSE) | |
Add new metadata fields from XML file. More... | |
NewFields () | |
Get new fields recently added (if any) via XML file. More... | |
ErrorMessages ($Method=NULL) | |
Get error messages (if any) from recent calls. More... | |
AddFieldFromXml ($Xml) | |
Add new metadata field based on supplied XML. More... | |
DropField ($FieldId) | |
Delete metadata field and all associated data. More... | |
GetField ($FieldId) | |
Retrieve metadata field by ID. More... | |
GetFieldByName ($FieldName, $IgnoreCase=FALSE) | |
Retrieve metadata field by name. More... | |
GetFieldByLabel ($FieldLabel, $IgnoreCase=FALSE) | |
Retrieve metadata field by label. More... | |
GetFieldIdByName ($FieldName, $IgnoreCase=FALSE) | |
Retrieve metadata field ID by name. More... | |
GetFieldIdByLabel ($FieldLabel, $IgnoreCase=FALSE) | |
Retrieve metadata field ID by label. More... | |
FieldExists ($FieldName) | |
Check whether field with specified name exists. More... | |
GetFields ($FieldTypes=NULL, $OrderType=NULL, $IncludeDisabledFields=FALSE, $IncludeTempFields=FALSE) | |
Retrieve array of fields. More... | |
GetFieldNames ($FieldTypes=NULL, $OrderType=NULL, $IncludeDisabledFields=FALSE, $IncludeTempFields=FALSE) | |
Retrieve field names. More... | |
GetFieldsAsOptionList ($OptionListName, $FieldTypes=NULL, $SelectedFieldId=NULL, $IncludeNullOption=TRUE, $AddEntries=NULL, $AllowMultiple=FALSE) | |
Retrieve fields of specified type as HTML option list with field names as labels and field IDs as value attributes. More... | |
GetFieldTypes () | |
Retrieve array of field types. More... | |
GetAllowedFieldTypes () | |
Retrieve array of field types that user can create. More... | |
RemoveQualifierAssociations ($QualifierIdOrObject) | |
Remove all metadata field associations for a given qualifier. More... | |
QualifierIsInUse ($QualifierIdOrObject) | |
Check whether qualifier is in use by any metadata field (in any schema). More... | |
GetHighestFieldId () | |
Get highest field ID currently in use. More... | |
GetFieldByMappedName ($MappedName) | |
Get field by standard field name. More... | |
GetFieldIdByMappedName ($MappedName) | |
Get field ID by standard field name. More... | |
GetOwnedFields () | |
Get fields that have an owner associated with them. More... | |
GetDisplayOrder () | |
Get the display order for the schema. More... | |
GetEditOrder () | |
Get the editing order for the schema. More... | |
![]() | |
ItemFactory ($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $OrderOpsAllowed=FALSE, $SqlCondition=NULL) | |
Class constructor. More... | |
GetItemClassName () | |
Get class name of items manipulated by factory. More... | |
GetCurrentEditedItemId () | |
Get ID of currently edited item. More... | |
SetCurrentEditedItemId ($NewId) | |
Set ID of currently edited item. More... | |
ClearCurrentEditedItemId () | |
Clear currently edited item ID. More... | |
ClearCurrentEditedItem () | |
Delete currently edited item and clear currently edited item ID. More... | |
CleanOutStaleTempItems ($MinutesUntilStale=10080) | |
Clear out (call the Delete() method) for any temp items more than specified number of minutes old. More... | |
GetLastTempItemId () | |
Retrieve most recent temp item ID for currently-logged-in user. More... | |
GetNextItemId () | |
Retrieve next available (non-temp) item ID. More... | |
GetHighestItemId ($IgnoreSqlCondition=FALSE) | |
Retrieve highest item ID in use. More... | |
GetNextTempItemId () | |
Return next available temporary item ID. More... | |
GetItemCount ($Condition=NULL, $IncludeTempItems=FALSE) | |
Get count of items. More... | |
GetItemIds ($Condition=NULL, $IncludeTempItems=FALSE, $SortField=NULL, $SortAscending=TRUE) | |
Return array of item IDs. More... | |
GetLatestModificationDate ($Condition=NULL) | |
Get newest modification date (based on values in "DateLastModified" column in database table). More... | |
GetItem ($ItemId) | |
Retrieve item by item ID. More... | |
ItemExists ($ItemId, $IgnoreSqlCondition=FALSE) | |
Check that item exists with specified ID. More... | |
GetItemByName ($Name, $IgnoreCase=FALSE) | |
Retrieve item by name. More... | |
GetItemIdByName ($Name, $IgnoreCase=FALSE) | |
Retrieve item ID by name. More... | |
GetItemNames ($SqlCondition=NULL) | |
Retrieve item names. More... | |
GetItems ($SqlCondition=NULL) | |
Retrieve items. More... | |
GetItemsAsOptionList ($OptionListName, $SelectedItemId=NULL, $SqlCondition=NULL, $DisplaySize=1, $SubmitOnChange=FALSE) | |
Retrieve items of specified type as HTML option list with item names as labels and item IDs as value attributes. More... | |
NameIsInUse ($Name, $IgnoreCase=FALSE) | |
Check whether item name is currently in use. More... | |
SearchForItemNames ($SearchString, $NumberOfResults=100, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $Offset=0, $IdExclusions=array(), $ValueExclusions=array()) | |
Retrieve items with names matching search string. More... | |
GetCountForItemNames ($SearchString, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $IdExclusions=array(), $ValueExclusions=array()) | |
Retrieve count of items with names matching search string. More... | |
AddItem ($ItemName, $AdditionalValues=NULL) | |
Add new item. More... | |
DeleteItem ($ItemId) | |
Delete item. More... | |
SetOrderOpsCondition ($Condition) | |
Set SQL condition (added to WHERE clause) used to select items for ordering operations. More... | |
InsertBefore ($TargetItem, $NewItem) | |
Insert item into order before specified item. More... | |
InsertAfter ($TargetItem, $NewItem) | |
Insert item into order after specified item. More... | |
Prepend ($Item) | |
Add item to beginning of order. More... | |
Append ($Item) | |
Add item to end of order. More... | |
GetItemIdsInOrder () | |
Retrieve list of item IDs in order. More... | |
RemoveItemFromOrder ($ItemId) | |
Remove item from existing order. More... | |
Static Public Member Functions | |
static | Create ($Name, PrivilegeSet $AuthorPrivs=NULL, PrivilegeSet $EditPrivs=NULL, PrivilegeSet $ViewPrivs=NULL, $ViewPage="", $ResourceName=NULL) |
Create new metadata schema. More... | |
static | SchemaExistsWithId ($SchemaId) |
Check with schema exists with specified ID. More... | |
static | StdNameToFieldMapping ($MappedName, $FieldId=NULL) |
Get/set mapping of standard field name to specific field. More... | |
static | FieldToStdNameMapping ($FieldId) |
Get mapping of field ID to standard field name. More... | |
static | GetAllSchemas () |
Get all existing metadata schemas. More... | |
static | SetOwnerListRetrievalFunction ($Callback) |
Allow external dependencies, i.e., the current list of owners that are available, to be injected. More... | |
static | NormalizeOwnedFields () |
Disable owned fields that have an owner that is unavailable and re-enable fields if an owner has returned and the field was flagged to be re-enabled. More... | |
Public Attributes | |
const | MDFTYPE_TEXT = 1 |
const | MDFTYPE_PARAGRAPH = 2 |
const | MDFTYPE_NUMBER = 4 |
const | MDFTYPE_DATE = 8 |
const | MDFTYPE_TIMESTAMP = 16 |
const | MDFTYPE_FLAG = 32 |
const | MDFTYPE_TREE = 64 |
const | MDFTYPE_CONTROLLEDNAME = 128 |
const | MDFTYPE_OPTION = 256 |
const | MDFTYPE_USER = 512 |
const | MDFTYPE_IMAGE = 1024 |
const | MDFTYPE_FILE = 2048 |
const | MDFTYPE_URL = 4096 |
const | MDFTYPE_POINT = 8192 |
const | MDFTYPE_REFERENCE = 16384 |
const | MDFORDER_DISPLAY = 1 |
const | MDFORDER_EDITING = 2 |
const | MDFORDER_ALPHABETICAL = 3 |
const | MDFSTAT_OK = 1 |
const | MDFSTAT_ERROR = 2 |
const | MDFSTAT_DUPLICATENAME = 4 |
const | MDFSTAT_DUPLICATEDBCOLUMN = 8 |
const | MDFSTAT_FIELDDOESNOTEXIST = 16 |
const | MDFSTAT_ILLEGALNAME = 32 |
const | MDFSTAT_DUPLICATELABEL = 64 |
const | MDFSTAT_ILLEGALLABEL = 128 |
const | SCHEMAID_DEFAULT = 0 |
const | SCHEMAID_USER = 1 |
const | RESOURCENAME_DEFAULT = "Resource" |
const | RESOURCENAME_USER = "User" |
const | ORDER_DISPLAY_NAME = "Display" |
const | ORDER_EDIT_NAME = "Edit" |
Protected Member Functions | |
UpdateFieldCompareOrders () | |
Update the field comparison ordering cache that is used for sorting fields. More... | |
FieldCompareOrdersSet () | |
Determine whether the field comparison ordering caches are set. More... | |
CompareFieldOrder ($FieldA, $FieldB) | |
Field sorting callback. More... | |
Static Protected Member Functions | |
static | GetOrderForUpgrade (MetadataSchema $Schema, $Name) |
Get the metadata field order for the default metadata schema. More... | |
static | GetRowsForUpgrade ($Type) |
Get rows for upgrading purposes. More... | |
Protected Attributes | |
$FieldCompareDisplayOrder = array() | |
The cache for metadata field display ordering. More... | |
$FieldCompareEditOrder = array() | |
The cache for metadata field edit ordering. More... | |
![]() | |
$DB | |
Static Protected Attributes | |
static | $DefaultDisplayOrder |
The default display order for metadata fields. More... | |
static | $DefaultEditOrder |
The default editing order for metadata fields. More... | |
static | $OwnerListRetrievalFunction |
Metadata schema (in effect a Factory class for MetadataField).
Definition at line 13 of file MetadataSchema.php.
MetadataSchema::AddField | ( | $FieldName, | |
$FieldType, | |||
$Optional = TRUE , |
|||
$DefaultValue = NULL |
|||
) |
Add new metadata field.
string | $FieldName | Name of new field. |
mixed | $FieldType | Type of new field. |
bool | $Optional | Whether setting a value for new field is optional when creating new records that use the field. (OPTIONAL, defaults to TRUE) |
mixed | $DefaultValue | Initial default value for field. (OPTIONAL) |
Definition at line 486 of file MetadataSchema.php.
References MetadataField\Create(), and Id().
Referenced by AddFieldFromXml(), and AddFieldsFromXmlFile().
MetadataSchema::AddFieldFromXml | ( | $Xml | ) |
Add new metadata field based on supplied XML.
The XML elements are method names from the MetadataField object, with the values being passed in as the parameter to that method. The FieldName and FieldType elements are required. Values for elements/methods that would normally be called with constants in PHP can be constant names.
string | $Xml | Block of XML containing field description. |
Definition at line 774 of file MetadataSchema.php.
References AddField(), and ErrorMessages().
MetadataSchema::AddFieldsFromXmlFile | ( | $FileName, | |
$TestRun = FALSE |
|||
) |
Add new metadata fields from XML file.
NewFields() can be used to determine how many (or whether) new fields were added, and ErrorMsgs() can be used to determine what errors were * encountered.
string | $FileName | Name of XML file. |
bool | $TestRun | If TRUE, any new fields created are removed before the method returns. |
Definition at line 520 of file MetadataSchema.php.
References AddField(), ErrorMessages(), ItemFactory\NameIsInUse(), and NewFields().
MetadataSchema::AuthoringPrivileges | ( | PrivilegeSet | $NewValue = NULL | ) |
Get/set privileges that allowing authoring resources with this schema.
object | $NewValue | New PrivilegeSet value. (OPTIONAL) |
Definition at line 289 of file MetadataSchema.php.
References Id().
Referenced by MetadataSchema(), and UserCanAuthor().
MetadataSchema::CacheData | ( | $NewValue | ) |
Enable/disable caching of metadata field info.
boo | $NewValue | TRUE to enable caching or FALSE to disable caching. |
Definition at line 472 of file MetadataSchema.php.
|
protected |
Field sorting callback.
MetadataField | $FieldA | first comparision field |
MetadataFIeld | $FieldB | second comparison field |
Definition at line 1560 of file MetadataSchema.php.
References $FieldCompareDisplayOrder, $FieldCompareEditOrder, MDFORDER_ALPHABETICAL, and MDFORDER_EDITING.
|
static |
Create new metadata schema.
string | $Name | Schema name. |
object | $AuthorPrivs | PrivilegeSet required for authoring. (OPTIONAL, defaults to all users) |
object | $EditPrivs | PrivilegeSet required for editing. (OPTIONAL, defaults to all users) |
object | $ViewPrivs | PrivilegeSet required for viewing. (OPTIONAL, defaults to all users) |
string | $ViewPage | The page used to view the full record for a resource. If "$ID" shows up in the parameter, it will be replaced by the resource ID when viewing the resource. (OPTIONAL) |
Definition at line 114 of file MetadataSchema.php.
References ItemFactory\$DB, and MetadataSchema().
MetadataSchema::DropField | ( | $FieldId | ) |
Delete metadata field and all associated data.
int | $FieldId | ID of field to be deleted. |
Definition at line 876 of file MetadataSchema.php.
References GetField().
MetadataSchema::EditingPrivileges | ( | PrivilegeSet | $NewValue = NULL | ) |
Get/set privileges that allowing editing resources with this schema.
object | $NewValue | New PrivilegeSet value. (OPTIONAL) |
Definition at line 311 of file MetadataSchema.php.
References Id().
Referenced by MetadataSchema().
MetadataSchema::ErrorMessages | ( | $Method = NULL | ) |
Get error messages (if any) from recent calls.
If no method name is specified, then an array is returned with method names for the index and arrays of error messages for the values.
string | $Method | Name of method. (OPTIONAL) |
Definition at line 747 of file MetadataSchema.php.
Referenced by AddFieldFromXml(), and AddFieldsFromXmlFile().
|
protected |
Determine whether the field comparison ordering caches are set.
Definition at line 1548 of file MetadataSchema.php.
References $FieldCompareEditOrder.
Referenced by GetFields().
MetadataSchema::FieldExists | ( | $FieldName | ) |
Check whether field with specified name exists.
string | $FieldName | Name of field. |
Definition at line 998 of file MetadataSchema.php.
References ItemFactory\NameIsInUse().
|
static |
Get mapping of field ID to standard field name.
int | $FieldId | Field ID. |
Definition at line 1274 of file MetadataSchema.php.
MetadataSchema::GetAllowedFieldTypes | ( | ) |
Retrieve array of field types that user can create.
Definition at line 1198 of file MetadataSchema.php.
References MetadataField\$FieldTypeDBAllowedEnums.
|
static |
Get all existing metadata schemas.
Definition at line 1340 of file MetadataSchema.php.
References MetadataSchema().
MetadataSchema::GetDisplayOrder | ( | ) |
Get the display order for the schema.
Definition at line 1462 of file MetadataSchema.php.
References MetadataFieldOrder\Create(), MetadataFieldOrder\GetOrderForSchema(), and Id().
Referenced by UpdateFieldCompareOrders().
MetadataSchema::GetEditOrder | ( | ) |
Get the editing order for the schema.
Definition at line 1505 of file MetadataSchema.php.
References MetadataFieldOrder\Create(), MetadataFieldOrder\GetOrderForSchema(), and Id().
Referenced by UpdateFieldCompareOrders().
MetadataSchema::GetField | ( | $FieldId | ) |
Retrieve metadata field by ID.
int | $FieldId | ID of field. |
Definition at line 895 of file MetadataSchema.php.
Referenced by DropField(), GetFieldByLabel(), GetFieldByMappedName(), GetFieldByName(), GetFields(), GetFieldsAsOptionList(), and GetOwnedFields().
MetadataSchema::GetFieldByLabel | ( | $FieldLabel, | |
$IgnoreCase = FALSE |
|||
) |
Retrieve metadata field by label.
string | $FieldLabel | Field label. |
bool | $IgnoreCase | If TRUE, case is ignore when matching field labels. |
Definition at line 935 of file MetadataSchema.php.
References GetField(), and GetFieldIdByLabel().
MetadataSchema::GetFieldByMappedName | ( | $MappedName | ) |
Get field by standard field name.
string | $MappedName | Standard field name. |
Definition at line 1296 of file MetadataSchema.php.
References GetField(), and StdNameToFieldMapping().
MetadataSchema::GetFieldByName | ( | $FieldName, | |
$IgnoreCase = FALSE |
|||
) |
Retrieve metadata field by name.
string | $FieldName | Field name. |
bool | $IgnoreCase | If TRUE, case is ignore when matching field names. |
Definition at line 923 of file MetadataSchema.php.
References GetField(), and GetFieldIdByName().
MetadataSchema::GetFieldIdByLabel | ( | $FieldLabel, | |
$IgnoreCase = FALSE |
|||
) |
Retrieve metadata field ID by label.
string | $FieldLabel | Field label. |
bool | $IgnoreCase | If TRUE, case is ignore when matching field labels. |
Definition at line 974 of file MetadataSchema.php.
References Id().
Referenced by GetFieldByLabel().
MetadataSchema::GetFieldIdByMappedName | ( | $MappedName | ) |
Get field ID by standard field name.
string | $MappedName | Standard field name. |
Definition at line 1309 of file MetadataSchema.php.
MetadataSchema::GetFieldIdByName | ( | $FieldName, | |
$IgnoreCase = FALSE |
|||
) |
Retrieve metadata field ID by name.
string | $FieldName | Field name. |
bool | $IgnoreCase | If TRUE, case is ignore when matching field names. |
Definition at line 948 of file MetadataSchema.php.
References Id().
Referenced by GetFieldByName().
MetadataSchema::GetFieldNames | ( | $FieldTypes = NULL , |
|
$OrderType = NULL , |
|||
$IncludeDisabledFields = FALSE , |
|||
$IncludeTempFields = FALSE |
|||
) |
Retrieve field names.
int | $FieldTypes | MetadataField types (MDFTYPE_ values) to retrieve, ORed together, or NULL to return all types of fields. (OPTIONAL, defaults to NULL) |
int | $OrderType | Order in which to return fields (MDFORDER_ value). (OPTIONAL, defaults to NULL which indicates no particular order) |
bool | $IncludeDisabledFields | TRUE to include disabled fields. (OPTIONAL, defaults to FALSE) |
bool | $IncludeTempFields | TRUE to include temporary fields (in the process of being created/edited). (OPTIONAL, defaults to FALSE) |
Definition at line 1090 of file MetadataSchema.php.
References GetFields().
Referenced by GetFieldsAsOptionList().
MetadataSchema::GetFields | ( | $FieldTypes = NULL , |
|
$OrderType = NULL , |
|||
$IncludeDisabledFields = FALSE , |
|||
$IncludeTempFields = FALSE |
|||
) |
Retrieve array of fields.
int | $FieldTypes | MetadataField types (MDFTYPE_ values) to retrieve, ORed together, or NULL to return all types of fields. (OPTIONAL, defaults to NULL) |
int | $OrderType | Order in which to return fields (MDFORDER_ value). (OPTIONAL, defaults to NULL which indicates no particular order) |
bool | $IncludeDisabledFields | TRUE to include disabled fields. (OPTIONAL, defaults to FALSE) |
bool | $IncludeTempFields | TRUE to include temporary fields (in the process of being created/edited). (OPTIONAL, defaults to FALSE) |
Definition at line 1013 of file MetadataSchema.php.
References MetadataField\$FieldTypePHPEnums, FieldCompareOrdersSet(), GetField(), Id(), and UpdateFieldCompareOrders().
Referenced by MetadataFieldOrder\Create(), GetFieldNames(), HumanMetadataField\LoadUserFieldList(), and UpdateFieldCompareOrders().
MetadataSchema::GetFieldsAsOptionList | ( | $OptionListName, | |
$FieldTypes = NULL , |
|||
$SelectedFieldId = NULL , |
|||
$IncludeNullOption = TRUE , |
|||
$AddEntries = NULL , |
|||
$AllowMultiple = FALSE |
|||
) |
Retrieve fields of specified type as HTML option list with field names as labels and field IDs as value attributes.
The first element on the list will have a label of "--" and an ID of -1 to indicate no field selected.
string | $OptionListName | Value of option list "name" and "id" attributes. |
int | $FieldTypes | Types of fields to return. (OPTIONAL - use NULL for all types) |
int | $SelectedFieldId | ID or array of IDs of the currently-selected field(s). (OPTIONAL) |
bool | $IncludeNullOption | Whether to include "no selection" (-1) option. (OPTIONAL - defaults to TRUE) |
array | $AddEntries | An array of additional entries to include at the end of the option list, with option list values for the indexes and option list labels for the values. (OPTIONAL) |
bool | $AllowMultiple | TRUE to allow multiple field selections |
Definition at line 1121 of file MetadataSchema.php.
References GetField(), and GetFieldNames().
MetadataSchema::GetFieldTypes | ( | ) |
Retrieve array of field types.
Definition at line 1188 of file MetadataSchema.php.
References MetadataField\$FieldTypeDBEnums.
MetadataSchema::GetHighestFieldId | ( | ) |
Get highest field ID currently in use.
Definition at line 1249 of file MetadataSchema.php.
References ItemFactory\GetHighestItemId().
|
staticprotected |
Get the metadata field order for the default metadata schema.
This will use the MetadataFields table If upgrading or the defaults included in this class.
MetadataSchema | $Schema | Schema for which to get the field order. |
string | $Name | The order name. |
Definition at line 1591 of file MetadataSchema.php.
References Id().
MetadataSchema::GetOwnedFields | ( | ) |
Get fields that have an owner associated with them.
Definition at line 1318 of file MetadataSchema.php.
References GetField(), and Id().
|
staticprotected |
Get rows for upgrading purposes.
This should only be run if an upgrade should be performed.
int | $Type | ordering type from MetadataSchema::MDFORDER_... |
Definition at line 1628 of file MetadataSchema.php.
References Database\DisplayQueryErrors(), and MDFORDER_EDITING.
MetadataSchema::GetViewPageIdParameter | ( | ) |
Get the resource ID GET parameter for the view page for the schema.
Definition at line 385 of file MetadataSchema.php.
References ViewPage().
MetadataSchema::Id | ( | ) |
Get schema ID.
Schema IDs are numerical, with two special values SCHEMAID_DEFAULT and SCHEMAID_USER.
Definition at line 188 of file MetadataSchema.php.
Referenced by AddField(), AuthoringPrivileges(), MetadataFieldOrder\Create(), EditingPrivileges(), GetDisplayOrder(), GetEditOrder(), GetFieldIdByLabel(), GetFieldIdByName(), GetFields(), MetadataFieldOrder\GetOrderForSchema(), GetOrderForUpgrade(), MetadataFieldOrder\GetOrdersForSchema(), GetOwnedFields(), MetadataSchema(), Name(), ResourceName(), ViewingPrivileges(), and ViewPage().
MetadataSchema::MetadataSchema | ( | $SchemaId = self::SCHEMAID_DEFAULT | ) |
Object constructor, used to load an existing schema.
(Use MetadataSchema::Create() to create a new schema.)
mixed | $SchemaId | ID of schema. Schema IDs are numerical, except for two special values SCHEMAID_DEFAULT and SCHEMAID_USER. (OPTIONAL, defaults to SCHEMAID_DEFAULT) |
Definition at line 71 of file MetadataSchema.php.
References AuthoringPrivileges(), EditingPrivileges(), Id(), ItemFactory\ItemFactory(), Name(), ViewingPrivileges(), and ViewPage().
Referenced by Create(), GetAllSchemas(), and NormalizeOwnedFields().
MetadataSchema::Name | ( | $NewValue = NULL | ) |
Get/set name of schema.
string | $NewValue | New name for schema. (OPTIONAL) |
Definition at line 199 of file MetadataSchema.php.
References Id().
Referenced by MetadataSchema().
MetadataSchema::NewFields | ( | ) |
Get new fields recently added (if any) via XML file.
Definition at line 733 of file MetadataSchema.php.
Referenced by AddFieldsFromXmlFile().
|
static |
Disable owned fields that have an owner that is unavailable and re-enable fields if an owner has returned and the field was flagged to be re-enabled.
Definition at line 1376 of file MetadataSchema.php.
References MetadataSchema().
MetadataSchema::PathMatchesViewPage | ( | $Path | ) |
Determine if a path matches the view page path for the schema.
For the two to match, the path GET parameters must contain at least the GET parameters in the view page's GET parameters, and all of the required GET parameters must match the ones in the view page, unless the parameter is a variable in the view page path. The path's GET parameters may contain more parameters.
string | $Path | Path to match against, e.g., index.php?P=FullRecord&ID=123. |
Definition at line 417 of file MetadataSchema.php.
References ViewPage().
MetadataSchema::QualifierIsInUse | ( | $QualifierIdOrObject | ) |
Check whether qualifier is in use by any metadata field (in any schema).
Definition at line 1223 of file MetadataSchema.php.
MetadataSchema::RemoveQualifierAssociations | ( | $QualifierIdOrObject | ) |
Remove all metadata field associations for a given qualifier.
Definition at line 1207 of file MetadataSchema.php.
MetadataSchema::ResourceName | ( | $NewValue = NULL | ) |
Get/set name of resources using this schema.
string | $NewValue | New resource name for schema. (OPTIONAL) |
Definition at line 226 of file MetadataSchema.php.
References Id().
|
static |
Check with schema exists with specified ID.
int | $SchemaId | ID to check. |
Definition at line 175 of file MetadataSchema.php.
References ItemFactory\$DB.
|
static |
Allow external dependencies, i.e., the current list of owners that are available, to be injected.
$Callback | retrieval callback |
Definition at line 1363 of file MetadataSchema.php.
|
static |
Get/set mapping of standard field name to specific field.
string | $MappedName | Standard field name. |
int | $FieldId | ID of field to map to. (OPTIONAL) |
Definition at line 1258 of file MetadataSchema.php.
Referenced by GetFieldByMappedName().
|
protected |
Update the field comparison ordering cache that is used for sorting fields.
Definition at line 1441 of file MetadataSchema.php.
References GetDisplayOrder(), GetEditOrder(), and GetFields().
Referenced by GetFields().
MetadataSchema::UserCanAuthor | ( | $User | ) |
Determine if the given user can author resources using this schema.
The result of this method can be modified via the EVENT_RESOURCE_AUTHOR_PERMISSION_CHECK event.
User | $User | user |
Definition at line 357 of file MetadataSchema.php.
References AuthoringPrivileges().
MetadataSchema::ViewingPrivileges | ( | PrivilegeSet | $NewValue = NULL | ) |
Get/set privileges that allowing viewing resources with this schema.
object | $NewValue | New PrivilegeSet value. (OPTIONAL) |
Definition at line 333 of file MetadataSchema.php.
References Id().
Referenced by MetadataSchema().
MetadataSchema::ViewPage | ( | $NewValue = NULL | ) |
Get/set name of page to go to for viewing resources using this schema.
string | $NewValue | New name for schema. (OPTIONAL) |
Definition at line 262 of file MetadataSchema.php.
References Id().
Referenced by GetViewPageIdParameter(), MetadataSchema(), and PathMatchesViewPage().
|
staticprotected |
The default display order for metadata fields.
The key of each item is the position and the value is the metadata field ID.
Definition at line 1670 of file MetadataSchema.php.
|
staticprotected |
The default editing order for metadata fields.
The key of each item is the position and the value is the metadata field ID.
Definition at line 1741 of file MetadataSchema.php.
|
protected |
The cache for metadata field display ordering.
Definition at line 1827 of file MetadataSchema.php.
Referenced by CompareFieldOrder().
|
protected |
The cache for metadata field edit ordering.
Definition at line 1832 of file MetadataSchema.php.
Referenced by CompareFieldOrder(), and FieldCompareOrdersSet().
|
staticprotected |
Definition at line 1822 of file MetadataSchema.php.
const MetadataSchema::MDFORDER_ALPHABETICAL = 3 |
Definition at line 39 of file MetadataSchema.php.
Referenced by CompareFieldOrder().
const MetadataSchema::MDFORDER_DISPLAY = 1 |
Definition at line 37 of file MetadataSchema.php.
const MetadataSchema::MDFORDER_EDITING = 2 |
Definition at line 38 of file MetadataSchema.php.
Referenced by CompareFieldOrder(), and GetRowsForUpgrade().
const MetadataSchema::MDFSTAT_DUPLICATEDBCOLUMN = 8 |
Definition at line 45 of file MetadataSchema.php.
Referenced by HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_DUPLICATELABEL = 64 |
Definition at line 48 of file MetadataSchema.php.
Referenced by HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_DUPLICATENAME = 4 |
Definition at line 44 of file MetadataSchema.php.
Referenced by MetadataField\Name(), and HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_ERROR = 2 |
Definition at line 43 of file MetadataSchema.php.
Referenced by HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_FIELDDOESNOTEXIST = 16 |
Definition at line 46 of file MetadataSchema.php.
Referenced by HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_ILLEGALLABEL = 128 |
Definition at line 49 of file MetadataSchema.php.
Referenced by MetadataField\Label(), and HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_ILLEGALNAME = 32 |
Definition at line 47 of file MetadataSchema.php.
Referenced by MetadataField\IsTempItem(), MetadataField\Name(), and HumanMetadataField\Status().
const MetadataSchema::MDFSTAT_OK = 1 |
Definition at line 42 of file MetadataSchema.php.
Referenced by MetadataField\__construct(), SPTSearchEngine\GetResultFacets(), MetadataField\Name(), and HumanMetadataField\Status().
const MetadataSchema::MDFTYPE_CONTROLLEDNAME = 128 |
Definition at line 27 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), MetadataField\GetCountOfPossibleValues(), MetadataField\GetFactory(), MetadataField\GetIdForValue(), MetadataField\GetPossibleValues(), Resource\GetQualifierByField(), ResourceFactory\GetResourceCount(), MetadataField\GetValueForId(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_DATE = 8 |
Definition at line 23 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), ResourceFactory\GetMatchingResources(), ResourceFactory\GetResourceIdsSortedBy(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), and SPTSearchEngine\SPTSearchEngine().
const MetadataSchema::MDFTYPE_FILE = 2048 |
Definition at line 31 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_FLAG = 32 |
Definition at line 25 of file MetadataSchema.php.
Referenced by Resource\Clear(), Resource\Create(), HumanMetadataField\DefaultValue(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), MetadataField\GetCountOfPossibleValues(), ResourceFactory\GetMatchingResources(), MetadataField\GetPossibleValues(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_IMAGE = 1024 |
Definition at line 30 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_NUMBER = 4 |
Definition at line 22 of file MetadataSchema.php.
Referenced by Resource\Clear(), Resource\Create(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), ResourceFactory\GetMatchingResources(), ResourceFactory\GetResourceIdsSortedBy(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), UnitTest(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_OPTION = 256 |
Definition at line 28 of file MetadataSchema.php.
Referenced by Resource\Clear(), Resource\Create(), MetadataField\DefaultValue(), HumanMetadataField\DefaultValue(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), MetadataField\GetCountOfPossibleValues(), MetadataField\GetFactory(), MetadataField\GetIdForValue(), MetadataField\GetPossibleValues(), Resource\GetQualifierByField(), ResourceFactory\GetResourceCount(), MetadataField\GetValueForId(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_PARAGRAPH = 2 |
Definition at line 21 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), ResourceFactory\GetMatchingResources(), ResourceFactory\GetResourceIdsSortedBy(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), UnitTest(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_POINT = 8192 |
Definition at line 33 of file MetadataSchema.php.
Referenced by Resource\Clear(), Resource\Create(), MetadataField\DefaultValue(), HumanMetadataField\DefaultValue(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\PointDecimalDigits(), MetadataField\PointPrecision(), Resource\Set(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_REFERENCE = 16384 |
Definition at line 34 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), and SPTSearchEngine\SPTSearchEngine().
const MetadataSchema::MDFTYPE_TEXT = 1 |
Definition at line 20 of file MetadataSchema.php.
Referenced by Resource\Clear(), Resource\Create(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), ResourceFactory\GetMatchingResources(), ResourceFactory\GetResourceIdsSortedBy(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_TIMESTAMP = 16 |
Definition at line 24 of file MetadataSchema.php.
Referenced by Resource\Clear(), Resource\Create(), CWUserFactory\CreateNewUser(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), ResourceFactory\GetMatchingResources(), ResourceFactory\GetResourceIdsSortedBy(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_TREE = 64 |
Definition at line 26 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), MetadataField\GetCountOfPossibleValues(), MetadataField\GetFactory(), MetadataField\GetIdForValue(), MetadataField\GetPossibleValues(), Resource\GetQualifierByField(), MetadataField\GetValueForId(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_URL = 4096 |
Definition at line 32 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), ResourceFactory\GetMatchingResources(), ResourceFactory\GetResourceIdsSortedBy(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::MDFTYPE_USER = 512 |
Definition at line 29 of file MetadataSchema.php.
Referenced by Resource\Clear(), MetadataField\Drop(), Resource\FieldIsSet(), Resource\Get(), MetadataField\GetAllowedConversionTypes(), MetadataField\GetCountOfPossibleValues(), MetadataField\GetPossibleValues(), HumanMetadataField\LoadUserFieldList(), SPTSearchEngine\SearchFieldForPhrases(), SPTSearchEngine\SearchFieldsForComparisonMatches(), Resource\Set(), SPTRecommender\SPTRecommender(), SPTSearchEngine\SPTSearchEngine(), and MetadataField\ValueUseCount().
const MetadataSchema::ORDER_DISPLAY_NAME = "Display" |
Definition at line 60 of file MetadataSchema.php.
const MetadataSchema::ORDER_EDIT_NAME = "Edit" |
Definition at line 61 of file MetadataSchema.php.
const MetadataSchema::RESOURCENAME_DEFAULT = "Resource" |
Definition at line 56 of file MetadataSchema.php.
const MetadataSchema::RESOURCENAME_USER = "User" |
Definition at line 57 of file MetadataSchema.php.
const MetadataSchema::SCHEMAID_DEFAULT = 0 |
Definition at line 52 of file MetadataSchema.php.
Referenced by Resource\Create().
const MetadataSchema::SCHEMAID_USER = 1 |
Definition at line 53 of file MetadataSchema.php.
Referenced by CWUserFactory\__construct(), CWUserFactory\CreateNewUser(), CWUser\FetchAssociatedResource(), CWUser\GetCustomUserFields(), and CWUser\GetDefaultUserFields().