Class EntityModelService
- All Implemented Interfaces:
com.priint.pubserver.plugin.interfaces.PluginControl
Supports through its URIs some helper methods from EntityManagerRemote interface.
You may use either XML or JSON as serialization method.
In case of errors a ServerResult object will be returned along with the HTTP status code (in most cases 500) containing exception details.
- Since:
- 4.0.5
-
Field Summary
FieldsFields inherited from class com.priint.pubserver.entitydata.service.AbstractService
ERR_OBJECT_ALREADY_EXISTS, ERR_OBJECT_DOES_NOT_EXIST, httpServletRequest, httpServletResponse, logger, pluginLibrary, PUBLISHINGHUBDB_MAPPED_NAME, WILDCARD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsemodDuplicateModel(String oldModelId, String newModelId, String oldTenantName, String newTenantName, String oldConnectorSpec, String newConnectorSpec) Duplicate an EntityModel.com.priint.pubserver.webservice.ServiceResultGet model names.jakarta.ws.rs.core.ResponsemodExportModelConfiguration(String entityModelIdentifier) com.priint.pubserver.entity.EntityModelmodExportModelToXML(String entityModelIdentifier) jakarta.ws.rs.core.ResponsemodImportModelConfiguration(String entityModelIdentifier, String mode, String connectorIdentifier, String connectorInstance, com.priint.pubserver.webservice.ServiceResult serviceRequest) com.priint.pubserver.entity.EntitymodModelEntity(String entityModelIdentifier, String entityType, String identifier) com.priint.pubserver.entity.EntitymodModelEntityByConnectorEntity(String entityModelIdentifier, String entityType, String identifier) jakarta.ws.rs.core.ResponsemodReplaceConnector(String modelId, String oldConnectorSpec, String newConnectorSpec) Replace connector references of a model.Methods inherited from class com.priint.pubserver.entitydata.service.AbstractService
clean, clean, connectorEntityFromRequest, connectorEntityFromRequest, connectorEntityFromRequest, connectorEntityFromRequest, contextFromListField, contextFromListField, fillUpdateItem, fillUpdateRecords, findMethod, fromEntityDataList, fromEntityDataList, lookupBean, lookupConnector, lookupEntityManager, lookupPersistConnector, lookupPlugin, lookupPluginByJndi, lookupPluginByPluginManager, lookupPublishingHubDBConnector, lookupPublishingManagementConnector, preProcessData, setConnectorEntity, setConnectorEntity, toEntityDataList, toEntityDataMap, toEntityDataRecord, toEntityDataRecord4Update, toEntityDataRecord4UpdateList, toEntityDataRecordList, toEntityItem, toEntityItem4UpdateList, toEntityItemForUpdate, toEntityItemList, toPushDataMethods inherited from class com.priint.pubserver.plugin.PluginControlDefault
afterCreateConfigurations, afterDeleteConfigurations, afterUpdateConfigurations, createConfiguration, deleteConfigurations, getSession, getSessionId, initInstance, loadServerConfig, ping, readSessionAttribute, updateConfigurations, writeSessionAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.priint.pubserver.plugin.interfaces.PluginControl
validateConfigurations
-
Field Details
-
MAPPED_NAME
- See Also:
-
-
Constructor Details
-
EntityModelService
public EntityModelService()
-
-
Method Details
-
modEntityModelIdentifiers
@Path("/identifiers") @GET public com.priint.pubserver.webservice.ServiceResult modEntityModelIdentifiers() throws com.priint.pubserver.exception.PubServerExceptionGet model names.- Returns:
- ServiceResult
- Throws:
com.priint.pubserver.exception.PubServerException
-
modModelEntity
@GET @Path("/{model}/{entityType}/{identifier}") public com.priint.pubserver.entity.Entity modModelEntity(@PathParam("model") String entityModelIdentifier, @PathParam("entityType") String entityType, @PathParam("identifier") String identifier) throws com.priint.pubserver.exception.PubServerException - Throws:
com.priint.pubserver.exception.PubServerException
-
modModelEntityByConnectorEntity
@GET @Path("/{model}/Entity/{identifier}/{entityType}") public com.priint.pubserver.entity.Entity modModelEntityByConnectorEntity(@PathParam("model") String entityModelIdentifier, @PathParam("entityType") String entityType, @PathParam("identifier") String identifier) throws com.priint.pubserver.exception.PubServerException - Throws:
com.priint.pubserver.exception.PubServerException
-
modExportModelToXML
@GET @Path("/{model}") public com.priint.pubserver.entity.EntityModel modExportModelToXML(@PathParam("model") String entityModelIdentifier) throws com.priint.pubserver.exception.PubServerException - Throws:
com.priint.pubserver.exception.PubServerException
-
modExportModelConfiguration
@GET @Path("/{entityModelIdentifier}/PluginConfigList") public jakarta.ws.rs.core.Response modExportModelConfiguration(@PathParam("entityModelIdentifier") String entityModelIdentifier) throws ServiceException - Parameters:
entityModelIdentifier-- Returns:
- list of PluginConfig containing model as well as all entities and their relationships
- Throws:
ServiceException
-
modImportModelConfiguration
@POST @Path("/{entityModelIdentifier}/PluginConfigList") public jakarta.ws.rs.core.Response modImportModelConfiguration(@PathParam("entityModelIdentifier") String entityModelIdentifier, @QueryParam("mode") @DefaultValue("") String mode, @QueryParam("connectorIdentifier") @DefaultValue("") String connectorIdentifier, @QueryParam("connectorInstance") @DefaultValue("") String connectorInstance, com.priint.pubserver.webservice.ServiceResult serviceRequest) throws ServiceException - Parameters:
entityModelIdentifier-mode-connectorIdentifier-connectorInstance-serviceRequest-- Returns:
- list of PluginConfig containing model as well as all entities and their relationships
- Throws:
ServiceException
-
modDuplicateModel
@POST @Path("/{modelId}/duplicate") public jakarta.ws.rs.core.Response modDuplicateModel(@PathParam("modelId") String oldModelId, @QueryParam("new-model") String newModelId, @QueryParam("tenant") String oldTenantName, @QueryParam("new-tenant") String newTenantName, @QueryParam("connector") String oldConnectorSpec, @QueryParam("new-connector") String newConnectorSpec) throws ServiceException Duplicate an EntityModel.This example shows how to duplicate existing model "aio" on tenant "WerkII" as model "ai2" on tenant "Default", while at the same time replacing all references to connector instance "com.priint.pubserver.connector.jpa.api.PublishingHubDBConnector:aio" by new reference to &newConnectorSpec=com.priint.pubserver.connector.rest.RestConnector:ai2"
curl -X POST \ 'https://pubserver.example.com/EntityDataService/entitymodel/aio/duplicate?new-model=ai2&tenant=WerkII&new-tenant=Default&connector=com.priint.pubserver.connector.jpa.api.PublishingHubDBConnector:default&new-connector=com.priint.pubserver.connector.rest.RestConnector:ai2' \ -H 'Accept: application/xml'- Parameters:
oldModelId-newModelId-oldTenantName-newTenantName-oldConnectorSpec-newConnectorSpec-- Returns:
- ServiceResult
- Throws:
ServiceException- Since:
- 4.1.6
-
modReplaceConnector
@POST @Path("/{modelId}/replace-connector") public jakarta.ws.rs.core.Response modReplaceConnector(@PathParam("modelId") String modelId, @QueryParam("connector") String oldConnectorSpec, @QueryParam("new-connector") String newConnectorSpec) throws ServiceException Replace connector references of a model.This example shows how to replace all references to connector instance "com.priint.pubserver.connector.jpa.api.PublishingHubDBConnector:aio" by new reference to &newConnectorSpec=com.priint.pubserver.connector.rest.RestConnector:xyz" on entity model "aio" on the default tenant.
curl -X POST \ 'https://pubserver.example.com/EntityDataService/entitymodel/aio/replace-connector?connector=com.priint.pubserver.connector.jpa.api.PublishingHubDBConnector:aio&new-connector=com.priint.pubserver.connector.rest.RestConnector:xyz' \ -H 'Accept: application/xml'- Parameters:
modelId-oldConnectorSpec-newConnectorSpec-- Returns:
- ServiceResult
- Throws:
ServiceException- Since:
- 4.1.6
-