Project

General

Profile

« Previous | Next » 

Revision 3768

Added by daigle over 16 years ago

Include the contextURL as a parameter for the transformer. Remove leading / from resultset paths

View differences:

lib/style/common/resultset-table.xsl
45 45
                <table class="resultstable" width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
46 46
                    <tr>
47 47
                        <th class="tablehead_lcorner" align="right" valign="top">
48
                            <img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" />
48
                            <img src="{$contextURL}style/skins/default/images/transparent1x1.gif" width="1" height="1" />
49 49
                        </th>
50 50
                        <th class="tablehead" style="text-align: left">
51 51
                            Title
......
65 65
                            </th>
66 66
                        </xsl:if>
67 67
                        <th class="tablehead_rcorner" align="right" valign="top">
68
                            <img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" />
68
                            <img src="{$contextURL}style/skins/default/images/transparent1x1.gif" width="1" height="1" />
69 69
                        </th>
70 70
                    </tr>
71 71
                    
......
87 87
                            
88 88
                            <td width="10">&#160;</td>
89 89
                            <td class="text_plain">
90
                                <form action="{$contextURL}/metacat" method="POST">
90
                                <form action="{$contextURL}metacat" method="POST">
91 91
                                    <xsl:attribute name="name"><xsl:value-of
92 92
                                        select="translate(./docid, '()-.', '____')" /></xsl:attribute>
93 93
                                    
......
181 181
                            
182 182
                            <xsl:if test="$enableediting = 'true'">
183 183
                                <td class="text_plain">
184
                                    <form action="{$contextURL}/metacat" method="POST">
184
                                    <form action="{$contextURL}metacat" method="POST">
185 185
                                        <input type="hidden" name="action" value="read" />
186 186
                                        <input type="hidden" name="qformat" value="{$qformat}" />
187 187
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
lib/style/common/resultset.xsl
42 42
   <html>
43 43
      <head>
44 44
        <link rel="stylesheet" type="text/css" 
45
              href="{$contextURL}/style/skins/{$qformat}/{$qformat}.css" />
45
              href="{$contextURL}style/skins/{$qformat}/{$qformat}.css" />
46 46
        <script language="Javascript" type="text/JavaScript"
47
                src="{$contextURL}/style/skins/{$qformat}/{$qformat}.js" />
47
                src="{$contextURL}style/skins/{$qformat}/{$qformat}.js" />
48 48
        <script language="Javascript" type="text/JavaScript"
49
                src="{$contextURL}/style/common/branding.js" />
49
                src="{$contextURL}style/common/branding.js" />
50 50
        <script language="JavaScript">
51 51
          <![CDATA[
52 52
          function submitform(action,form_ref) {
src/edu/ucsb/nceas/metacat/advancedsearch/Stylizer.java
32 32
import javax.xml.transform.TransformerException;
33 33
import javax.xml.transform.TransformerFactory;
34 34

  
35
import org.apache.log4j.Logger;
36

  
37
import edu.ucsb.nceas.metacat.MetaCatUtil;
38

  
35 39
/**
36 40
 * @author dcosta
37 41
 * 
......
40 44
 */
41 45
public class Stylizer {
42 46

  
47
  private Logger logMetacat = Logger.getLogger(Stylizer.class);
48
	
43 49
  /**
44 50
   * Applies the resultset.xsl stylesheet to the pathquery result string
45 51
   * returned by Metacat.
......
76 82

  
77 83
    try {
78 84
      transformer = transformerFactory.newTransformer(xsltSource);
85
      
86
      MetaCatUtil metaCatUtil = new MetaCatUtil();
87
      
88
      String httpServer = MetaCatUtil.getOption("httpserver");
89
      String context = MetaCatUtil.getOption("context");
90
      
91
      // Log error if httpserver or context are not set in metacat
92
      // configuration, but allow transform to proceed.  User will
93
      // see data, albeit without pretty formatting.
94
      if (httpServer == null || context == null) {
95
    	logMetacat.error("httpserver and context values must be set in " +
96
    			"metacat configuration for advanced search formatting to " +
97
    			"work properly");
98
      } else {
99
        transformer.setParameter("contextURL", httpServer+"/"+context+"/");
100
      }
79 101

  
80 102
      if (sessionId != null) {
81 103
        transformer.setParameter("sessid", sessionId);

Also available in: Unified diff