Skip to content

Commit

Permalink
LPS-23133 Fixing Wiki export problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hudakl authored and brianchandotcom committed Nov 16, 2011
1 parent ce0cff7 commit efc9cce
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,15 @@ protected static void exportPage(
_NAMESPACE, "attachments") &&
page.isHead()) {

for (String attachment : page.getAttachmentsFiles()) {
int pos = attachment.lastIndexOf(CharPool.SLASH);
String[] attachmentsFiles = page.getAttachmentsFiles();

for (int i = 0; i < attachmentsFiles.length; i++) {
String attachment = attachmentsFiles[i];
int pos = attachment.lastIndexOf(StringPool.SLASH);

String name = attachment.substring(pos + 1);
String binPath = getPageAttachementBinPath(
portletDataContext, page, name);
portletDataContext, page, "attachment" + i);

Element attachmentEl = pageElement.addElement("attachment");

Expand Down Expand Up @@ -418,15 +421,15 @@ protected static String getNodePath(

protected static String getPageAttachementBinPath(
PortletDataContext portletDataContext, WikiPage page,
String attachment) {
String fileName) {

StringBundler sb = new StringBundler(5);

sb.append(portletDataContext.getPortletPath(PortletKeys.WIKI));
sb.append("/bin/");
sb.append(page.getPageId());
sb.append(StringPool.SLASH);
sb.append(attachment);
sb.append(fileName);

return sb.toString();
}
Expand Down

0 comments on commit efc9cce

Please sign in to comment.