Project

General

Profile

« Previous | Next » 

Revision 2852

Added by sgarg about 19 years ago

added function to read document from the cgi script and modified the code so that when user is logged in, the document is read from the cgi

View differences:

lib/style/skins/esa/esa-resultset.xsl
53 53
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
54 54
              form_ref.submit();
55 55
          }
56
          function submitCGIform(form_ref) {
57
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
58
              form_ref.cfg.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
59
              form_ref.submit();
60
          }
56 61
          ]]>
57 62
        </script>
58 63
      </head>
......
98 103

  
99 104
             <td width="10">&#160;</td>
100 105
             <td class="text_plain">
101
               <form action="@servlet-path@" method="POST">
106
	       
107
	     <xsl:choose>
108
             <xsl:when test="$enableediting = 'true'">
109
               <form action="@cgi-prefix@/register-dataset.cgi" method="POST">
102 110
                 <xsl:attribute name="name">
103 111
                   <xsl:value-of select="translate(./docid, '()-.', '____')" />
104 112
                 </xsl:attribute>
105 113

  
114
                 <input type="hidden" name="cfg" />
115
                 <input type="hidden" name="sessionid" />
116
	 	 <input type="hidden" name="enableediting" value="{$enableediting}"/>
117
                 <input type="hidden" name="stage" value="read"/>
118
                 <input type="hidden" name="docid">
119
                   <xsl:attribute name="value">
120
                     <xsl:value-of select="./docid"/>
121
                   </xsl:attribute>
122
                 </input>
123
                 <a>
124
                   <xsl:attribute name="href">javascript:submitCGIform(document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute>
125
                   <xsl:text>&#187;&#160;</xsl:text>
126
                   <xsl:choose>
127
                     <xsl:when test="./param[@name='dataset/title']!=''">
128
                        <xsl:value-of select="./param[@name='dataset/title']"/>
129
                     </xsl:when>
130
                     <xsl:otherwise>
131
                       <xsl:value-of select="./param[@name='citation/title']"/>
132
                       <xsl:value-of select="./param[@name='software/title']"/>
133
                       <xsl:value-of select="./param[@name='protocol/title']"/>
134
                     </xsl:otherwise>
135
                   </xsl:choose>
136
                 </a><br />
137
                 <br/>
138
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
139
               </form>
140
	      </xsl:when>
141
	      <xsl:otherwise>
142
		 <form action="@servlet-path@" method="POST">
143
                 <xsl:attribute name="name">
144
                   <xsl:value-of select="translate(./docid, '()-.', '____')" />
145
                 </xsl:attribute>
146

  
106 147
                 <input type="hidden" name="qformat" />
107 148
                 <input type="hidden" name="sessionid" />
108 149
                 <xsl:if test="$enableediting = 'true'">
109
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
150
                           <input type="hidden" name="enableediting" value="{$enableediting}"/>
110 151
                 </xsl:if>
111 152
                 <input type="hidden" name="action" value="read"/>
112 153
                 <input type="hidden" name="docid">
......
121 162
                     </xsl:attribute>
122 163
                   </input>
123 164
                 </xsl:for-each>
124

  
125 165
                 <a>
126 166
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute>
127 167
                   <xsl:text>&#187;&#160;</xsl:text>
......
138 178
                 </a><br />
139 179
                 <br/>
140 180
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
141

  
142 181
               </form>
182
	      </xsl:otherwise>
183
	      </xsl:choose>
143 184
             </td>
144 185

  
145 186
             <td class="text_plain">
......
218 259
		  </xsl:when>
219 260
		  <xsl:otherwise>
220 261
               	     <td class="text_plain">
221
			<form action="@servlet-path@" method="POST">
222
                       <input type="hidden" name="action" value="read"/>
223
                        <input type="hidden" name="qformat" value="{$qformat}"/>
262
			<form action="@cgi-prefix@/register-dataset.cgi" method="POST">
263
                       		<input type="hidden" name="stage" value="read"/>
264
                        	<input type="hidden" name="cfg" value="{$qformat}"/>
224 265
                                <input type="hidden" name="sessionid"  value="{$sessid}"/>
225
                       <input type="hidden" name="docid">
226
                       <xsl:attribute name="value">
227
                          <xsl:value-of select="./docid"/>
228
                       </xsl:attribute>
229
                       </input>
230
                       <center>
231
                       <input type="SUBMIT"  value=" View " name="View">
232
                       </input>
233
                       </center>
234
                     </form>
235
                 <form action="@cgi-prefix@/register-dataset.cgi" 
236
                       method="POST">
266
                       		<input type="hidden" name="docid">
267
                       			<xsl:attribute name="value">
268
                          			<xsl:value-of select="./docid"/>
269
                       			</xsl:attribute>
270
                       		</input>
271
                       		<center>
272
                       		<input type="SUBMIT"  value=" View " name="View"></input>
273
                       		</center>
274
                     	</form>
275
                 	<form action="@cgi-prefix@/register-dataset.cgi" 
276
                       		method="POST">
237 277
                       <input type="hidden" name="stage" value="modify"/>        
238 278
                            <input type="hidden" name="cfg" value="{$qformat}"/>
239 279
                                        <input type="hidden" name="sessionid"  value="{$sessid}"/>

Also available in: Unified diff