-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
448 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
xwiki-android-howtos/src/org/xwiki/android/howtos/_00_SampleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
xwiki-android-howtos/src/org/xwiki/android/howtos/_01_CreateDocument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 13 additions & 4 deletions
17
xwiki-android-howtos/src/org/xwiki/android/howtos/_03_SaveDocument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
package org.xwiki.android.howtos; | ||
|
||
import org.xwiki.android.svc.xmodel.DocumentLocalSvcs; | ||
import org.xwiki.android.svc.xmodel.DocumentSvcImpl; | ||
import org.xwiki.android.xmodel.blog.XBlogPost; | ||
import org.xwiki.android.xmodel.entity.Comment; | ||
import org.xwiki.android.xmodel.entity.Document; | ||
import org.xwiki.android.xmodel.svc.DocumentLocalSvcs; | ||
import org.xwiki.android.xmodel.svc.DocumentSvcImpl; | ||
|
||
public class _03_SaveDocument | ||
{ | ||
public void demo(){ | ||
|
||
Document mydoc=new Document("wikiName", "spaceName", "pageName");//create empty document | ||
// ... edit mydoc | ||
mydoc.addObject(new XBlogPost()); | ||
mydoc.setContent("edited page content"); | ||
mydoc.addComment(new Comment("hi")); | ||
|
||
//lets save it! | ||
|
||
DocumentLocalSvcs docsvcl=new DocumentSvcImpl(); | ||
|
||
docsvcl.save(mydoc, "My tag to identify this easily", null);//docsvcl.save(doc, tag, clbk). we pass null for clbk | ||
// since we do not want to know wether the doc was sucessfully | ||
docsvcl.save(mydoc, "My short TAG to identify this easily", null);//docsvcl.save(doc, tag, clbk). we pass null for clbk | ||
// since we do not want to know whether the doc was sucessfully | ||
// saved or not. | ||
/* | ||
* The current implementatation supports tagging to identify documents saved in the file store. | ||
* The key for the document is automatically generated as a combination of wiki:space:page:version. | ||
*/ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
xwiki-android-howtos/src/org/xwiki/android/howtos/filestore/README
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
These how tos explain how to directly use the File Store. | ||
(DocumentSvc in svc.xmodel package provide an asynchronous layer with call backs to call these same methods.) |
22 changes: 22 additions & 0 deletions
22
xwiki-android-howtos/src/org/xwiki/android/howtos/filestore/_00_Save.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.xwiki.android.howtos.filestore; | ||
|
||
import org.xwiki.android.context.XWikiApplicationContext; | ||
import org.xwiki.android.data.fileStore.DocumentFao; | ||
import org.xwiki.android.data.fileStore.FSDocumentReference; | ||
import org.xwiki.android.data.fileStore.FileStoreManager; | ||
import org.xwiki.android.xmodel.entity.Document; | ||
|
||
public class _00_Save | ||
{ | ||
void save() | ||
{ | ||
XWikiApplicationContext ctx = XWikiApplicationContext.getInstance(); | ||
FileStoreManager fm = ctx.getFileStoreManager(); | ||
DocumentFao fao = fm.getDocumentFao(); | ||
|
||
|
||
Document doc=new Document("WikiName", "spaceName", "pageName"); | ||
FSDocumentReference ref = fao.save(doc, "sas"); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
xwiki-android-howtos/src/org/xwiki/android/howtos/filestore/_01_ListAndLoad.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.xwiki.android.howtos.filestore; | ||
|
||
import org.xwiki.android.context.XWikiApplicationContext; | ||
import org.xwiki.android.data.fileStore.DocumentFao; | ||
import org.xwiki.android.data.fileStore.FSDocumentReference; | ||
import org.xwiki.android.data.fileStore.FileStoreManager; | ||
import org.xwiki.android.xmodel.entity.Document; | ||
|
||
public class _01_ListAndLoad | ||
{ | ||
void load(){ | ||
XWikiApplicationContext ctx = XWikiApplicationContext.getInstance(); | ||
FileStoreManager fm = ctx.getFileStoreManager(); | ||
DocumentFao fao = fm.getDocumentFao(); | ||
|
||
|
||
|
||
FSDocumentReference ref=fao.listByTag("my File Store tag. ").get(0); //file store supports tagging to search documents. | ||
//listBy... returns a list of references; | ||
Document doc=fao.load(ref);//ok we loaded it. | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
These how tos explain how to directly use the RAL layer. | ||
All the operations here are longrunning blocking operations. | ||
So it is adviced to use the svc.xmodel package's DocumentSvc classes to do these asynchronically. |
Oops, something went wrong.