Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1243693

Summary: Can't create new project containing spaces in name via REST API
Product: [Retired] JBoss BPMS Platform 6 Reporter: Abhijit humbe <abhumbe>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED WONTFIX QA Contact: Lukáš Petrovický <lpetrovi>
Severity: low Docs Contact:
Priority: medium    
Version: 6.1.0CC: abhumbe, mrietvel, smcgowan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-25 07:33:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sourcefile
none
TestPatch none

Description Abhijit humbe 2015-07-16 06:15:29 UTC
Description of problem:
Not able create new project containing spaces in 'name' via REST API. It results in an invalid artifactID being generated in the pom.xml file.

~~~~~
ERROR [org.kie.workbench.common.services.backend.builder.BuildServiceImpl] (http-localhost.localdomain/127.0.0.1:8080-3) org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] 'artifactId' with value 'My New Project' does not match a valid id pattern. @ line 6, column 15
: java.lang.RuntimeException: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] 'artifactId' with value 'My New Project' does not match a valid id pattern. @ line 6, column 
~~~~~

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Start BPMS 6.1 server instance.
2. Use following command to create new project:

curl -i -X POST -H "Content-Type:application/json"  http://admin:admin12#@localhost:8080/business-central/rest/repositories/repository1/projects/  --data '{"name":"My New Project","description":"My description of the project.","groupId":"org.jboss.test","version":"1.0.0"}'

Actual results:
project created with invalid artifactId.

Expected results:
Project should be created with valid artifactId.

Additional info:

Comment 2 Marco Rietveld 2015-07-16 09:07:19 UTC
No spaces in the project id (which is the artifactId of the artifact) is an (apache) maven constraint, as shown in the stack trace above. 

As far as I can tell, there is no good solution to this problem. 

Abhijit, because of this, I'd like to close this. Would that be okay? Is there another solution you have in mind?

Comment 4 Abhijit humbe 2015-07-17 05:38:06 UTC
Created attachment 1052980 [details]
Sourcefile

Comment 5 Abhijit humbe 2015-07-17 05:38:54 UTC
Created attachment 1052981 [details]
TestPatch

Comment 6 Abhijit humbe 2015-07-17 05:41:09 UTC
Attached patch files are not tested by Red Hat QA team.Its not supported ,recommended to use in production environment, it can be used in development environment.

Comment 7 Marco Rietveld 2015-07-19 20:41:56 UTC
Abhijit, what happens in this situation: 

1. Client creates project with name "MyProjName". 
2. Client creates project with name "My Proj Name"

What do you think should happen in this case?

Comment 8 Abhijit humbe 2015-07-22 07:23:04 UTC
Marco, 

1. Client creates project with name "MyProjName". 
Project created successfully  with "Project Name" `MyProjName` and artifactId is set to "MyProjName".

2. Client creates project with name "My Proj Name"
Project created successfully with "Project Name"--> `My Proj Name` and artifactId is set to "MyProjName"


As per my understanding its correct behaviour. Please share thoughts on this.

Comment 9 Marco Rietveld 2015-07-24 06:46:01 UTC
Abhijit, 

The behavior you describe above is not technically possible: artifactIds must be unique. In step 2, an error would be thrown because the "MyProjName" project already exists. 

The UI has different behavior than what you describe above. In the UI, the following happens: 

1. Client creates project with name "MyProjName". 
-> Project created successfully. 

2. Client creates project with name "My Proj Name"
-> Project name is corrected to "MyProjName" and shown to the user. 
-> If the user then proceeds, an error is thrown that the project already exists. 


Unfortunately, the REST API is not interactive in the same way that the UI is. I'm not sure what a better behavior for the REST API would be for this. 

What do you think? Do you have any ideas for what the REST API should do in this case?

Comment 10 JBoss JIRA Server 2015-08-11 23:24:22 UTC
Marco Rietveld <marco.rietveld> updated the status of jira JBPM-4703 to Resolved

Comment 11 Marco Rietveld 2015-08-25 07:33:23 UTC
Rejecting this issue (see my comment 9 above). 

If there is a solution that fixes the problem outlined in comment 9, please reopen the issue.