org.directdemocracyportal.democracy.service
Class PortalServiceImpl

Package class diagram package PortalServiceImpl
java.lang.Object
  extended by org.directdemocracyportal.democracy.service.PortalServiceImpl
All Implemented Interfaces:
PortalService

@Transactional(propagation=REQUIRED)
public class PortalServiceImpl
extends java.lang.Object
implements PortalService

The Class PortalServiceImpl.


Constructor Summary
Constructor and Description
PortalServiceImpl(UserDAO userDAO, EventDAO eventDAO, PortalDAO portalDAO, CountryDAO countryDAO, UserSessionDAO userSessionDAO, PoliticalPartyDAO politicalPartyDAO, GovernmentDAO governmentDAO, AgentDAO agentDAO, DocumentDAO documentDAO, RoleDAO roleDAO, RegionDAO regionDAO)
          Instantiates a new portal service impl.
 
Method Summary
Modifier and Type Method and Description
 void addMember(Organisation organisation, Person person)
          Adds the member.
 void addMemberById(java.lang.Long orgId, java.lang.Long personId)
          Adds the member by id.
 void addResolutionIssue(Resolution resolution, Issue issue, VoteResult voteResult)
          Adds the resolution issue.
 void addRolePlayed(Role role, Person person)
          Adds the role played.
 void addRolePlayedById(java.lang.Long roleId, java.lang.Long agentId)
          Adds the role played by id.
 Country createCountry(java.lang.String name)
          Creates the country.
 void createElection(java.lang.String name, ElectionType electionType, java.lang.Long governmentid)
          Creates the election.
 Government createGovernment(java.lang.String name, java.lang.Long countryId, GovernmentType governmentType, java.lang.String headOfstate)
          Creates the government.
 Organisation createOrganisation(java.lang.String name, java.lang.String abbr, Country country, Region region, OrganisationType organisationType, Organisation parent)
          Creates the organisation.
 void createOrganisationById(java.lang.String name, java.lang.String abbr, java.lang.Long countryId, java.lang.Long regionId, OrganisationType organisationType, java.lang.Long orgId)
          Creates the organisation by id.
 Organisation createOrgUnit(java.lang.String orgName, java.lang.String shortName, OrganisationType organisationType, java.lang.Long orgId)
          Creates the org unit.
 PoliticalParty createParty(CreatePartyCommand command, java.lang.Long userId)
          Creates the party.
 Person createPerson(java.lang.String name)
          Creates the person.
 PoliticalParty createPoliticalParty(java.lang.String name, java.lang.String shortCode, Country country, Region region)
          Creates the political party.
 PoliticalParty createPoliticalPartyById(java.lang.String name, java.lang.String shortCode, java.lang.Long countryId)
          Creates the political party by id.
 Government createRegionalGovernment(java.lang.String name, Country country, Region region, OrganisationType organisationType, Government parentGovernment)
          Creates the regional government.
 void createResolution(Resolution resolution)
          Creates the resolution.
 Role createRoleInOrg(java.lang.String roleName, Organisation organisation)
          Creates the role in org.
 Country findCountryByName(java.lang.String name)
          Find country by name.
 Person findMemberByNameInOrg(java.lang.Long orgId, java.lang.String name)
          Find member by name in org.
 Organisation findOrgByName(java.lang.String name)
          Find org by name.
 PoliticalParty findPartyByShortCode(java.lang.String shortCode)
          Find party by short code.
 Region findRegionByName(java.lang.String name)
          Find region by name.
 java.util.List<UserSession> getActiveUserSessions()
          Gets the active user sessions.
 java.util.List<Country> getCountries()
          Gets the countries.
 java.util.List<Resolution> getDecidedResolutions()
          Gets the decided resolutions.
 java.util.List<Election> getElections()
          Gets the elections.
 java.util.List<Event> getEvents()
          Gets the events.
 Portal getGlobalPortal()
          Gets the global portal.
 Government getGovernment(java.lang.Long governmentId)
          Gets the government.
 java.util.List<Government> getGovernments()
          Gets the governments.
 java.util.List<OnlinePoliticalParty> getOnlinePoliticalParties()
          Gets the online political parties.
 GroupAgent getOrganisation(java.lang.Long organisationId)
          Gets the organisation.
 java.util.List<PoliticalParty> getPoliticalParties()
          Gets the political parties.
 PoliticalParty getPoliticalParty(java.lang.Long partyId)
          Gets the political party.
 java.util.List<Portal> getPortals()
          Gets the portals.
 java.util.List<User> getUsers()
          Gets the users.
 OnlinePoliticalParty joinParty(java.lang.Long partyId, java.lang.Long userId)
          Join party.
 void setResolutionDecidedDate(Resolution resolution, java.util.Date parseDate)
          Sets the resolution decided date.
 void updateVoteResult(VoteResult voteResult)
          Update vote result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalServiceImpl

public PortalServiceImpl(UserDAO userDAO,
                         EventDAO eventDAO,
                         PortalDAO portalDAO,
                         CountryDAO countryDAO,
                         UserSessionDAO userSessionDAO,
                         PoliticalPartyDAO politicalPartyDAO,
                         GovernmentDAO governmentDAO,
                         AgentDAO agentDAO,
                         DocumentDAO documentDAO,
                         RoleDAO roleDAO,
                         RegionDAO regionDAO)
Instantiates a new portal service impl.

Parameters:
userDAO - the user dao
eventDAO - the event dao
portalDAO - the portal dao
countryDAO - the country dao
userSessionDAO - the user session dao
politicalPartyDAO - the political party dao
governmentDAO - the government dao
agentDAO - the agent dao
documentDAO - the document dao
roleDAO - the role dao
regionDAO - the region dao
Method Detail

getEvents

public java.util.List<Event> getEvents()
Description copied from interface: PortalService
Gets the events.

Specified by:
getEvents in interface PortalService
Returns:
the events

getElections

public java.util.List<Election> getElections()
Description copied from interface: PortalService
Gets the elections.

Specified by:
getElections in interface PortalService
Returns:
the elections

getGovernments

public java.util.List<Government> getGovernments()
Description copied from interface: PortalService
Gets the governments.

Specified by:
getGovernments in interface PortalService
Returns:
the governments

getPortals

public java.util.List<Portal> getPortals()
Description copied from interface: PortalService
Gets the portals.

Specified by:
getPortals in interface PortalService
Returns:
the portals

getCountries

public java.util.List<Country> getCountries()
Description copied from interface: PortalService
Gets the countries.

Specified by:
getCountries in interface PortalService
Returns:
the countries

createParty

public PoliticalParty createParty(CreatePartyCommand command,
                                  java.lang.Long userId)
                           throws PartyAlreadyExistException
Description copied from interface: PortalService
Creates the party.

Specified by:
createParty in interface PortalService
Parameters:
command - the command
userId - the user id
Returns:
the political party
Throws:
PartyAlreadyExistException - the party already exist exception

getPoliticalParties

public java.util.List<PoliticalParty> getPoliticalParties()
Description copied from interface: PortalService
Gets the political parties.

Specified by:
getPoliticalParties in interface PortalService
Returns:
the political parties

getPoliticalParty

public PoliticalParty getPoliticalParty(java.lang.Long partyId)
Description copied from interface: PortalService
Gets the political party.

Specified by:
getPoliticalParty in interface PortalService
Parameters:
partyId - the party id
Returns:
the political party

joinParty

public OnlinePoliticalParty joinParty(java.lang.Long partyId,
                                      java.lang.Long userId)
Description copied from interface: PortalService
Join party.

Specified by:
joinParty in interface PortalService
Parameters:
partyId - the party id
userId - the user id
Returns:
the online political party

getGovernment

public Government getGovernment(java.lang.Long governmentId)
Description copied from interface: PortalService
Gets the government.

Specified by:
getGovernment in interface PortalService
Parameters:
governmentId - the government id
Returns:
the government

getActiveUserSessions

public java.util.List<UserSession> getActiveUserSessions()
Description copied from interface: PortalService
Gets the active user sessions.

Specified by:
getActiveUserSessions in interface PortalService
Returns:
the active user sessions

getUsers

public java.util.List<User> getUsers()
Description copied from interface: PortalService
Gets the users.

Specified by:
getUsers in interface PortalService
Returns:
the users

getOrganisation

public GroupAgent getOrganisation(java.lang.Long organisationId)
Description copied from interface: PortalService
Gets the organisation.

Specified by:
getOrganisation in interface PortalService
Parameters:
organisationId - the organisation id
Returns:
the organisation

getOnlinePoliticalParties

public java.util.List<OnlinePoliticalParty> getOnlinePoliticalParties()
Description copied from interface: PortalService
Gets the online political parties.

Specified by:
getOnlinePoliticalParties in interface PortalService
Returns:
the online political parties

createPoliticalParty

public PoliticalParty createPoliticalParty(java.lang.String name,
                                           java.lang.String shortCode,
                                           Country country,
                                           Region region)
Description copied from interface: PortalService
Creates the political party.

Specified by:
createPoliticalParty in interface PortalService
Parameters:
name - the name
shortCode - the short code
country - the country
region - the region
Returns:
the political party

addMember

public void addMember(Organisation organisation,
                      Person person)
Description copied from interface: PortalService
Adds the member.

Specified by:
addMember in interface PortalService
Parameters:
organisation - the organisation
person - the person

addRolePlayed

public void addRolePlayed(Role role,
                          Person person)
Description copied from interface: PortalService
Adds the role played.

Specified by:
addRolePlayed in interface PortalService
Parameters:
role - the role
person - the person

createRoleInOrg

public Role createRoleInOrg(java.lang.String roleName,
                            Organisation organisation)
Description copied from interface: PortalService
Creates the role in org.

Specified by:
createRoleInOrg in interface PortalService
Parameters:
roleName - the role name
organisation - the organisation
Returns:
the role

createOrganisation

public Organisation createOrganisation(java.lang.String name,
                                       java.lang.String abbr,
                                       Country country,
                                       Region region,
                                       OrganisationType organisationType,
                                       Organisation parent)
                                throws OrganisationAlreadyExistException
Description copied from interface: PortalService
Creates the organisation.

Specified by:
createOrganisation in interface PortalService
Parameters:
name - the name
abbr - the abbr
country - the country
region - the region
organisationType - the organisation type
parent - the parent
Returns:
the organisation
Throws:
OrganisationAlreadyExistException - the organisation already exist exception

createGovernment

public Government createGovernment(java.lang.String name,
                                   java.lang.Long countryId,
                                   GovernmentType governmentType,
                                   java.lang.String headOfstate)
Description copied from interface: PortalService
Creates the government.

Specified by:
createGovernment in interface PortalService
Parameters:
name - the name
countryId - the country id
governmentType - the government type
headOfstate - the head of state
Returns:
the government

getGlobalPortal

public Portal getGlobalPortal()
Description copied from interface: PortalService
Gets the global portal.

Specified by:
getGlobalPortal in interface PortalService
Returns:
the global portal

createRegionalGovernment

public Government createRegionalGovernment(java.lang.String name,
                                           Country country,
                                           Region region,
                                           OrganisationType organisationType,
                                           Government parentGovernment)
Description copied from interface: PortalService
Creates the regional government.

Specified by:
createRegionalGovernment in interface PortalService
Parameters:
name - the name
country - the country
region - the region
organisationType - the organisation type
parentGovernment - the parent government
Returns:
the government

createResolution

public void createResolution(Resolution resolution)
Description copied from interface: PortalService
Creates the resolution.

Specified by:
createResolution in interface PortalService
Parameters:
resolution - the resolution

setResolutionDecidedDate

public void setResolutionDecidedDate(Resolution resolution,
                                     java.util.Date parseDate)
Description copied from interface: PortalService
Sets the resolution decided date.

Specified by:
setResolutionDecidedDate in interface PortalService
Parameters:
resolution - the resolution
parseDate - the parse date

getDecidedResolutions

public java.util.List<Resolution> getDecidedResolutions()
Description copied from interface: PortalService
Gets the decided resolutions.

Specified by:
getDecidedResolutions in interface PortalService
Returns:
the decided resolutions

addResolutionIssue

public void addResolutionIssue(Resolution resolution,
                               Issue issue,
                               VoteResult voteResult)
Description copied from interface: PortalService
Adds the resolution issue.

Specified by:
addResolutionIssue in interface PortalService
Parameters:
resolution - the resolution
issue - the issue
voteResult - the vote result

updateVoteResult

public void updateVoteResult(VoteResult voteResult)
Description copied from interface: PortalService
Update vote result.

Specified by:
updateVoteResult in interface PortalService
Parameters:
voteResult - the vote result

createOrgUnit

public Organisation createOrgUnit(java.lang.String orgName,
                                  java.lang.String shortName,
                                  OrganisationType organisationType,
                                  java.lang.Long orgId)
                           throws OrganisationAlreadyExistException
Description copied from interface: PortalService
Creates the org unit.

Specified by:
createOrgUnit in interface PortalService
Parameters:
orgName - the org name
shortName - the short name
organisationType - the internal
orgId - the org id
Returns:
the organisation
Throws:
OrganisationAlreadyExistException - the organisation already exist exception

findOrgByName

public Organisation findOrgByName(java.lang.String name)
Description copied from interface: PortalService
Find org by name.

Specified by:
findOrgByName in interface PortalService
Parameters:
name - the sveriges riksdag
Returns:
the organisation

findMemberByNameInOrg

public Person findMemberByNameInOrg(java.lang.Long orgId,
                                    java.lang.String name)
Description copied from interface: PortalService
Find member by name in org.

Specified by:
findMemberByNameInOrg in interface PortalService
Parameters:
orgId - the org id
name - the president name
Returns:
the person

addMemberById

public void addMemberById(java.lang.Long orgId,
                          java.lang.Long personId)
Description copied from interface: PortalService
Adds the member by id.

Specified by:
addMemberById in interface PortalService
Parameters:
orgId - the org id
personId - the person id

addRolePlayedById

public void addRolePlayedById(java.lang.Long roleId,
                              java.lang.Long agentId)
Description copied from interface: PortalService
Adds the role played by id.

Specified by:
addRolePlayedById in interface PortalService
Parameters:
roleId - the role id
agentId - the agent id

createCountry

public Country createCountry(java.lang.String name)
Description copied from interface: PortalService
Creates the country.

Specified by:
createCountry in interface PortalService
Parameters:
name - the sverige
Returns:
the country

findCountryByName

public Country findCountryByName(java.lang.String name)
Description copied from interface: PortalService
Find country by name.

Specified by:
findCountryByName in interface PortalService
Parameters:
name - the country
Returns:
the country

createElection

public void createElection(java.lang.String name,
                           ElectionType electionType,
                           java.lang.Long governmentid)
Description copied from interface: PortalService
Creates the election.

Specified by:
createElection in interface PortalService
Parameters:
name - the name
electionType - the election type
governmentid - the id

createPoliticalPartyById

public PoliticalParty createPoliticalPartyById(java.lang.String name,
                                               java.lang.String shortCode,
                                               java.lang.Long countryId)
Description copied from interface: PortalService
Creates the political party by id.

Specified by:
createPoliticalPartyById in interface PortalService
Parameters:
name - the name
shortCode - the short code
countryId - the country id
Returns:
the political party

createOrganisationById

public void createOrganisationById(java.lang.String name,
                                   java.lang.String abbr,
                                   java.lang.Long countryId,
                                   java.lang.Long regionId,
                                   OrganisationType organisationType,
                                   java.lang.Long orgId)
                            throws org.springframework.dao.DataAccessException,
                                   OrganisationAlreadyExistException
Description copied from interface: PortalService
Creates the organisation by id.

Specified by:
createOrganisationById in interface PortalService
Parameters:
name - the name
abbr - the abbr
countryId - the country id
regionId - the region id
organisationType - the type
orgId - the org id
Throws:
org.springframework.dao.DataAccessException - the data access exception
OrganisationAlreadyExistException - the organisation already exist exception

findPartyByShortCode

public PoliticalParty findPartyByShortCode(java.lang.String shortCode)
Description copied from interface: PortalService
Find party by short code.

Specified by:
findPartyByShortCode in interface PortalService
Parameters:
shortCode - the trim
Returns:
the political party

createPerson

public Person createPerson(java.lang.String name)
Description copied from interface: PortalService
Creates the person.

Specified by:
createPerson in interface PortalService
Parameters:
name - the name
Returns:
the person

findRegionByName

public Region findRegionByName(java.lang.String name)
Description copied from interface: PortalService
Find region by name.

Specified by:
findRegionByName in interface PortalService
Parameters:
name - the name
Returns:
the region


Copyright © 2004-2010 www.DirectDemocracyPortal.org. All Rights Reserved.