Re: How to make template with license
Vaclav Trojan <[email protected]> Wed, 13 May 2009 02:25:10 +0200
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <C236852B3F4F44E2A017CEBE86116B99@xpnbtrojan> |
------=_NextPart_000_000D_01C9D372.0A41D9B0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Dear Brett, thank you for resepone. However, I tried exactly what you recommended = and I received response of NetBeans: Error reading included file = Templates/Classes/../Licenses/license-TYPE.txt Have you an idea awhat is my mistake? Yours Vaclav ----- Original Message -----=20 From: Brett Ryan=20 To: [email protected]=20 Sent: Tuesday, May 12, 2009 9:07 PM Subject: Re: [nbui] How to make template with license 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 ver 6.5.=20 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 ------=_NextPart_000_000D_01C9D372.0A41D9B0 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dwindows-1252"> <META content=3D"MSHTML 6.00.6000.16825" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Dear Brett,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>thank you for resepone. However, I = tried exactly=20 what you recommended and I received response of NetBeans:</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Error reading included file=20 Templates/Classes/../Licenses/license-TYPE.txt</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Have you an idea awhat is my = mistake?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Yours</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Vaclav</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <BLOCKQUOTE=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: = black"><B>From:</B>=20 <A [email protected] = href=3D"mailto:[email protected]">Brett=20 Ryan</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A = [email protected]=20 href=3D"mailto:[email protected]">[email protected]</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, May 12, 2009 = 9:07 PM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [nbui] How to make = template=20 with license</DIV> <DIV><BR></DIV>Hi Vaclav, there's a few steps you need to=20 undertake<BR><BR>Setup the License Text<BR>1. Create a new text file = with form=20 "license-TYPE.txt" where TYPE is the license type you wish to refer = to.<BR>2.=20 Go to Tools > Templates<BR>3. Click add and browse to your license=20 file.<BR><BR>Alter your project license<BR>1. Go to the "Files" = tab.<BR>2.=20 Navigate to "nbproject" and open "project.properties".<BR>3. Add a new = line=20 containing the following text (replacing TYPE with your license=20 type):<BR>project.license=3DTYPE<BR><BR>Now, your license will be used = with=20 templates that refer to it.<BR><BR>Hope this helps,<BR>-Brett<BR><BR> <DIV class=3Dgmail_quote>2009/5/13 Trojan V=E1clav <SPAN = dir=3Dltr><<A=20 = href=3D"mailto:[email protected]">[email protected]</A>></= SPAN><BR> <BLOCKQUOTE class=3Dgmail_quote=20 style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: = rgb(204,204,204) 1px solid"> <DIV lang=3DCS vlink=3D"purple" link=3D"blue"> <DIV> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Dear = all,</SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have problem to = create the=20 license text in java templates in NetBeans ver 6.5. = </SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">In the template editor = I get the=20 following source text:</SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><#assign = licenseFirst=20 =3D "/*"></SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><#assign=20 licensePrefix =3D " * "></SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><#assign = licenseLast=20 =3D " */"></SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><#include=20 "../Licenses/license-${project.license}.txt"></SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'"></SPAN></FONT> </P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><#if = package??=20 && package !=3D ""></SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">package=20 ${package};</SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'"></SPAN></FONT> </P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'"></#if></SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'">/**</SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'"> *</SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> * = @author=20 ${user}</SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'"> */</SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">public class = ${name}=20 {</SPAN></FONT></P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'"></SPAN></FONT> </P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier = New'">}</SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">How should I modify = the=20 command:</SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3D"Courier New" size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><#include=20 "../Licenses/license-${project.license}.txt"></SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">And where should I = create the=20 text file? If I put there an absolute pathname or a relative path it = dosn=92t=20 work properly.</SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanx for = help</SPAN></FONT></P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: = Arial"></SPAN></FONT> </P> <P><FONT face=3DArial size=3D2><SPAN lang=3DEN-US=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Vaclav=20 = Trojan</SPAN></FONT></P></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE><= /BODY></HTML> ------=_NextPart_000_000D_01C9D372.0A41D9B0--