mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
updating servletcontextformdatafunctionsadapter for change to how getRealPath gets processed as a jndipath. updating press release form for changes to alfresco namespace.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4775 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.alfresco.web.forms;
|
||||
|
||||
import org.alfresco.jndi.AVMFileDirContext;
|
||||
import org.alfresco.util.JNDIPath;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
import javax.servlet.ServletContext;
|
||||
@@ -39,13 +40,22 @@ public class ServletContextFormDataFunctionsAdapter
|
||||
{
|
||||
// The real_path will look something like this:
|
||||
// /alfresco.avm/avm.alfresco.localhost/$-1$alfreco-guest-main:/www/avm_webapps/my_webapp
|
||||
System.err.println("looking up real path for " + path);
|
||||
path = this.servletContext.getRealPath(path);
|
||||
System.err.println("got real path " + path);
|
||||
try
|
||||
{
|
||||
final JNDIPath jndiPath = new JNDIPath(AVMFileDirContext.getAVMFileDirAppBase(), path);
|
||||
// The avm_path to the root of the context will look something like this:
|
||||
// alfreco-guest-main:/www/avm_webapps/my_webapp
|
||||
|
||||
// The avm_path to the root of the context will look something like this:
|
||||
// alfreco-guest-main:/www/avm_webapps/my_webapp
|
||||
path = path.substring(path.indexOf('$', path.indexOf('$') + 1) + 1);
|
||||
path = path.replace('\\','/');
|
||||
return path;
|
||||
return jndiPath.getAvmPath();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println(e.getMessage());
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
public Document parseXMLDocument(final String path)
|
||||
|
@@ -16,7 +16,7 @@ ${press_release.location}--${press_release.launch_date}--
|
||||
${body?trim}
|
||||
</#list>
|
||||
<#list press_release.include_company_footer as cf>
|
||||
<#assign cf_document=alfresco.parseXMLDocument(cf)>
|
||||
<#assign cf_document=alf.parseXMLDocument(cf)>
|
||||
|
||||
<@show_heading heading="About ${cf_document.name}"/>
|
||||
<#list cf_document.body as body>
|
||||
|
@@ -65,7 +65,7 @@ Produces an html rendition of a press release
|
||||
<xsl:for-each select="/pr:press_release/pr:include_company_footer">
|
||||
<xsl:variable name="cf-id"><xsl:value-of select="."/></xsl:variable>
|
||||
<!-- load the xml document for the company footer using a built in FormDataFunction -->
|
||||
<xsl:variable name="cf" select="alfresco:parseXMLDocument($cf-id)"/>
|
||||
<xsl:variable name="cf" select="alf:parseXMLDocument($cf-id)"/>
|
||||
<h2>About <xsl:value-of select="$cf/pr:name"/></h2>
|
||||
<xsl:for-each select="$cf/pr:body">
|
||||
<p><xsl:value-of select="." disable-output-escaping="yes"/></p>
|
||||
@@ -79,7 +79,7 @@ Produces an html rendition of a press release
|
||||
<!-- END MAIN CONTENT -->
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="fn:replaceAll(string($alfresco:form_instance_data_file_name), '.xml', '.txt')"/>
|
||||
<xsl:value-of select="fn:replaceAll(string($alf:form_instance_data_file_name), '.xml', '.txt')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:text>view plain text version</xsl:text>
|
||||
</xsl:element>
|
||||
@@ -97,7 +97,7 @@ Produces an html rendition of a press release
|
||||
select="/pr:press_release/pr:title"/>
|
||||
<!-- load all press releases into a variable by calling into a form data function -->
|
||||
<xsl:variable name="all_press_releases"
|
||||
select="alfresco:parseXMLDocuments('press-release')"/>
|
||||
select="alf:parseXMLDocuments('press-release')"/>
|
||||
<ul>
|
||||
<!-- select a unique set of categories for the first level navigation -->
|
||||
<xsl:for-each select="$all_press_releases[not(pr:category=preceding-sibling::pr:press_release/pr:category)]">
|
||||
@@ -117,7 +117,7 @@ Produces an html rendition of a press release
|
||||
<xsl:attribute name="style">font-weight:bold;</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="fn:replaceAll(string(@alfresco:file_name), '.xml', '.html')"/>
|
||||
<xsl:value-of select="fn:replaceAll(string(@alf:file_name), '.xml', '.html')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="pr:title"/>
|
||||
</xsl:element>
|
||||
@@ -132,7 +132,7 @@ Produces an html rendition of a press release
|
||||
-->
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="fn:replaceAll(string(@alfresco:file_name), '.xml', '.html')"/>
|
||||
<xsl:value-of select="fn:replaceAll(string(@alf:file_name), '.xml', '.html')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="pr:category"/>
|
||||
</xsl:element>
|
||||
|
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
elementFormDefault="qualified">
|
||||
<xs:element name="repeat-textarea">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="zero-to-one" type="xs:anyType" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="one-to-one" type="xs:anyType" minOccurs="1" maxOccurs="1"/>
|
||||
<xs:element name="one-to-inf" type="xs:anyType" minOccurs="1" maxOccurs="unbounded"/>
|
||||
<xs:element name="zero-to-inf" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
Reference in New Issue
Block a user