Page 1 of 1

copy document's url to browser address,page display nothing

PostPosted:Fri Sep 24, 2010 11:55 am
by wangmj
language = zh_CN
copy the document url to browser address, but the page display nothing 。
if the url is in english,everything is fine .

for example:
http://localhost:8080/OpenKM/com.openkm ... 务库使用帮助.doc
nothing display.

http://localhost:8080/OpenKM/com.openkm ... t/test.jpg
display correctly.

Re: copy document's url to browser address,page display noth

PostPosted:Sat Sep 25, 2010 2:34 pm
by jllort
seems its a problem with chinese character, in that wiki url is not displayed correctly.

In version 4.x there's no way to solving it, I'll take note and adding the issue for trying correcting in version 5.x I'll send de UUID document not the document path and that will solve the problem

Re: copy document's url to browser address,page display noth

PostPosted:Sun Sep 26, 2010 12:25 am
by wangmj
great! thanks your response!

Re: copy document's url to browser address,page display noth

PostPosted:Tue Oct 05, 2010 3:36 am
by wangmj
openkm5.x

=========solution==add new parameter "docUuid"============================
1. change the url content
com.openkm.frontend.client.widget.properties.Document.java
goto line 298
Code: Select all
url += "?docPath=" + URL.encodeComponent(document.getPath());
change to
Code: Select all
//		url += "?docPath=" + URL.encodeComponent(document.getPath());
		url += "?docUuid=" + URL.encodeComponent(document.getUuid());
2.com.openkm.frontend.client.Main.java
add new code
Code: Select all
	private final OKMRepositoryServiceAsync repositoryService = (OKMRepositoryServiceAsync) GWT
	.create(OKMRepositoryService.class);

public String docUuid = "";  //added by wangmj 为了实现拷贝url就能浏览文档
Code: Select all
	/**
	 * 通过uuid获取到文档的节点的全路径
	 */
	final AsyncCallback<String> callbackGetNodePath = new AsyncCallback<String>() {
		public void onSuccess(String result) {
			if (result!= null && !result.trim().equals("")){
				Main.get().docPath = result; 			
				Main.get().fldPath = Main.get().docPath.substring(0, Main.get().docPath.lastIndexOf("/")); 			
			}else{
				Main.get().docPath = null;
				Main.get().fldPath = null;
			}
		}

		public void onFailure(Throwable caught) {
			// On error must reset variables too
			Main.get().docPath = null;
			Main.get().fldPath = null;
			Main.get().showError("isValid", caught);
		}
	};
in method onModuleLoad()
Code: Select all
		//added by wangmj 获取到文档的uuid
		if (loc.getParameter("docUuid")!=null && !loc.getParameter("docUuid").equals("")) {
			docUuid = loc.getParameter("docUuid");
		}
		if (Main.get().docUuid != null && !Main.get().docUuid.equals("")){
			//首先获取到节点的全路径,然后调用下面的方法
			ServiceDefTarget endPoint = (ServiceDefTarget) repositoryService;
			endPoint.setServiceEntryPoint(Config.OKMRepositoryService);
			repositoryService.getPathByUUID(Main.get().docUuid, callbackGetNodePath);
		}

Re: copy document's url to browser address,page display noth

PostPosted:Tue Oct 05, 2010 4:45 pm
by jllort
put the eclipse patch too

Re: copy document's url to browser address,page display noth

PostPosted:Tue Oct 05, 2010 4:52 pm
by wangmj
btw, "the eclipse patch" what does it mean? :roll:

Re: copy document's url to browser address,page display noth

PostPosted:Thu Oct 07, 2010 12:44 am
by wangmj
"the eclipse patch",i see. :D

Re: copy document's url to browser address,page display noth

PostPosted:Wed Oct 20, 2010 2:46 pm
by pavila
Please, can you test this issue in the public demo (http://demo.openkm.com) ?