This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 89892 - AppInfo Customization Provider needed
Summary: AppInfo Customization Provider needed
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on:
Blocks: 89266
  Show dependency tree
 
Reported: 2006-11-22 19:10 UTC by Samaresh Panda
Modified: 2007-02-06 18:08 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
AppInfo customization provider (19.87 KB, application/octet-stream)
2006-11-22 19:11 UTC, Samaresh Panda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samaresh Panda 2006-11-22 19:10:02 UTC
This is a requirement from the Monrovia team. They have a feature targeted for
Kenai release, that requires a custom AppInfo provider in Schema tools.

Here is a brief description of the use-case:
1. The user should be able to add and remove AppInfo customization providers.
2. Once a customization is added, there will be one line added to the annotation
of the schema information item (xsd:schema), as illustrated below:

<xsd:schema ...>
 <xsd:annotation>
   <xsd:appinfo source=”urn:com.sun:xsdeditor-customization”
        xmlns:xec=”urn:com.sun:xsdeditor-customization”>
          <xec:customization xec:name=”urn:com.sun:custom-encoder-ui-1.0”/>
          <xec:customization xec:name=”urn:com.foo:other.customization”/>
   </xsd:appinfo>
 </xsd:annotation>
...
...
</xsd:schema>

The tool at runtime, finds the active customization provider and queries it to
get the special (appInfo customizer) property sheet for the selected Node.

A two-page document describing the requirement has been attached for reference.
Comment 1 Samaresh Panda 2006-11-22 19:11:08 UTC
Created attachment 36225 [details]
AppInfo customization provider
Comment 2 Samaresh Panda 2006-11-22 19:22:12 UTC
As a part of this feature requirement, we (SchemaTool) need to provide an
interface (possible name may be AppInfoCustomizationProvider) that must be
implemented by whoever wants to provide the customization.

At runtime, the tool will lookup various customization providers available for
the schema, get the active one(perhaps) and be able to display the property
sheet (appinfo customizer) for the selected node. This sheet will be provided by
the customization provider.

Next we're going to define the interface.
Comment 3 Samaresh Panda 2006-12-11 21:27:16 UTC
class AppInfoProvider.java is added to a new package
org.netbeans.modules.xml.schema.ui.basic.spi and the package has been made public.

Checking in AppInfoProvider.java;
/cvs/xml/schema/schemaui/src/org/netbeans/modules/xml/schema/ui/basic/spi/Attic/AppInfoProvider.java,v
 <--  AppInfoProvider.java
new revision: 1.1.2.2; previous revision: 1.1.2.1

Checking in project.xml;
/cvs/xml/schema/schemaui/nbproject/project.xml,v  <--  project.xml
new revision: 1.1.2.12.22.1; previous revision: 1.1.2.12
Comment 4 Todd Fast 2006-12-20 02:46:38 UTC
I don't see any information about the use cases. This is a necessary first step.
I don't think the UI proposal works, for several reasons. In particular, the SPI
that it implies is problematic. Let's see the use cases, then discuss a proper
SPI to make those possible.
Comment 5 Chris Webster 2006-12-20 18:12:07 UTC
The originating use case is described here:
http://www.netbeans.org/nonav/issues/showattachment.cgi/36225/CustomizeXSDEditor.odt

The intention is to support this case in the form of a provider for app info
information. The appinfo of schema is the extension point for the language
similar to the way annotation support allows Java to be extended. The initial
proposal is to support custom Node injection into the schema view. Given this
functionality the following would be supported:

* The ability to add an action to the Data Node -- this is supported by the Data
System infrastructure and is already present. This feature supports a custom
language to be generated into the schema (using the existing schema model).
Since this supports a set of arbitrary actions, any action can be attached to
the schema Data Node.

* The provider supports the ability to inject Nodes under the AppInfo node and
thus into the schema tree. Since the nodes are custom, all the capabilities
provided by Nodes such as actions and properties are available.

* Another possibility is that a set of new types could be supplied by the
provider, which would be visible on the App Info node. 


In terms of Use Cases:
 A custom language defined in terms of the schema App Info node could be created
by extended the current schema editor. The extension would allow top level
wizards via Data Object Extension (similar to the apply design pattern feature)
as well as visibility and editing capabilities in the node tree. This provides
some first class support for extension languages. A more tightly coupled unified
vision would provide better usability but require custom changes for each new
language supported. 
Comment 6 Samaresh Panda 2007-01-11 03:44:16 UTC
The is now available in release551 code base. Marking this as fixed. No QE needed.
Comment 7 Samaresh Panda 2007-02-06 18:08:27 UTC
Following are the links pointing to the encoder wiki pages, which show how the
feature is used.

http://www.glassfishwiki.org/jbiwiki/Wiki.jsp?page=Introduction

http://www.glassfishwiki.org/jbiwiki/Wiki.jsp?page=CustomDefined

Please contact j.xu@Sun.COM or Ching.Lai.Meng@Sun.COM for questions.