view client/digitallibrary/dlContext-xml.jsp @ 636:7049579a0097 jquery

last and next page works now implemented redisplay function (only tested with fullscreen) parameters that are changed need to be in data.queryParams to get in the url on redisplay
author robcast
date Tue, 18 Jan 2011 21:30:03 +0100
parents fd2ef7e46119
children
line wrap: on
line source

<%@ page language="java" %><%!
// create DocumentBean instance for all JSP requests
digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();

// initialize DocumentBean instance in JSP init
public void jspInit() {
    try {
        // set servlet init-parameter
        docBean.setConfig(getServletConfig());
    } catch (javax.servlet.ServletException e) {
        System.out.println(e);
    }
}
%><?xml version="1.0" encoding="UTF-8" ?>
<%
// process request
// get digilib config
digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig();
// parsing the query
digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
// dir cache
digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache");

%><!-- Automatically generated XML snippet with document context -->
<result>
<%
int pn = dlRequest.getAsInt("pn");
String fn = dlRequest.getFilePath();
String ctx = "";
digilib.io.DocuDirent f = dirCache.getFile(fn, pn, digilib.io.FileOps.FileClass.IMAGE);
if (f != null) {
    //ctx = "hasfile:"+f.getName();
    f.checkMeta();
    java.util.HashMap meta = f.getFileMeta();
    if (meta != null) {
	//ctx = "JSP:hasmeta!";
	if (meta.containsKey("context")) {
	    ctx = (String) meta.get("context");
	}
    }
}
%><%= ctx %>
</result>