• Adding automatic password retrieval

  • He we will discuss about how to make customization and improvement to the OpenKM source code.
He we will discuss about how to make customization and improvement to the OpenKM source code.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #18901  by ciropom
 
Hi to all,
I would like to add to OpenKM 6.2 the ability to reset the password directly from the login page in case the user forget it.
(there is already something similar?)

To do this I followed the developer guide but I can't manage to run openkm in debug mode as a Java Application.
I followed this guide:
http://wiki.openkm.com/index.php/Debugging_with_GWT

but when the GWT debug mode window appears there is nothing inside it (see the attached screenshot)
and if i click on the button "Launch default browser"
a 404 error arises
Code: Select all
type Status report

message /OpenKM/frontend/index.jsp

description The requested resource (/OpenKM/frontend/index.jsp) is not available.
I already tried also with
localhost:8080
localhost:8080/OpenKM/
localhost:8080/OpenKM/frontend/
localhost:8080/OpenKM/frontend/index.jsp

but all yelds the same error as above.

what I am doing wrong?

Thank you very much.
Attachments
screenshot of gwt debug mode
screenshot of gwt debug mode
screen.png (19.49 KiB) Viewed 6388 times
 #18918  by jllort
 
You should have tomcat started too !!

Then, simply use copy button and then paste into your browser ( you'll paste the url which call GWT shell ). I suggest you use firefox for it ( and better if you found version 10 or lower ).

Finally, you should working on edit login.jsp for it purpose and is not needed debug GWT code. Finally if you want to share this piece of code to the project we will include as a configuration feature from administration.
 #18924  by ciropom
 
jllort wrote:You should have tomcat started too !!

Then, simply use copy button and then paste into your browser ( you'll paste the url which call GWT shell ). I suggest you use firefox for it ( and better if you found version 10 or lower ).
Yes tomcat is already started..
But it gives error 404 for every page I try to load (even /)
Maybe I failed saying tomcat to load OpenKM in it?

I followed this guide:
http://wiki.openkm.com/index.php/Config ... in_Eclipse

the only pair of instructions that I've not followed are:
Checkbox Use Tomcat installation ( takes control of tomcat installation ).
Increment startup and stop timeouts.

because I haven't managed to find that checkbox.. (even on your screenshots)

I reached the other tomcat configuration popups from "right-click"->debug->run configurations..
From there I added openkm folder to the "source" tab, the environment variables and the extra-commandline to the vm..
Then "debug" and tomcat started (but gives 404 when from firefox I try to load openkm)
jllort wrote: Finally, you should working on edit login.jsp for it purpose and is not needed debug GWT code. Finally if you want to share this piece of code to the project we will include as a configuration feature from administration.

Thank you for the tip.
Of course I will share my code, but I miss how.
There is some irc channel or similar that we can use to communicate faster?

Thank you a lot.
 #18926  by macjaeger
 
I couldn't follow these instructions either - yet I'm no java-savy in any way, so that's most probably my own fault. Although I have maven, eclipse, subversion, m2e and subclipse all installed and configured, I still do the testing "barefoot": run build.sh from workspace-folder, then copy OpenKM.war from target-folder to the place where I installed OpenKM+tomcat from the bundle. I'm sure, there's better ways - that's what maven & eclipse are there for, right? - but at least now I can take first steps... (I'm seasoned c# programmer in windows environment, but java & eclipse is all new grounds for me).
 #18931  by ciropom
 
This is the log when I start tomcat:
Code: Select all
Oct 29, 2012 8:33:17 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/danilo/tomcat-7.0.27/lib/sigar
Oct 29, 2012 8:33:18 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Oct 29, 2012 8:33:18 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Oct 29, 2012 8:33:18 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 640 ms
Oct 29, 2012 8:33:18 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 29, 2012 8:33:18 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Oct 29, 2012 8:33:18 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Oct 29, 2012 8:33:18 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Oct 29, 2012 8:33:18 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 399 ms
apart from the fact that it doesn't find sigar (the path should be right, and points to the zip-extracted folder downloaded from openkm download page (I downloaded the bundle))
it doesn't seem to start OpenKM on it..even if from "source", in "debug configuration" i added the openkm folder.
 #18933  by ciropom
 
Hi I tried to debug substituting the war file i compiled in the bundle distribution,
but I'm not able to call a servlet from a jsp page before login.

I added in com.openkm.servlet the ForgotServlet.java
Code: Select all
public class ForgotServlet extends BasicSecuredServlet {
	private static final long serialVersionUID = 1L;
	private static Logger log = LoggerFactory.getLogger(ForgotServlet.class);
	private static boolean db = Config.PRINCIPAL_ADAPTER.equals(DatabasePrincipalAdapter.class.getCanonicalName());
	
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		//response.setContentType("text/plain; charset=UTF-8");
		log.trace(getServletName());

		String name=request.getParameter("email");
		
		ServletContext sc = getServletContext();
		sc.setAttribute("response", 1);
		sc.getRequestDispatcher("/login_desktop.jsp").forward(request, response);
		
		log.trace(getServletName()+" completed.");
		
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
	}
}
but now I don't know how to call it from jsp.
From firefox neither /OpenKM/Forgot nor /OpenKM/ForgotServlet works.
I Tried to add it to web.xml file in WEB-INF but eclipse said that the file is auto generated..
Probably I'm missing some trivial step.. sorry but it's the first time that I program with java/servlets.

Thank you for your help.
 #18956  by ciropom
 
ciropom wrote:Hi I tried to debug substituting the war file i compiled in the bundle distribution,
but I'm not able to call a servlet from a jsp page before login.

I added in com.openkm.servlet the ForgotServlet.java
Code: Select all
public class ForgotServlet extends BasicSecuredServlet {
	private static final long serialVersionUID = 1L;
	private static Logger log = LoggerFactory.getLogger(ForgotServlet.class);
	private static boolean db = Config.PRINCIPAL_ADAPTER.equals(DatabasePrincipalAdapter.class.getCanonicalName());
	
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		//response.setContentType("text/plain; charset=UTF-8");
		log.trace(getServletName());

		String name=request.getParameter("email");
		
		ServletContext sc = getServletContext();
		sc.setAttribute("response", 1);
		sc.getRequestDispatcher("/login_desktop.jsp").forward(request, response);
		
		log.trace(getServletName()+" completed.");
		
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
	}
}
but now I don't know how to call it from jsp.
From firefox neither /OpenKM/Forgot nor /OpenKM/ForgotServlet works.
I Tried to add it to web.xml file in WEB-INF but eclipse said that the file is auto generated..
Probably I'm missing some trivial step.. sorry but it's the first time that I program with java/servlets.

Thank you for your help.
Ok to do this I found the right way (I was adding the servlet to the autogenerated web.xml file)
but still can't run tomcat directly from eclipse..

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.