Hi
I tried to use the PieChartable extension.
I added the component factory.
@Singleton
public class ComponentFactoryRegistrarForQuickStart extends
ComponentFactoryRegistrarDefault {
@Override
public void addComponentFactories(ComponentFactoryList componentFactories) {
super.addComponentFactories(componentFactories);
//////////////////
componentFactories.add(new
CollectionOfEntitiesAsPieChartablesFactory());
/////////////
}
added a class Pie
public class Pie implements PieChartable {
double value;
String label;
public Pie(String label, double value) {
this.label = label;
this.value = value;
}
@Override
public double getPieChartValue() {
return value;
}
@Override
@Title
public String getPieChartLabel() {
return label;
}
}
Added an action 'showPie()' in ToDoItems:
public List<Pie> showPie(){
ArrayList<Pie> pList = new ArrayList<Pie>();
for (int i=0; i<10; i++){
Pie p = new Pie("Piece of Cake " + i, i * 1.1);
pList.add(p);
}
return pList;
}
But the list only shows the pie values as a table view.
The complete source code is here (added myApp, which is the vanilla quickstart
archetype with the few changes I've mentioned)
https://github.com/chris58/isiswicketextensions.git
Christian
________________________________________
From: Christian Steinebach [[email protected]]
Sent: Wednesday, January 16, 2013 5:59 PM
To: [email protected]
Subject: RE: isis compile from source, gmaps2 widget?
Hei everybody!
I created a repository at github with
https://github.com/chris58/isiswicketextensions.git with
- view-calendarviews
- view-cooldatasoftmenu
- view-gmap2
- view-googlecharts
they 'almost' compile with the isis 1.0.0 release.
googlecharts compiles and installs (haven't tested it yet, though).
I changed the poms, updated the import statements etc. to make it compile
without knowing so well what I was doing... ;-)
I am mostly interested in the gmap2 extension.
To make the gmap2 view compile there are 2 problems
- ImageCache, only ImageResourceCache is available, but then s.th. to replace
findImage() is missing.
- urlFor()
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Wicket Viewer: Gmap2 .............................. SUCCESS [0.002s]
[INFO] Wicket Viewer: Gmap2 AppLib ....................... SUCCESS [1.975s]
[INFO] Wicket Viewer: Gmap2 View ......................... FAILURE [1.985s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.131s
[INFO] Finished at: Wed Jan 16 17:55:04 CET 2013
[INFO] Final Memory: 12M/110M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile)
on project wicket-view-gmap2-view: Compilation failure: Compilation failure:
[ERROR]
/home/chris/NetBeansProjects/views/view-gmap2/view/src/main/java/org/apache/isis/extensions/wicket/view/gmap2/collection/locatable/CollectionOfEntitiesAsLocatables.java:[138,39]
cannot find symbol
[ERROR] symbol : method
urlFor(org.apache.wicket.request.resource.ResourceReference)
[ERROR] location: class
org.apache.isis.extensions.wicket.view.gmap2.collection.locatable.CollectionOfEntitiesAsLocatables
[ERROR]
[ERROR]
/home/chris/NetBeansProjects/views/view-gmap2/view/src/main/java/org/apache/isis/extensions/wicket/view/gmap2/collection/locatable/CollectionOfEntitiesAsLocatables.java:[158,47]
cannot find symbol
[ERROR] symbol : method findImage(java.lang.String)
[ERROR] location: interface
org.apache.isis.viewer.wicket.model.models.ImageResourceCache
[ERROR]
[ERROR]
/home/chris/NetBeansProjects/views/view-gmap2/view/src/main/java/org/apache/isis/extensions/wicket/view/gmap2/collection/locatable/CollectionOfEntitiesAsLocatables.java:[163,43]
cannot find symbol
[ERROR] symbol : method
findImage(org.apache.isis.core.metamodel.spec.ObjectSpecification)
[ERROR] location: interface
org.apache.isis.viewer.wicket.model.models.ImageResourceCache
Any help appreciated :-)
Christian
________________________________________
From: Dan Haywood [[email protected]]
Sent: Tuesday, January 15, 2013 2:54 PM
To: [email protected]
Subject: Re: isis compile from source, gmaps2 widget?
On 15 January 2013 13:05, Christian Steinebach <
[email protected]> wrote:
> Hi,
>
> Googling isis I found some extension which was supposed to show objects on
> a map when they
> implemented a Locatable interface. Is there a plan to add this feature
> back into isis?
>
Yes, most probably. I need to ensure that the license of the gmap2 stuff
is compatible with ASF, though.
> I 'located' the source code, but I have no clue on how to extend the
> wicket viewer
> to use it (neither how to compile it).
>
That's done by writing ComponentFactory and registering into
ComponentFactory registry; see [1]; also [2] and [3] show an example.
> Plan was to download the source code for isis, try to compile it and then
> have a look
> at the gmap2 extension whether I could figure out something.
>
> Yup, makes sense.
> I could not compile isis from the source. I cloned using git, moved to the
> root directory,
>
> 'mvn install'
>
> [INFO] 3 errors
> [INFO] -------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Apache Isis Core .................................. SUCCESS [4.493s]
> [INFO] Isis Core AppLib .................................. SUCCESS [5.681s]
> [INFO] Isis Core Unit Test Support ....................... SUCCESS [2.361s]
> [INFO] Isis Core MetaModel ............................... FAILURE [4.614s]
> ...
> ...
> ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile
> (default-compile) on project isis-core-metamodel: Compilation failure:
> Compilation failure:
> [ERROR]
> /home/chris/NetBeansProjects/isis/core/metamodel/src/main/java/org/apache/isis/core/commons/factory/InstanceUtil.java:[66,35]
> invalid inferred types for T; inferred type does not conform to declared
> bound(s)
> [ERROR] inferred: T
> [ERROR] bound(s): R
> [ERROR]
> [ERROR]
> /home/chris/NetBeansProjects/isis/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java:[143,89]
> invalid inferred types for T; inferred type does not conform to declared
> bound(s)
> [ERROR] inferred: org.apache.isis.core.metamodel.facets.FacetFactory
> [ERROR] bound(s): R
> [ERROR]
> [ERROR]
> /home/chris/NetBeansProjects/isis/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java:[157,85]
> invalid inferred types for T; inferred type does not conform to declared
> bound(s)
> [ERROR] inferred: org.apache.isis.core.metamodel.facets.FacetFactory
> [ERROR] bound(s): R
> [ERROR] -> [Help 1]
> [ERROR]
>
>
Hmm, that's more of an issue. Which version of Java did you build with? I
use Java 1.6, so if you use Java 7 then perhaps the compiler is more fussy?
Dan
[1]
https://github.com/apache/isis/blob/master/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
[2]
https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/viewer-webapp/src/main/java/app/QuickStartApplication.java
[3]
https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/viewer-webapp/src/main/java/app/ComponentFactoryRegistrarForQuickStart.java
> Christian
>