Что такое портлеты? Описание портлетной технологии. Презентация портлетов.
Sunday, January 11, 2009
Tuesday, December 9, 2008
Reverse-engineer Source Code into UML Diagrams
Look at the maven pom file at http://svn.exoplatform.org/projects/portlet-container/tags/2.0.12/component/core/pom-with-javadoc-pictures.xml
How to use in maven
org.apache.maven.plugins
maven-javadoc-plugin
org.exoplatform.services.portletcontainer.test
org.umlgraph.doclet.UmlGraphDoc
/home/alexey/java/eXoProjects/portlet-container/trunk/component/core/UmlGraph.jar
-views
Install dependency program:
sudo apt-get install graphviz
Maven command:
mvn site
PACKAGE org.exoplatform.services.portletcontainer.pci
1. views
2. inferrel and inferdep
3. inferrel, inferdep, operations and constructors

CLASS ActionInput
1. views
2. inferrel and inferdep
3. inferrel, inferdep, operations and constructors

CLASS Input
1. views
2. inferrel and inferdep
3. inferrel, inferdep, operations and constructors

http://java.dzone.com/articles/reverse-engineer-source-code-u
It works pretty good!!!
Documentation here
google codesearch ? pom.xml + UmlGraphDoc
google codesearch ? pom.xml + org.umlgraph.doclet.UmlGraphDoc
mvn site
1. views
2. inferrel and inferdep
3. inferrel, inferdep, operations and constructors
CLASS ActionInput
1. views
2. inferrel and inferdep
3. inferrel, inferdep, operations and constructors
CLASS Input
1. views
2. inferrel and inferdep
3. inferrel, inferdep, operations and constructors
http://java.dzone.com/articles/reverse-engineer-source-code-u
It works pretty good!!!
What Gets Drawn
- -all
- Same as
-attributes-operations-visibility-types-enumerations-enumconstants - -attributes
- Show class attributes (Java fields)
- -commentname
- Name the element using the text in the javadoc comment, instead of the name of its class.
- -constructors
- Show a class's constructors
- -enumconstants
- When showing enumerations, also show the values they can take.
- -enumerations
- Show enumarations as separate stereotyped primitive types.
- -hide
- Specify entities to hide from the graph. Matching is done using a non-anchored regular match. For instance, "
-hide (Big|\.)Widget" would hide "com.foo.widgets.Widget" and "com.foo.widgets.BigWidget". Can also be used without arguments, in this case it will hide everything (useful in the context of views to selectively unhide some portions of the graph, see the view chapter for further details). - -operations
- Show class operations (Java methods)
- -qualify
- Produce fully-qualified class names.
- -types
- Add type information to attributes and operations
- -view
- Specify the fully qualified name of a class that contains a view definition. Only the class diagram specified by this view will be generated.
See the views chapter for more details. - -views
- Generate a class diagram for every view found in the source path.
- -visibility
- Adorn class elements according to their visibility (private, public, protected, package)
Relationship Inference
- -collpackages
- Specify the classes that will be treated as containers for one to many relationships when inference is enabled. Matching is done using a non-anchored regular match. Empty by default.
- -inferdep
- Try to automatically infer dependencies between classes by inspecting methods and fields. See the class diagram inference chapter for more details. Disabled by default.
- -inferdepinpackage
- Enable or disable dependency inference among classes in the same package. This option is disabled by default, because classes in the same package are supposed to be related anyway, and also because there's no working mechanism to actually detect all of these dependencies since imports are not required to use classes in the same package.
- -inferdepvis
- Specifies the lowest visibility level of elements used to infer dependencies among classes. Possible values are private, package, protected, public, in this order. The default value is private. Use higher levels to limit the number of inferred dependencies.
- -inferrel
- Try to automatically infer relationships between classes by inspecting field values. See the class diagram inference chapter for further details. Disabled by default.
- -inferreltype
- The type of relationship inferred when -inferrel is activated. Defaults to "navassoc" (see the class modelling chapter for a list of relationship types).
- -useimports
- Will also use imports to infer dependencies. Disabled by default, since it does not work properly if there are multiple classes in the same source file (will add dependencies to every class in the source file).
google codesearch ? pom.xml + UmlGraphDoc
google codesearch ? pom.xml + org.umlgraph.doclet.UmlGraphDoc
Friday, December 5, 2008
SAXException2: missing an @XmlRootElement annotation
PROBLEM
Caused by: com.sun.istack.SAXException2: unable to marshal type "org.exoplatform.training.portlet.eventing.AddressBookEntry" as an element because it is missing an @XmlRootElement annotation
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:244)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:303)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
... 67 more
[com.sun.istack.SAXException2: unable to marshal type "org.exoplatform.training.portlet.eventing.AddressBookEntry" as an element because it is missing an @XmlRootElement annotation]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at org.exoplatform.services.portletcontainer.plugins.pc.portletAPIImp.StateAwareResponseImp.validateWithJAXB(StateAwareResponseImp.java:244)
at org.exoplatform.services.portletcontainer.plugins.pc.portletAPIImp.StateAwareResponseImp.setEvent(StateAwareResponseImp.java:263)
SOLUTION
As the error message suggests, one way is to put @XmlRootElement on your class. Another way is to use JAXBElement like this:
Caused by: com.sun.istack.SAXException2: unable to marshal type "org.exoplatform.training.portlet.eventing.AddressBookEntry" as an element because it is missing an @XmlRootElement annotation
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:244)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:303)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
... 67 more
[com.sun.istack.SAXException2: unable to marshal type "org.exoplatform.training.portlet.eventing.AddressBookEntry" as an element because it is missing an @XmlRootElement annotation]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at org.exoplatform.services.portletcontainer.plugins.pc.portletAPIImp.StateAwareResponseImp.validateWithJAXB(StateAwareResponseImp.java:244)
at org.exoplatform.services.portletcontainer.plugins.pc.portletAPIImp.StateAwareResponseImp.setEvent(StateAwareResponseImp.java:263)
SOLUTION
As the error message suggests, one way is to put @XmlRootElement on your class. Another way is to use JAXBElement like this:
marshaller.marshal( new JAXBElement(new QName("nsUri","local"), AddNumbersResponse.class, result), ... );
Sample at here MyEventPub
Thanks to kohsuke at forums.java.net
Subscribe to:
Posts (Atom)