TOM.NET API delta compared to SDL Tridion 2013 SP1
Compared to SDL Tridion 2013 SP1 HR1, the API has changed slightly.
Compatiblity break: Previously, if a Publication contained published items, the method
Publication.Deletewould throw anItemIsInUseException, with an error code ofTcmErrorCode.ItemIsPublished. Now, the exceptions thrown isInvalidActionExceptionand the error code isTcmErrorCode.ItemHasPublishedItems.-
SaveEventArgshas new properties:DetectedChanges- Gets a list of item properties that changed since the last read operation from the database.
ApprovalStatusResetOverride-
Gets or sets the reset value of the Approval Status, either
UnapprovedorUndefined. This property exists to cover the use case where an item was previously configured to go through workflow, but now not anymore (that is, it no longer has a Workflow Process Association). In this case, it must be possible to reset its Approval Status toUndefinedrather than toUnapproved, to keep it publishable.
-
To improve measuring and troubleshooting your publish actions, the
PublishTransactionclass has the following new properties:TotalExecutionTimeResolvingTimeRenderingTime
Implementers can now use the
GetPublishUrlmethod in thePublication,StructureGroupandPageclasses to retrieve the full URL, rather than a URL relative to the server, of the published item, provided that they specify the Target Type or Purpose to which the item was published.The
Targetproperty ofSetPublishStateEventArgs, referring to the Publication Target, has been made read-only because changing the Publication Target in this class does not serve any purpose and can only lead to incorrect data about where the item was published.The
Actionsenumeration in the Tridion.ContentManager namespace is now deprecated, because it had no more room for the newDemoteandPromoteenumeration values. In theActionsenumeration, those actions will now result in the enumeration valueUnknownByClient. SDL recommends that you use the newTcmActionenumeration in the same namespace, which does cover all actions in its enumeration values.A number of Content Manager lists returned by an API call now contain not only a user name but also a user description.
The
ActivityStateenumeration has a new value,Waiting for Workflow Agent.The
PublishTransactionStateenumeration has a new value,Waiting for CD environment.-
In the Tridion.ContenManager.Extensibility.Events namespace, the new release adds the
GetListEventArgsclass. By hooking into list events, you can:- Remove list items
- Extend list data
- Modify list data
Such actions could be part of a GUI extension to the product.
The following example shows an event handler that removes any Multimedia Component from a list that has the ECL Multimedia Type:void SuppressEclStubs(IdentifiableObject subject, GetListEventArgs eventArgs, EventPhases eventPhase) { IList<IdentifiableObject> listItems = eventArgs.ListItems; foreach (Component mmComp in listItems.OfType(Component).Where(c => c.BinaryContent != null)) { if (mmComp.BinaryContent.MultimediaType == EclMultimediaType) { listItems.Remove(mmComp); } } }And this other example shows an event handler that sets custom properties that are part of an extension:void AddCustomProperties(TargetGroup subject, LoadEventArgs eventArgs, EventPhases event Phase) { subject.ExtensionProperties["MyOrg.CustProp1"] = "CustVal1"; subject.ExtensionProperties["MyOrg.CustProp2"] = "CustVal2"; } - A new
LoadApplicationDataForSubjectsmethod allows for bulk application data loading. The method helps to improve performance by lowering the amount of roundtrips to TOM.NET that need to be performed by the Core Service'sReadApplicationDataForSubjectIdsmethod, which previously made individualLoadApplicationDatacalls.