it.sistematica.isharedoc.service
Class OrganizationServiceImpl

java.lang.Object
  extended by it.sistematica.isharedoc.service.OrganizationServiceImpl
All Implemented Interfaces:
OrganizationService

@Service(value="organizationService")
public class OrganizationServiceImpl
extends java.lang.Object
implements OrganizationService


Field Summary
(package private)  AddressBookService addressBookService
           
(package private)  net.sf.ehcache.CacheManager cacheManager
           
(package private)  it.neverworks.util.Configuration configuration
           
(package private)  it.neverworks.data.EntityManager entities
           
(package private)  it.neverworks.cache.ehcache.EhCache<java.util.Map<java.lang.String,InstanceSecurityServiceImpl.InstanceAclItem>> instanceAclCache
           
(package private)  it.neverworks.cache.ehcache.EhCache<java.util.Map<java.lang.String,InstanceSecurityServiceImpl.InstanceAclItem>> instanceAttachmentAclCache
           
(package private)  InstanceSecurityService instanceSecurityService
           
(package private)  InstanceService instanceService
           
(package private)  MessageboxService messageboxService
           
(package private)  PartitionService partitionService
           
(package private)  org.hibernate.SessionFactory sessionFactory
           
(package private)  WorkTaskManager taskManager
           
(package private)  it.neverworks.application.service.UserInfo userInfo
           
 
Constructor Summary
OrganizationServiceImpl()
           
 
Method Summary
 OrganizationUser addOrganizationUser(Organization organization, it.neverworks.security.User user)
          Adds the organization user.
 boolean canChangeFileConfidentialityLevel(CloudFile file)
          Can change file confidentiality level.
 boolean canChangeInstanceConfidentialityLevel(ItemInstance instance)
          Can change instance confidentiality level.
 void cloneOrganizationVersion(OrganizationVersion sourceVersion, OrganizationVersion targetVersion)
          Clone organization version.
 void copyUserProfile(it.neverworks.security.User source, it.neverworks.security.User target, Partition targetPartition, boolean cleanTarget, boolean copyProfileMbox, boolean copyProfileOrg, boolean copyProfileTeam, boolean copyProfileWf, boolean copyProfileSubscr, boolean copyProfileUsr)
          Copy user profile.
 it.neverworks.security.User findUserById(java.lang.String id)
          Find user by id.
 java.util.List<Organization> getActiveOrganizations()
          Gets the active organizations.
 OrganizationVersion getActiveOrganizationVersion()
          Gets the active organization version.
 java.util.List<Team> getActiveTeams()
          Gets the active teams.
 java.util.List<Organization> getAllOrganizations()
          Gets the all organizations.
 java.util.List<ConfidentialityLevel> getConfidentialityLevels()
          Gets the confidentiality levels.
 java.util.List<Organization> getMyActiveOrganizations()
          Gets the my active organizations.
 Organization getOrganizationBy(java.lang.String fieldName, java.lang.Object byValue)
          Gets the organization by.
 OrganizationUser getOrganizationUser(Organization organization, it.neverworks.security.User user)
          Gets the organization user.
 java.util.List<Organization> getUserActiveOrganizations(it.neverworks.security.User user)
          Gets the user active organizations.
 it.neverworks.security.User getUserByName(java.lang.String name)
          Gets the user by name.
 Organization getUserFirstOrganization(it.neverworks.security.User user)
          Gets the user first organization.
 void removeOrganization(Organization organization, Organization movePendingToOrganization, it.neverworks.security.User movePendingTasksToUser)
          Removes the organization.
 void removeOrganizationUser(OrganizationUser organizationUser, OrganizationUser movePendingToOrganizationUser)
          Removes the organization user.
 it.neverworks.security.User resolveAssigneeAssignment(ItemInstance instance, java.lang.String taskDefinitionKey)
          Resolve assignee assignment.
 it.neverworks.security.User resolveAssigneeAssignment(ItemInstance instance, java.lang.String taskDefinitionKey, Organization organization)
          Resolve assignee assignment.
 it.neverworks.security.User resolveAssigneeAssignmentInLane(ItemInstance instance, java.lang.String taskDefinitionKey, java.lang.String laneId)
          Resolve assignee assignment in lane.
 Organization resolveOrganizationId(java.lang.String organizationId)
          Resolve organization id.
 OrganizationUser resolveOrganizationUserId(java.lang.String organizationUserId)
          Resolve organization user id.
 Organization resolveOwnerAssignment(ItemInstance instance, java.lang.String taskDefinitionKey)
          Resolve owner assignment.
 Organization resolveOwnerAssignmentFirst(ItemInstance instance, java.lang.String taskDefinitionKey)
          Resolve owner assignment first.
 Organization resolveOwnerAssignmentInLane(ItemInstance instance, java.lang.String taskDefinitionKey, java.lang.String laneId)
          Resolve owner assignment in lane.
 java.util.List<OrganizationUser> resolveUsersWithFunction(Organization organization, java.lang.String function)
          Resolve users with function.
 void save(Organization organization)
          Save.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userInfo

it.neverworks.application.service.UserInfo userInfo

entities

it.neverworks.data.EntityManager entities

configuration

it.neverworks.util.Configuration configuration

addressBookService

AddressBookService addressBookService

taskManager

WorkTaskManager taskManager

instanceService

InstanceService instanceService

partitionService

PartitionService partitionService

instanceSecurityService

InstanceSecurityService instanceSecurityService

messageboxService

MessageboxService messageboxService

cacheManager

net.sf.ehcache.CacheManager cacheManager

instanceAclCache

it.neverworks.cache.ehcache.EhCache<java.util.Map<java.lang.String,InstanceSecurityServiceImpl.InstanceAclItem>> instanceAclCache

instanceAttachmentAclCache

it.neverworks.cache.ehcache.EhCache<java.util.Map<java.lang.String,InstanceSecurityServiceImpl.InstanceAclItem>> instanceAttachmentAclCache

sessionFactory

org.hibernate.SessionFactory sessionFactory
Constructor Detail

OrganizationServiceImpl

public OrganizationServiceImpl()
Method Detail

save

@Transactional
public void save(Organization organization)
Description copied from interface: OrganizationService
Save.

Specified by:
save in interface OrganizationService
Parameters:
organization - the organization

cloneOrganizationVersion

@Transactional
public void cloneOrganizationVersion(OrganizationVersion sourceVersion,
                                                   OrganizationVersion targetVersion)
Description copied from interface: OrganizationService
Clone organization version.

Specified by:
cloneOrganizationVersion in interface OrganizationService
Parameters:
sourceVersion - the source version
targetVersion - the target version

removeOrganization

@Transactional
public void removeOrganization(Organization organization,
                                             Organization movePendingToOrganization,
                                             it.neverworks.security.User movePendingTasksToUser)
Description copied from interface: OrganizationService
Removes the organization.

Specified by:
removeOrganization in interface OrganizationService
Parameters:
organization - the organization
movePendingToOrganization - the move pending to organization
movePendingTasksToUser - the move pending tasks to user

addOrganizationUser

@Transactional
public OrganizationUser addOrganizationUser(Organization organization,
                                                          it.neverworks.security.User user)
Description copied from interface: OrganizationService
Adds the organization user.

Specified by:
addOrganizationUser in interface OrganizationService
Parameters:
organization - the organization
user - the user
Returns:
the organization user

removeOrganizationUser

@Transactional
public void removeOrganizationUser(OrganizationUser organizationUser,
                                                 OrganizationUser movePendingToOrganizationUser)
Description copied from interface: OrganizationService
Removes the organization user.

Specified by:
removeOrganizationUser in interface OrganizationService
Parameters:
organizationUser - the organization user
movePendingToOrganizationUser - the move pending to organization user

findUserById

@Transactional
public it.neverworks.security.User findUserById(java.lang.String id)
Description copied from interface: OrganizationService
Find user by id.

Specified by:
findUserById in interface OrganizationService
Parameters:
id - the id
Returns:
the user

resolveOrganizationId

@Transactional
public Organization resolveOrganizationId(java.lang.String organizationId)
Description copied from interface: OrganizationService
Resolve organization id.

Specified by:
resolveOrganizationId in interface OrganizationService
Parameters:
organizationId - the organization id
Returns:
the organization

resolveOrganizationUserId

@Transactional
public OrganizationUser resolveOrganizationUserId(java.lang.String organizationUserId)
Description copied from interface: OrganizationService
Resolve organization user id.

Specified by:
resolveOrganizationUserId in interface OrganizationService
Parameters:
organizationUserId - the organization user id
Returns:
the organization user

resolveAssigneeAssignment

@Transactional
public it.neverworks.security.User resolveAssigneeAssignment(ItemInstance instance,
                                                                           java.lang.String taskDefinitionKey)
Description copied from interface: OrganizationService
Resolve assignee assignment.

Specified by:
resolveAssigneeAssignment in interface OrganizationService
Parameters:
instance - the instance
taskDefinitionKey - the task definition key
Returns:
the user

resolveAssigneeAssignment

@Transactional
public it.neverworks.security.User resolveAssigneeAssignment(ItemInstance instance,
                                                                           java.lang.String taskDefinitionKey,
                                                                           Organization organization)
Description copied from interface: OrganizationService
Resolve assignee assignment.

Specified by:
resolveAssigneeAssignment in interface OrganizationService
Parameters:
instance - the instance
taskDefinitionKey - the task definition key
organization - the organization
Returns:
the user

resolveAssigneeAssignmentInLane

@Transactional
public it.neverworks.security.User resolveAssigneeAssignmentInLane(ItemInstance instance,
                                                                                 java.lang.String taskDefinitionKey,
                                                                                 java.lang.String laneId)
Description copied from interface: OrganizationService
Resolve assignee assignment in lane.

Specified by:
resolveAssigneeAssignmentInLane in interface OrganizationService
Parameters:
instance - the instance
taskDefinitionKey - the task definition key
laneId - the lane id
Returns:
the user

resolveOwnerAssignment

@Transactional
public Organization resolveOwnerAssignment(ItemInstance instance,
                                                         java.lang.String taskDefinitionKey)
Description copied from interface: OrganizationService
Resolve owner assignment.

Specified by:
resolveOwnerAssignment in interface OrganizationService
Parameters:
instance - the instance
taskDefinitionKey - the task definition key
Returns:
the organization

resolveOwnerAssignmentFirst

@Transactional
public Organization resolveOwnerAssignmentFirst(ItemInstance instance,
                                                              java.lang.String taskDefinitionKey)
Description copied from interface: OrganizationService
Resolve owner assignment first.

Specified by:
resolveOwnerAssignmentFirst in interface OrganizationService
Parameters:
instance - the instance
taskDefinitionKey - the task definition key
Returns:
the organization

resolveOwnerAssignmentInLane

@Transactional
public Organization resolveOwnerAssignmentInLane(ItemInstance instance,
                                                               java.lang.String taskDefinitionKey,
                                                               java.lang.String laneId)
Description copied from interface: OrganizationService
Resolve owner assignment in lane.

Specified by:
resolveOwnerAssignmentInLane in interface OrganizationService
Parameters:
instance - the instance
taskDefinitionKey - the task definition key
laneId - the lane id
Returns:
the organization

getActiveOrganizationVersion

public OrganizationVersion getActiveOrganizationVersion()
Description copied from interface: OrganizationService
Gets the active organization version.

Specified by:
getActiveOrganizationVersion in interface OrganizationService
Returns:
the active organization version

getUserByName

@Transactional
public it.neverworks.security.User getUserByName(java.lang.String name)
Description copied from interface: OrganizationService
Gets the user by name.

Specified by:
getUserByName in interface OrganizationService
Parameters:
name - the name
Returns:
the user by name

getOrganizationUser

@Transactional
public OrganizationUser getOrganizationUser(Organization organization,
                                                          it.neverworks.security.User user)
Description copied from interface: OrganizationService
Gets the organization user.

Specified by:
getOrganizationUser in interface OrganizationService
Parameters:
organization - the organization
user - the user
Returns:
the organization user

getOrganizationBy

@Transactional
public Organization getOrganizationBy(java.lang.String fieldName,
                                                    java.lang.Object byValue)
Description copied from interface: OrganizationService
Gets the organization by.

Specified by:
getOrganizationBy in interface OrganizationService
Parameters:
fieldName - the field name
byValue - the by value
Returns:
the organization by

getConfidentialityLevels

@Transactional
public java.util.List<ConfidentialityLevel> getConfidentialityLevels()
Description copied from interface: OrganizationService
Gets the confidentiality levels.

Specified by:
getConfidentialityLevels in interface OrganizationService
Returns:
the confidentiality levels

canChangeInstanceConfidentialityLevel

@Transactional
public boolean canChangeInstanceConfidentialityLevel(ItemInstance instance)
Description copied from interface: OrganizationService
Can change instance confidentiality level.

Specified by:
canChangeInstanceConfidentialityLevel in interface OrganizationService
Parameters:
instance - the instance
Returns:
true, if successful

canChangeFileConfidentialityLevel

@Transactional
public boolean canChangeFileConfidentialityLevel(CloudFile file)
Description copied from interface: OrganizationService
Can change file confidentiality level.

Specified by:
canChangeFileConfidentialityLevel in interface OrganizationService
Parameters:
file - the file
Returns:
true, if successful

getMyActiveOrganizations

@Transactional
public java.util.List<Organization> getMyActiveOrganizations()
Description copied from interface: OrganizationService
Gets the my active organizations.

Specified by:
getMyActiveOrganizations in interface OrganizationService
Returns:
the my active organizations

getUserActiveOrganizations

@Transactional
public java.util.List<Organization> getUserActiveOrganizations(it.neverworks.security.User user)
Description copied from interface: OrganizationService
Gets the user active organizations.

Specified by:
getUserActiveOrganizations in interface OrganizationService
Parameters:
user - the user
Returns:
the user active organizations

getUserFirstOrganization

@Transactional
public Organization getUserFirstOrganization(it.neverworks.security.User user)
Description copied from interface: OrganizationService
Gets the user first organization.

Specified by:
getUserFirstOrganization in interface OrganizationService
Parameters:
user - the user
Returns:
the user first organization

getActiveOrganizations

@Transactional
public java.util.List<Organization> getActiveOrganizations()
Description copied from interface: OrganizationService
Gets the active organizations.

Specified by:
getActiveOrganizations in interface OrganizationService
Returns:
the active organizations

getAllOrganizations

@Transactional
public java.util.List<Organization> getAllOrganizations()
Description copied from interface: OrganizationService
Gets the all organizations.

Specified by:
getAllOrganizations in interface OrganizationService
Returns:
the all organizations

getActiveTeams

@Transactional
public java.util.List<Team> getActiveTeams()
Description copied from interface: OrganizationService
Gets the active teams.

Specified by:
getActiveTeams in interface OrganizationService
Returns:
the active teams

resolveUsersWithFunction

public java.util.List<OrganizationUser> resolveUsersWithFunction(Organization organization,
                                                                 java.lang.String function)
Description copied from interface: OrganizationService
Resolve users with function.

Specified by:
resolveUsersWithFunction in interface OrganizationService
Parameters:
organization - the organization
function - the function
Returns:
the list

copyUserProfile

@Transactional
public void copyUserProfile(it.neverworks.security.User source,
                                          it.neverworks.security.User target,
                                          Partition targetPartition,
                                          boolean cleanTarget,
                                          boolean copyProfileMbox,
                                          boolean copyProfileOrg,
                                          boolean copyProfileTeam,
                                          boolean copyProfileWf,
                                          boolean copyProfileSubscr,
                                          boolean copyProfileUsr)
Description copied from interface: OrganizationService
Copy user profile.

Specified by:
copyUserProfile in interface OrganizationService
Parameters:
source - the source
target - the target
targetPartition - the target partition
cleanTarget - the clean target
copyProfileMbox - the copy profile mbox
copyProfileOrg - the copy profile org
copyProfileTeam - the copy profile team
copyProfileWf - the copy profile wf
copyProfileSubscr - the copy profile subscr
copyProfileUsr - the copy profile usr