Have use the plugin before ? Can't seem to configure using the Dynamic parameter as I need to request start and end date from user in the form of Month and year.
Have not used the plugin in real-world scenarios. So, developing a custom plugin for Confluence is a better option, than messing around with custom JSPs. https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project/create-a-helloworld-plugin-project https://developer.atlassian.com/display/CONFDEV/Creating+a+New+Confluence+Macro We can take it offline, contact us via the contact form on http://www.confiforms.com/cfweb/ and I can try to help you to start with your custom plugin development
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, my goal is to use the Confluence's instance web server functionality to call a user defines JSP which will be located http://Confluence Apps/admin/xxxxxx.jsp to access a table and to display the content on screen:
I have created the following:
<html> <head><title>Space/Page Statistics</title></head> <body> <%@ page import="java.util.*" %> <%@ page import="javax.sql.*;" %> <%
java.sql.Connection con; java.sql.Statement s; java.sql.ResultSet rs; java.sql.PreparedStatement pst;
con=null; s=null; pst=null; rs=null;
// Remember to change the next line with your own environment String url= "jdbc:mysql://mysql-wiki-1.test.internal/wiki"; String id= ""; String pass = "";
try{
Class.forName("com.mysql.jdbc.Driver"); con = java.sql.DriverManager.getConnection(url, id, pass);
}catch(ClassNotFoundException cnfex){ cnfex.printStackTrace();
} String sql = "SELECT PageAccessedURL, COUNT(PageAccessedURL) `HitCount` FROM confluence_access_logs WHERE EntryDate >= '2015-01-06 18:46:50' AND EntryDate <= '2015-01-07 00:20:21' GROUP BY PageAccessedURL ORDER BY HitCount DESC limit 10 ";
try{ s = con.createStatement(); rs = s.executeQuery(sql); %> <table border="1"> <tr> <th>Space/Page Name</th> <th>Hit Count </th> </tr> <% while( rs.next() ){ %><tr> <td><%= rs.getString("PageAccessedURL") %></td> <td><b><%= rs.getString("HitCount") %></b></td> </tr> <% } %>
<%
}
catch(Exception e){e.printStackTrace();} finally{ if(rs!=null) rs.close(); if(s!=null) s.close(); if(con!=null) con.close(); }
%> </table> </body> </html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe that developing this as a plugin would make more sense (as additionally to custom functionality you can develop yourself, there is a huge stack of Atlassian libraries you can access/use, and it is all initialized and ready to use, knows your user, context, etc). And for this particular case there are plugins already available: PocketQuery Developing some custom JSPs that just run within the Java Container... especially, the code you have pasted: no db connection pool, driver is initialized on request... not very efficient
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why would you need it? You cannot use JSPs as your templates in Confluence.
You can have a servlet defined, yes, but the templating engine is Velocity, not JSP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.