Moxkiriyaプロジェクト事前開発用の作業部屋
Revisión | e565ca1f2beb402d574a526bddf1f6e9e77a98df (tree) |
---|---|
Tiempo | 2018-10-13 20:31:48 |
Autor | Harold_Andoh <andolloyd@gmai...> |
Commiter | Harold_Andoh |
[Moxkiriya7]
@@ -997,9 +997,11 @@ public class WikiMainWindowController implements Initializable { | ||
997 | 997 | */ |
998 | 998 | public PageData getLatestContents() throws Exception { |
999 | 999 | PageData pageData = new PageData(); |
1000 | - | |
1000 | + PageData editData = (PageData)AnchorPaneEdit.getUserData(); | |
1001 | + | |
1001 | 1002 | pageData.setTitle(textFieldTitle.getText()); |
1002 | 1003 | pageData.setContent(textAreaContents.getText()); |
1004 | + pageData.setNamespace(editData.getNamespace()); | |
1003 | 1005 | String pathname = textFieldAttachFile.getText(); |
1004 | 1006 | if( (pathname != null) |
1005 | 1007 | && (pathname.isEmpty() != true)) { |
@@ -1,5 +1,12 @@ | ||
1 | -package com.wiki.standalone.moxkiriya.parser.inlineparser; | |
2 | - | |
1 | +/** | |
2 | + * Moxkiriya standalone Wiki. | |
3 | + * Wiki Internallink inline parser | |
4 | + * | |
5 | + * @author Ryuhei Terada | |
6 | + * See the '<a href="{@docRoot}/copyright.html">Copyright</a>' | |
7 | + */package com.wiki.standalone.moxkiriya.parser.inlineparser; | |
8 | + | |
9 | +import java.io.ByteArrayOutputStream; | |
3 | 10 | import java.io.InputStream; |
4 | 11 | import java.util.HashMap; |
5 | 12 | import java.util.LinkedHashMap; |
@@ -10,13 +17,17 @@ import java.util.regex.Pattern; | ||
10 | 17 | import javax.jcr.Node; |
11 | 18 | import javax.jcr.Property; |
12 | 19 | |
13 | -import org.apache.xerces.impl.dv.util.Base64; | |
20 | +import org.apache.jackrabbit.util.Base64; | |
14 | 21 | |
15 | 22 | import com.wiki.standalone.moxkiriya.PageData; |
16 | 23 | import com.wiki.standalone.moxkiriya.WikiEngine; |
17 | 24 | import com.wiki.standalone.moxkiriya.WikiRepository; |
18 | 25 | import com.wiki.standalone.moxkiriya.util.FileTypeDeterminator; |
19 | 26 | |
27 | +/** | |
28 | + * Wiki internal inline parser. | |
29 | + * Transform [[linkTarget|Title]] to <a href="linkTarget">Title</a> | |
30 | + */ | |
20 | 31 | public class WikiInternalLinkInlineParser extends WikiInlineParserBase { |
21 | 32 | /** WIKI開始トークン */ |
22 | 33 | public static final String WIKI_TOKEN_START = "[["; |
@@ -164,12 +175,11 @@ public class WikiInternalLinkInlineParser extends WikiInlineParserBase { | ||
164 | 175 | mediaType = fileData.getMimeType(); |
165 | 176 | |
166 | 177 | InputStream inputStream = fileData.getInputStream(); |
178 | + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); | |
167 | 179 | |
168 | 180 | if(mediaType.startsWith("image/") == true) { |
169 | - byte[] byteBuf = new byte[256]; | |
170 | - while(inputStream.read(byteBuf) != -1) { | |
171 | - databuf.append(Base64.encode(byteBuf)); | |
172 | - } | |
181 | + Base64.encode(inputStream, outputStream); | |
182 | + databuf.append(outputStream.toString()); | |
173 | 183 | } |
174 | 184 | |
175 | 185 | buf.append(IMAGE_START_TAG); |