org.telscenter.sail.webapp.service.project
Interface ProjectService

All Known Subinterfaces:
ExternalProjectService
All Known Implementing Classes:
ExternalProjectServiceImpl, LdProjectServiceImpl, OTrunkProjectServiceImpl, PodProjectServiceImpl, POTrunkProjectServiceImpl, ProjectServiceImpl, RooloProjectServiceImpl

public interface ProjectService

A Service for Projects

Version:
$Id$
Author:
Hiroki Terashima

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.
 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 bookmarker)
          Retrieves a List of Project that has been bookmarked by the given User
 Project getById(Serializable projectId)
          Gets a project with the given projectid
 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.
 List<Project> getProjectCopies(Long projectId)
          Given a project id, returns projects that are copies of the project
 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.
 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
 Long identifyRootProjectId(Project project)
          Given a project, gets the project id for the project's root level project
 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 sortProjectsByDateCreated(List<Project> projectList)
          Sorts the given List list of projects by the date they were created.
 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.
 

Method Detail

getAllProjectsList

@Transactional
List<Project> getAllProjectsList()
Get a List of Project

Returns:
a List of Project

getProjectList

@Transactional
@Secured(value={"ROLE_USER","AFTER_ACL_COLLECTION_READ"})
List<Project> getProjectList()
Get a List of Project

Returns:
a List of Project

getProjectList

@Transactional
@Secured(value={"ROLE_USER","AFTER_ACL_COLLECTION_READ"})
List<Project> getProjectList(User user)
Get a List of Project that the specified user owns

Returns:
a List of Project

getSharedProjectList

@Transactional
@Secured(value={"ROLE_USER","AFTER_ACL_COLLECTION_READ"})
List<Project> getSharedProjectList(User user)
Get a List of Project that have been shared with the specified user.

Returns:
a List of Project

getProjectListByTag

@Transactional
List<Project> getProjectListByTag(FamilyTag tag)
                                  throws ObjectNotFoundException
Get a List of Project with matching FamilyTag

Returns:
a List of Project
Throws:
ObjectNotFoundException

getProjectListByTag

@Transactional
List<Project> getProjectListByTag(String tag)
                                  throws ObjectNotFoundException
Get a List of Project with matching ProjectInfoTag

Returns:
a List of Project
Throws:
ObjectNotFoundException

getProjectListByInfo

@Transactional
List<Project> getProjectListByInfo(ProjectInfo info)
                                   throws ObjectNotFoundException
Get a List of Project with matching ProjectInfo

Returns:
a List of Project
Throws:
ObjectNotFoundException

getBookmarkerProjectList

@Transactional
List<Project> getBookmarkerProjectList(User bookmarker)
                                       throws ObjectNotFoundException
Retrieves a List of Project that has been bookmarked by the given User

Parameters:
User - bookmarker
Returns:
List
Throws:
ObjectNotFoundException

addBookmarkerToProject

@Transactional
void addBookmarkerToProject(Project project,
                                          User bookmarker)
                            throws ObjectNotFoundException
Adds the given User bookmarker to the Project project

Parameters:
Project - project
User - bookmarker
Throws:
ObjectNotFoundException

removeBookmarkerFromProject

@Transactional
void removeBookmarkerFromProject(Project project,
                                               User bookmarker)
                                 throws ObjectNotFoundException
Removes the given User bookmarker from the Project project

Parameters:
Project - project
User - bookmarker
Throws:
ObjectNotFoundException

getSharedTeacherRole

@Transactional(readOnly=true)
String getSharedTeacherRole(Project project,
                                          User user)
Returns the permission that the specified user has on the specified project

Parameters:
project - The Project that is shared.
user - The User that shares the Project
Returns:
A String containing the permission that the user has on the project. If the user does not have permission on the project, null is returned.

addSharedTeacherToProject

@Secured(value="ROLE_TEACHER")
@Transactional
void addSharedTeacherToProject(AddSharedTeacherParameters addSharedTeacherParameters)
                               throws ObjectNotFoundException
Parameters:
addSharedTeacherParameters -
Throws:
ObjectNotFoundException

removeSharedTeacherFromProject

@Secured(value="ROLE_TEACHER")
@Transactional
void removeSharedTeacherFromProject(String username,
                                                          Project project)
                                    throws ObjectNotFoundException
Removes shared user from project. if user or project does not exist, ignore.

Throws:
ObjectNotFoundException

createProject

Project createProject(ProjectParameters projectParameters)
                      throws ObjectNotFoundException
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. 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

Parameters:
ProjectParameters - the project parameters object
Returns:
the Project that was created
Throws:
ObjectNotFoundException - when projectparameters references curnitId and jnlpId that do not exist

updateProject

void updateProject(Project project,
                   User user)
                   throws NotAuthorizedException
Saves the project

Parameters:
project - Project contains updated Project.
Throws:
NotAuthorizedException

launchProject

Object launchProject(LaunchProjectParameters launchProjectParameters)
                     throws Exception
Launches the project given the launchProjectParameters

Parameters:
launchProjectParameters - parameters needed to launch the project
Throws:
Exception

launchReport

Object launchReport(LaunchReportParameters launchReportParameters)
Launches the report given the launchReportParameters

Returns:

previewProject

Object previewProject(PreviewProjectParameters previewProjectParameters)
                      throws Exception
Launches a Preview of the Project

Parameters:
projectId - the id of the project
Throws:
ObjectNotFoundException - when the specified projectId does not exist
IOException - when the url cannot be loaded
Exception

authorProject

Object authorProject(AuthorProjectParameters authorProjectParameters)
                     throws Exception
Allows users to author a project

Parameters:
authorProjectParameters -
Returns:
Throws:
Exception

getById

Project getById(Serializable projectId)
                throws ObjectNotFoundException
Gets a project with the given projectid

Parameters:
projectId - the id of the project
Returns:
Project with the specified projectId
Throws:
ObjectNotFoundException - when the specified projectId does not exist

getProjectList

List<Project> getProjectList(String query)
Given a String query, returns a List of Project that satisfies the query.

Parameters:
String - query
Returns:
List

minifyProject

String minifyProject(Project project)
Given a Project project, attempts to minify a file and returns a String of the final status of the operation.

Parameters:
project -
Returns:

getMetadata

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.

Parameters:
projectId -
Returns:

canCreateRun

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.

Parameters:
project -
user -
Returns:
boolean

canAuthorProject

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.

Parameters:
project -
user -
Returns:
boolean

canReadProject

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.

Parameters:
project -
user -
Returns:

getAdminProjectList

List<Project> getAdminProjectList()
Returns a List list of all projects in the data store.

Returns:
List projects

sortProjectsByDateCreated

void sortProjectsByDateCreated(List<Project> projectList)
Sorts the given List list of projects by the date they were created.

Parameters:
projectList -

getProjectListByTagName

@Transactional
List<Project> getProjectListByTagName(String tagName)
Given a String tag name, returns a List list of projects with that tag.

Parameters:
String - - tagName
Returns:
List - list of projects

getProjectListByTagNames

@Transactional
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.

Parameters:
Set - - set of tagNames
Returns:
List - list of projects

addTagToProject

@Transactional
Long addTagToProject(Tag tag,
                                   Long projectId)
Given a Tag tag and a Long project id adds the given tag to the project.

Parameters:
Tag - - tag
Project - - project

addTagToProject

@Transactional
Long addTagToProject(String tag,
                                   Long projectId)
Given a String and a Project adds the tag to the project.

Parameters:
String - - tag
String - - project

removeTagFromProject

@Transactional
void removeTagFromProject(Long tagId,
                                        Long projectId)
Given a Tag and a Project, removes the tag from the project.

Parameters:
Tag - - tag
Project - - project

updateTag

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.

Parameters:
Long - - tagId
Long - - projectId
String - - name
Returns:
Long - tag id

projectContainsTag

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.

Parameters:
Long - - projectId
String - - name
Returns:
boolean

isAuthorizedToCreateTag

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.

Parameters:
User - - user
String - - name
Returns:
boolean

getProjectCopies

List<Project> getProjectCopies(Long projectId)
Given a project id, returns projects that are copies of the project

Parameters:
projectId -
Returns:

identifyRootProjectId

Long identifyRootProjectId(Project project)
                           throws ObjectNotFoundException
Given a project, gets the project id for the project's root level project

Parameters:
project -
Returns:
project
Throws:
ObjectNotFoundException


Copyright © 2012. All Rights Reserved.