|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.directdemocracyportal.democracy.service.PortalServiceImpl
@Transactional(propagation=REQUIRED) public class PortalServiceImpl extends java.lang.Object implements PortalService
The Class PortalServiceImpl.
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. |
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 |
---|
public PortalServiceImpl(UserDAO userDAO, EventDAO eventDAO, PortalDAO portalDAO, CountryDAO countryDAO, UserSessionDAO userSessionDAO, PoliticalPartyDAO politicalPartyDAO, GovernmentDAO governmentDAO, AgentDAO agentDAO, DocumentDAO documentDAO, RoleDAO roleDAO, RegionDAO regionDAO)
userDAO
- the user daoeventDAO
- the event daoportalDAO
- the portal daocountryDAO
- the country daouserSessionDAO
- the user session daopoliticalPartyDAO
- the political party daogovernmentDAO
- the government daoagentDAO
- the agent daodocumentDAO
- the document daoroleDAO
- the role daoregionDAO
- the region daoMethod Detail |
---|
public java.util.List<Event> getEvents()
PortalService
getEvents
in interface PortalService
public java.util.List<Election> getElections()
PortalService
getElections
in interface PortalService
public java.util.List<Government> getGovernments()
PortalService
getGovernments
in interface PortalService
public java.util.List<Portal> getPortals()
PortalService
getPortals
in interface PortalService
public java.util.List<Country> getCountries()
PortalService
getCountries
in interface PortalService
public PoliticalParty createParty(CreatePartyCommand command, java.lang.Long userId) throws PartyAlreadyExistException
PortalService
createParty
in interface PortalService
command
- the commanduserId
- the user idPartyAlreadyExistException
- the party already exist exceptionpublic java.util.List<PoliticalParty> getPoliticalParties()
PortalService
getPoliticalParties
in interface PortalService
public PoliticalParty getPoliticalParty(java.lang.Long partyId)
PortalService
getPoliticalParty
in interface PortalService
partyId
- the party idpublic OnlinePoliticalParty joinParty(java.lang.Long partyId, java.lang.Long userId)
PortalService
joinParty
in interface PortalService
partyId
- the party iduserId
- the user idpublic Government getGovernment(java.lang.Long governmentId)
PortalService
getGovernment
in interface PortalService
governmentId
- the government idpublic java.util.List<UserSession> getActiveUserSessions()
PortalService
getActiveUserSessions
in interface PortalService
public java.util.List<User> getUsers()
PortalService
getUsers
in interface PortalService
public GroupAgent getOrganisation(java.lang.Long organisationId)
PortalService
getOrganisation
in interface PortalService
organisationId
- the organisation idpublic java.util.List<OnlinePoliticalParty> getOnlinePoliticalParties()
PortalService
getOnlinePoliticalParties
in interface PortalService
public PoliticalParty createPoliticalParty(java.lang.String name, java.lang.String shortCode, Country country, Region region)
PortalService
createPoliticalParty
in interface PortalService
name
- the nameshortCode
- the short codecountry
- the countryregion
- the regionpublic void addMember(Organisation organisation, Person person)
PortalService
addMember
in interface PortalService
organisation
- the organisationperson
- the personpublic void addRolePlayed(Role role, Person person)
PortalService
addRolePlayed
in interface PortalService
role
- the roleperson
- the personpublic Role createRoleInOrg(java.lang.String roleName, Organisation organisation)
PortalService
createRoleInOrg
in interface PortalService
roleName
- the role nameorganisation
- the organisationpublic Organisation createOrganisation(java.lang.String name, java.lang.String abbr, Country country, Region region, OrganisationType organisationType, Organisation parent) throws OrganisationAlreadyExistException
PortalService
createOrganisation
in interface PortalService
name
- the nameabbr
- the abbrcountry
- the countryregion
- the regionorganisationType
- the organisation typeparent
- the parentOrganisationAlreadyExistException
- the organisation already exist exceptionpublic Government createGovernment(java.lang.String name, java.lang.Long countryId, GovernmentType governmentType, java.lang.String headOfstate)
PortalService
createGovernment
in interface PortalService
name
- the namecountryId
- the country idgovernmentType
- the government typeheadOfstate
- the head of statepublic Portal getGlobalPortal()
PortalService
getGlobalPortal
in interface PortalService
public Government createRegionalGovernment(java.lang.String name, Country country, Region region, OrganisationType organisationType, Government parentGovernment)
PortalService
createRegionalGovernment
in interface PortalService
name
- the namecountry
- the countryregion
- the regionorganisationType
- the organisation typeparentGovernment
- the parent governmentpublic void createResolution(Resolution resolution)
PortalService
createResolution
in interface PortalService
resolution
- the resolutionpublic void setResolutionDecidedDate(Resolution resolution, java.util.Date parseDate)
PortalService
setResolutionDecidedDate
in interface PortalService
resolution
- the resolutionparseDate
- the parse datepublic java.util.List<Resolution> getDecidedResolutions()
PortalService
getDecidedResolutions
in interface PortalService
public void addResolutionIssue(Resolution resolution, Issue issue, VoteResult voteResult)
PortalService
addResolutionIssue
in interface PortalService
resolution
- the resolutionissue
- the issuevoteResult
- the vote resultpublic void updateVoteResult(VoteResult voteResult)
PortalService
updateVoteResult
in interface PortalService
voteResult
- the vote resultpublic Organisation createOrgUnit(java.lang.String orgName, java.lang.String shortName, OrganisationType organisationType, java.lang.Long orgId) throws OrganisationAlreadyExistException
PortalService
createOrgUnit
in interface PortalService
orgName
- the org nameshortName
- the short nameorganisationType
- the internalorgId
- the org idOrganisationAlreadyExistException
- the organisation already exist exceptionpublic Organisation findOrgByName(java.lang.String name)
PortalService
findOrgByName
in interface PortalService
name
- the sveriges riksdagpublic Person findMemberByNameInOrg(java.lang.Long orgId, java.lang.String name)
PortalService
findMemberByNameInOrg
in interface PortalService
orgId
- the org idname
- the president namepublic void addMemberById(java.lang.Long orgId, java.lang.Long personId)
PortalService
addMemberById
in interface PortalService
orgId
- the org idpersonId
- the person idpublic void addRolePlayedById(java.lang.Long roleId, java.lang.Long agentId)
PortalService
addRolePlayedById
in interface PortalService
roleId
- the role idagentId
- the agent idpublic Country createCountry(java.lang.String name)
PortalService
createCountry
in interface PortalService
name
- the sverigepublic Country findCountryByName(java.lang.String name)
PortalService
findCountryByName
in interface PortalService
name
- the countrypublic void createElection(java.lang.String name, ElectionType electionType, java.lang.Long governmentid)
PortalService
createElection
in interface PortalService
name
- the nameelectionType
- the election typegovernmentid
- the idpublic PoliticalParty createPoliticalPartyById(java.lang.String name, java.lang.String shortCode, java.lang.Long countryId)
PortalService
createPoliticalPartyById
in interface PortalService
name
- the nameshortCode
- the short codecountryId
- the country idpublic 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
PortalService
createOrganisationById
in interface PortalService
name
- the nameabbr
- the abbrcountryId
- the country idregionId
- the region idorganisationType
- the typeorgId
- the org idorg.springframework.dao.DataAccessException
- the data access exceptionOrganisationAlreadyExistException
- the organisation already exist exceptionpublic PoliticalParty findPartyByShortCode(java.lang.String shortCode)
PortalService
findPartyByShortCode
in interface PortalService
shortCode
- the trimpublic Person createPerson(java.lang.String name)
PortalService
createPerson
in interface PortalService
name
- the namepublic Region findRegionByName(java.lang.String name)
PortalService
findRegionByName
in interface PortalService
name
- the name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |