Project

General

Profile

Actions

Bug #2223

closed

Title and Abstract screen insert empty abstract tag

Added by Saurabh Garg over 18 years ago. Updated over 14 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
morpho - general
Target version:
Start date:
10/10/2005
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2223

Description

To reproduce the bug:
1. Create a datapackage with no abstract using the data package wizard.
2. Save it locally or over the network.
3. Open the documentation menu and open the Title and Abstract screen.
4. Modify the title but add no abstract.
5. Save the dp again.

Actions #1

Updated by Saurabh Garg over 18 years ago

Oops.. commited the bug too soon.

The result of the above steps is that a empty abstract tag is inserted by the
Title and Abstract screen.
If you try to save the document over the network, Metacat will return an error:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of
element 'abstract' is not complete. One of '{"":section, "":para}' is expected.

Actions #2

Updated by Saurabh Garg over 18 years ago

Fixed.

Actions #3

Updated by Will Tyburczy over 18 years ago

fix is working great, resolving bug

Actions #4

Updated by Will Tyburczy over 18 years ago

the insertion of an empty abtract tag is fixed, however it is now not possible
to delete an abstract from a dp using the wizard interface (modifications still
work, as long as some non whitespace characters are left in the abstract at the
end).

To recreate this bug:

-open a data package that doesn't have an abstract
-open the title and abstract wizard page
-add some text to the abstract
-click ok
The change will occur normally
-open the title and abstract wizard page again
-delete the text in the abstract field
-click ok
The abstract will still appear in the dp view with the text you added originally

This seems to be a problem with the wizard, as you can still delete the abstract
by deleting the text through the tree editor

Actions #5

Updated by P. Anderson about 18 years ago

The problem is that the following code (in both getPageData() methods of
plugins/datapackagewizard/pages/General.java) prevents an empty abstract from
being set.

if ( !(absField.getText().trim().equals("")) ) {
returnMap.put(rootXPath + "/abstract/para1",
absField.getText().trim());
}

Removing the if statement and trying to save an empty abstract produces this XML:

<abstract><para> </para>
</abstract>

...which Metacat seems to accept. AFAICT, this bug is now fixed.

Here is the link to the code:
http://cvs.ecoinformatics.org/cvs/cvsweb.cgi/morpho/src/edu/ucsb/nceas/morpho/plugins/datapackagewizard/pages/General.java

Actions #6

Updated by Matt Jones about 18 years ago

I don't like this fix. We need to discuss this before we finalize, so I am
reopening the bug to force us to discuss the issue.

Actions #7

Updated by P. Anderson about 18 years ago

OK now this is much better. Checks for empty abstract and makes sure to remove
any extant abstract from the DOM. If no abstract is given, then no XML tag is
produced.

Here's the diff:
http://cvs.ecoinformatics.org/cvs/cvsweb.cgi/morpho/src/edu/ucsb/nceas/morpho/datapackage/AddTitleAbstractCommand.java.diff?r1=1.2&r2=1.3

Actions #8

Updated by Jing Tao about 15 years ago

Morpho still create an empty string in abstract/para.

Actions #9

Updated by Jing Tao almost 15 years ago

In WizardContainerFrame class, a statement of checking if abstract object is empty string is added. If it is empty, the abstract tree wouldn't be added to the eml. So this bug is fixed:
1. In new wizard page, if the abstract field is empty, no abstract will be added.
2. User still can use title/abstract button to remove an abstract.

Actions #10

Updated by Jing Tao over 14 years ago

move to 1.7

Actions #11

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 2223

Actions

Also available in: Atom PDF