Dashboard panel in a plugin

829 views
Skip to first unread message

Nicolas Micoud

unread,
May 21, 2013, 10:53:39 AM5/21/13
to idem...@googlegroups.com
Hi all,

Is it possible to put a dashboard panel (like DPActivities) in a plugin (in order to use new tables handled in this plugin).

Thanks,

Nicolas

Jan Thielemann

unread,
May 21, 2013, 1:13:51 PM5/21/13
to idem...@googlegroups.com
Yes this should be possible. I haven't tried it yet but i guess you have to make the java package from your plugin available via the manifest and also create an entry in the application dictionary. Correct me if am wrong :)

Nicolas Micoud

unread,
May 21, 2013, 1:23:42 PM5/21/13
to idem...@googlegroups.com
Hi,

I will try it.

It means that 'myNewDashboard.class' will be included in the 'core' package ?

Nicolas Micoud

unread,
May 22, 2013, 4:49:32 AM5/22/13
to idem...@googlegroups.com
I've tried, but that's not a success.

Steps:
I move DPActivities from org.adempiere.ui.zk.org.adempiere.dashboard to myPlugin.org.adempiere.webui.dashboard

Then in the MANIFEST of myPlugin, i added org.adempiere.webui.dashboard to the exported packages


Log says :

22 mai 2013 10:45:35 org.adempiere.webui.desktop.DashboardController render
ATTENTION: Failed to create components. zul=/zul/activities.zul
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException: org.adempiere.webui.dashboard.DPActivities



Nicolas

Heng Sin Low

unread,
May 22, 2013, 4:51:04 AM5/22/13
to idem...@googlegroups.com
you have to put your dashboard classes inside a fragment that have org.adempiere.ui.zk as host.


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nicolas Micoud

unread,
May 22, 2013, 4:59:15 AM5/22/13
to idem...@googlegroups.com
Thanks a lot hengsin ; it works !

Is it the way of doing when we need to modify a core class ?

Regards,

Nicolas

Heng Sin Low

unread,
May 22, 2013, 5:00:42 AM5/22/13
to idem...@googlegroups.com
no, you can only add classes using fragment. we need to add more osgi services or extension point for core UI customization.

Heng Sin Low

unread,
May 22, 2013, 5:02:28 AM5/22/13
to idem...@googlegroups.com
another option is to create a fork, make whatever changes you need and make a custom build :)

Nicolas Micoud

unread,
May 22, 2013, 5:11:02 AM5/22/13
to idem...@googlegroups.com
is there a way to identify classes that use fragment ?

Nicolas Micoud

unread,
May 22, 2013, 5:31:59 AM5/22/13
to idem...@googlegroups.com
I think i overjoyed...

It worked when the DPActivities class was missing from org.adempiere.ui.zk.
I've restored it and now, my customized class in not used anymore.

The fragment has 2 classes :
org.adempiere.webui.dashboard.DPActivities
org.adempiere.webui.dashboard.DPViews

(for testing purpose)

It is is the list of the plugin loaded by the launcher.

Here the manifest.mf :

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DevTest
Bundle-SymbolicName: devTest;singleton:=true
Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.adempiere.ui.zk;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.adempiere.webui.dashboard
Bundle-ClassPath: src/,
 .

I've tried to modify some values (exported packages, classpath, ...) but never managed to use the customized classes.

Can you see what i miss ?


Thanks,


Nicolas

Le mercredi 22 mai 2013 10:51:04 UTC+2, hengsin a écrit :

Heng Sin Low

unread,
May 22, 2013, 6:42:21 AM5/22/13
to idem...@googlegroups.com

don't think so. why do you needs to do that?

Heng Sin Low

unread,
May 22, 2013, 6:45:12 AM5/22/13
to idem...@googlegroups.com

you can use the dashboard content edit to use different zul and class. fragment can be used to contribute zul file as well.

Nicolas Micoud

unread,
May 22, 2013, 6:53:34 AM5/22/13
to idem...@googlegroups.com

to know what "objects" can be customized without touching the core.

it seems that fragment could be used for theme ,zul files.

I need to study the difference between a plugin and a fragment.

 

BTW, we made some very specific customization to trees on adempiere swingUI (which uses new tables and model classes).

The goal is to have a view of data from childen tabs from the tree of the main tab.

 

I've integrated those classes in a plugin and now i'm customizing webUI trees (MTree, ADTreePanel, ...).

But, as those trees have to use new classes, i need to move them from the plugin to the core ? Because i can't a way to call a plugin class from the core classes ?

You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/VN7YpJH0jBM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.

Jan Thielemann

unread,
May 22, 2013, 8:03:30 AM5/22/13
to idem...@googlegroups.com
Hi Nicolas,
i think that in your specific case you should branch the trunk and put your changes into the core. What you want to do is not possible with plugins for now.

Nicolas Micoud

unread,
May 22, 2013, 9:04:29 AM5/22/13
to idem...@googlegroups.com

That's what i feared.

Until now, i used plugins for process, callout, model classes, theme and it was just fantastic !

 

Will be hard to use the 'old way' again. But seems that there is no other solutions :(

 

Regards

Jan Thielemann

unread,
May 23, 2013, 2:49:21 AM5/23/13
to idem...@googlegroups.com
I think that there is currently not much work on trees so if you merge regulary you shouldn't get to much problems

Nicolas Micoud

unread,
May 23, 2013, 4:42:25 AM5/23/13
to idem...@googlegroups.com

That's what i have done.

 

So now, my customization are located in 3 places :

 - org.adempiere.ui / org.adempiere.ui.zk : new tables needed by in core classes

 - a plugin : devCommon with callout, process, new tables, ...

 - a fragment : devCustomUiZk : contains a custom theme and a new dashboard:

            - devCustomUiZk/src/org/adempiere/webui/dashboard/DPActivities_Tgi.java

            - theme\expertWebLight\ css ; images ; zul

            - zul\activities_Tgi.zul

 

 

All works perfectly within Eclipse.

But when i try to put the fragment on my idempiere instance, it fails.

 

Seems like the fragment is not correctly installed.

I can't access the login page ; error : Page not found: /theme/expertWebLight/zul/login/login.zul

 

And if i return to the default theme (using ZK_THEME), i can login but can't see the new dashboard.

Log says :

 

10:32:16.856-----------> DashboardController.render: Failed to create components. zul=/zul/activitie
s_Tgi.zul [18]
org.zkoss.zk.ui.UiException: Page not found: /zul/activities_Tgi.zul
at org.zkoss.zk.ui.http.ExecutionImpl.getPageDefinition(ExecutionImpl.java:371)
at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
at org.zkoss.zk.ui.Executions.createComponents(Executions.java:179)
at org.adempiere.webui.desktop.DashboardController.render(DashboardController.java:317)
at org.adempiere.webui.desktop.DefaultDesktop.renderHomeTab(DefaultDesktop.java:279)
at org.adempiere.webui.desktop.DefaultDesktop.access$3(DefaultDesktop.java:272)
at org.adempiere.webui.desktop.DefaultDesktop$5$1.updateUI(DefaultDesktop.java:244)
at org.adempiere.webui.util.ServerPushTemplate$1.onEvent(ServerPushTemplate.java:55)
at org.zkoss.zk.ui.impl.DesktopImpl$ScheduleInfo.invoke(DesktopImpl.java:1551)
at org.zkoss.zk.ui.impl.DesktopImpl$ScheduleInfo.access$1100(DesktopImpl.java:1543)
at org.zkoss.zk.ui.impl.DesktopImpl$ScheduleListener.onEvent(DesktopImpl.java:1566)
at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2742)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2713)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2654)
at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1717)
at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1502)
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1212)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:600)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)

 

 

 

The MANIFEST.MF of devCustomUiZk :

Manifest-Version: 1.0

Bundle-ManifestVersion: 2
Bundle-Name: devCustomUiZk
Bundle-SymbolicName: devCustomUiZk;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .,
zul/,
theme/
Fragment-Host: org.adempiere.ui.zk;bundle-version="1.0.0"
Export-Package: org.adempiere.webui.dashboard;version="1.0.0.qualifier"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.tgi.alfresco
Bundle-Vendor: T.G.I.

 

 

For exporting it, i'm using a feature (devCustomUiZkFeature) ; here's the feature.xml :

 

<?xml version="1.0" encoding="UTF-8"?>
<feature
id="devCustomUiZkFeature"
label="DevCustomUiZkFeature"
version="1.0.0.qualifier"
provider-name="T.G.I.">

<description url="http://www.example.com/description">
bla bla bla
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>

<license url="http://www.example.com/license">
[Enter License Description here.]
</license>

<requires>
<import plugin="org.adempiere.ui.zk" version="1.0.0" match="greaterOrEqual"/>
</requires>

<plugin
id="devCustomUiZk"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"/>

</feature>

 

 

It generates a devCustomUiZk_1.0.0.<timestamp>.jar that i put in the idempiere instance using Felix console.

Its status is 'installed'.

 

 

Any ideas where to look ?

 

Thanks,

 

Nicolas

Heng Sin Low

unread,
May 23, 2013, 4:49:49 AM5/23/13
to idem...@googlegroups.com
instead of using felix console, export the feature from eclipse as a p2 repository, create a copy of the update.sh script and you can install your feature by replacing org.adempiere.server.product with devCustomUiZkFeature.feature.group

Nicolas Micoud

unread,
May 28, 2013, 6:42:50 AM5/28/13
to idem...@googlegroups.com
Hi,

I've added a p2 directory on the idempiere server.
I put in my 3 plugins (devCommon, devThemes and devCustomUiZk) ; as a copy of the files generated from Eclipse.

Then i made a copy of the update.sh file.

Here mine :

cd $(dirname "${0}")
DESTINATION=$(pwd)

REPO=file:/opt/iDempiere/p2

cp idempiere.ini idempiere.ini.sav

java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $REPO -u devCustomUiZkFeature.feature.group

java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $REPO -i devCustomUiZkFeature.feature.group

cp idempiere.ini.sav idempiere.ini




Then if i execute myUpdate.sh, it fails :



Installation failed.
The installable unit devCustomUiZkFeature.feature.group has not been found.
Application failed, log file location: /opt/iDempiere/idempiere.gtk.linux.x86_64/idempiere-server/director/configuration/1369736123396.log
!SESSION 2013-05-28 12:15:23.104 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_09-icedtea
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -application org.eclipse.equinox.p2.director -profileProperties org.eclipse.update.install.features=true -destination /opt/iDempiere/idempiere.gtk.linux.x86_64/idempiere-server -repository file:/opt/iDempiere/p2 -u devCustomUiZkFeature.feature.group
Command-line arguments:  -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination /opt/iDempiere/idempiere.gtk.linux.x86_64/idempiere-server -repository file:/opt/iDempiere/p2 -u devCustomUiZkFeature.feature.group

!ENTRY org.eclipse.equinox.p2.director.app 4 0 2013-05-28 12:15:25.197
!MESSAGE The installable unit devCustomUiZkFeature.feature.group has not been found.
Installation failed.
The installable unit devCustomUiZkFeature.feature.group has not been found.
Application failed, log file location: /opt/iDempiere/idempiere.gtk.linux.x86_64/idempiere-server/director/configuration/1369736126041.log
!SESSION 2013-05-28 12:15:25.757 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_09-icedtea
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -application org.eclipse.equinox.p2.director -profileProperties org.eclipse.update.install.features=true -destination /opt/iDempiere/idempiere.gtk.linux.x86_64/idempiere-server -repository file:/opt/iDempiere/p2 -i devCustomUiZkFeature.feature.group
Command-line arguments:  -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination /opt/iDempiere/idempiere.gtk.linux.x86_64/idempiere-server -repository file:/opt/iDempiere/p2 -i devCustomUiZkFeature.feature.group

!ENTRY org.eclipse.equinox.p2.director.app 4 0 2013-05-28 12:15:27.874
!MESSAGE The installable unit devCustomUiZkFeature.feature.group has not been found.



Any idea ?

BTW, i  notice that sometimes (can't explain how or when) the devCustomUiZk fragment status is 'fragment' (and so is available). But seems not 100% sure, so i'd prefer to have the p2 solution working.


Thanks,


Nicolas

Heng Sin Low

unread,
May 28, 2013, 6:45:21 AM5/28/13
to idem...@googlegroups.com
You can't just copy the jar files over to create a p2 repository, you have to do the export feature from Eclipse to create that.

Nicolas Micoud

unread,
May 28, 2013, 6:52:49 AM5/28/13
to idem...@googlegroups.com

I'm using the Export Wizard from Eclipse (to a directory).

Then i copy the generated files and directories on the server (/opt/iDempiere/p2)

 

There, i have :

/opt/iDempiere/p2

 - features

      - devCustomUiZlFeature_1.0.0.201305281248

 - plugins

      - devCustomUiZk_1.0.0.201305281248

 - artifacts.jar

 - content.jar

 

 

Should i do it differently ?

Heng Sin Low

unread,
May 30, 2013, 10:29:58 PM5/30/13
to idem...@googlegroups.com
is devCustomUiZkFeature the correct feature id ? 

<feature
      id="org.adempiere.base"
      label="Adempiere Base"
      version="1.0.0.qualifier">

for e.g, for base feature, the id is org.adempiere.base and for installation, you would have to use org.adempiere.base.feature.group

Nicolas Micoud

unread,
May 31, 2013, 5:59:57 AM5/31/13
to idem...@googlegroups.com

Ooops... the id was devCustomUiZlFeature

 

I've corrected this and now, scripts can be applied.

So, now i can install devCommon and devCustomUiZk using "my" update.sh

>>

Installing xxx.feature.group 1.0.0.201305311127.
Operation completed in 8522 ms.

 

but the status is still 'Installed' for the fragment devCustomUiZk :(

I notice also that i had to start devCommon manually through Felix (whereas it started automatically when installing with Felix).

 

Any idea ?

 

Thanks,

 

Nicolas

Jan Thielemann

unread,
Jun 3, 2013, 6:51:19 AM6/3/13
to idem...@googlegroups.com
Hello,
i created a fragment project with a DashboardPanel by myself and i have the same problem as Nicolas. After installing the fragment, the state never switches from installed to fragment like on other fragments. When i try to load my DashboardPanel i get the same error:

12:22:03.400-----------> DashboardController.render: Failed to create components. zul=/zul/invoices.zul [15]
org.zkoss.zk.ui.UiException: Page not found: /zul/invoices.zul

I wonder what i am doing wrong. If you can help me to find out how to create a DashboardPanel fragment, i'll write a tutorial on the wiki.


Jan Thielemann

unread,
Jun 5, 2013, 3:46:33 AM6/5/13
to idem...@googlegroups.com
I found the solution. After installing the fragment, you have to refresh the ui.zk package.

Carlos Antonio Ruiz Gomez

unread,
Jun 5, 2013, 9:17:01 AM6/5/13
to idem...@googlegroups.com
Thanks Jan for sharing that info.

I find your wiki tutorials very useful.

Regards,

Carlos Ruiz

Heng Sin Low

unread,
Jun 7, 2013, 2:21:47 PM6/7/13
to idem...@googlegroups.com

have you try installing the fragment using the p2 approach ? Just wondering whether the refresh is needed if installation is done through p2.

Reply all
Reply to author
Forward
0 new messages