Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 121301 - When you rename a template, the template is lost
When you rename a template, the template is lost
Product: platform
Classification: Unclassified
Component: Data Systems
All All
: P1 (vote)
: 6.x
Assigned To: Jaroslav Tulach
Depends on:
  Show dependency treegraph
Reported: 2007-11-06 15:30 UTC by Petr Pisl
Modified: 2008-12-22 10:54 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2007-11-06 15:30:33 UTC
- Create an application. In my case web application. 
- In the index.jsp add some text and then invoke action Save as Template. Place the template to a category.
- Go to Tools -> Templates and find your new template in the Template Manager.
- Rename it and close the Template Manager
- Go to new file dialog and try to find your template. The template is not there. If you open the Template Manager, the
template is not there anymore either.
Comment 1 Jiri Rechtacek 2007-11-06 16:59:09 UTC
It's a regression on NB5.5.1 but if an user don't rename the template then s/he can use it w/o problems. Maybe the
priority should be reconsider.
Comment 2 Jaroslav Tulach 2007-11-06 21:21:00 UTC
Jirka is right, there is no reason for this problem to be P1.
Comment 3 Petr Pisl 2007-11-06 21:40:29 UTC
I think this is P1. It's data lost. I lost my template, which is not very nice.  What else should be P1? At least
disable the Rename action in the Template manager. 

- What i did is that I create a new jsp page. 
- Modified the page to have this page as template
- I saved this page as template and deleted the original page. I didn't need it in my project. 
- Then I renamed the template in the Template Manager -> my work was lost. 
Comment 4 Jaroslav Tulach 2007-11-07 08:30:44 UTC
It is not data loss. The data are untouched on your disk.
Comment 5 Jaroslav Tulach 2007-11-07 08:33:13 UTC
The problem is that after rename of the template, the .nbattrs in the template directory contain old entry:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 
1.0//EN" "">
<attributes version="1.0">
    <fileobject name="pokus.jsp">
        <attr name="Content-Encoding" stringvalue="UTF-8"/>
        <attr name="template" boolvalue="true"/>

I think I want to pass it to filesystems...
Comment 6 rmatous 2007-11-07 10:41:29 UTC
Trivial fix:
/cvs/core/startup/src/org/netbeans/core/startup/layers/,v  <--
new revision: 1.9; previous revision: 1.8
Comment 7 rmatous 2007-11-07 10:44:20 UTC
REGRESSION caused by - #79722 "extend file system to allow deleting writable instances of files from xml layers"

I think, its candidate for fixing in 6.0.
Comment 8 Stanislav Aubrecht 2007-11-07 11:09:24 UTC
reviewed, the patch is ok
Comment 9 Jaromir Uhrik 2007-11-07 13:49:07 UTC
I have verified in the latest hudson build. It works as expected now. I agree with the integration to the 6.0.
Comment 10 rmatous 2007-11-08 10:47:59 UTC
Fixed in 6.0:
/cvs/core/startup/src/org/netbeans/core/startup/layers/,v  <--
new revision:; previous revision: 1.8
Comment 11 Jaromir Uhrik 2007-11-09 09:33:52 UTC
Verified in the following build from RC1-branch:
Product Version: NetBeans IDE 6.0 RC1 (Build 200711090000)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb)

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo