Changeset 4311
- Timestamp:
- 01/21/14 10:49:17 (11 years ago)
- Location:
- vlo/branches/vlo-2.18
- Files:
-
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-2.18
- Property svn:mergeinfo changed
/vlo/trunk (added) merged: 4288,4305,4307,4309-4310
- Property svn:mergeinfo changed
-
vlo/branches/vlo-2.18/UPGRADE
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/vlo/trunk/UPGRADE merged eligible /vlo/branches/to-wicket-1.6-twagoo/UPGRADE 4212-4219 /vlo/branches/to-wicket-1.6/UPGRADE 4199-4268 /vlo/branches/vlo-2.13-param/UPGRADE 2570-2767
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
vlo/branches/vlo-2.18/vlo_importer/src/main/resources/VloConfig.xml
r4247 r4311 1 1 <VloConfig> 2 2 3 <pagesInApplicationCache>128</pagesInApplicationCache> 3 <!-- Sets the maximum number of page instances which will be stored in the application scoped second level cache for faster retrieval --> 4 <pagesInApplicationCache>40</pagesInApplicationCache> 4 5 5 <sessionCacheSize>500</sessionCacheSize> 6 <!-- Sets the maximum size (in KILOBYTES) of the File where page instances per session are stored. --> 7 <sessionCacheSize>10000</sessionCacheSize> 6 8 7 9 <deleteAllFirst>true</deleteAllFirst> -
vlo/branches/vlo-2.18/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java
r4247 r4311 21 21 import org.apache.wicket.util.string.StringValue; 22 22 import org.apache.wicket.util.lang.Bytes; 23 import org.slf4j.Logger; 24 import org.slf4j.LoggerFactory; 23 25 24 26 /** … … 32 34 public class VloWebApplication extends WebApplication { 33 35 36 private final static Logger logger = LoggerFactory.getLogger(VloWebApplication.class); 37 34 38 /** 35 39 * Customised client request cycle<br><br> … … 113 117 114 118 // configure cache by applying the vlo configuration settings to it 115 this.getStoreSettings().setInmemoryCacheSize(VloConfig.getPagesInApplicationCache()); 116 this.getStoreSettings().setMaxSizePerSession(Bytes.kilobytes((long)VloConfig.getSessionCacheSize())); 119 final int pagesInApplicationCache = VloConfig.getPagesInApplicationCache(); 120 logger.info("Setting Wicket in-memory cache size to {}", pagesInApplicationCache); 121 this.getStoreSettings().setInmemoryCacheSize(pagesInApplicationCache); 122 123 final Bytes sessionCacheSize = Bytes.kilobytes((long)VloConfig.getSessionCacheSize()); 124 logger.info("Setting Wicket max size per session to {}", sessionCacheSize); 125 this.getStoreSettings().setMaxSizePerSession(sessionCacheSize); 117 126 118 127 // creata an object referring to the search results -
vlo/branches/vlo-2.18/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetBoxPanel.java
r4240 r4311 66 66 }; 67 67 add(facetList); 68 PageParameters facetParameters = new PageParameters();68 PageParameters facetParameters = query.getPageParameters(); 69 69 facetParameters.add(ShowAllFacetValuesPage.SELECTED_FACET_PARAM, facetField.getName()); 70 70 facetParameters.add(ShowAllFacetValuesPage.FACET_MIN_OCCURS, "1"); -
vlo/branches/vlo-2.18/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.java
r4259 r4311 7 7 import eu.clarin.cmdi.vlo.config.VloConfig; 8 8 import eu.clarin.cmdi.vlo.dao.DaoLocator; 9 import java.io.InputStreamReader;10 import java.io.StringWriter;11 9 import java.io.UnsupportedEncodingException; 12 10 import java.net.MalformedURLException; … … 19 17 import java.util.List; 20 18 import java.util.regex.Pattern; 21 import javax.xml.transform.stream.StreamSource;22 import net.sf.saxon.s9api.Processor;23 import net.sf.saxon.s9api.Serializer;24 import net.sf.saxon.s9api.XdmNode;25 import net.sf.saxon.s9api.XsltCompiler;26 import net.sf.saxon.s9api.XsltExecutable;27 import net.sf.saxon.s9api.XsltTransformer;28 19 import org.apache.solr.common.SolrDocument; 29 20 import org.apache.wicket.Application; … … 61 52 import org.apache.wicket.util.encoding.UrlDecoder; 62 53 import org.apache.wicket.util.encoding.UrlEncoder; 54 import org.apache.wicket.util.string.StringValue; 63 55 import org.slf4j.Logger; 64 56 import org.slf4j.LoggerFactory; … … 75 67 public static final String feedbackfromURL = VloConfig.getFeedbackFromUrl(); 76 68 77 private final URL xslFile = getClass().getResource("/eu/clarin/cmdi/vlo/pages/cmdi2xhtml.xsl");78 69 private final ResourceReference XSL_CSS_REFERENCE = new PackageResourceReference(getClass(), "cmdi.css"); 79 70 … … 81 72 public ShowResultPage(final PageParameters currentParam) { 82 73 super(currentParam); 74 75 final StringValue docIdParam = getPageParameters().get(PARAM_DOC_ID); 76 if (docIdParam == null) { 77 throw new RuntimeException("No document id was specified. Cannot construct result page."); 78 } 83 79 //Document ID is assumed to have been encoded (typcially in DocumentLinkPanel) decode here 84 80 final String docId = UrlDecoder.QUERY_INSTANCE.decode( 85 getPageParameters().get(PARAM_DOC_ID).toString(),81 docIdParam.toString(), 86 82 Application.get().getRequestCycleSettings().getResponseRequestEncoding()); // get current character set from request cycle 87 83 SolrDocument solrDocument = DaoLocator.getSearchResultsDao().getSolrDocument(docId); 84 88 85 if (solrDocument != null) { 89 86 final SearchPageQuery query = new SearchPageQuery(currentParam); … … 558 555 559 556 private void createCompleteCmdiView(final SolrDocument solrDocument) { 560 StringWriter strWriter = new StringWriter(); 561 562 final Processor proc = new Processor(false); 563 final XsltCompiler comp = proc.newXsltCompiler(); 564 557 final String completeMetadataField = solrDocument.getFirstValue(FacetConstants.FIELD_COMPLETE_METADATA).toString(); 565 558 try { 566 final XsltExecutable exp = comp.compile(new StreamSource(xslFile.getFile())); 567 final XdmNode source = proc.newDocumentBuilder().build( 568 new StreamSource(new InputStreamReader(new URL(solrDocument.getFirstValue(FacetConstants.FIELD_COMPLETE_METADATA).toString()).openStream()))); 569 final Serializer out = new Serializer(); 570 out.setOutputProperty(Serializer.Property.METHOD, "html"); 571 out.setOutputProperty(Serializer.Property.INDENT, "yes"); 572 out.setOutputProperty(Serializer.Property.ENCODING, "UTF-8"); 573 out.setOutputWriter(strWriter); 574 final XsltTransformer trans = exp.load(); 575 576 trans.setInitialContextNode(source); 577 trans.setDestination(out); 578 trans.transform(); 579 } catch (Exception e) { 580 LOG.error("Couldn't create CMDI metadata: ", e); 581 strWriter = new StringWriter().append("<b>Could not load complete CMDI metadata</b>"); 582 } 583 584 completeCmdiLabel = new Label("completeCmdi", strWriter.toString()); 585 completeCmdiLabel.setEscapeModelStrings(false); 559 final CmdiXsltModel cmdiXsltModel = new CmdiXsltModel(new URL(completeMetadataField)); 560 completeCmdiLabel = new Label("completeCmdi", cmdiXsltModel); 561 completeCmdiLabel.setEscapeModelStrings(false); 562 } catch (MalformedURLException ex) { 563 LOG.error("Could not create CMDI view, malformed URL: {}", completeMetadataField, ex); 564 completeCmdiLabel = new Label("<b>Could not read metadata</b>"); 565 } 586 566 } 587 567
Note: See TracChangeset
for help on using the changeset viewer.