Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sasinda committed Aug 21, 2012
1 parent c1b8000 commit 4799dbe
Show file tree
Hide file tree
Showing 9 changed files with 381 additions and 313 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,20 @@ public DocumentBuilder withAttachment(Attachment attachment)
d.setAttachment(a);
return this;
}

// public DocumentBuilder_XML withLinks(List<Link> links)

// @Override
// public DocumentBuilder withHistory(Attachments attachments)
// {
// for (Attachment ares : attachments.getAttachments()) {
// withAttachment(ares);
// }
// return this;
// }

//
// These methods are too fine grain to be worth it.
//
//public DocumentBuilder_XML withLinks(List<Link> links)
// {
// return this;
// }
Expand Down Expand Up @@ -462,6 +474,7 @@ public DocumentBuilder withAttachment(Attachment attachment)
// return this;
// }
//

/*
* (non-Javadoc)
* @see org.xwiki.android.xmlrpc.transformation.DocumentBuilder#build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.xwiki.android.rest.transformation;

/**
*
* Translates RestModle to XModel.(other model)
*
*/
public class RestModelTranslator
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
import org.xwiki.android.xmodel.xobjects.XProperty;
import org.xwiki.android.xmodel.xobjects.XSimpleObject;

/**
*
* Translates XModel to rest Model (other model).
*
*/
public class XModelTranslator_XML
{
public Page toPage(XWikiPage doc)
Expand Down
293 changes: 4 additions & 289 deletions xwiki-android-core/src/org/xwiki/android/xmodel/entity/XWikiPage.java
Original file line number Diff line number Diff line change
@@ -1,50 +1,17 @@
package org.xwiki.android.xmodel.entity;

import java.util.Date;
import java.util.List;
import org.xwiki.android.rest.reference.DocumentReference;
import org.xwiki.android.rest.reference.Link;

/**
* Contains the properties of a Page +Additional methods for Document.
*
* @author xwiki dev: not saved to DB. Only the DocumentReference is saved.
*/

public abstract class XWikiPage extends XWikiResource
public abstract class XWikiPage extends XWikiPageSummary
{

// Resource fields
//
protected List<Link> links;

protected String id;// id field in the resource representation. Mobile apps normally use ReSTful URL to
// identify a resource.Not this.

protected String fullName;

protected String wikiName;// wiki in page element

protected String spaceName;// space in page element

protected String name; // name in page element (same)

protected String title;

protected String parentFullName;// parent in resoruce repr.

protected String parentId;

protected String xwikiRelativeUrl;

protected String xwikiAbsoluteUrl;

protected List<String> translations;

protected String defalutTranslation;

protected String syntax;

protected String language;

protected String version;
Expand All @@ -63,8 +30,8 @@ public abstract class XWikiPage extends XWikiResource

protected String content;

// other fields
protected DocumentReference docRef;




/**
Expand All @@ -86,7 +53,7 @@ public XWikiPage(String wikiName, String spaceName, String pageName)
*/
public DocumentReference getDocumentReference()
{
docRef = new DocumentReference(wikiName, spaceName, name);
DocumentReference docRef = new DocumentReference(wikiName, spaceName, name);
docRef.setVersion(version);
docRef.setLanguage(language);
return docRef;
Expand All @@ -111,258 +78,6 @@ public DocumentReference getDocumentReference()



/**
* Gets the value of the id property.
*
* @return possible object is {@link String }
*/
public String getId()
{
return id;
}



/**
* Sets the value of the id property.
*
* @param value allowed object is {@link String }
*/
public void setId(String value)
{
this.id = value;
}

/**
* Gets the value of the fullName property. *
*
* @return possible object is {@link String }
*/
public String getFullName()
{
return fullName;
}

/**
* Sets the value of the fullName property. *
*
* @param value allowed object is {@link String }
*/
public void setFullName(String value)
{
this.fullName = value;
}

/**
* Gets the value of the wiki property.
*
* @return possible object is {@link String }
*/
public String getWikiName()
{
return wikiName;
}

/**
* Sets the value of the wiki property.
*
* @param value allowed object is {@link String }
*/
public void setWikiName(String value)
{
this.wikiName = value;
}

/**
* Gets the value of the space property.
*
* @return possible object is {@link String }
*/
public String getSpaceName()
{
return spaceName;
}

/**
* Sets the value of the space property.
*
* @param value allowed object is {@link String }
*/
public void setSpaceName(String value)
{
this.spaceName = value;
}

// TODO:Consider refactor rename back to getName() ? confuse with name,fullName ?
/**
* get Page Name.
* @return the value of the name property in the Rest model "Page" element..
*/
public String getPageName()
{
return name;
}

/**
* Sets the value of the name property.
*
* @param value allowed object is {@link String }
*/
public void setPageName(String name)
{
this.name = name;
}

/**
* Gets the value of the title property.
*
* @return possible object is {@link String }
*/
public String getTitle()
{
return title;
}

/**
* Sets the value of the title property.
*
* @param value allowed object is {@link String }
*/
public void setTitle(String value)
{
this.title = value;
}

/**
* Gets the value of the parent property.
*
* @return possible object is {@link String }
*/
public String getParentFullName()
{
return parentFullName;
}

/**
* Sets the value of the parent property.
*
* @param value allowed object is {@link String }
*/
public void setParentFullName(String parent)
{
this.parentFullName = parent;
}

/**
* Gets the value of the parentId property.
*
* @return possible object is {@link String }
*/
public String getParentId()
{
return parentId;
}

/**
* Sets the value of the parentId property.
*
* @param value allowed object is {@link String }
*/
public void setParentId(String value)
{
this.parentId = value;
}

/**
* Gets the value of the xwikiRelativeUrl property.
*
* @return possible object is {@link String }
*/
public String getXwikiRelativeUrl()
{
return xwikiRelativeUrl;
}

/**
* Sets the value of the xwikiRelativeUrl property.
*
* @param value allowed object is {@link String }
*/
public void setXwikiRelativeUrl(String value)
{
this.xwikiRelativeUrl = value;
}

/**
* Gets the value of the xwikiAbsoluteUrl property.
*
* @return possible object is {@link String }
*/
public String getXwikiAbsoluteUrl()
{
return xwikiAbsoluteUrl;
}

/**
* Sets the value of the xwikiAbsoluteUrl property.
*
* @param value allowed object is {@link String }
*/
public void setXwikiAbsoluteUrl(String value)
{
this.xwikiAbsoluteUrl = value;
}

/**
* Gets the value of the translations property.
*
* @return possible object is {@link Translations }
*/
public List<String> getTranslations()
{
return translations;
}

/**
* Sets the value of the translations property.
*
* @param value allowed object is {@link Translations }
*/
public void setTranslations(List<String> translations)
{
this.translations = translations;
}

public String getDefalutTranslation()
{
return defalutTranslation;
}

public void setDefalutTranslation(String defalutTranslation)
{
this.defalutTranslation = defalutTranslation;
}

/**
* Gets the value of the syntax property.
*
* @return possible object is {@link String }
*/
public String getSyntax()
{
return syntax;
}

/**
* Sets the value of the syntax property.
*
* @param value allowed object is {@link String }
*/
public void setSyntax(String value)
{
this.syntax = value;
}

public String getLanguage()
{
return language;
Expand Down
Loading

0 comments on commit 4799dbe

Please sign in to comment.