Package de.xima.fc.dao.impl
Class ProjektDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<E>
-
- de.xima.fc.dao.impl.MandantDependentBaseDao<Projekt>
-
- de.xima.fc.dao.impl.ProjektDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<Projekt,Long,IEntityContext>
,IGenericDao<Projekt>
,IMandantDependentBaseDao<Projekt>
,IProjektDao
public class ProjektDao extends MandantDependentBaseDao<Projekt> implements IProjektDao
-
-
Constructor Summary
Constructors Constructor Description ProjektDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<Projekt>
allByClient(IEntityContext ec, Mandant client, boolean includeTemplates)
List<Projekt>
allByClient(IEntityContext ec, Mandant client, String scope, boolean includeTemplates)
List<Projekt>
allByMandant(IEntityContext ec, Mandant mandant)
Deprecated.List<Projekt>
allEditableProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates)
Deprecated.List<Projekt>
allEditableProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates, de.xima.cmn.criteria.QueryCriteriaManager customQcm)
Deprecated.List<Projekt>
allTemplatesByClient(IEntityContext ec, Mandant client)
List<Projekt>
allTemplatesByClient(IEntityContext ec, Mandant client, String scope)
List<Projekt>
allVisibleProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates)
Deprecated.List<Projekt>
allVisibleProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates, de.xima.cmn.criteria.QueryCriteriaManager customQcm)
Deprecated.de.xima.cmn.criteria.QueryCriteriaManager
allVisibleProjectsQcm(IEntityContext ec, Benutzer user, Mandant client, String projectScope, boolean includeTemplates)
Deprecated.String
findUniqueName(IEntityContext ec, Mandant client, String candidate, Projekt exclude)
Returns a name that is not taken by anotherProjekt
in the given client other than the excluded data source.String
findUniqueTitle(IEntityContext ec, Mandant client, String candidate, Projekt exclude)
Returns a title that is not taken by anotherProjekt
in the given client other than the excluded data source.List<Projekt>
getAccessableProjects(IEntityContext ec, IUser user, Mandant client)
Returns all projects which are editable or visible by the user groups of the user in the given client.Projekt
getByUserPortal(IEntityContext ec, UUID userPortalUuid, UUID formUuid)
Projekt
getByUUID(IEntityContext ec, Mandant client, String uuid)
Gets a project by its UUID.Projekt
getByUUID(IEntityContext ec, Mandant client, UUID uuid)
Gets a project by its UUID.Projekt
getByUUID(IEntityContext ec, Long clientId, UUID uuid)
Gets a project by its UUID.Projekt
getByUUID(IEntityContext ec, UUID clientUuid, UUID uuid)
Gets a project by its UUID.protected IFCDaoActionHook<Projekt>
getPostActionHook()
protected IFCDaoActionHook<Projekt>
getPreActionHook()
byte[]
getPreviewImage(IEntityContext ec, Projekt project)
String
getPreviewImageVersion(IEntityContext ec, Projekt project)
int
getProjectsCount(IEntityContext ec, ProjectsPageQuery projectPageRequest)
Returns the number of projects for the given page request and filter.PagedResult<Projekt>
getProjectsPage(IEntityContext ec, PageQuery pageQuery, ProjectsPageQuery projectPageRequest, boolean skipCount)
Returns all projects for the given page request and filter.Set<Long>
getProjectsWithPreviewImage(IEntityContext ec, Mandant client)
List<Projekt>
getProjektByEditorBenutzer(IEntityContext ec, Benutzer benutzer, Mandant mandant)
Deprecated.List<Projekt>
getProjektByEditorBenutzer(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope)
Deprecated.ProjectFile
getUserPortalProjectFile(IEntityContext ec, UUID portalUuid, UUID clientUuid, UUID projectUuid, UUID fileUuid)
Returns the project file with the given file UUID in the context of the user portal with the given UUID.boolean
isActivationAllowed(IEntityContext ec, Projekt projekt)
boolean
isEditingAllowed(IEntityContext ec, Projekt p, Benutzer ben)
Deprecated.boolean
isFsAllowed(IEntityContext ec, Projekt project, FrontendServer fs)
boolean
isNameExisiting(IEntityContext ec, Mandant client, String name)
Returns whether or not the given project name exists within the given clientboolean
isTitleExisiting(IEntityContext ec, Mandant client, String name)
Returns whether or not the given project title exists within the given clientboolean
isZugriffsberechtigt(IEntityContext ec, Projekt project, Benutzer user)
Deprecated.void
updatePreviewImage(IEntityContext ec, Projekt project, byte[] data)
IProjectRecordsBulkUpdateResult
updateProjectRecords(IEntityContext ec, IProjectRecordsParameters parameter)
Performs a bulk update of form records based on the given project.-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
getEntityRefs, read
-
Methods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
-
-
-
Method Detail
-
getByUUID
public Projekt getByUUID(IEntityContext ec, Mandant client, String uuid)
Description copied from interface:IProjektDao
Gets a project by its UUID. The project must be in the given client.- Specified by:
getByUUID
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.client
- The client to which the project must belong.uuid
- UUID of the project to get.- Returns:
- The project with the given UUID in the given client, or
null
if no such project exists.
-
getByUUID
public Projekt getByUUID(IEntityContext ec, UUID clientUuid, UUID uuid)
Description copied from interface:IProjektDao
Gets a project by its UUID. The project must be in the given client.- Specified by:
getByUUID
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.clientUuid
- UUID of the client to which the project must belong.uuid
- UUID of the project to get.- Returns:
- The project with the given UUID in the given client, or
null
if no such project exists.
-
getByUUID
public Projekt getByUUID(IEntityContext ec, Long clientId, UUID uuid)
Description copied from interface:IProjektDao
Gets a project by its UUID. The project must be in the given client.- Specified by:
getByUUID
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.clientId
- ID of the client to which the project must belong.uuid
- UUID of the project to get.- Returns:
- The project with the given UUID in the given client, or
null
if no such project exists.
-
getByUUID
public Projekt getByUUID(IEntityContext ec, Mandant client, UUID uuid)
Description copied from interface:IProjektDao
Gets a project by its UUID. The project must be in the given client.- Specified by:
getByUUID
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.client
- The client to which the project must belong.uuid
- UUID of the project to get.- Returns:
- The project with the given UUID in the given client, or
null
if no such project exists.
-
getUserPortalProjectFile
public ProjectFile getUserPortalProjectFile(IEntityContext ec, UUID portalUuid, UUID clientUuid, UUID projectUuid, UUID fileUuid)
Description copied from interface:IProjektDao
Returns the project file with the given file UUID in the context of the user portal with the given UUID.- Specified by:
getUserPortalProjectFile
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.portalUuid
- UUID of the user portal (context).clientUuid
- UUID of the client (context).projectUuid
- UUID of the project.fileUuid
- UUID of the project file.- Returns:
- The project file with the given UUID, or
null
if no such project file exists.
-
getPreviewImage
public byte[] getPreviewImage(IEntityContext ec, Projekt project)
- Specified by:
getPreviewImage
in interfaceIProjektDao
-
getPreviewImageVersion
public String getPreviewImageVersion(IEntityContext ec, Projekt project)
- Specified by:
getPreviewImageVersion
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.project
- Project for which to find the preview image.- Returns:
- The current (locking) version of the preview image.
-
isActivationAllowed
public boolean isActivationAllowed(IEntityContext ec, Projekt projekt)
- Specified by:
isActivationAllowed
in interfaceIProjektDao
-
isFsAllowed
public boolean isFsAllowed(IEntityContext ec, Projekt project, FrontendServer fs)
- Specified by:
isFsAllowed
in interfaceIProjektDao
-
allByClient
public List<Projekt> allByClient(IEntityContext ec, Mandant client, boolean includeTemplates)
- Specified by:
allByClient
in interfaceIProjektDao
-
allByClient
public List<Projekt> allByClient(IEntityContext ec, Mandant client, String scope, boolean includeTemplates)
- Specified by:
allByClient
in interfaceIProjektDao
-
allTemplatesByClient
public List<Projekt> allTemplatesByClient(IEntityContext ec, Mandant client)
- Specified by:
allTemplatesByClient
in interfaceIProjektDao
-
findUniqueName
public String findUniqueName(IEntityContext ec, Mandant client, String candidate, Projekt exclude)
Description copied from interface:IProjektDao
Returns a name that is not taken by anotherProjekt
in the given client other than the excluded data source. An index will be added to the candidate if necessary.- Specified by:
findUniqueName
in interfaceIProjektDao
- Parameters:
ec
-IEntityContext
to be usedclient
-Mandant
for which a unique project name should be generatedcandidate
-String
project name candiate to be made uniqueexclude
-Projekt
project to be excluded from search- Returns:
- unique project name in the context of the given client
-
findUniqueTitle
public String findUniqueTitle(IEntityContext ec, Mandant client, String candidate, Projekt exclude)
Description copied from interface:IProjektDao
Returns a title that is not taken by anotherProjekt
in the given client other than the excluded data source. An index will be added to the candidate if necessary.- Specified by:
findUniqueTitle
in interfaceIProjektDao
- Parameters:
ec
-IEntityContext
to be usedclient
-Mandant
for which a unique project title should be generatedcandidate
-String
project title candiate to be made uniqueexclude
-Projekt
project to be excluded from search- Returns:
- unique project title in the context of the given client
-
isNameExisiting
public boolean isNameExisiting(IEntityContext ec, Mandant client, String name)
Description copied from interface:IProjektDao
Returns whether or not the given project name exists within the given client- Specified by:
isNameExisiting
in interfaceIProjektDao
- Parameters:
ec
-IEntityContext
to be usedclient
-Mandant
for which to check uniquenessname
- Project name to check- Returns:
- whether or not the given name is unique
-
isTitleExisiting
public boolean isTitleExisiting(IEntityContext ec, Mandant client, String name)
Description copied from interface:IProjektDao
Returns whether or not the given project title exists within the given client- Specified by:
isTitleExisiting
in interfaceIProjektDao
- Parameters:
ec
-IEntityContext
to be usedclient
-Mandant
for which to check uniquenessname
- Project title to check- Returns:
- whether or not the given title is unique
-
allTemplatesByClient
public List<Projekt> allTemplatesByClient(IEntityContext ec, Mandant client, String scope)
- Specified by:
allTemplatesByClient
in interfaceIProjektDao
-
updatePreviewImage
public void updatePreviewImage(IEntityContext ec, Projekt project, byte[] data)
- Specified by:
updatePreviewImage
in interfaceIProjektDao
-
getPreActionHook
protected IFCDaoActionHook<Projekt> getPreActionHook()
- Overrides:
getPreActionHook
in classGenericDao<Projekt>
-
getPostActionHook
protected IFCDaoActionHook<Projekt> getPostActionHook()
- Overrides:
getPostActionHook
in classGenericDao<Projekt>
-
getProjectsWithPreviewImage
public Set<Long> getProjectsWithPreviewImage(IEntityContext ec, Mandant client)
- Specified by:
getProjectsWithPreviewImage
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.client
- Client to which to limit the search. May benull
, in which case no restriction is applied.- Returns:
- A list of all IDs of projects for which a preview image is available.
-
getAccessableProjects
public List<Projekt> getAccessableProjects(IEntityContext ec, IUser user, Mandant client)
Description copied from interface:IProjektDao
Returns all projects which are editable or visible by the user groups of the user in the given client.- Specified by:
getAccessableProjects
in interfaceIProjektDao
- Parameters:
ec
-IEntityContext
to be useduser
-IUser
who has the user groupsclient
-Mandant
containing the user groups- Returns:
- all projects which are visible or editable for the user in the given client
-
getProjectsPage
public PagedResult<Projekt> getProjectsPage(IEntityContext ec, PageQuery pageQuery, ProjectsPageQuery projectPageRequest, boolean skipCount)
Description copied from interface:IProjektDao
Returns all projects for the given page request and filter.- Specified by:
getProjectsPage
in interfaceIProjektDao
- Parameters:
ec
- entity context for database transactions.pageQuery
- page request defining the page and page size.projectPageRequest
- page request defining the user portal, filters.skipCount
- whether to skip the count query.- Returns:
- all projects enabled for the given user portal.
-
getProjectsCount
public int getProjectsCount(IEntityContext ec, ProjectsPageQuery projectPageRequest)
Description copied from interface:IProjektDao
Returns the number of projects for the given page request and filter.- Specified by:
getProjectsCount
in interfaceIProjektDao
- Parameters:
ec
- user context for database transactions.projectPageRequest
- page request defining the user portal, filters.- Returns:
- the number of projects enabled for the given user portal.
-
updateProjectRecords
public IProjectRecordsBulkUpdateResult updateProjectRecords(IEntityContext ec, IProjectRecordsParameters parameter) throws Exception
Description copied from interface:IProjektDao
Performs a bulk update of form records based on the given project.- Specified by:
updateProjectRecords
in interfaceIProjektDao
- Parameters:
ec
- Entity context for accessing the database.parameter
- Parameters for the bulk update operation.- Returns:
- Result of the bulk update operation.
- Throws:
Exception
- if a hard error occurs during the bulk update operation.
-
getByUserPortal
public Projekt getByUserPortal(IEntityContext ec, UUID userPortalUuid, UUID formUuid)
- Specified by:
getByUserPortal
in interfaceIProjektDao
-
allByMandant
@Deprecated public List<Projekt> allByMandant(IEntityContext ec, Mandant mandant)
Deprecated.- Specified by:
allByMandant
in interfaceIProjektDao
-
isZugriffsberechtigt
@Deprecated public boolean isZugriffsberechtigt(IEntityContext ec, Projekt project, Benutzer user)
Deprecated.- Specified by:
isZugriffsberechtigt
in interfaceIProjektDao
-
isEditingAllowed
@Deprecated public boolean isEditingAllowed(IEntityContext ec, Projekt p, Benutzer ben)
Deprecated.- Specified by:
isEditingAllowed
in interfaceIProjektDao
-
getProjektByEditorBenutzer
@Deprecated public List<Projekt> getProjektByEditorBenutzer(IEntityContext ec, Benutzer benutzer, Mandant mandant)
Deprecated.- Specified by:
getProjektByEditorBenutzer
in interfaceIProjektDao
-
getProjektByEditorBenutzer
@Deprecated public List<Projekt> getProjektByEditorBenutzer(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope)
Deprecated.- Specified by:
getProjektByEditorBenutzer
in interfaceIProjektDao
-
allVisibleProjects
@Deprecated public List<Projekt> allVisibleProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates)
Deprecated.- Specified by:
allVisibleProjects
in interfaceIProjektDao
-
allVisibleProjects
@Deprecated public List<Projekt> allVisibleProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates, de.xima.cmn.criteria.QueryCriteriaManager customQcm)
Deprecated.- Specified by:
allVisibleProjects
in interfaceIProjektDao
-
allVisibleProjectsQcm
@Deprecated public de.xima.cmn.criteria.QueryCriteriaManager allVisibleProjectsQcm(IEntityContext ec, Benutzer user, Mandant client, String projectScope, boolean includeTemplates)
Deprecated.- Specified by:
allVisibleProjectsQcm
in interfaceIProjektDao
-
allEditableProjects
@Deprecated public List<Projekt> allEditableProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates)
Deprecated.- Specified by:
allEditableProjects
in interfaceIProjektDao
-
allEditableProjects
@Deprecated public List<Projekt> allEditableProjects(IEntityContext ec, Benutzer benutzer, Mandant mandant, String projectScope, boolean includeTemplates, de.xima.cmn.criteria.QueryCriteriaManager customQcm)
Deprecated.- Specified by:
allEditableProjects
in interfaceIProjektDao
-
-