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 java.io.File;
23
24 import org.apache.continuum.web.util.AuditLog;
25 import org.apache.continuum.web.util.AuditLogConstants;
26 import org.apache.maven.continuum.ContinuumException;
27 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
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, checkProtocol, scmUseCache,
46 this.getBuildDefinitionTemplateId() );
47
48 AuditLog event = new AuditLog( hidePasswordInUrl( pomUrl ), AuditLogConstants.ADD_M1_PROJECT );
49 event.setCategory( AuditLogConstants.PROJECT );
50 event.setCurrentUser( getPrincipal() );
51
52 if ( result == null || result.hasErrors() )
53 {
54 event.setAction( AuditLogConstants.ADD_M1_PROJECT_FAILED );
55 }
56
57 event.log();
58
59 return result;
60 }
61
62
63
64
65 public String getM1Pom()
66 {
67 return getPom();
68 }
69
70
71
72
73 public void setM1Pom( String pom )
74 {
75 setPom( pom );
76 }
77
78
79
80
81 public File getM1PomFile()
82 {
83 return getPomFile();
84 }
85
86
87
88
89 public void setM1PomFile( File pomFile )
90 {
91 setPomFile( pomFile );
92 }
93
94
95
96
97 public String getM1PomUrl()
98 {
99 return getPomUrl();
100 }
101
102
103
104
105 public void setM1PomUrl( String pomUrl )
106 {
107 setPomUrl( pomUrl );
108 }
109 }