cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 114625 - Regression: unable to customize user property
: Regression: unable to customize user property
Status: VERIFIED FIXED
: platform
Favorites
: 6.0
: All All
: P2 (vote)
: 6.0
Assigned To:
:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-09-04 13:36 by
Modified: 2009-10-29 18:56 (History)
Issue Type: DEFECT
:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-09-04 13:36:03
In NB5.x it was possible to customize user property using a string table in
advanced options. This customization affects
code generation from file templates as this property is expanded into javadoc
as a value of @author anotation.

I used to customize the user property to contain more details: "Name Surname
(name.surname at myemail.com)"

In NB6, this string table is not available and there is no UI that would allow
me to customize the property. For
experienced NB5.x users it might be a significant usability issue.

There is one workaround I eventually found after I spent some time
unsuccessfully trying to get some help directly from
NB core developers:
- start netbeans with additional "-J-Duser.name="Name Surname (name.surname at
myemail.com)" parameter
This workaround is rather ugly though and not easy to figure out.
------- Comment #1 From 2007-09-05 13:16:22 -------
Jan, I think it would be great is there was a file general.freemarker that
would be included by all templates, 
especially the Java one and which could user modify to contain user.name="...".
This file would be visible in 
Tools/Templates and user could change it.

Do you think this is good idea to create such file?
------- Comment #2 From 2007-09-05 14:29:39 -------
It seems to be better than the present state. I just do not understand why you
assign it to the java module. IMO the
file should be registered by the FreeMarker integration module in order to be
available to all FreeMarker clients. Have
you considered possibility to read general.freemarker file content to the
scripting environment directly without
necessity to import the file? Later someone might also require to have certain
properties project specific. The template
manager will be unusable to edit such properties then.

BTW is not this a duplicate of issue #107725
------- Comment #3 From 2007-09-06 10:39:06 -------
We agreed with Jarda he takes care of this. openide/templates could be the
right place. Reassigning ...
------- Comment #4 From 2007-09-07 09:46:51 -------
TM=6.0beta2
------- Comment #5 From 2007-09-19 14:16:52 -------
*** Issue 104358 has been marked as a duplicate of this issue. ***
------- Comment #6 From 2007-09-25 14:54:01 -------
I'll fix it by changing core/favorites to read
Templates/Properties/*.properties files with values define there. I'll 
change projects/projectui to define a file there with value for property user.
------- Comment #7 From 2007-09-25 16:34:49 -------
IDE:-------------------------------------------------
IDE: [25.9.07 17:32] Committing "Favorites" started
Directory /shared/data/ccvs/repository/core/favorites/src/META-INF added to the
repository
Directory /shared/data/ccvs/repository/core/favorites/src/META-INF/services
added to the repository
cvs server: scheduling file
`src/META-INF/services/org.openide.loaders.CreateFromTemplateAttributesProvider'
for 
addition
cvs server: scheduling file
`test/unit/src/org/netbeans/modules/favorites/templates/PropertiesProviderTest.java'
for 
addition
cvs server: scheduling file
`src/org/netbeans/modules/favorites/templates/PropertiesProvider.java' for
addition
cvs server: use 'cvs commit' to add these files permanently
Checking in src/org/netbeans/modules/favorites/Bundle.properties;
/shared/data/ccvs/repository/core/favorites/src/org/netbeans/modules/favorites/Bundle.properties,v
 <--  
Bundle.properties
new revision: 1.19; previous revision: 1.18
done
RCS 
file:
/shared/data/ccvs/repository/core/favorites/test/unit/src/org/netbeans/modules/favorites/templates/PropertiesProviderTest.java,v
done
Checking in
test/unit/src/org/netbeans/modules/favorites/templates/PropertiesProviderTest.java;
/shared/data/ccvs/repository/core/favorites/test/unit/src/org/netbeans/modules/favorites/templates/PropertiesProviderTest.java,v 
<--  PropertiesProviderTest.java
initial revision: 1.1
done
RCS 
file:
/shared/data/ccvs/repository/core/favorites/src/META-INF/services/org.openide.loaders.CreateFromTemplateAttributesProvider,v
done
Checking in
src/META-INF/services/org.openide.loaders.CreateFromTemplateAttributesProvider;
/shared/data/ccvs/repository/core/favorites/src/META-INF/services/org.openide.loaders.CreateFromTemplateAttributesProvider,v 
<--  org.openide.loaders.CreateFromTemplateAttributesProvider
initial revision: 1.1
done
Checking in nbproject/project.xml;
/shared/data/ccvs/repository/core/favorites/nbproject/project.xml,v  <-- 
project.xml
new revision: 1.16; previous revision: 1.15
done
Checking in src/org/netbeans/modules/favorites/resources/layer.xml;
/shared/data/ccvs/repository/core/favorites/src/org/netbeans/modules/favorites/resources/layer.xml,v
 <--  layer.xml
new revision: 1.23; previous revision: 1.22
done
Checking in src/org/netbeans/modules/favorites/templates/TemplatesAction.java;
/shared/data/ccvs/repository/core/favorites/src/org/netbeans/modules/favorites/templates/TemplatesAction.java,v
 <--  
TemplatesAction.java
new revision: 1.6; previous revision: 1.5
done
RCS 
file:
/shared/data/ccvs/repository/core/favorites/src/org/netbeans/modules/favorites/templates/PropertiesProvider.java,v
done
Checking in
src/org/netbeans/modules/favorites/templates/PropertiesProvider.java;
/shared/data/ccvs/repository/core/favorites/src/org/netbeans/modules/favorites/templates/PropertiesProvider.java,v 
<--  PropertiesProvider.java
initial revision: 1.1
done
IDE: [25.9.07 17:32] Committing "Favorites" finished
------- Comment #8 From 2007-09-25 16:35:58 -------
*** Issue 107725 has been marked as a duplicate of this issue. ***
------- Comment #9 From 2007-11-01 13:32:25 -------
I'm reopening this issue as the new system will only affect newly created
files. 

When editing an existing class an adding an initial Javadoc comment, NB still
uses the current OS user when
automatically adding the @author tag, and there is no way to change that (other
than starting NB with -J-Duser.name=....)
------- Comment #10 From 2007-11-01 14:18:26 -------
Jardo, will you set the system property 'user.name'? Otherwise I will look up
the property in registered
CreateFromTemplateAttributesProviders in JavaDataLoader in order to support old
templates.
------- Comment #11 From 2007-11-01 14:58:10 -------
Old templates use new template properties now.

/cvs/java/source/src/org/netbeans/modules/java/JavaDataLoader.java,v  <-- 
JavaDataLoader.java
new revision: 1.8; previous revision: 1.7
------- Comment #12 From 2007-11-07 16:47:46 -------
still not working for case generating javadoc by hints:

- set user property
- create new java class (now @author is generated according to user property)
- delete this javadoc
- generate javadoc by hint (hints have to be enabled) -> @author is system user
------- Comment #13 From 2007-11-07 23:15:58 -------
Open new bug please. This one was about templates. Javadoc is generated by
completely different infrastructure.
------- Comment #14 From 2007-11-22 16:49:46 -------
Ok, so setting user property by template works -Verified in 6.0 RC2. I'll file
a new one for java/hints. 
------- Comment #15 From 2008-02-18 17:40:22 -------
Where can I define the user name property? There is any GUI? I can't find it...
------- Comment #16 From 2008-05-30 12:45:30 -------
I've reached here while trying to set the $user parameter.

My suggestion would be to create a more informative help file. 

Then you don't have to worry about how "discoverable" some features are

It would be peace of cake to find them in the help file.
------- Comment #17 From 2008-12-15 03:37:16 -------
How about adding a button on the pref/editor/codeTemplates area. This button is
"showAllVariables" and it would show all
variables allowed to be used, according to whatever file netbeans is currently
using. 
If they are/not editable, then a button could be added to make them so. 
------- Comment #18 From 2009-10-29 16:52:20 -------
Where can I define the user name property? There is any GUI? I can't find it...
------- Comment #19 From 2009-10-29 17:57:49 -------
hmichel: Tools->Templates->User Configuration Properties->User.properties and
Open in Editor
------- Comment #20 From 2009-10-29 18:56:53 -------
Thanks, work like a charm.