How to use D3 Component library plugin in Require.js Dashboard.?Right now d3 component library is missing in Require.js dashboard.
Anyone have faced the same problem.Please suggest any workaround for this.
Printable View
How to use D3 Component library plugin in Require.js Dashboard.?Right now d3 component library is missing in Require.js dashboard.
Anyone have faced the same problem.Please suggest any workaround for this.
The issue is with outdated cpk libs. We're working on fixing it but you can just take the cpk libs from sparkl or so and should work
Other than the problem with CPK libraries, the plugin only provides components for the legacy dashboards.
The conversion of the components to RequireJS should present no challenge though.
The code is available at https://github.com/webdetails/d3ComponentLibrary
If you do end up porting the components to RequireJS, please consider submitting a pull request to so that the community benefits from the update.
As you suggest i have copied the cpk libs ie cpk-core-7.1.0.0-12,cpk-pentaho5-7.1.0.0-12 from the sparkl plugin.Getting below mentioned error:
org.pentaho.caching.impl.PentahoCacheManagerFactory$RegistrationHandler$1.onSuccess New Caching Service registered
14:32:55,994 ERROR [Logger] Error: Pentaho
14:32:55,999 ERROR [Logger] misc-class org.pentaho.platform.plugin.services.pluginmgr.PentahoSystemPluginManager: PluginManager.ERROR_0011 - Failed to register plugin d3ComponentLibrary
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'd3ComponentLibrary.api' defined in file [G:\shared\p7.1\pentaho-server\pentaho-solutions\system\d3ComponentLibrary\plugin.spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [pt.webdetails.cpk.CpkApi]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: pt/webdetails/cpf/utils/XmlParserFactoryProducer
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.pentaho.platform.plugin.services.pluginmgr.PentahoSystemPluginManager.reload(PentahoSystemPluginManager.java:286)
at org.pentaho.platform.plugin.services.pluginmgr.PentahoSystemPluginManager.reload(PentahoSystemPluginManager.java:176)
at org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter.startup(PluginAdapter.java:40)
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:443)
at org.pentaho.platform.engine.core.system.PentahoSystem$2.call(PentahoSystem.java:434)
at org.pentaho.platform.engine.core.system.PentahoSystem.runAsSystem(PentahoSystem.java:413)
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:434)
at org.pentaho.platform.engine.core.system.PentahoSystem.access$000(PentahoSystem.java:84)
at org.pentaho.platform.engine.core.system.PentahoSystem$1.call(PentahoSystem.java:365)
at org.pentaho.platform.engine.core.system.PentahoSystem$1.call(PentahoSystem.java:362)
at org.pentaho.platform.engine.core.system.PentahoSystem.runAsSystem(PentahoSystem.java:413)
at org.pentaho.platform.engine.core.system.PentahoSystem.notifySystemListenersOfStartup(PentahoSystem.java:362)
at org.pentaho.platform.engine.core.system.PentahoSystem.init(PentahoSystem.java:332)
at org.pentaho.platform.engine.core.system.PentahoSystem.init(PentahoSystem.java:228)
at org.pentaho.platform.web.http.context.SolutionContextListener.contextInitialized(SolutionContextListener.java:162)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [pt.webdetails.cpk.CpkApi]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: pt/webdetails/cpf/utils/XmlParserFactoryProducer
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
... 38 more
Caused by: java.lang.NoClassDefFoundError: pt/webdetails/cpf/utils/XmlParserFactoryProducer
at pt.webdetails.cpk.CpkEngine.loadElements(CpkEngine.java:232)
at pt.webdetails.cpk.CpkEngine.reload(CpkEngine.java:158)
at pt.webdetails.cpk.CpkEngine.initializeKettleResultCache(CpkEngine.java:147)
at pt.webdetails.cpk.CpkEngine.init(CpkEngine.java:110)
at pt.webdetails.cpk.CpkCoreService.<init>(CpkCoreService.java:51)
at pt.webdetails.cpk.CpkApi.init(CpkApi.java:87)
at pt.webdetails.cpk.CpkApi.<init>(CpkApi.java:81)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
... 40 more
Caused by: java.lang.ClassNotFoundException: pt.webdetails.cpf.utils.XmlParserFactoryProducer
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.pentaho.platform.plugin.services.pluginmgr.PluginClassLoader.loadClass(PluginClassLoader.java:193)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 52 more
What you are asking is for a full-blown tutorial. Currently I don't have that much time available.
Start by reading http://redmine.webdetails.org/projec...wiki/RequireJS
Take a look at https://github.com/webdetails/sparkl for some inspiration: that plugin contains the legacy and requirejs variants of the "SparklPluginCardComponent".
You'll see that the file plugin.xml declares a requirejs configuration file
Near the end of sparkl-require-js-cfg.js, you'll see the definition of an AMD id for the module that returns the requirejs variant of the component:Code:<external-resources>
<file context="requirejs">content/sparkl/resources/sparkl-require-js-cfg.js</file>
</external-resources>
You'll need to know that the requireJS variant of the component is located under resources/amd-component, and that the file resources/components/SparklCards/component.xml was modified to add support for the requireJS variant:Code:requirePaths['sparkl/components/SparklPluginCardComponent'] = prefix + '/SparklCards/SparklPluginCardComponent';
Dive into the code, compare legacy and requireJS variants.Code:<Implementation supportsLegacy="true" supportsAMD="true">
@crusso As per your guideline i have done changes :
I have defined the require.js configuration in plugin.xml:
in the d3-require-js-cfg.js I have defined the definition of an AMD id for the module that returns the requirejs variant of the component:Code:<external-resources>
<file context="requirejs">content/d3ComponentLibrary/resources/d3-require-js-cfg.js</file>
</external-resources>
Also modified the component.xml file to add the support of Require.jsCode:requirePaths['d3ComponentLibrary/components/d3ComponentBase'] = prefix + '/common/d3ComponentBase';
requirePaths['d3ComponentLibrary/components/box'] = prefix + '/d3BoxPlots/d3BoxPlots';
requirePaths['d3ComponentLibrary/components/d3CalendarView'] = prefix + '/d3CalendarView/d3CalendarView';
requirePaths['d3ComponentLibrary/components/d3Component'] = prefix + '/d3Component/d3Component';
requirePaths['d3ComponentLibrary/components/MotionScatterPlot'] = prefix + '/d3MotionScatterPlot/d3MotionScatterPlot';
requirePaths['d3ComponentLibrary/components/d3ScatterplotMatrix'] = prefix + '/d3ScatterplotMatrix/d3ScatterplotMatrix';
But i am getting the error which i have mentioned below :Code:<Implementation supportsLegacy="true" supportsAMD="true">
if possible can you please tell me where i m doing wrong .Code:org.pentaho.platform.plugin.services.pluginmgr.SystemPathXmlPluginProvider: SystemPathXmlPluginProvider.ERROR_0001 - Failed to process plugin in G:\shared\p7.1\pentaho-server\pentaho-solutions\system\d3ComponentLibrary
org.pentaho.platform.api.engine.PlatformPluginRegistrationException: PluginManager.ERROR_0005 - Failed to process plugin.xml: system/d3ComponentLibrary/plugin.xml
Most likely you simply pasted the block <external-resources> outside of the <plugin> tag, or violated some XML.
I would need to see the entire plugin.xml to tell what's wrong
@crusso Thanks for your guideline and finally i am able to see D3 Component .when i am creating sample dashboard with the help D3 component then i am unable to see the chart and getting below mentioned error:
Code:Error: Script error for: d3ComponentLibrary/components/D3Component http://requirejs.org/docs/errors.html#scripterror
You have typos in the require js config file.
You should have
Note the letter casingCode:requirePaths['d3ComponentLibrary/components/D3Component'] = prefix + '/d3Component/d3Component';
@crusso getting below mentioned error after the changes:
Also ,i have mentioned below the d3-require-js-cfg.Let me know where i am doing wrong :Code:ReferenceError: D3ComponentBase is not defined[Learn More] d3Component.js
TypeError: D3Component is not a constructor[Learn More] generatedContent:76:17
Code:/**
* RequireJS configuration file for d3ComponentLibrary
*/
(function() {
var requirePaths = requireCfg.paths;
var prefix;
if(typeof KARMA_RUN !== "undefined") { // unit tests
prefix = requirePaths['d3ComponentLibrary/components'] = 'resources/amd-components';
} else if(typeof CONTEXT_PATH !== "undefined") { // production
prefix = requirePaths['d3ComponentLibrary/components'] = CONTEXT_PATH +'api/repos/d3ComponentLibrary/resources/amd-components';
} else if(typeof FULL_QUALIFIED_URL != "undefined") { // embedded production
prefix = requirePaths['d3ComponentLibrary/components'] = FULL_QUALIFIED_URL + 'api/repos/d3ComponentLibrary/resources/amd-components';
} else { // build
prefix = requirePaths['d3ComponentLibrary/components'] = '../resources/amd-components';
}
requirePaths['d3ComponentLibrary/components/D3ComponentBase'] = prefix + '/common/d3ComponentBase';
requirePaths['d3ComponentLibrary/components/D3BoxPlots'] = prefix + '/d3BoxPlots/d3BoxPlots';
requirePaths['d3ComponentLibrary/components/D3CalendarView'] = prefix + '/d3CalendarView/d3CalendarView';
requirePaths['d3ComponentLibrary/components/D3Component'] = prefix + '/d3Component/d3Component';
requirePaths['d3ComponentLibrary/components/D3MotionScatterPlot'] = prefix + '/d3MotionScatterPlot/d3MotionScatterPlot';
requirePaths['d3ComponentLibrary/components/D3ScatterplotMatrix'] = prefix + '/d3ScatterplotMatrix/d3ScatterplotMatrix';
})();
The problem now lies within d3Component.js
You probably failed to declare a define block:
Code:define(['d3ComponentLibrary/components/D3BaseComponent'], function(D3BaseComponent){
return ....
});
@crusso thanks for your quick response..i have changes the file which is located at :system\d3ComponentLibrary\resources\amd-components\d3Component
After changes my files looks like :
it is correct ?Code:/*
* d3 component, using the d3ComponentBase
*/
define(['d3ComponentLibrary/components/D3BaseComponent'], function(D3BaseComponent){
var D3Component = D3ComponentBase.extend({
defaultWidth: 600,
defaultHeight: 400
});
});
just add:
return D3Component;
@crusso: getting same error as like previously
Code:GET http://localhost:8083/pentaho/api/repos/d3ComponentLibrary/resources/amd-components/D3BaseComponent.js [HTTP/1.1 404 Not Found 12ms]
Error: Script error for: d3ComponentLibrary/components/D3BaseComponenthttp://requirejs.org/docs/errors.html#scripterror
This is no proper way for debugging code. You would need to post the code somewhere, e.g. your own fork of the component in github, so that people can inspect the code
Actually, the problem is another typo:
Note that every js file under amd-components must be edited to be contained within define() blocks.Code:
/*
* d3 component, using the d3ComponentBase
*/
define(['d3ComponentLibrary/components/D3ComponentBase'], function(D3ComponentBase){
var D3Component = D3ComponentBase.extend({
defaultWidth: 600,
defaultHeight: 400
});
return D3Component;
});
As per my understanding, we need to make compatible of d3ComponentBase.js with require.js.The d3ComponentBase.js code i have mentioned below:
Code:
/*
* d3 component, using the chartComponent
*/
var D3ComponentBase = ChartComponent.extend({
defaultWidth: 600,
defaultHeight: 400,
update : function() {
if (this.parameters == undefined) {
this.parameters = [];
};
this.renderChart();
},
render: function(values) {
this.customfunction.call(this,values);
},
cdaResultToD3Array: function(d){
var result = [];
_.each(d.resultset,function(row, o){
var line = {};
_.each(row,function(cell,idx){
line[_.findWhere(d.metadata,{colIndex:idx})["colName"]] = cell;
});
result.push(line);
});
return result;
},
getHeight: function(){
var $ph = this.placeholder();
return this.height?this.height:($ph.height()>0?$ph.height():this.defaultHeight);
},
getWidth: function(){
var $ph = this.placeholder();
return this.width?this.width:($ph.width()>0?$ph.width():this.defaultWidth);
}
});
In this case you need to have:
I hope you were able to pick up the pattern hereCode:define(["cdf/components/ChartComponent"], function(ChartComponent){
// content of legacy d3ComponentBase.js goes here
return D3ComponentBase;
});
@crusso: same pattern already follow but getting same error :
But i have copied my code in github repository and provides the link https://github.com/sumit140/d3componentlibraryCode:Error: Script error for: d3ComponentLibrary/components/D3ComponentBasehttp://requirejs.org/docs/errors.html#scripterror
RequireJS is failing to find the module at the path d3ComponentLibrary/components/D3ComponentBase
You shouldn't have deleted the requirejs path definitions for all the other modules, as you had initially. Keep the config file as:
Code:/**
* RequireJS configuration file for d3ComponentLibrary
*/
(function() {
var requirePaths = requireCfg.paths;
var prefix;
if(typeof KARMA_RUN !== "undefined") { // unit tests
prefix = requirePaths['d3ComponentLibrary/components'] = 'resources/amd-components';
} else if(typeof CONTEXT_PATH !== "undefined") { // production
prefix = requirePaths['d3ComponentLibrary/components'] = CONTEXT_PATH +'api/repos/d3ComponentLibrary/resources/amd-components';
} else if(typeof FULL_QUALIFIED_URL != "undefined") { // embedded production
prefix = requirePaths['d3ComponentLibrary/components'] = FULL_QUALIFIED_URL + 'api/repos/d3ComponentLibrary/resources/amd-components';
} else { // build
prefix = requirePaths['d3ComponentLibrary/components'] = '../resources/amd-components';
}
requirePaths['d3ComponentLibrary/components/D3ComponentBase'] = prefix + '/common/d3ComponentBase';
requirePaths['d3ComponentLibrary/components/D3BoxPlots'] = prefix + '/d3BoxPlots/d3BoxPlots';
requirePaths['d3ComponentLibrary/components/D3CalendarView'] = prefix + '/d3CalendarView/d3CalendarView';
requirePaths['d3ComponentLibrary/components/D3Component'] = prefix + '/d3Component/d3Component';
requirePaths['d3ComponentLibrary/components/D3MotionScatterPlot'] = prefix + '/d3MotionScatterPlot/d3MotionScatterPlot';
requirePaths['d3ComponentLibrary/components/D3ScatterplotMatrix'] = prefix + '/d3ScatterplotMatrix/d3ScatterplotMatrix';
})();
@crusso: thanks a lot for the help .but i have already tried the same thing and also i have updated my whole complete code in github:https://github.com/sumit140/d3componentlibrary getting same error as like previous:
Code:Error: Script error for: d3ComponentLibrary/components/D3ComponentBasehttp://requirejs.org/docs/errors.html#scripterror
This is beyond what can be done via forum messaging.
Here's a bunch of things you can try
0) Restart the server. The message you are getting may mean that the requirejs configuration is not loaded. It is only loaded when the server/plugin starts, afaik.
1) Try to refer to D3ComponentBase using a relative path, e.g.
2) Remove all component.xml from within resources/amd-components, and add define blocks for all js files within amd-components.Code:define(['../commons/d3ComponentBase'], function(D3ComponentBase){
...
Do not delete the component.xml files within resources/components
After all the changes i am getting this error in console :
in log getting this errorCode:Error: Script error for: d3ComponentLibrary/commons/d3ComponentBasehttp://requirejs.org/docs/errors.html#scripterror
Code:2017-07-25 17:56:34,445 ERROR [org.pentaho.platform.engine.core.system.objfac.references.AbstractPentahoObjectReference] Error creating object. Null will be returned.org.pentaho.platform.api.engine.ObjectFactoryException: Error creating instance
at org.pentaho.platform.engine.core.system.objfac.references.PrototypePentahoObjectReference.createObject(PrototypePentahoObjectReference.java:34)
at org.pentaho.platform.engine.core.system.objfac.references.AbstractPentahoObjectReference.getObject(AbstractPentahoObjectReference.java:43)
at org.pentaho.platform.engine.core.system.objfac.AggregateObjectFactory.get(AggregateObjectFactory.java:267)
at org.pentaho.platform.engine.core.system.PentahoSystem.get(PentahoSystem.java:684)
at org.pentaho.platform.plugin.services.pluginmgr.PentahoSystemPluginManager.getContentGenerator(PentahoSystemPluginManager.java:864)
at org.pentaho.platform.web.http.api.resources.RepositoryResource$ContentTypeCGFactory.create(RepositoryResource.java:804)
at org.pentaho.platform.web.http.api.resources.RepositoryResource.getContentGeneratorResponse(RepositoryResource.java:874)
at org.pentaho.platform.web.http.api.resources.RepositoryResource.doService(RepositoryResource.java:688)
at org.pentaho.platform.web.http.api.resources.RepositoryResource.doGet(RepositoryResource.java:598)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at org.pentaho.platform.web.servlet.JAXRSServlet.service(JAXRSServlet.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.pentaho.platform.web.servlet.JAXRSServlet.service(JAXRSServlet.java:114)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.pentaho.platform.web.http.filters.PentahoWebContextFilter.doFilter(PentahoWebContextFilter.java:195)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.pentaho.platform.web.http.filters.PentahoRequestContextFilter.doFilter(PentahoRequestContextFilter.java:87)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at org.pentaho.platform.web.http.filters.PreFlightReportingFilter.doFilter(PreFlightReportingFilter.java:47)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.pentaho.platform.web.http.security.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:191)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215)
at org.pentaho.platform.web.http.security.PentahoBasicProcessingFilter.doFilterInternal(PentahoBasicProcessingFilter.java:125)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.pentaho.platform.web.http.filters.HttpSessionPentahoSessionIntegrationFilter.doFilter(HttpSessionPentahoSessionIntegrationFilter.java:271)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.pentaho.platform.web.http.filters.SystemStatusFilter.doFilter(SystemStatusFilter.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.pentaho.platform.web.http.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:114)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.pentaho.platform.web.http.filters.WebappRootForwardingFilter.doFilter(WebappRootForwardingFilter.java:70)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.pentaho.platform.web.http.filters.PentahoPathDecodingFilter.doFilter(PentahoPathDecodingFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2521)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2510)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: pt.webdetails.cpk.CpkContentGenerator cannot be cast to org.pentaho.platform.api.engine.IContentGenerator
Ok, so the relative path did not work, you'll need to keep using the absolute path: "d3ComponentLibrary/components/D3ComponentBase"
Also, note that in your requirejs config file there is a typo on the path:
It should beCode:requirePaths['d3ComponentLibrary/components/D3ComponentBase'] = prefix + '/common/d3ComponentBase';
Code:requirePaths['d3ComponentLibrary/components/D3ComponentBase'] = prefix + '/commons/d3ComponentBase';
@crusso: finally there is no error on console regarding the d3component library .thanks a lot for your time and effort which you have put on this thread.
After writing the d3 chart code getting some other error which i have mentioned below that i am trying to resolve :
Code:[error] WD: TypeError: Cannot read property 'each' of undefined
localhost:8083/pentaho/plugin/pentaho-cdf/api/resources/js/compressed/Logger.js:4
My guess is that there is a missing dependency. For instance, on https://github.com/sumit140/d3compon...entBase.js#L27 the code assumes underscore has been loaded.
Try to replace the header of the define block:
Code:define(["cdf/components/ChartComponent", "cdf/lib/underscore"], function(ChartComponent, _){
If you are willing to share your effort with the community, you could place a pull request against the main git repository.
A pull request typically means a professional will review and validate the code.
Once merged, your changes justify a new version of the plugin that could appear in the marketplace.