org.squashtest.tm.service.internal.customfield
Class CustomFieldBindingModificationServiceImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.customfield.CustomFieldBindingModificationServiceImpl
All Implemented Interfaces:
CustomFieldBindingFinderService, CustomFieldBindingModificationService

@Service(value="squashtest.tm.service.CustomFieldBindingService")
@Transactional
public class CustomFieldBindingModificationServiceImpl
extends Object
implements CustomFieldBindingModificationService


Constructor Summary
CustomFieldBindingModificationServiceImpl()
           
 
Method Summary
 void addNewCustomFieldBinding(long projectId, org.squashtest.tm.domain.customfield.BindableEntity entity, long customFieldId, org.squashtest.tm.domain.customfield.CustomFieldBinding newBinding)
          Will attach a CustomField to a Project.
 void addRenderingLocation(long bindingId, org.squashtest.tm.domain.customfield.RenderingLocation location)
          Add a rendering location to a custom field binding
 void copyCustomFieldsSettingsFromTemplate(org.squashtest.tm.domain.project.Project newProject, org.squashtest.tm.domain.project.ProjectTemplate projectTemplate)
          Will copy the custom field bindings of the template and apply them to the project.
 List<org.squashtest.tm.domain.customfield.CustomField> findAvailableCustomFields()
          returns all the existing custom fields.
 List<org.squashtest.tm.domain.customfield.CustomField> findAvailableCustomFields(long projectId, org.squashtest.tm.domain.customfield.BindableEntity entity)
          same as CustomFieldBindingFinderService.findAvailableCustomFields(), restricted to the given project and bindable entity.
 List<org.squashtest.tm.domain.customfield.CustomField> findBoundCustomFields(long projectId, org.squashtest.tm.domain.customfield.BindableEntity entity)
          Returns the complementary of CustomFieldBindingFinderService.findAvailableCustomFields(long, BindableEntity)
 List<org.squashtest.tm.domain.customfield.CustomFieldBinding> findCustomFieldsForBoundEntity(org.squashtest.tm.domain.customfield.BoundEntity boundEntity)
          returns all the custom field bindinds associated to that entity wrt its project and BindableEntity type
 List<org.squashtest.tm.domain.customfield.CustomFieldBinding> findCustomFieldsForGenericProject(long projectId)
          returns all the custom field bindings associated to a GenericProject.
 List<org.squashtest.tm.domain.customfield.CustomFieldBinding> findCustomFieldsForProjectAndEntity(long projectId, org.squashtest.tm.domain.customfield.BindableEntity entity)
          returns all the custom field bindings associated to a project for a given entity type
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.customfield.CustomFieldBinding>> findCustomFieldsForProjectAndEntity(long projectId, org.squashtest.tm.domain.customfield.BindableEntity entity, org.squashtest.tm.core.foundation.collection.Paging paging)
          returns all the custom field bindings associated to a project for a given entity type (paged version)
 void moveCustomFieldbindings(List<Long> bindingIds, int newIndex)
          Given a list of CustomFieldBindings, will reorder them with respect to their project and bound entity.
 void removeCustomFieldBindings(List<Long> bindingIds)
          removes a batch of custom field bindings using their ids.
 void removeCustomFieldBindings(Long projectId)
          removes all the custom field bindings defined for a project.
 void removeRenderingLocation(long bindingId, org.squashtest.tm.domain.customfield.RenderingLocation location)
          Remove the rendering location from a custom field binding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomFieldBindingModificationServiceImpl

public CustomFieldBindingModificationServiceImpl()
Method Detail

findAvailableCustomFields

@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.customfield.CustomField> findAvailableCustomFields()
Description copied from interface: CustomFieldBindingFinderService
returns all the existing custom fields.

Specified by:
findAvailableCustomFields in interface CustomFieldBindingFinderService
Returns:
what I just said.

findAvailableCustomFields

@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.customfield.CustomField> findAvailableCustomFields(long projectId,
                                                                                                      org.squashtest.tm.domain.customfield.BindableEntity entity)
Description copied from interface: CustomFieldBindingFinderService
same as CustomFieldBindingFinderService.findAvailableCustomFields(), restricted to the given project and bindable entity. The only returned fields are those who aren't already mapped for that project and entity.

Specified by:
findAvailableCustomFields in interface CustomFieldBindingFinderService
Returns:

findBoundCustomFields

@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.customfield.CustomField> findBoundCustomFields(long projectId,
                                                                                                  org.squashtest.tm.domain.customfield.BindableEntity entity)
Description copied from interface: CustomFieldBindingFinderService
Returns the complementary of CustomFieldBindingFinderService.findAvailableCustomFields(long, BindableEntity)

Specified by:
findBoundCustomFields in interface CustomFieldBindingFinderService
Returns:

findCustomFieldsForGenericProject

@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.customfield.CustomFieldBinding> findCustomFieldsForGenericProject(long projectId)
Description copied from interface: CustomFieldBindingFinderService
returns all the custom field bindings associated to a GenericProject.

Specified by:
findCustomFieldsForGenericProject in interface CustomFieldBindingFinderService
Returns:

findCustomFieldsForProjectAndEntity

@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.customfield.CustomFieldBinding> findCustomFieldsForProjectAndEntity(long projectId,
                                                                                                                       org.squashtest.tm.domain.customfield.BindableEntity entity)
Description copied from interface: CustomFieldBindingFinderService
returns all the custom field bindings associated to a project for a given entity type

Specified by:
findCustomFieldsForProjectAndEntity in interface CustomFieldBindingFinderService
Returns:

findCustomFieldsForBoundEntity

@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.customfield.CustomFieldBinding> findCustomFieldsForBoundEntity(org.squashtest.tm.domain.customfield.BoundEntity boundEntity)
Description copied from interface: CustomFieldBindingFinderService
returns all the custom field bindinds associated to that entity wrt its project and BindableEntity type

Specified by:
findCustomFieldsForBoundEntity in interface CustomFieldBindingFinderService
Returns:

findCustomFieldsForProjectAndEntity

@Transactional(readOnly=true)
public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.customfield.CustomFieldBinding>> findCustomFieldsForProjectAndEntity(long projectId,
                                                                                                                                                                                           org.squashtest.tm.domain.customfield.BindableEntity entity,
                                                                                                                                                                                           org.squashtest.tm.core.foundation.collection.Paging paging)
Description copied from interface: CustomFieldBindingFinderService
returns all the custom field bindings associated to a project for a given entity type (paged version)

Specified by:
findCustomFieldsForProjectAndEntity in interface CustomFieldBindingFinderService
Returns:

addNewCustomFieldBinding

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void addNewCustomFieldBinding(long projectId,
                                                  org.squashtest.tm.domain.customfield.BindableEntity entity,
                                                  long customFieldId,
                                                  org.squashtest.tm.domain.customfield.CustomFieldBinding newBinding)
Description copied from interface: CustomFieldBindingModificationService
Will attach a CustomField to a Project. The details and conditions of that binding is described in the CustomFieldBinding newBinding. The new binding will be inserted last.

Specified by:
addNewCustomFieldBinding in interface CustomFieldBindingModificationService

addRenderingLocation

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void addRenderingLocation(long bindingId,
                                              org.squashtest.tm.domain.customfield.RenderingLocation location)
Description copied from interface: CustomFieldBindingModificationService
Add a rendering location to a custom field binding

Specified by:
addRenderingLocation in interface CustomFieldBindingModificationService

removeRenderingLocation

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void removeRenderingLocation(long bindingId,
                                                 org.squashtest.tm.domain.customfield.RenderingLocation location)
Description copied from interface: CustomFieldBindingModificationService
Remove the rendering location from a custom field binding

Specified by:
removeRenderingLocation in interface CustomFieldBindingModificationService

removeCustomFieldBindings

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void removeCustomFieldBindings(List<Long> bindingIds)
Description copied from interface: CustomFieldBindingModificationService
removes a batch of custom field bindings using their ids.

Specified by:
removeCustomFieldBindings in interface CustomFieldBindingModificationService

removeCustomFieldBindings

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void removeCustomFieldBindings(Long projectId)
Description copied from interface: CustomFieldBindingModificationService
removes all the custom field bindings defined for a project.

Specified by:
removeCustomFieldBindings in interface CustomFieldBindingModificationService
Parameters:
projectId - the id of the project

moveCustomFieldbindings

@PreAuthorize(value="hasRole(\'ROLE_TM_PROJECT_MANAGER\') or hasRole(\'ROLE_ADMIN\')")
public void moveCustomFieldbindings(List<Long> bindingIds,
                                                 int newIndex)
Description copied from interface: CustomFieldBindingModificationService
Given a list of CustomFieldBindings, will reorder them with respect to their project and bound entity. This method assumes that they all bind the same entity to the same project. If the input list mixes binding for different projects and/or entities, unexpected behavior may occur.

Specified by:
moveCustomFieldbindings in interface CustomFieldBindingModificationService
See Also:
CustomFieldBindingModificationService.copyCustomFieldsSettingsFromTemplate(Project, ProjectTemplate)

copyCustomFieldsSettingsFromTemplate

@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
public void copyCustomFieldsSettingsFromTemplate(org.squashtest.tm.domain.project.Project newProject,
                                                              org.squashtest.tm.domain.project.ProjectTemplate projectTemplate)
Description copied from interface: CustomFieldBindingModificationService
Will copy the custom field bindings of the template and apply them to the project.

Specified by:
copyCustomFieldsSettingsFromTemplate in interface CustomFieldBindingModificationService
See Also:
CustomFieldBindingModificationService.copyCustomFieldsSettingsFromTemplate(Project, ProjectTemplate)


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.