Package org.cyclos.impl.system
Class ExportFormatServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>
-
- org.cyclos.impl.system.ExportFormatServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<ExportFormat,ExportFormatDTO,ExportFormatData,Void>,ExportFormatServiceLocal,CRUDService<ExportFormatDTO,ExportFormatData,Void>,CRUDWithConfirmationPasswordService<ExportFormatDTO,ExportFormatData,Void>,Service,ExportFormatService
@Service public class ExportFormatServiceImpl extends CRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void> implements ExportFormatServiceLocal
Implementation forExportFormatService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description ExportFormatServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCustomInternalNameValidations(Property internalName, ExportFormatDTO dto)This method may be overridden to add custom validations for the INTERNAL_NAME property.FileInfoexportMultiple(ExportFormat format, ExportFormatContext context, QueryParameters params, com.mysema.commons.lang.CloseableIterator<?> entities)Exports a series of entities using the given format and contextFileInfoexportMultiple(ExportFormat format, ExportFormatContext context, QueryParameters params, com.mysema.commons.lang.CloseableIterator<?> entities, Map<String,Object> additionalData)Exports a series of entities using the given format and context, passing additional data to the export handlerFileInfoexportSingle(ExportFormat format, ExportFormatContext context, SimpleEntity entity)Exports a single entity using the given format and contextFileInfoexportSingle(ExportFormat format, ExportFormatContext context, SimpleEntity entity, Map<String,Object> additionalData)Exports a single entity using the given format and context, passing additional data to the export handlerExportFormatgetCSV()Returns CSV export formatprotected ExportFormatDatagetData(ExportFormat entity)Returns details data for the given entityExportFormatgetPDF()Returns the PDF export formatExportFormatgetXLSX()Returns the XLSX export formatvoidinitialize()protected booleanisEntityInternalNameRequired()NOTE: This method will be only invoked if the entity is anIInternalNamedEntity.List<ExportFormatVO>list()Lists all available export formatsList<ExportFormat>listAll()Returns all the export formatsList<ExportFormat>listByContext(ExportFormatContext context)Returns the enabled export formats associated with the given contextExportFormatload(String internalName)Loads an export format by internal nameExportFormatnewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected ObjectonBeforeSave(ExportFormat entity, ExportFormat currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(ExportFormatDTO dto)-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isNameRequired, load, logEntity, onAfterRemove, onAfterSave, onBeforeRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, toDTO, toEntity, validate
-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
-
-
-
Method Detail
-
exportMultiple
public FileInfo exportMultiple(ExportFormat format, ExportFormatContext context, QueryParameters params, com.mysema.commons.lang.CloseableIterator<?> entities)
Description copied from interface:ExportFormatServiceLocalExports a series of entities using the given format and context- Specified by:
exportMultiplein interfaceExportFormatServiceLocal
-
exportMultiple
public FileInfo exportMultiple(ExportFormat format, ExportFormatContext context, QueryParameters params, com.mysema.commons.lang.CloseableIterator<?> entities, Map<String,Object> additionalData)
Description copied from interface:ExportFormatServiceLocalExports a series of entities using the given format and context, passing additional data to the export handler- Specified by:
exportMultiplein interfaceExportFormatServiceLocal
-
exportSingle
public FileInfo exportSingle(ExportFormat format, ExportFormatContext context, SimpleEntity entity)
Description copied from interface:ExportFormatServiceLocalExports a single entity using the given format and context- Specified by:
exportSinglein interfaceExportFormatServiceLocal
-
exportSingle
public FileInfo exportSingle(ExportFormat format, ExportFormatContext context, SimpleEntity entity, Map<String,Object> additionalData)
Description copied from interface:ExportFormatServiceLocalExports a single entity using the given format and context, passing additional data to the export handler- Specified by:
exportSinglein interfaceExportFormatServiceLocal
-
getCSV
public ExportFormat getCSV()
Description copied from interface:ExportFormatServiceLocalReturns CSV export format- Specified by:
getCSVin interfaceExportFormatServiceLocal
-
getPDF
public ExportFormat getPDF()
Description copied from interface:ExportFormatServiceLocalReturns the PDF export format- Specified by:
getPDFin interfaceExportFormatServiceLocal
-
getXLSX
public ExportFormat getXLSX()
Description copied from interface:ExportFormatServiceLocalReturns the XLSX export format- Specified by:
getXLSXin interfaceExportFormatServiceLocal
-
initialize
@PostConstruct public void initialize()
-
list
public List<ExportFormatVO> list() throws FrameworkException
Description copied from interface:ExportFormatServiceLists all available export formats- Specified by:
listin interfaceExportFormatService- Throws:
FrameworkException
-
listAll
public List<ExportFormat> listAll()
Description copied from interface:ExportFormatServiceLocalReturns all the export formats- Specified by:
listAllin interfaceExportFormatServiceLocal
-
listByContext
public List<ExportFormat> listByContext(ExportFormatContext context)
Description copied from interface:ExportFormatServiceLocalReturns the enabled export formats associated with the given context- Specified by:
listByContextin interfaceExportFormatServiceLocal
-
load
public ExportFormat load(String internalName)
Description copied from interface:ExportFormatServiceLocalLoads an export format by internal name- Specified by:
loadin interfaceExportFormatServiceLocal
-
newEntity
public ExportFormat newEntity(Void params)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<ExportFormat,ExportFormatDTO,ExportFormatData,Void>- Specified by:
newEntityin classCRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>
-
addCustomInternalNameValidations
protected void addCustomInternalNameValidations(Property internalName, ExportFormatDTO dto)
Description copied from class:CRUDServiceImplThis method may be overridden to add custom validations for the INTERNAL_NAME property.- Overrides:
addCustomInternalNameValidationsin classCRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>
-
getData
protected ExportFormatData getData(ExportFormat entity)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>
-
isEntityInternalNameRequired
protected boolean isEntityInternalNameRequired()
Description copied from class:CRUDServiceImplNOTE: This method will be only invoked if the entity is anIInternalNamedEntity. Subclasses could override it if the internal name is required.- Overrides:
isEntityInternalNameRequiredin classCRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>- Returns:
- false (optional by default)
-
onBeforeSave
protected Object onBeforeSave(ExportFormat entity, ExportFormat currentCopy)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before saving an entity. Any returned value will be passed to theCRUDServiceImpl.onAfterSave(BaseEntity, BaseEntity, Object)method- Overrides:
onBeforeSavein classCRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
resolveValidator
protected Validator resolveValidator(ExportFormatDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<ExportFormat,QExportFormat,ExportFormatDTO,ExportFormatData,Void>
-
-