Re: How to make template with license

Brett Ryan <[email protected]> Wed, 13 May 2009 05:07:55 +1000
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
--001e680f1660f2e1d30469bbcfa2
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Hi Vaclav, there's a few steps you need to undertake

Setup the License Text
1. Create a new text file with form "license-TYPE.txt" where TYPE is the
license type you wish to refer to.
2. Go to Tools > Templates
3. Click add and browse to your license file.

Alter your project license
1. Go to the "Files" tab.
2. Navigate to "nbproject" and open "project.properties".
3. Add a new line containing the following text (replacing TYPE with your
license type):
project.license=3DTYPE

Now, your license will be used with templates that refer to it.

Hope this helps,
-Brett

2009/5/13 Trojan V=E1clav <[email protected]>

>  Dear all,
>
>
>
> I have problem to create the license text in java templates in NetBeans v=
er
> 6.5.
>
>
>
> In the template editor I get the following source text:
>
>
>
> <#assign licenseFirst =3D "/*">
>
> <#assign licensePrefix =3D " * ">
>
> <#assign licenseLast =3D " */">
>
> <#include "../Licenses/license-${project.license}.txt">
>
>
>
> <#if package?? && package !=3D "">
>
> package ${package};
>
>
>
> </#if>
>
> /**
>
>  *
>
>  * @author ${user}
>
>  */
>
> public class ${name} {
>
>
>
> }
>
>
>
> How should I modify the command:
>
>
>
> <#include "../Licenses/license-${project.license}.txt">
>
>
>
> And where should I create the text file? If I put there an absolute
> pathname or a relative path it dosn=92t work properly.
>
>
>
> Thanx for help
>
>
>
> Vaclav Trojan
>

--001e680f1660f2e1d30469bbcfa2
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Hi Vaclav, there&#39;s a few steps you need to undertake<br><br>Setup the L=
icense Text<br>1. Create a new text file with form &quot;license-TYPE.txt&q=
uot; where TYPE is the license type you wish to refer to.<br>2. Go to Tools=
 &gt; Templates<br>
3. Click add and browse to your license file.<br><br>Alter your project lic=
ense<br>1. Go to the &quot;Files&quot; tab.<br>2. Navigate to &quot;nbproje=
ct&quot; and open &quot;project.properties&quot;.<br>3. Add a new line cont=
aining the following text (replacing TYPE with your license type):<br>
project.license=3DTYPE<br><br>Now, your license will be used with templates=
 that refer to it.<br><br>Hope this helps,<br>-Brett<br><br><div class=3D"g=
mail_quote">2009/5/13 Trojan V=E1clav <span dir=3D"ltr">&lt;<a href=3D"mail=
to:[email protected]">[email protected]</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link=3D"blue" vlink=3D"purple" lang=3D"CS">

<div>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">Dear all,</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">I have problem to create the license text in ja=
va templates
in NetBeans ver 6.5. </span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">In the template editor I get the following sour=
ce
text:</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;#assign licenseFirs=
t =3D
&quot;/*&quot;&gt;</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;#assign licensePref=
ix =3D
&quot; * &quot;&gt;</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;#assign licenseLast=
 =3D
&quot; */&quot;&gt;</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;#include &quot;../L=
icenses/license-${project.license}.txt&quot;&gt;</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;#if package?? &amp;=
&amp;
package !=3D &quot;&quot;&gt;</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">package ${package};</sp=
an></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;/#if&gt;</span></fo=
nt></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">/**</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">=A0*</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">=A0* @author ${user}</s=
pan></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">=A0*/</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">public class ${name} {<=
/span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">}</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">How should I modify the command:</span></font><=
/p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: &quot;Courier New&quot;;" lang=3D"EN-US">&lt;#include &quot;../L=
icenses/license-${project.license}.txt&quot;&gt;</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">And where should I create the text file? If I p=
ut
there an absolute pathname or a relative path it dosn=92t work properly.</s=
pan></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">Thanx for help</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">=A0</span></font></p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;" lang=3D"EN-US">Vaclav Trojan</span></font></p>

</div>

</div>


</blockquote></div><br>

--001e680f1660f2e1d30469bbcfa2--