Giter Club home page Giter Club logo

tapa's Introduction

tapa

What it does?

Tapa is a PUCLogin modifier that also delivers css/js injection to Pentaho User Console. And it does it in a minimally invasive fashion. The plugin installs itself and only patches your PUCLogin.jsp and your applicationContext-spring-security.xml - keeping backups of both.

Why tapa?

Tapa uses Pebble template engine to simplify your job while customizing Pentaho's login page.

And because it also injects js/css files to your Mantle context in the best way possible you can take advantage of this to make modifications on your Pentaho User Console and/or deliver some js applications through Pentaho js APIs.

How to install

The easy way

  1. Open Marketplace on your Pentaho User Console
  2. Find tapa and install it;
  3. Restart your Pentaho Server 2x (yes, twice);

If you have the Pentaho Server Enterprise, you need to first activate Marketplace on your server. To see how, open the Marketplace page and click "Find Marketplace".

If you prefer install the hard way, you can clone it directly:

$ cd pentaho-solutions/system
$ git clone https://github.com/marpontes/tapa.git tapa

Using it

The installed templates are located into:

tapa/resources/templates/[template-name]/

Tapa delivers the following features:

  • Change Pentaho User Console Login page to a custom one;
  • Tapa admin-ui perspective from the Pentaho User Console;
  • Ability to open admin-ui in a new browser tab;
  • Expose <TEMPLATE_ROOT>/assets/* to non-authenticated users.
  • Enable and disable Tapa from the Tapa admin-ui;
  • Switch the currently active template via admin-ui;
  • Implement all the customizations without touching many bi-server files - we only patch PUCLogin.jsp - and it's reversible via UI;
  • Inject js/css resources into puc using our admin user interface;
  • Upload a Tapa template to the server;
  • Download a Tapa template from the server;
  • Preview a Tapa template from the admin-ui;
  • Change template name from admin-ui;
  • Developers can Insert text tags into templates so that admin users can change these texts from admin-ui;
  • Developers have the ability to use server-side variables previously calculated into PUCLogin.jsp into their templates;
  • Developers can use a variable that holds their template url - so that they keep their templates name-independent;
  • Admin users can change the images of a template from the admin-ui;
  • Example of external-resources that inserts a company logo on PUC header - image can be changed via admin-ui and feature can be disabled via admin-ui;
  • Example of external-resources that changes the default User Console welcome page to a custom one - that is so far only customizable through editing the html file.

Each template has its own index.html that you can change - please see Pebble docs. If you see our PUCLogin.jsp you'll see we're providig all server-side variables to the template, so you're free to use them.

Place all your assets into your templates/[template-folder]/assets/ so that they're publicly visible - to non-authenticated users.

Every template has its own template-config.json in which you can specify some vars such as:

{  
   "thumbnailImageUrl" : "assets/img/nagem-screenshot.jpg",
   "externalResources" : [  
      {  
         "type" : "js",
         "context" : "mantle",
         "url" : "assets/js/mantle-context.js"
      },
      {  
         "type" : "css",
         "context" : "mantle",
         "url" : "assets/css/mantle-context.css"
      }
   ],
   "textTags" : [  
      {  
         "tag" : "STATIC_RIGHT_HEADER_TEXT",
         "value" : "Business Intelligence Portal"
      },
      {  
         "tag" : "STATIC_LOGIN_TEXT",
         "value" : "Please enter your credentials"
      },
      {  
         "tag" : "STATIC_USERNAME_PLACEHOLDER",
         "value" : "Username"
      },
      {  
         "tag" : "STATIC_PASSWORD_PLACEHOLDER",
         "value" : "Password"
      },
      {  
         "tag" : "STATIC_BASED_TEXT",
         "value" : "Based on"
      },
      {  
         "tag" : "STATIC_BROUGHT_BY_TEXT",
         "value" : "Brought to you by"
      }
   ]
}

As you can see, there are STATIC_ text variables that you can use on your template as well as static resources to be injected.

TODO:

The documentation is sparse - there are docs on tapa's upload template dialog; on tapa's splash screen and on this wiki. We need to put it all together in a Wiki on this repository.

Architecture diagram

Architecture

tapa's People

Contributors

marpontes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tapa's Issues

Implement template download

From the template card, on the template listing view, the user should be able to download that bundle as a zipped file, for local works, backup or any other purpose

how to use it

i download tapa and restart pentaho Bi but i can't find tapa on the menu and SPARKL display let me restart again ,so i restart many times...it desn't work... please help

Pentaho 7.1 Other URL

Hello !

Im install tapa successfully... but cant see the login page... i get:

"Sorry. Hey, there was something wrong while rendering your brand new template. suggestion: make your login here and restore the original login page within Tapa Plugin."

My pentaho working fine... after install tapa. My URL is not the default ..../pentaho/Login is ../w/Login

Any ideas?

Implement Template import

There's already a button on admin-ui [the plus central button located on the header] that is supposed to call the template-import use-case.

When the button is clicked, the user is supposed to choose a zipped file from his machine and the system is then supposed to upload it, check for pre-existing folders with the same name of the zipped folder within and then place it on the right spot : resources/templates/.

If there's already a template with the same [folder]name, the process should be intelligent enough to determine a new folder-name.

Even though there's a minimal structure for a template, we shouldn't do many checks at this point. The system should be intelligent enough for not listing/controlling badly structured templates.

The zip file should have the minimal template structure which is:

  • my-template.zip
    • my_template/
      • template-confir.json
      • index.html
      • assets/ [public-files inside]
        • [...]

This issue should deliver:

  • The uploader view on admin-ui with a nice and modern interface
  • An Pentaho uploader endpoint
  • kettle Endpoints to handle the process

Change the interface after login

Hi,

I'm starting to use Tapa and it's pretty interesting. I read that it only changes the PUCLogin, but I would like to know if is possible to change the UI of the other pages. For example: the top menu with buttons after login is done.

Implement the admin-ui Splash Screen

There's already a config attribute being managed on admin-ui, that tells whether the splash-screen is going or not to be visible on the ui-load.

There's even a directive+template implemented - but inactive.

What need to be done now is to make this splash-screen beautiful and useful - are splash-screens any useful?

Implement image substitution

From the edit dialog, the use should see a list of images that are used on his template and he should be able to upload his own images to replace each of them.

I think of it like a list of images, placed one below the other and one action button like [Upload]. By clicking that button, he'll be presented a file dialog so he could choose the image to replace that one.

We could list images from assets/img folder and enable the replacement of those ones from the interface. That's a limited feature, once it forces the user to place his images there and it's also file extension limiting, but more advanced users can still make templates with inline css and put Pebble variables in there to tackle this issue.

implement admin-edittable text places on templates

Implement a way so that templates would have static texts configurable from admin-ui.

We could have these texts configured as {{STATIC_TEXT_whatever}}. Then our TapaTemplateFactory would search for these strings at template-config.json and replace one by one for their values.

So https://github.com/marpontes/tapa-template-engine might be involved.

This issue includes the administration of these text tags on the admin-ui.

As these configurations belong to each template, they should be edited into a single template-edit-view.

The admin-user would be able to name and configure these attributes, and then he would need to manually place them - {{STATIC_TEXT_whatever}} - into his index.html [PUCLogin template].

Implement CRUD to manage the assets to be injected to pentaho webcontext

Each template has the option to deliver js/css to pentaho webcontext - only mantle context for now;

So admin-users should be able to choose from their template structure, which assets [css/js] will be injected to webcontext.

This management should happen into the Template-Edit-View, because it belongs to the template.

The admin-user should see a list of css/js files within his template structure - listed through a kettle endpoint and presented elegantly - and then he would enable them by checking a sort of checklist. Let's keep up with ngMaterial.

There should have a button for submitting/applying this change. We don't want that every click turns out to change the system.

Clarifying the Lincense of tapa plugin

Dear Tapa team,

Thanks for this great plugin. I am considering to use it but I need to be sure this will not raise licensing problems.

So i need to be sure it is opensource and compatible with Pentaho Licenses.

By the way it could be great to put the answer in the code by the mean of a LICENSE.md file at the root near the README file.

Kind regards and thanks in advance for your answer.

Commands for auto adding the correct XML nodes to applicationContext

xmlstarlet ed --pf --ps -N util="http://www.springframework.org/schema/util" -N sec="http://www.springframework.org/schema/security" --insert "/:beans/:bean[@id="filterChainProxy"]/:constructor-arg[1]/util:list/sec:filter-chain[1]" --type elem -n ResourceTMP -v ""
-i "/
:beans/:bean[@id="filterChainProxy"]/:constructor-arg[1]/util:list/ResourceTMP" -t attr -n "pattern" -v "/content/tapa/resources/templates/*/assets/**"
-i "/:beans/:bean[@id="filterChainProxy"]/:constructor-arg[1]/util:list/ResourceTMP" -t attr -n "filters" -v "securityContextHolderAwareRequestFilterForWS,httpSessionPentahoSessionContextIntegrationFilter,httpSessionContextIntegrationFilter,basicProcessingFilter,requestParameterProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilterForWS,filterInvocationInterceptorForTapa"
-r "/
:beans/:bean[@id="filterChainProxy"]/:constructor-arg[1]/util:list/ResourceTMP" -v "sec:filter-chain" applicationContext-spring-security.xml

You then follow with
xmllint --format applicationContext-spring-security.xml --output applicationContext-spring-security.xml

This approach is more readable than sed or other kinds of contortions. It also reliably places the xml nodes where they need to be and the attributes with absolutely the correct values and formatting. Another command for the other bean settings. This is the approach I am using in my dockerfile where I am incorporating your superior login screen plugin as a default.

Pentaho 7

Is this not compatible with Pentaho 7, the latest version? I don't see it in market place and if I place the plugin from my old Pentaho version, it doesn't even show up in the menu.

Thanks!

Download Template doesn't work on Pentaho 6.0

All the rest is working.

When the downloadTemplate endpoint is called, an exception is thrown:

2015/10/14 16:31:40 - downloadTemplate - Dispatching started for transformation [downloadTemplate]
2015/10/14 16:31:40 - higgsBoson.0 - Finished processing (I=0, O=0, R=0, W=1, U=0, E=0)
2015/10/14 16:31:40 - assets_path.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
2015/10/14 16:31:40 - Get File Names.0 - Finished processing (I=0, O=0, R=1, W=11, U=0, E=0)
2015/10/14 16:31:40 - OUTPUT.0 - Finished processing (I=0, O=0, R=11, W=11, U=0, E=0)
Oct 14, 2015 4:31:40 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: org/apache/commons/vfs2/FileSystemException
    at pt.webdetails.cpk.elements.impl.KettleElement.inferResult(KettleElement.java:330)
    at pt.webdetails.cpk.elements.impl.KettleElement.processRequest(KettleElement.java:385)
    at pt.webdetails.cpk.elements.impl.KettleElement.processRequest(KettleElement.java:369)
    at pt.webdetails.cpk.CpkCoreService.createContent(CpkCoreService.java:81)
    at pt.webdetails.cpk.CpkApi.callEndpoint(CpkApi.java:384)
    at pt.webdetails.cpk.CpkApi.genericEndpointGet(CpkApi.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$VoidOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:167)
    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:1511)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
    at org.pentaho.platform.web.servlet.JAXRSPluginServlet.service(JAXRSPluginServlet.java:112)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.pentaho.platform.web.servlet.JAXRSPluginServlet.service(JAXRSPluginServlet.java:117)
    at org.pentaho.platform.web.servlet.PluginDispatchServlet.service(PluginDispatchServlet.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.PentahoWebContextFilter.doFilter(PentahoWebContextFilter.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.PentahoRequestContextFilter.doFilter(PentahoRequestContextFilter.java:87)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.pentaho.platform.web.http.security.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:191)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
    at org.pentaho.platform.web.http.security.PentahoBasicProcessingFilter.doFilterHttp(PentahoBasicProcessingFilter.java:115)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.pentaho.platform.web.http.filters.HttpSessionPentahoSessionIntegrationFilter.doFilter(HttpSessionPentahoSessionIntegrationFilter.java:263)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
    at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.SystemStatusFilter.doFilter(SystemStatusFilter.java:55)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:114)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.WebappRootForwardingFilter.doFilter(WebappRootForwardingFilter.java:70)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.PentahoPathDecodingFilter.doFilter(PentahoPathDecodingFilter.java:34)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.vfs2.FileSystemException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at org.pentaho.platform.plugin.services.pluginmgr.PluginClassLoader.loadClass(PluginClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 88 more


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.