1 package org.apache.maven.continuum.web.action;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.continuum.web.util.AuditLog;
23 import org.apache.continuum.web.util.AuditLogConstants;
24 import org.apache.maven.continuum.ContinuumException;
25 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
26
27 import java.io.File;
28
29
30
31
32
33
34
35
36
37 public class AddMavenOneProjectAction
38 extends AddMavenProjectAction
39 {
40
41 protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup, boolean checkProtocol,
42 boolean scmUseCache )
43 throws ContinuumException
44 {
45 ContinuumProjectBuildingResult result = getContinuum().addMavenOneProject( pomUrl, selectedProjectGroup,
46 checkProtocol, scmUseCache,
47 this.getBuildDefinitionTemplateId() );
48
49 AuditLog event = new AuditLog( hidePasswordInUrl( pomUrl ), AuditLogConstants.ADD_M1_PROJECT );
50 event.setCategory( AuditLogConstants.PROJECT );
51 event.setCurrentUser( getPrincipal() );
52
53 if ( result == null || result.hasErrors() )
54 {
55 event.setAction( AuditLogConstants.ADD_M1_PROJECT_FAILED );
56 }
57
58 event.log();
59
60 return result;
61 }
62
63
64
65
66 public String getM1Pom()
67 {
68 return getPom();
69 }
70
71
72
73
74 public void setM1Pom( String pom )
75 {
76 setPom( pom );
77 }
78
79
80
81
82 public File getM1PomFile()
83 {
84 return getPomFile();
85 }
86
87
88
89
90 public void setM1PomFile( File pomFile )
91 {
92 setPomFile( pomFile );
93 }
94
95
96
97
98 public String getM1PomUrl()
99 {
100 return getPomUrl();
101 }
102
103
104
105
106 public void setM1PomUrl( String pomUrl )
107 {
108 setPomUrl( pomUrl );
109 }
110 }