|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.telscenter.sail.webapp.service.project.impl.ExternalProjectServiceImpl
public class ExternalProjectServiceImpl
DIY Project Service implementation. Speaks to the DIY portal remotely.
| Field Summary | |
|---|---|
protected ProjectDao<Project> |
projectDao
|
protected WorkgroupDao<Workgroup> |
workgroupDao
|
| Constructor Summary | |
|---|---|
ExternalProjectServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
addBookmarkerToProject(Project project,
User bookmarker)
Adds the given User bookmarker to the Project project |
void |
addSharedTeacherToProject(AddSharedTeacherParameters addSharedTeacherParameters)
|
Long |
addTagToProject(String tag,
Long projectId)
Given a String and a Project adds the
tag to the project. |
Long |
addTagToProject(Tag tag,
Long projectId)
Given a Tag tag and a Long project id
adds the given tag to the project. |
Object |
authorProject(AuthorProjectParameters authorProjectParameters)
Allows users to author a project |
boolean |
canAuthorProject(Project project,
User user)
Given a Project project and User user, returns
boolean true if the user is allowed to author that particular
project, returns false otherwise. |
boolean |
canCreateRun(Project project,
User user)
Given a Project project and User user, returns
boolean true if the user is allowed to create a run from that
project (ie, project is TELS, owner, sharedOwner), returns false otherwise. |
boolean |
canReadProject(Project project,
User user)
Given a Project project and a User user, returns
boolean true if the user has read access to that particular
project, returns false otherwise. |
Project |
createProject(ProjectParameters projectParameters)
Creates a new Project
Also, this creates a "Preview run"- that is, a run that is used
just for the purpose of previewing this project. |
String |
getActiveVersion(Project project)
|
List<Project> |
getAdminProjectList()
Returns a List list of all projects in the data store. |
List<Project> |
getAllProjectsList()
Get a List of Project |
List<Project> |
getBookmarkerProjectList(User user)
Retrieves a List of Project that
has been bookmarked by the given User |
Project |
getById(Serializable projectId)
Gets a project with the given projectid |
List<ExternalProject> |
getExternalProjectList()
|
ProjectMetadata |
getMetadata(Long projectId)
Given a Long projectId returns the
ProjectMetadata that is associated with that projectId and versionId, if
one exists, returns null otherwise. |
ProjectCommunicator |
getProjectCommunicator()
|
ProjectCommunicatorDao<ProjectCommunicator> |
getProjectCommunicatorDao()
|
List<Project> |
getProjectCopies(Long projectId)
Given a project id, returns projects that are copies of the project |
ProjectDao<Project> |
getProjectDao()
|
Project |
getProjectFull(Long projectId)
|
List<Project> |
getProjectList()
Get a List of Project |
List<Project> |
getProjectList(String query)
Given a String query, returns a List of
Project that satisfies the query. |
List<Project> |
getProjectList(User user)
Get a List of Project that the specified
user owns |
List<Project> |
getProjectListByInfo(ProjectInfo info)
Get a List of Project with
matching ProjectInfo |
List<Project> |
getProjectListByTag(FamilyTag tag)
Get a List of Project with
matching FamilyTag |
List<Project> |
getProjectListByTag(String tag)
Get a List of Project with
matching ProjectInfoTag |
List<Project> |
getProjectListByTagName(String tagName)
Given a String tag name, returns a List
list of projects with that tag. |
List<Project> |
getProjectListByTagNames(Set<String> tagNames)
Given a Set set of tag names, returns a
List list of projects with all of the tag names. |
JSONObject |
getProjectMetadataFile(Project project)
|
List<Project> |
getSharedProjectList(User user)
Get a List of Project that have
been shared with the specified user. |
String |
getSharedTeacherRole(Project project,
User user)
Returns the permission that the specified user has on the specified project |
WorkgroupDao<Workgroup> |
getWorkgroupDao()
|
Long |
identifyRootProjectId(Project projectId)
Given a project, gets the project id for the project's root level project |
void |
importProject(Long externalId,
Serializable projectCommunicatorId)
|
boolean |
isAuthorizedToCreateTag(User user,
String name)
Given a User user and a String tag name,
returns true if that user is authorized to create a tag with that
name, returns false otherwise. |
Object |
launchProject(LaunchProjectParameters launchProjectParameters)
Launches the project given the launchProjectParameters |
Object |
launchReport(LaunchReportParameters launchReportParameters)
Launches the report given the launchReportParameters |
String |
minifyProject(Project project)
Given a Project project, attempts to minify a file and returns
a String of the final status of the operation. |
Object |
previewProject(PreviewProjectParameters previewProjectParameters)
Launches a Preview of the Project |
boolean |
projectContainsTag(Long projectId,
String name)
Given a Long project id and a String tag
name, returns boolean true if the project contains a
tag with that name, false otherwise. |
void |
removeBookmarkerFromProject(Project project,
User bookmarker)
Removes the given User bookmarker from the Project project |
void |
removeSharedTeacherFromProject(String username,
Project project)
Removes shared user from project. |
void |
removeTagFromProject(Long tagId,
Long projectId)
Given a Tag and a Project, removes the
tag from the project. |
void |
setProjectCommunicator(ProjectCommunicator projectCommunicator)
|
void |
setProjectCommunicatorDao(ProjectCommunicatorDao<ProjectCommunicator> projectCommunicatorDao)
|
void |
setProjectDao(ProjectDao<Project> projectDao)
|
void |
setRunService(RunService runService)
|
void |
setWorkgroupDao(WorkgroupDao<Workgroup> workgroupDao)
|
void |
sortProjectsByDateCreated(List<Project> projectList)
Sorts the given List list of projects by the date they were created. |
String |
takeSnapshot(Project project,
String username,
String snapshotName)
|
void |
updateProject(Project project,
User user)
Saves the project |
Long |
updateTag(Long tagId,
Long projectId,
String name)
Given a Long tag id, a Long project id and
a String name, updates that project tag to that name, returning
the resulting Long tag Id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ProjectDao<Project> projectDao
protected WorkgroupDao<Workgroup> workgroupDao
| Constructor Detail |
|---|
public ExternalProjectServiceImpl()
| Method Detail |
|---|
public void setRunService(RunService runService)
runService - the runService to set
public Object authorProject(AuthorProjectParameters authorProjectParameters)
throws Exception
ProjectService
authorProject in interface ProjectServiceExceptionProjectService.authorProject(org.telscenter.sail.webapp.domain.project.impl.AuthorProjectParameters)
public Project createProject(ProjectParameters projectParameters)
throws ObjectNotFoundException
ProjectServiceProject
Also, this creates a "Preview run"- that is, a run that is used
just for the purpose of previewing this project. This is not the ideal
solution to Previewing a Project, but the other solution is too much work
(making a new JNLP project that takes in curniturl and jnlpurl). The author
can also always use the authoring tool to preview the project
createProject in interface ProjectServiceProject that was created
ObjectNotFoundException - when projectparameters references
curnitId and jnlpId that do not existProjectService.createProject(org.telscenter.sail.webapp.domain.impl.ProjectParameters)
public Project getById(Serializable projectId)
throws ObjectNotFoundException
ProjectService
getById in interface ProjectServiceprojectId - the id of the project
Project with the specified projectId
ObjectNotFoundException - when the specified projectId
does not existProjectService.getById(java.io.Serializable)public List<ExternalProject> getExternalProjectList()
getExternalProjectList in interface ExternalProjectServiceExternalProjectService.getExternalProjectList()
@Transactional
public void importProject(Long externalId,
Serializable projectCommunicatorId)
throws ObjectNotFoundException
importProject in interface ExternalProjectServiceObjectNotFoundExceptionorg.telscenter.sail.webapp.service.project.ExternalProjectService#importProject(org.telscenter.sail.webapp.domain.project.ExternalProject)public List<Project> getProjectList()
ProjectServiceList of Project
getProjectList in interface ProjectServiceList of ProjectProjectService.getProjectList()
public List<Project> getProjectListByInfo(ProjectInfo info)
throws ObjectNotFoundException
ProjectServiceList of Project with
matching ProjectInfo
getProjectListByInfo in interface ProjectServiceList of Project
ObjectNotFoundExceptionProjectService.getProjectListByInfo(org.telscenter.sail.webapp.domain.project.ProjectInfo)
public List<Project> getProjectListByTag(FamilyTag tag)
throws ObjectNotFoundException
ProjectServiceList of Project with
matching FamilyTag
getProjectListByTag in interface ProjectServiceList of Project
ObjectNotFoundExceptionProjectService.getProjectListByTag(org.telscenter.sail.webapp.domain.project.FamilyTag)
public List<Project> getProjectListByTag(String tag)
throws ObjectNotFoundException
ProjectServiceList of Project with
matching ProjectInfoTag
getProjectListByTag in interface ProjectServiceList of Project
ObjectNotFoundExceptionProjectService.getProjectListByTag(java.lang.String)
@Transactional(readOnly=false)
public Object launchProject(LaunchProjectParameters launchProjectParameters)
throws Exception
ProjectService
launchProject in interface ProjectServicelaunchProjectParameters - parameters needed to launch the project
ExceptionProjectService.launchProject(org.telscenter.sail.webapp.domain.project.impl.LaunchProjectParameters)public Object launchReport(LaunchReportParameters launchReportParameters)
ProjectService
launchReport in interface ProjectServiceProjectService.launchReport(org.telscenter.sail.webapp.domain.project.impl.LaunchReportParameters)
public Object previewProject(PreviewProjectParameters previewProjectParameters)
throws Exception
ProjectService
previewProject in interface ProjectServiceObjectNotFoundException - when the specified projectId
does not exist
IOException - when the url cannot be loaded
ExceptionProjectService.previewProject(org.telscenter.sail.webapp.domain.project.impl.PreviewProjectParameters)
@Transactional
public void updateProject(Project project,
User user)
ProjectService
updateProject in interface ProjectServiceproject - Project contains updated Project.org.telscenter.sail.webapp.service.project.ProjectService#updateProject(org.telscenter.sail.webapp.domain.project.Project)public ProjectDao<Project> getProjectDao()
public void setProjectDao(ProjectDao<Project> projectDao)
projectDao - the projectDao to setpublic ProjectCommunicatorDao<ProjectCommunicator> getProjectCommunicatorDao()
public void setProjectCommunicatorDao(ProjectCommunicatorDao<ProjectCommunicator> projectCommunicatorDao)
projectCommunicatorDao - the projectCommunicatorDao to setpublic ProjectCommunicator getProjectCommunicator()
getProjectCommunicator in interface ExternalProjectServicepublic void setProjectCommunicator(ProjectCommunicator projectCommunicator)
setProjectCommunicator in interface ExternalProjectService
public void addSharedTeacherToProject(AddSharedTeacherParameters addSharedTeacherParameters)
throws ObjectNotFoundException
addSharedTeacherToProject in interface ProjectServiceObjectNotFoundExceptionpublic List<Project> getProjectList(User user)
ProjectServiceList of Project that the specified
user owns
getProjectList in interface ProjectServiceList of Project
public String getSharedTeacherRole(Project project,
User user)
ProjectService
getSharedTeacherRole in interface ProjectServiceproject - The Project that is shared.user - The User that shares the Project
String containing the permission that
the user has on the project. If the user does not have permission on the project,
null is returned.public List<Project> getSharedProjectList(User user)
ProjectServiceList of Project that have
been shared with the specified user.
getSharedProjectList in interface ProjectServiceList of Projectpublic WorkgroupDao<Workgroup> getWorkgroupDao()
public void setWorkgroupDao(WorkgroupDao<Workgroup> workgroupDao)
workgroupDao - the workgroupDao to setpublic List<Project> getBookmarkerProjectList(User user)
ProjectServiceList of Project that
has been bookmarked by the given User
getBookmarkerProjectList in interface ProjectServiceListProjectService.getBookmarkerProjectList(net.sf.sail.webapp.domain.User)
public void addBookmarkerToProject(Project project,
User bookmarker)
throws ObjectNotFoundException
ProjectServiceUser bookmarker to the Project project
addBookmarkerToProject in interface ProjectServiceObjectNotFoundExceptionProjectService.addBookmarkerToProject(org.telscenter.sail.webapp.domain.project.Project, net.sf.sail.webapp.domain.User)
public void removeBookmarkerFromProject(Project project,
User bookmarker)
throws ObjectNotFoundException
ProjectServiceUser bookmarker from the Project project
removeBookmarkerFromProject in interface ProjectServiceObjectNotFoundExceptionProjectService.removeBookmarkerFromProject(org.telscenter.sail.webapp.domain.project.Project, net.sf.sail.webapp.domain.User)public List<Project> getAllProjectsList()
ProjectServiceList of Project
getAllProjectsList in interface ProjectServiceList of Projectpublic List<Project> getProjectList(String query)
ProjectServiceString query, returns a List of
Project that satisfies the query.
getProjectList in interface ProjectServiceListpublic String minifyProject(Project project)
ProjectServiceProject project, attempts to minify a file and returns
a String of the final status of the operation.
minifyProject in interface ProjectServicepublic JSONObject getProjectMetadataFile(Project project)
public boolean canCreateRun(Project project,
User user)
ProjectServiceProject project and User user, returns
boolean true if the user is allowed to create a run from that
project (ie, project is TELS, owner, sharedOwner), returns false otherwise.
canCreateRun in interface ProjectService
public boolean canAuthorProject(Project project,
User user)
ProjectServiceProject project and User user, returns
boolean true if the user is allowed to author that particular
project, returns false otherwise.
canAuthorProject in interface ProjectService
public boolean canReadProject(Project project,
User user)
ProjectServiceProject project and a User user, returns
boolean true if the user has read access to that particular
project, returns false otherwise.
canReadProject in interface ProjectServicepublic List<Project> getAdminProjectList()
ProjectServiceList list of all projects in the data store.
getAdminProjectList in interface ProjectServicepublic String getActiveVersion(Project project)
public String takeSnapshot(Project project,
String username,
String snapshotName)
public ProjectMetadata getMetadata(Long projectId)
ProjectServiceLong projectId returns the
ProjectMetadata that is associated with that projectId and versionId, if
one exists, returns null otherwise.
getMetadata in interface ProjectServicepublic void sortProjectsByDateCreated(List<Project> projectList)
ProjectServiceList list of projects by the date they were created.
sortProjectsByDateCreated in interface ProjectService
public Long addTagToProject(Tag tag,
Long projectId)
ProjectServiceTag tag and a Long project id
adds the given tag to the project.
addTagToProject in interface ProjectService
public Long addTagToProject(String tag,
Long projectId)
ProjectServiceString and a Project adds the
tag to the project.
addTagToProject in interface ProjectServicepublic List<Project> getProjectListByTagName(String tagName)
ProjectServiceString tag name, returns a List
list of projects with that tag.
getProjectListByTagName in interface ProjectServicepublic List<Project> getProjectListByTagNames(Set<String> tagNames)
ProjectServiceSet set of tag names, returns a
List list of projects with all of the tag names.
getProjectListByTagNames in interface ProjectService
public boolean isAuthorizedToCreateTag(User user,
String name)
ProjectServiceUser user and a String tag name,
returns true if that user is authorized to create a tag with that
name, returns false otherwise.
isAuthorizedToCreateTag in interface ProjectService
public boolean projectContainsTag(Long projectId,
String name)
ProjectServiceLong project id and a String tag
name, returns boolean true if the project contains a
tag with that name, false otherwise.
projectContainsTag in interface ProjectService
public void removeTagFromProject(Long tagId,
Long projectId)
ProjectServiceTag and a Project, removes the
tag from the project.
removeTagFromProject in interface ProjectService
public Long updateTag(Long tagId,
Long projectId,
String name)
ProjectServiceLong tag id, a Long project id and
a String name, updates that project tag to that name, returning
the resulting Long tag Id.
updateTag in interface ProjectServicepublic List<Project> getProjectCopies(Long projectId)
ProjectService
getProjectCopies in interface ProjectService
public void removeSharedTeacherFromProject(String username,
Project project)
throws ObjectNotFoundException
ProjectService
removeSharedTeacherFromProject in interface ProjectServiceObjectNotFoundException
public Project getProjectFull(Long projectId)
throws ObjectNotFoundException
ObjectNotFoundException
public Long identifyRootProjectId(Project projectId)
throws ObjectNotFoundException
ProjectService
identifyRootProjectId in interface ProjectServiceObjectNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||