com.stratelia.webactiv.yellowpages.control.ejb
Class YellowpagesBmEJB

java.lang.Object
  extended by com.stratelia.webactiv.yellowpages.control.ejb.YellowpagesBmEJB
All Implemented Interfaces:
YellowpagesBm

public class YellowpagesBmEJB
extends Object
implements YellowpagesBm

This is the Yellowpages EJB-tier controller of the MVC. It is implemented as a session EJB. It controls all the activities that happen in a client session. It also provides mechanisms to access other session EJBs.

Author:
Nicolas Eysseric

Constructor Summary
YellowpagesBmEJB()
           
 
Method Summary
 void addContactToTopic(com.stratelia.webactiv.util.contact.model.ContactPK contactPK, String fatherId)
          Add a contact to a topic and send email alerts to topic subscribers
 List<com.stratelia.webactiv.util.node.model.NodeDetail> addGroup(List<com.stratelia.webactiv.util.node.model.NodeDetail> tree, com.stratelia.webactiv.beans.admin.Group group, int level)
           
 void addGroup(String groupId, com.stratelia.webactiv.util.node.model.NodePK nodePK)
           
 com.stratelia.webactiv.util.node.model.NodePK addToTopic(com.stratelia.webactiv.util.node.model.NodeDetail father, com.stratelia.webactiv.util.node.model.NodeDetail subTopic)
          Add a subtopic to a topic - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
 String createContact(com.stratelia.webactiv.util.contact.model.Contact contact, com.stratelia.webactiv.util.node.model.NodePK nodePK)
          Create a new Contact (only the header - parameters) to the current Topic
 void createInfoModel(com.stratelia.webactiv.util.contact.model.ContactPK contactPK, String modelId)
          Create model info attached to a contact
 void deleteContact(com.stratelia.webactiv.util.contact.model.ContactPK contactPK, com.stratelia.webactiv.util.node.model.NodePK nodePK)
          Delete a contact If this contact is in the basket or in the DZ, it's deleted from the database Else it only send to the basket
 void deleteContactFromTopic(com.stratelia.webactiv.util.contact.model.ContactPK contactPK, String fatherId)
          Delete a path between contact and topic
 void deleteTopic(com.stratelia.webactiv.util.node.model.NodePK pkToDelete)
          Delete a topic and all descendants.
 void emptyDZByUserId(String instanceId, String userId)
           
 Collection<com.stratelia.webactiv.util.contact.model.ContactFatherDetail> getAllContactDetails(com.stratelia.webactiv.util.node.model.NodePK nodePK)
           
 com.stratelia.webactiv.util.contact.model.CompleteContact getCompleteContact(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
           
 com.stratelia.webactiv.util.contact.model.CompleteContact getCompleteContactInNode(com.stratelia.webactiv.util.contact.model.ContactPK contactPK, String nodeId)
          Return all info of a contact
 com.stratelia.webactiv.util.contact.model.ContactDetail getContactDetail(com.stratelia.webactiv.util.contact.model.ContactPK pk)
          Return the detail of a contact (only the Header)
 Collection<com.stratelia.webactiv.util.contact.model.ContactDetail> getContactDetailsByLastName(com.stratelia.webactiv.util.contact.model.ContactPK pk, String query)
           
 Collection<com.stratelia.webactiv.util.contact.model.ContactDetail> getContactDetailsByLastNameAndFirstName(com.stratelia.webactiv.util.contact.model.ContactPK pk, String lastName, String firstName)
           
 Collection<com.stratelia.webactiv.util.contact.model.ContactDetail> getContactDetailsByLastNameOrFirstName(com.stratelia.webactiv.util.contact.model.ContactPK pk, String query)
           
 Collection<com.stratelia.webactiv.util.node.model.NodePK> getContactFathers(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
           
 Collection<UserContact> getContacts(Collection<String> contactIds, String instanceId)
          Return a collection of ContactDetail throught a collection of contact ids
 List<String> getGroupIds(com.stratelia.webactiv.util.node.model.NodePK pk)
           
 Collection<String> getModelUsed(String instanceId)
           
 List<Collection<com.stratelia.webactiv.util.node.model.NodeDetail>> getPathList(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
          Return list of all path to this contact - it's a Collection of NodeDetail collection
 com.stratelia.webactiv.util.node.model.NodeDetail getSubTopicDetail(com.stratelia.webactiv.util.node.model.NodePK pk)
          Return a subtopic to currentTopic
 List<com.stratelia.webactiv.util.node.model.NodeDetail> getTree(String instanceId)
           
 TopicDetail goTo(com.stratelia.webactiv.util.node.model.NodePK pk, String userId)
          Return a the detail of a topic
 void index(String instanceId)
           
 void removeGroup(String groupId)
           
 void removeGroup(String groupId, com.stratelia.webactiv.util.node.model.NodePK nodePK)
           
 void setModelUsed(String[] models, String instanceId)
           
 void unreferenceOrphanContacts(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
           
 void updateContact(com.stratelia.webactiv.util.contact.model.Contact contactDetail)
          Update a contact (only the header - parameters)
 com.stratelia.webactiv.util.node.model.NodePK updateTopic(com.stratelia.webactiv.util.node.model.NodeDetail topic)
          Update a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YellowpagesBmEJB

public YellowpagesBmEJB()
Method Detail

goTo

public TopicDetail goTo(com.stratelia.webactiv.util.node.model.NodePK pk,
                        String userId)
Return a the detail of a topic

Specified by:
goTo in interface YellowpagesBm
Parameters:
id - the id of the topic
Returns:
a TopicDetail
Since:
1.0
See Also:
TopicDetail

getTree

public List<com.stratelia.webactiv.util.node.model.NodeDetail> getTree(String instanceId)
Specified by:
getTree in interface YellowpagesBm

addGroup

public List<com.stratelia.webactiv.util.node.model.NodeDetail> addGroup(List<com.stratelia.webactiv.util.node.model.NodeDetail> tree,
                                                                        com.stratelia.webactiv.beans.admin.Group group,
                                                                        int level)

addToTopic

public com.stratelia.webactiv.util.node.model.NodePK addToTopic(com.stratelia.webactiv.util.node.model.NodeDetail father,
                                                                com.stratelia.webactiv.util.node.model.NodeDetail subTopic)
Add a subtopic to a topic - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK

Specified by:
addToTopic in interface YellowpagesBm
Parameters:
fatherId - the topic Id of the future father
subTopic - the NodeDetail of the new sub topic
Returns:
If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
Since:
1.0
See Also:
NodeDetail, NodePK

updateTopic

public com.stratelia.webactiv.util.node.model.NodePK updateTopic(com.stratelia.webactiv.util.node.model.NodeDetail topic)
Update a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK

Specified by:
updateTopic in interface YellowpagesBm
Parameters:
topic - the NodeDetail of the updated sub topic
alertType - Alert all users, only publishers or nobody of the topic creation alertType = "All"|"Publisher"|"None"
Returns:
If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
Since:
1.0
See Also:
NodeDetail, NodePK

getSubTopicDetail

public com.stratelia.webactiv.util.node.model.NodeDetail getSubTopicDetail(com.stratelia.webactiv.util.node.model.NodePK pk)
Description copied from interface: YellowpagesBm
Return a subtopic to currentTopic

Specified by:
getSubTopicDetail in interface YellowpagesBm
Returns:
the detail of the specified topic
See Also:
NodeDetail

deleteTopic

public void deleteTopic(com.stratelia.webactiv.util.node.model.NodePK pkToDelete)
Delete a topic and all descendants. Delete all links between descendants and contacts. This contacts will be visible in the Declassified zone. Delete All subscriptions and favorites on this topics and all descendants

Specified by:
deleteTopic in interface YellowpagesBm
Parameters:
topicId - the id of the topic to delete
Since:
1.0

getContactDetail

public com.stratelia.webactiv.util.contact.model.ContactDetail getContactDetail(com.stratelia.webactiv.util.contact.model.ContactPK pk)
Return the detail of a contact (only the Header)

Specified by:
getContactDetail in interface YellowpagesBm
Parameters:
contactId - the id of the contact
Returns:
a ContactDetail
Since:
1.0
See Also:
ContactDetail

getContactDetailsByLastName

public Collection<com.stratelia.webactiv.util.contact.model.ContactDetail> getContactDetailsByLastName(com.stratelia.webactiv.util.contact.model.ContactPK pk,
                                                                                                       String query)
Specified by:
getContactDetailsByLastName in interface YellowpagesBm

getContactDetailsByLastNameOrFirstName

public Collection<com.stratelia.webactiv.util.contact.model.ContactDetail> getContactDetailsByLastNameOrFirstName(com.stratelia.webactiv.util.contact.model.ContactPK pk,
                                                                                                                  String query)
Specified by:
getContactDetailsByLastNameOrFirstName in interface YellowpagesBm

getContactDetailsByLastNameAndFirstName

public Collection<com.stratelia.webactiv.util.contact.model.ContactDetail> getContactDetailsByLastNameAndFirstName(com.stratelia.webactiv.util.contact.model.ContactPK pk,
                                                                                                                   String lastName,
                                                                                                                   String firstName)
Specified by:
getContactDetailsByLastNameAndFirstName in interface YellowpagesBm

getAllContactDetails

public Collection<com.stratelia.webactiv.util.contact.model.ContactFatherDetail> getAllContactDetails(com.stratelia.webactiv.util.node.model.NodePK nodePK)
Specified by:
getAllContactDetails in interface YellowpagesBm

getPathList

public List<Collection<com.stratelia.webactiv.util.node.model.NodeDetail>> getPathList(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
Return list of all path to this contact - it's a Collection of NodeDetail collection

Specified by:
getPathList in interface YellowpagesBm
Parameters:
ContactId - the id of the contact
Returns:
a Collection of NodeDetail collection
Since:
1.0
See Also:
NodeDetail

createContact

public String createContact(com.stratelia.webactiv.util.contact.model.Contact contact,
                            com.stratelia.webactiv.util.node.model.NodePK nodePK)
Create a new Contact (only the header - parameters) to the current Topic

Specified by:
createContact in interface YellowpagesBm
Parameters:
contactDetail - a ContactDetail
Returns:
the id of the new contact
Since:
1.0
See Also:
Contact

updateContact

public void updateContact(com.stratelia.webactiv.util.contact.model.Contact contactDetail)
Update a contact (only the header - parameters)

Specified by:
updateContact in interface YellowpagesBm
Parameters:
contactDetail - a ContactDetail
Since:
1.0
See Also:
Contact

deleteContact

public void deleteContact(com.stratelia.webactiv.util.contact.model.ContactPK contactPK,
                          com.stratelia.webactiv.util.node.model.NodePK nodePK)
Delete a contact If this contact is in the basket or in the DZ, it's deleted from the database Else it only send to the basket

Specified by:
deleteContact in interface YellowpagesBm
Parameters:
ContactId - the id of the contact to delete
Since:
1.0
See Also:
TopicDetail

emptyDZByUserId

public void emptyDZByUserId(String instanceId,
                            String userId)
Specified by:
emptyDZByUserId in interface YellowpagesBm

addContactToTopic

public void addContactToTopic(com.stratelia.webactiv.util.contact.model.ContactPK contactPK,
                              String fatherId)
Add a contact to a topic and send email alerts to topic subscribers

Specified by:
addContactToTopic in interface YellowpagesBm
Parameters:
ContactId - the id of the contact
fatherId - the id of the topic
Since:
1.0

deleteContactFromTopic

public void deleteContactFromTopic(com.stratelia.webactiv.util.contact.model.ContactPK contactPK,
                                   String fatherId)
Delete a path between contact and topic

Specified by:
deleteContactFromTopic in interface YellowpagesBm
Parameters:
ContactId - the id of the contact
fatherId - the id of the topic
Since:
1.0

createInfoModel

public void createInfoModel(com.stratelia.webactiv.util.contact.model.ContactPK contactPK,
                            String modelId)
Create model info attached to a contact

Specified by:
createInfoModel in interface YellowpagesBm
Parameters:
ContactId - the id of the contact
modelId - the id of the selected model
Since:
1.0

getCompleteContactInNode

public com.stratelia.webactiv.util.contact.model.CompleteContact getCompleteContactInNode(com.stratelia.webactiv.util.contact.model.ContactPK contactPK,
                                                                                          String nodeId)
Return all info of a contact

Specified by:
getCompleteContactInNode in interface YellowpagesBm
Parameters:
ContactId - the id of a contact
nodeId - the id of the node
Returns:
a CompleteContact
See Also:
CompleteContact

getCompleteContact

public com.stratelia.webactiv.util.contact.model.CompleteContact getCompleteContact(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
Specified by:
getCompleteContact in interface YellowpagesBm

getContacts

public Collection<UserContact> getContacts(Collection<String> contactIds,
                                           String instanceId)
Return a collection of ContactDetail throught a collection of contact ids

Specified by:
getContacts in interface YellowpagesBm
Parameters:
contactIds - a collection of contact ids
Returns:
a collection of ContactDetail
Since:
1.0
See Also:
ContactDetail

getContactFathers

public Collection<com.stratelia.webactiv.util.node.model.NodePK> getContactFathers(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)
Specified by:
getContactFathers in interface YellowpagesBm

unreferenceOrphanContacts

public void unreferenceOrphanContacts(com.stratelia.webactiv.util.contact.model.ContactPK contactPK)

getGroupIds

public List<String> getGroupIds(com.stratelia.webactiv.util.node.model.NodePK pk)
Specified by:
getGroupIds in interface YellowpagesBm

addGroup

public void addGroup(String groupId,
                     com.stratelia.webactiv.util.node.model.NodePK nodePK)
Specified by:
addGroup in interface YellowpagesBm

removeGroup

public void removeGroup(String groupId)
Specified by:
removeGroup in interface YellowpagesBm

removeGroup

public void removeGroup(String groupId,
                        com.stratelia.webactiv.util.node.model.NodePK nodePK)
Specified by:
removeGroup in interface YellowpagesBm

setModelUsed

public void setModelUsed(String[] models,
                         String instanceId)
Specified by:
setModelUsed in interface YellowpagesBm

getModelUsed

public Collection<String> getModelUsed(String instanceId)
Specified by:
getModelUsed in interface YellowpagesBm

index

public void index(String instanceId)
Specified by:
index in interface YellowpagesBm


Copyright © 2016 Silverpeas. All Rights Reserved.