Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

.2.4.4 Creating, Finding and Managing Data Resources
.2.4.4.1 General
There are several ways in which DataResource entities can be edited. At the lowest level, the various administration screens of the 'content' module can be used to enter a DataResource entity directly. Once a DataResource entity has been added, the associated text and image screens will bring up or allow the entry of the associated data, depending on the mimeTypeId of DataResource.
The content module also has a CMS section that facilitates the creation of content in one step. This process uses the persistContentAndAssoc service.

Another way to enter content is to create a custom screen for doing the particular entry of maintenance. Such a screen should rely on the persistContentAndAssoc service.

.2.4.4.2 persistContentAndAssoc
The persistContentAndAssoc service was created in recognition of the fact that content operations often require operations on three or more entities at one time. These operations usually conform to one thing that the user has in mind, so it makes sense to have a high-level service that does all these things.
PersistContentAndAssoc has a large parameter set. See the Services appendix for a complete description. It works with parameters for Content, DataResource, ContentAssoc, ElectronicText and ImageDataResource. It also make use of the file upload capabilities in ServiceEventHandler to take care of that function as well. PersistContentAndAssoc works with parameters for these entities or ContentAssoc/DataResource/ViewFrom/To view entities, as well.

One key to using persistContentAndAssoc is to properly use the 'type' fields for Content, DataResource and ContentAssoc. If the corresponding type field (ie. contentTypeId, dataResourceTypeId and contentAssocTypeId, respectively) is present, then the persist functions for that entity will take place.

PersistContentAndAssoc returns all the primary keys for Content, DataResource and ContentAssoc, if they are available, even if an operation is not performed on that entity.