This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 115058 - No possibility to specify initial file license for freeform projects
Summary: No possibility to specify initial file license for freeform projects
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Freeform (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 13250
  Show dependency tree
 
Reported: 2007-09-07 19:55 UTC by Jesse Glick
Modified: 2008-03-31 09:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch file (1.09 KB, patch)
2007-10-03 14:10 UTC, Milan Kubec
Details | Diff
patch file (6.19 KB, patch)
2007-10-09 15:26 UTC, Milan Kubec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-09-07 19:55:36 UTC
CreateFromTemplateAttributesProvider is not implemented in freeform projects. Therefore it is impossible to, e.g.,
specify that files added to nbbuild should use CDDL by default.
Comment 1 Milan Kubec 2007-09-10 14:10:18 UTC
Jesse, where should be the license stored in the case of freeform project?
Comment 2 Jesse Glick 2007-09-13 23:26:05 UTC
Probably not a P3.

Would need to be stored in project.xml somewhere. I think it would be OK to add a new field to
http://www.netbeans.org/ns/freeform-project/2 since it has not been in an official release yet.
Comment 3 Milan Kubec 2007-09-24 14:14:20 UTC
Do you have any suggestion about where to put it? 
Something like:
<project-license></project-license>
under the <general-data> element?
Comment 4 Jesse Glick 2007-09-26 17:45:32 UTC
Sure, that would work I think.

Can use nbbuild/nbproject/project.xml as a test case, BTW.
Comment 5 Milan Kubec 2007-10-03 14:10:09 UTC
Created attachment 50089 [details]
patch file
Comment 6 Milan Kubec 2007-10-03 14:14:07 UTC
I've attached diff for the freeform schema, I think that the patch should be applied now before Beta2 and the actual
implementation could be done after Beta2. Please review, thanks.
Comment 7 Jesse Glick 2007-10-03 15:27:28 UTC
I don't think it's wise to commit a schema change with no corresponding impl. How can you be sure it works?
Comment 8 Milan Kubec 2007-10-09 15:26:54 UTC
Created attachment 50505 [details]
patch file
Comment 9 Milan Kubec 2007-10-09 15:29:55 UTC
I've attached diff with complete implementation. I will provide tests. I'd like to commit the change on Friday 10/12.
Please review. Thanks.
Comment 10 Jesse Glick 2007-10-09 22:19:21 UTC
Looks OK.
Comment 11 Milan Kubec 2007-10-12 08:31:36 UTC
Fixed. <project-license> element under <general-data> can be used to define license for freeform project, when creating
new files from template.

RCS file: /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/src/org/foo/NewClass.java,v
done
Checking in test/unit/data/example-projects/simplewithlicense/src/org/foo/NewClass.java;
/cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/src/org/foo/NewClass.java,v  <--  NewClass.java
initial revision: 1.1
done
RCS file: /cvs/ant/freeform/test/unit/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProviderTest.java,v
done
Checking in test/unit/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProviderTest.java;
/cvs/ant/freeform/test/unit/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProviderTest.java,v  <-- 
FreeformTemplateAttributesProviderTest.java
initial revision: 1.1
done
RCS file: /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/nbproject/project.xml,v
done
Checking in test/unit/data/example-projects/simplewithlicense/nbproject/project.xml;
/cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/nbproject/project.xml,v  <--  project.xml
initial revision: 1.1
done
Checking in nbproject/project.xml;
/cvs/ant/freeform/nbproject/project.xml,v  <--  project.xml
new revision: 1.31; previous revision: 1.30
done
RCS file: /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProvider.java,v
done
Checking in src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProvider.java;
/cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProvider.java,v  <-- 
FreeformTemplateAttributesProvider.java
initial revision: 1.1
done
Checking in src/org/netbeans/modules/ant/freeform/FreeformProject.java;
/cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformProject.java,v  <--  FreeformProject.java
new revision: 1.52; previous revision: 1.51
done
RCS file: /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/build.xml,v
done
Checking in test/unit/data/example-projects/simplewithlicense/build.xml;
/cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/build.xml,v  <--  build.xml
initial revision: 1.1
done
Checking in src/org/netbeans/modules/ant/freeform/resources/freeform-project-general-2.xsd;
/cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/resources/freeform-project-general-2.xsd,v  <-- 
freeform-project-general-2.xsd
new revision: 1.6; previous revision: 1.5
done
Comment 12 Jesse Glick 2007-10-12 18:23:38 UTC
Seems to work:

Checking in project.xml;
/shared/data/ccvs/repository/nbbuild/nbproject/project.xml,v  <--  project.xml
new revision: 1.93; previous revision: 1.92
done
Comment 13 slepage01 2008-03-31 03:02:26 UTC
The same behavior is seen when creating a standard java project with existing source. There is no corresponding
<project-license> element in the xmlns="http://www.netbeans.org/ns/project/1" schema.
Comment 14 Milan Kubec 2008-03-31 09:46:27 UTC
Well, there is no need for changes in project.xml for j2seproject. It already works, but it's kind of awkward to set up.
You need to open Template manager via Tools -> Templates and select node Licenses. Then you add your license file, which
needs to be named as 'license-LicenseID.txt'. Then you open nbproject/project.properties of your project and add new
property 'project.license' with value 'LicenseID'. After that your newly created files that are supposed to contain
license will contain the new license.