[portal-commits] JBoss Portal SVN: r11934 - in branches/JBoss_Portal_2_6_6_JBPORTAL-2109: cms/src/main/org/jboss/portal/cms/impl/jcr/command and 3 other directories.
portal-commits at lists.jboss.org
portal-commits at lists.jboss.org
Thu Sep 18 18:34:11 EDT 2008
Author: sohil.shah at jboss.com
Date: 2008-09-18 18:34:10 -0400 (Thu, 18 Sep 2008)
New Revision: 11934
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/CMSException.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
Log:
JBPORTAL-2161 - Special character in filename generates NullPointerException
JBPORTAL-2162 - Special character in foldername throws RepositoryException
JBPORTAL-2163 - File- and foldernames with special characters and umlauts are not exported correctly
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/CMSException.java
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/CMSException.java 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/CMSException.java 2008-09-18 22:34:10 UTC (rev 11934)
@@ -49,4 +49,16 @@
{
super(cause);
}
+
+ public boolean hasPathFormatFailure()
+ {
+ boolean pathFormatFailure = false;
+
+ if(this.getMessage().indexOf("is not a legal path element")!=-1)
+ {
+ pathFormatFailure = true;
+ }
+
+ return pathFormatFailure;
+ }
}
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java 2008-09-18 22:34:10 UTC (rev 11934)
@@ -24,6 +24,7 @@
import org.jboss.portal.cms.impl.jcr.JCRCommand;
import org.jboss.portal.cms.util.FileUtil;
+import org.jboss.portal.cms.CMSException;
import javax.jcr.Session;
@@ -58,7 +59,7 @@
catch (Exception e)
{
e.printStackTrace();
+ throw new CMSException(e);
}
- return null;
}
}
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java 2008-09-18 22:34:10 UTC (rev 11934)
@@ -38,6 +38,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
+import java.io.IOException;
import java.util.Date;
import java.util.Enumeration;
import java.util.Locale;
@@ -90,84 +91,14 @@
String itemName = zipEntry.getName();
if (!zipEntry.isDirectory())
{
- long fileSize = zipEntry.getSize();
- byte[] zipBytes = new byte[(int)fileSize];
- InputStream zipDataStream = zipFile.getInputStream(zipEntry);
- long bytesRead = 0;
-
- while (bytesRead < fileSize)
- {
- bytesRead += zipDataStream.read(zipBytes, (int)bytesRead, (int)(fileSize - bytesRead));
- }
-
- org.jboss.portal.cms.model.File file = new FileImpl();
-
- String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
- sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
- file.setBasePath(sBasePath);
-
- Content content = new ContentImpl();
- content.setEncoding("UTF-8");
- content.setTitle(itemName);
- content.setDescription(itemName);
- content.setBasePath(sBasePath + "/" + this.msLanguage);
- content.setBytes(zipBytes);
- file.setContent(new Locale(this.msLanguage), content);
-
- //Store the file
- JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(file.getBasePath());
- Boolean bExists = (Boolean)context.execute(nodeExists);
- if (!bExists.booleanValue())
- {
- //Create new file
- JCRCommand newFile = (JCRCommand)context.getCommandFactory().createNewFileCommand(file, content);
- context.execute(newFile);
- }
- else
- {
- //Update the existing one, and make the new version created
- //in return as live
- JCRCommand updateFile = (JCRCommand)context.getCommandFactory().createUpdateFileCommand(file, content, true);
- context.execute(updateFile);
- }
+ this.addFile(zipFile, zipEntry);
}
else // isDirectory
{
- // trim trailing slash.
- if (itemName.endsWith("/"))
- {
- itemName = itemName.substring(0, itemName.length() - 1);
- }
-
- if (!"".equals(itemName))
- {
- String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
- sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
- String sParentPath = NodeUtil.getParentPath(sBasePath);
- JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sParentPath);
- Boolean bExists = (Boolean)context.execute(nodeExists);
- if (!bExists.booleanValue())
- {
- this.createParentHierarchy(sParentPath);
- }
-
- JCRCommand nodeExists2 = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sBasePath);
- Boolean bExists2 = (Boolean)context.execute(nodeExists2);
- if (!bExists2.booleanValue())
- {
- Folder folder = new FolderImpl();
- folder.setName(itemName);
- folder.setDescription(itemName);
- folder.setTitle(itemName);
- folder.setLastModified(new Date());
- folder.setBasePath(sBasePath);
-
- JCRCommand folderSave = (JCRCommand)context.getCommandFactory().createFolderSaveCommand(folder);
- context.execute(folderSave);
- }
- }
+ this.addFolder(zipEntry);
}
}
+
return null;
}
catch (Exception e)
@@ -182,6 +113,112 @@
}
}
}
+
+ /**
+ *
+ * @param zipFile
+ * @param zipEntry
+ * @throws IOException
+ */
+ private void addFile(ZipFile zipFile, ZipEntry zipEntry) throws IOException
+ {
+ try
+ {
+ String itemName = zipEntry.getName();
+ long fileSize = zipEntry.getSize();
+ byte[] zipBytes = new byte[(int)fileSize];
+ InputStream zipDataStream = zipFile.getInputStream(zipEntry);
+ long bytesRead = 0;
+
+ while (bytesRead < fileSize)
+ {
+ bytesRead += zipDataStream.read(zipBytes, (int)bytesRead, (int)(fileSize - bytesRead));
+ }
+
+ org.jboss.portal.cms.model.File file = new FileImpl();
+
+ String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
+ sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
+ file.setBasePath(sBasePath);
+
+ Content content = new ContentImpl();
+ content.setEncoding("UTF-8");
+ content.setTitle(itemName);
+ content.setDescription(itemName);
+ content.setBasePath(sBasePath + "/" + this.msLanguage);
+ content.setBytes(zipBytes);
+ file.setContent(new Locale(this.msLanguage), content);
+
+ //Store the file
+ JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(file.getBasePath());
+ Boolean bExists = (Boolean)context.execute(nodeExists);
+ if (!bExists.booleanValue())
+ {
+ //Create new file
+ JCRCommand newFile = (JCRCommand)context.getCommandFactory().createNewFileCommand(file, content);
+ context.execute(newFile);
+ }
+ else
+ {
+ //Update the existing one, and make the new version created
+ //in return as live
+ JCRCommand updateFile = (JCRCommand)context.getCommandFactory().createUpdateFileCommand(file, content, true);
+ context.execute(updateFile);
+ }
+ }
+ catch(CMSException e)
+ {
+ //Log the error, but don't fail creation of other resources in the archive
+ log.error(this, e);
+ }
+ }
+
+ private void addFolder(ZipEntry zipEntry)
+ {
+ try
+ {
+ String itemName = zipEntry.getName();
+
+ //trim trailing slash.
+ if (itemName.endsWith("/"))
+ {
+ itemName = itemName.substring(0, itemName.length() - 1);
+ }
+
+ if (!"".equals(itemName))
+ {
+ String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
+ sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
+ String sParentPath = NodeUtil.getParentPath(sBasePath);
+ JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sParentPath);
+ Boolean bExists = (Boolean)context.execute(nodeExists);
+ if (!bExists.booleanValue())
+ {
+ this.createParentHierarchy(sParentPath);
+ }
+
+ JCRCommand nodeExists2 = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sBasePath);
+ Boolean bExists2 = (Boolean)context.execute(nodeExists2);
+ if (!bExists2.booleanValue())
+ {
+ Folder folder = new FolderImpl();
+ folder.setName(itemName);
+ folder.setDescription(itemName);
+ folder.setTitle(itemName);
+ folder.setLastModified(new Date());
+ folder.setBasePath(sBasePath);
+
+ JCRCommand folderSave = (JCRCommand)context.getCommandFactory().createFolderSaveCommand(folder);
+ context.execute(folderSave);
+ }
+ }
+ }
+ catch(Exception e)
+ {
+ //Log the error, but don't fail creation of other resources in the archive
+ log.error(this, e);
+ }
+ }
/** @param parentPath */
private void createParentHierarchy(String parentPath) throws CMSException
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2008-09-18 22:34:10 UTC (rev 11934)
@@ -63,6 +63,8 @@
public static final String OP_CREATE_COLLECTION = "createcollection";
public static final String OP_CONFIRM_CREATE_COLLECTION = "confirmcreatecollection";
+
+ public static final String OP_CONFIRM_CREATE_COLLECTION_VALIDATION_ERROR = "confirmcreatecollection_validationError";
public static final String OP_CONFIRMCOPY = "confirmcopy";
@@ -111,4 +113,8 @@
public static final String OP_VIEWPENDINGPREVIEW = "view_pending_preview";
public static final String OP_MODIFYANDAPPROVE = "modify_and_approve";
+
+ public static final String CMS_FILENAME_INVALID = "CMS_FILENAME_INVALID";
+
+ public static final String CMS_FOLDERNAME_INVALID = "CMS_FOLDERNAME_INVALID";
}
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-09-18 22:34:10 UTC (rev 11934)
@@ -78,7 +78,6 @@
import javax.portlet.UnavailableException;
import java.io.IOException;
import java.io.InputStream;
-import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -274,7 +273,7 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/main.jsp");
prd.include(rReq, rRes);
}
- else if (CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION.equals(op))
+ else if (CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION.equals(op) || CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION_VALIDATION_ERROR.equals(op))
{
try
{
@@ -295,6 +294,21 @@
String sPath = rReq.getParameter("path");
rRes.setContentType("text/html");
rReq.setAttribute("createpath", sPath);
+
+ if (rReq.getParameter("error:message") != null)
+ {
+ rReq.setAttribute("error:message", rReq.getParameter("error:message"));
+ }
+ if (rReq.getParameter("error:newcollectionname") != null)
+ {
+ rReq.setAttribute("error:newcollectionname", rReq.getParameter("error:newcollectionname"));
+ }
+ if (rReq.getParameter("error:newcollectiondescription") != null)
+ {
+ rReq.setAttribute("error:newcollectiondescription", rReq.getParameter("error:newcollectiondescription"));
+ }
+
+
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/confirmcreatecollection.jsp");
prd.include(rReq, rRes);
}
@@ -563,6 +577,14 @@
{
rReq.setAttribute("error:language", rReq.getParameter("error:language"));
}
+ if (rReq.getParameter("error:filename") != null)
+ {
+ rReq.setAttribute("error:filename", rReq.getParameter("error:filename"));
+ }
+ if (rReq.getParameter("error:message") != null)
+ {
+ rReq.setAttribute("error:message", rReq.getParameter("error:message"));
+ }
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/create.jsp");
prd.include(rReq, rRes);
@@ -875,11 +897,46 @@
folder.setName(sFolderName);
folder.setBasePath(sNewPath);
- Command saveCMD = CMSService.getCommandFactory().createFolderSaveCommand(folder);
- CMSService.execute(saveCMD);
+ try
+ {
+ Command saveCMD = CMSService.getCommandFactory().createFolderSaveCommand(folder);
+ CMSService.execute(saveCMD);
+ }
+ catch(CMSException cme)
+ {
+ if(cme.hasPathFormatFailure())
+ {
+ //Validation Error occurred
+ //FileName should not be empty
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION_VALIDATION_ERROR);
+ aRes.setRenderParameter("path", aReq.getParameter("destination"));
+ //used to remember the data already submitted by the user
+ aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
+ aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
+ aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
+
+ return;
+ }
+ else
+ {
+ throw cme;
+ }
+ }
+
aRes.setRenderParameter("op", CMSAdminConstants.OP_MAIN);
aRes.setRenderParameter("path", sNewPath);
+ }
+ else
+ {
+ //Validation Error
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION_VALIDATION_ERROR);
+ aRes.setRenderParameter("path", aReq.getParameter("destination"));
+
+ //used to remember the data already submitted by the user
+ aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
+ aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
+ aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
}
}
else if (CMSAdminConstants.OP_UPLOADCONTENT.equals(op))
@@ -1262,8 +1319,40 @@
file.setContent(new Locale(sLanguage), content);
+ //Check and make sure file can be successfully saved
Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(content.getBasePath());
- Boolean bExists = (Boolean)CMSService.execute(existsCMD);
+ Boolean bExists = null;
+ try
+ {
+ bExists = (Boolean)CMSService.execute(existsCMD);
+ }
+ catch(CMSException cme)
+ {
+ if(cme.hasPathFormatFailure())
+ {
+ //Validation Error occurred
+ //FileName should not be empty
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_CREATEFILE_VALIDATION_ERROR);
+
+ //set render parameters here
+ aRes.setRenderParameter("path", sDirectory);
+
+ //used to remember the data already submitted by the user
+ aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FILENAME_INVALID);
+ aRes.setRenderParameter("error:filename", aReq.getParameter("filename"));
+ aRes.setRenderParameter("error:content", aReq.getParameter("elm1"));
+ aRes.setRenderParameter("error:description", aReq.getParameter("description"));
+ aRes.setRenderParameter("error:title", aReq.getParameter("title"));
+ aRes.setRenderParameter("error:language", aReq.getParameter("language"));
+
+ return;
+ }
+ else
+ {
+ throw cme;
+ }
+ }
+
if (bExists.booleanValue()) // if file exists, update contentNode
{
Command cmdUpdate = CMSService.getCommandFactory().createUpdateFileCommand(file, content, true);
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-09-18 22:34:10 UTC (rev 11934)
@@ -135,3 +135,6 @@
CMS_ACCESS_DENIED=Access Denied
CMS_ACCESS_DENIED_DESCRIPTION=You are not allowed to access this resource
CMS_ACCESS_DENIED_DESCRIPTION_PATH=You are not allowed to access the resource
+
+CMS_FILENAME_INVALID=File Name is invalid. It may contain illegal characters
+CMS_FOLDERNAME_INVALID=Folder Name is invalid. It may contain illegal characters
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp 2008-09-18 22:34:10 UTC (rev 11934)
@@ -6,6 +6,19 @@
<%
String sCurrPath = (String)request.getAttribute("createpath");
String OP = CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION;
+
+ //validation handling related data
+ String newcollectionname = (String)request.getAttribute("error:newcollectionname");
+ String newcollectiondescription = (String)request.getAttribute("error:newcollectiondescription");
+ String errorMessage = (String)request.getAttribute("error:message");
+ if(newcollectionname == null)
+ {
+ newcollectionname = "";
+ }
+ if(newcollectiondescription == null)
+ {
+ newcollectiondescription = "";
+ }
%>
<portlet:defineObjects/>
<link rel="stylesheet" type="text/css" href="/portal-admin/css/style.css" media="screen"/>
@@ -14,6 +27,14 @@
<h3 class="sectionTitle-blue">${n:i18n("TITLE_CREATECOLLCONFIRM")}</h3>
<div class=" cms-tab-container">
<table width="100%">
+ <%if(errorMessage != null){%>
+ <tr>
+ <td colspan="2">
+ <font color="red">${n:i18n("CMS_FOLDERNAME_INVALID")}</font>
+ </td>
+ </tr>
+ <%}%>
+
<tr>
<td valign="top" width="250" class="portlet-section-alternate">
<%@ include file="folderlist.jsp" %>
@@ -36,14 +57,14 @@
<tr>
<td valign="bottom">${n:i18n("CMS_NAME")}:</td>
<td align="left"><input class="portlet-form-input-field" type="text"
- name="newcollectionname" size="40" maxlength="50">
+ name="newcollectionname" size="40" maxlength="50" value="<%=newcollectionname%>">
</td>
</tr>
<tr>
<td valign="bottom">${n:i18n("CMS_DESCRIPTION")}:</td>
<td align="left"><input class="portlet-form-input-field" type="text"
name="newcollectiondescription"
- size="40" maxlength="80">
+ size="40" maxlength="80" <%=newcollectiondescription%> value="<%=newcollectiondescription%>">
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2008-09-18 21:46:11 UTC (rev 11933)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2008-09-18 22:34:10 UTC (rev 11934)
@@ -19,6 +19,8 @@
String description = (String)request.getAttribute("error:description");
String title = (String)request.getAttribute("error:title");
String language = (String)request.getAttribute("error:language");
+ String fileName = (String)request.getAttribute("error:filename");
+ String errorMessage = (String)request.getAttribute("error:message");
if (sContent == null)
{
sContent = "";
@@ -35,6 +37,10 @@
{
language = "";
}
+ if(fileName == null)
+ {
+ fileName = "";
+ }
%>
<!-- tinyMCE -->
@@ -104,7 +110,16 @@
<tr>
<td height="10"></td>
</tr>
+
+<%if(errorMessage != null){%>
<tr>
+ <td colspan="2">
+ <font color="red">${n:i18n("CMS_FILENAME_INVALID")}</font>
+ </td>
+</tr>
+<%}%>
+
+<tr>
<td>
<table>
<tr>
@@ -118,7 +133,9 @@
<td>
<input
type="text" name="filename"
- class="portlet-form-input-field"/>
+ class="portlet-form-input-field"
+ value="<%=fileName%>"
+ />
: ${n:i18n("CMS_REQUIRED")}
</td>
</tr>
More information about the portal-commits
mailing list