public String saveToProject()
throws ContinuumException, ProfileException
{
AuditLog event = null;
String resource = "Project id=" + projectId + ":" + goals + " " + arguments;
try
{
if ( buildDefinitionId == 0 )
{
checkAddProjectBuildDefinitionAuthorization( getProjectGroupName() );
getContinuum().addBuildDefinitionToProject( projectId, getBuildDefinitionFromInput() );
event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
}
else
{
checkModifyProjectBuildDefinitionAuthorization( getProjectGroupName() );
getContinuum().updateBuildDefinitionForProject( projectId, getBuildDefinitionFromInput() );
event = new AuditLog( resource, AuditLogConstants.MODIFY_GOAL );
}
}
catch ( ContinuumActionException cae )
{
addActionError( cae.getMessage() );
return INPUT;
}
catch ( AuthorizationRequiredException authzE )
{
addActionError( authzE.getMessage() );
return REQUIRES_AUTHORIZATION;
}
event.setCategory( AuditLogConstants.BUILD_DEFINITION );
event.setCurrentUser( getPrincipal() );
event.log();
if ( groupBuildView )
{
return "success_group";
}