public abstract class MediaWikiApiImpl implements MediawikiApi {
  
  /**
   * Logging may be enabled by setting debug to true
   */
  protected static java.util.logging.Logger LOGGER = java.util.logging.Logger
      .getLogger("com.bitplan.mediawiki.japi");

  /**
   * set to true if exceptions should be thrown on Error
   */
  protected boolean throwExceptionOnError = true;
  
  /**
   * protection Marker - if this shows in  page edits are suppressed and logged with a warning
   */
  protected String protectionMarker="<!-- This page is protected against edits by Mediawiki-Japi -->";

  private String mediawikiVersion;
  
  /**
   * @return the throwExceptionOnError
   */
  public boolean isThrowExceptionOnError() {
    return throwExceptionOnError;
  }

  /**
   * @param throwExceptionOnError
   *          the throwExceptionOnError to set
   */
  public void setThrowExceptionOnError(boolean throwExceptionOnError) {
    this.throwExceptionOnError = throwExceptionOnError;
  }
  
  /**
   * @return the protectionMarker
   */
  public String getProtectionMarker() {
    return protectionMarker;
  }

  /**
   * @param protectionMarker the protectionMarker to set
   */
  public void setProtectionMarker(String protectionMarker) {
    this.protectionMarker = protectionMarker;
  }
  
  /**
   * handle the given error Message according to the exception setting
   * 
   * @param errMsg
   * @throws Exception
   */
  protected void handleError(String errMsg) throws Exception {
    // log it
    LOGGER.log(Level.SEVERE, errMsg);
    // and throw an error if this is configured
    if (this.isThrowExceptionOnError()) {
      throw new Exception(errMsg);
    }
  }
  
  /**
   * handle the given api error
   * @param error
   * @throws Exception
   */
  protected void handleError(Error error) throws Exception {
    String errMsg="error: "+error.getCode()+" info: "+error.getInfo();
    handleError(errMsg);
  }
  
  /**
   * 
   * @param api
   * @throws Exception
   */
  protected void handleError(Api api) throws Exception {
    if (api==null) {
      String errMsg="api result is null";
      handleError(errMsg);
    }
    if (api.getError() != null) {
      this.handleError(api.getError());
    }
    if (api.getWarnings() != null) {
      Warnings warnings = api.getWarnings();
      if (warnings.getTokens() != null) {
        Tokens warningTokens = warnings.getTokens();
        String errMsg = warningTokens.getValue();
        handleError(errMsg);
      }
    }
  }
  
  /**
   * return Api from the given xml
   * @param xml - the xml go unmarshal
   * @return
   * @throws Exception
   */
  public Api fromXML(String xml) throws Exception {
    // retrieve the JAXB wrapper representation from the xml received
    Api api = Api.fromXML(xml);
    // check whether an error code was sent
    Error error = api.getError();
    // if there is an error - handle it
    if (error != null) {
      // prepare the error message
      String errMsg = "error code=" + error.getCode() + " info:'"
          + error.getInfo() + "'";
      this.handleError(errMsg);
    }
    return api;
  }
  
  // we do not implement this ... 
  public abstract SiteInfo getSiteInfo() throws Exception;
  
  /**
   * copy the page for a given title from this wiki to the given target Wiki
   * uses https://www.mediawiki.org/wiki/API:Edit FIXME - make this an API
   * interface function FIXME - create a multi title version
   * 
   * @param targetWiki
   *          - the other wiki (could use a different API implementation ...)
   * @param pageTitle
   *          - the title of the page to copy
   * @param summary
   *          - the summary to use
   * @return - the Edit result
   * @throws Exception
   */
  public Edit copyToWiki(MediawikiApi targetWiki, String pageTitle,
      String summary) throws Exception {
    SiteInfo siteinfo = this.getSiteInfo();
    SiteInfo targetSiteInfo = targetWiki.getSiteInfo();
    PageInfo sourcePageInfo=new PageInfo(pageTitle,siteinfo);
    String targetPageTitle=pageTitle;
    Edit result=null;
    String nameSpaceName="";
    if (sourcePageInfo.namespace!=null) {
      nameSpaceName=sourcePageInfo.nameSpaceName;
      String targetNameSpace=siteinfo.mapNamespace(nameSpaceName, targetSiteInfo);
      targetPageTitle=pageTitle.replaceFirst(nameSpaceName+":",targetNameSpace+":");
    }
    String content = getPageContent(pageTitle);
    // "File:" namespace (ID: 6) used see http://www.mediawiki.org/wiki/Manual:Namespace#Built-in_namespaces
    if (sourcePageInfo.namespaceId==6) {
      // get the image information 
      Ii ii = this.getImageInfo(pageTitle);
      String filename=pageTitle.replaceFirst("File:","");
      if (nameSpaceName!=null) {
        filename=filename.replaceFirst(nameSpaceName+":", "");
      }
      targetWiki.upload(ii,filename,content);
      result=new Edit();
      result.setTitle(filename);
    } else {
      result = targetWiki.edit(targetPageTitle, content, summary);
    }
    return result;
  }
  
  /**
   * get the Version of this wiki
   * 
   * @throws Exception
   */
  public String getVersion() throws Exception {
    // is there a cached value of the mediaWikiVersion 
    if (mediawikiVersion==null) {
      // get the version (just once)
      mediawikiVersion=getSiteInfo().getVersion();
    }
    return mediawikiVersion;
  }
  
  /**
   * set the version via API
   * @param version
   */
  public void setVersion(String version) {
    if (mediawikiVersion==null) {
      mediawikiVersion=version;
    } else {
      throw new IllegalStateException("version "+mediawikiVersion+" already set");
    }
  }
  
  /**
   * request parameter encoding
   * 
   * @param param
   * @return an encoded url parameter
   * @throws Exception
   */
  protected String encode(String param) throws Exception {
    String result = URLEncoder.encode(param, "UTF-8");
    return result;
  }
  
  /**
   * decode the given html markup
   * @param html
   * @return decoded html
   * @throws Exception
   */
  protected String decode(String html) throws Exception {
    String result=StringEscapeUtils.unescapeHtml4(html);
    return result;
  }

  /**
   * normalize the given page title
   * 
   * @param title
   * @return the normalized title e.g. replacing blanks FIXME encode is not good
   *         enough
   * @throws Exception
   */
  public String normalizeTitle(String title) throws Exception {
    String result = encode(title);
    result=result.replace("+","_");
    return result;
  }
} public interface MediawikiApi {
  /**
   * @return the siteurl
   */
  public String getSiteurl();

  /**
   * set the siteurl
   * 
   * @param siteurl
   * @throws Exception
   *           - if the url is not o.k.
   */
  public void setSiteurl(String siteurl) throws Exception;

  /**
   * set the scriptPath of this Wiki
   * 
   * @param scriptPath
   *          - the scriptPath to set
   */
  public void setScriptPath(String scriptPath);

  /**
   * get the script Path
   * 
   * @return
   */
  public String getScriptPath();

  /**
   * get the Version of this Mediawiki
   * 
   * @return the the version string
   * @throws Exception
   */
  public String getVersion() throws Exception;

  /**
   * get the general siteinfo
   * 
   * @return the siteinfo
   * @throws Exception
   */
  public SiteInfo getSiteInfo() throws Exception;

  /**
   * get the Image Info for the given pageTitle
   * 
   * @param pageTitle
   *          - the pageTitle to get the ImageInfo for
   * @return - the Image Info
   * @throws Exception
   */
  public Ii getImageInfo(String pageTitle) throws Exception;

  /**
   * overrideable method to do pre setup stuff
   * 
   * @param siteurl
   *          - the url to use
   * @param scriptPath
   *          - the script path to use
   * @throws Exception
   */
  public void init(String siteurl, String scriptPath) throws Exception;

  /**
   * login the given user with the given password
   * 
   * See <a href="https://www.mediawiki.org/wiki/API:Login">API:Login</a>
   * 
   * @param username
   * @param password
   * @return the Login information as returned by the API
   * @throws Exception
   * @since 0.0.1
   */
  public Login login(String username, String password) throws Exception;

  /**
   * check whether there is a User logged In
   * 
   * @return
   */
  public boolean isLoggedIn();

  /**
   * 
   * Log the current user out See <a
   * href="https://www.mediawiki.org/wiki/API:Logout">API:Logout</a>
   * 
   * @throws Exception
   * @since 0.0.1
   */
  public void logout() throws Exception;

  /**
   * get the page Content for the given page Title
   * 
   * @param pageTitle
   * @return the content of the page
   * @throws Exception
   * @since 0.0.1
   */
  public String getPageContent(String pageTitle) throws Exception;
  
  /**
   * get the html rendered version of a page
   * @param pageTitle
   * @return the html for a page
   * @throws Exception
   * @since 0.0.15
   */
  public String getPageHtml(String pageTitle) throws Exception;

  /**
   * get the Images on the given page
   * 
   * @param pageTitle
   * @param imLimit
   * @return
   * @throws Exception
   */
  public List<Im> getImagesOnPage(String pageTitle, int imLimit)
      throws Exception;

  /**
   * get the content of the given section
   * 
   * @param pageTitle
   * @param sectionNumber
   * @return the content of the section;
   * @throws Exception
   */
  public String getSectionText(String pageTitle, int sectionNumber)
      throws Exception;

  /**
   * delete the given page for the given reason
   * 
   * @param title
   * @param reason
   * @return
   * @throws Exception
   * @since 0.0.1
   */
  public Delete delete(String title, String reason) throws Exception;

  /**
   * Edits a page by setting its text to the supplied value.
   *
   * @param text
   *          the text of the page
   * @param pagetitle
   *          the title of the page
   * @param summary
   *          the edit summary. Summaries longer than 200 characters are
   *          truncated server-side.
   * @return the edit stage as a wrapped Edit API response
   * @throws Exception
   *           - if the edit fails
   * @see #getPageContent
   * @since 0.0.1
   */
  public Edit edit(String pagetitle, String text, String summary)
      throws Exception;

  /**
   * edit
   * 
   * @param pageTitle
   * @param text
   * @param summary
   * @param minor
   *          - true if this is a minor edit
   * @param bot
   *          whether to mark the edit as a bot edit (ignored if one does not
   *          have the necessary permissions)
   * @param sectionNumber
   *          the section to edit. Use -1 to specify a new section and -2 to
   *          disable section editing.
   * @param sectionTitle
   *          the title of a new section
   * @param basetime
   *          the timestamp of the revision on which <tt>text</tt> is based,
   *          used to check for edit conflicts. <tt>null</tt> disables this.
   * @return the edit stage as a wrapped Edit API response * @throws Exception -
   *         if the edit fails
   * @see #getPageContent
   * @since 0.0.4
   */
  public Edit edit(String pageTitle, String text, String summary,
      boolean minor, boolean bot, int sectionNumber, String sectionTitle,
      Calendar basetime) throws Exception;

  /**
   * Uploads an image. Equivalent to [[Special:Upload]].
   * 
   * @param file
   *          the image file
   * @param filename
   *          the target file name (may contain File)
   * @param pageContent
   *          the contents of the image description page, set to "" if
   *          overwriting an existing file
   * @param comment
   *          an upload summary (defaults to <tt>contents</tt>, use "" to not
   *          specify one)
   * @throws Exception
   *           - if the upload fails
   * @since 0.0.3
   */
  public void upload(File file, String filename, String pageContent,
      String comment) throws Exception;

  /**
   * upload the image described in the given imageinfo
   * 
   * @param ii
   * @param fileName
   * @param pageContent
   *          the contents of the image description page, set to "" if
   *          overwriting an existing file
   * @throws Exception
   * @since 0.0.5
   */
  public void upload(Ii ii, String fileName, String pageContent)
      throws Exception;

  /**
   * getAllPages
   * 
   * @param apfrom
   *          - may be null or empty
   * @param aplimit
   * @return
   * @throws Exception
   */
  public List<P> getAllPages(String apfrom, int aplimit) throws Exception;

  /**
   * get all Images by the given time stamps
   * 
   * @param aistart
   *          - start time stamp
   * @param aiend
   *          - end time stamp
   * @param ailimit
   *          - how many images to get
   * @throws Exception
   */
  public List<Img> getAllImagesByTimeStamp(String aistart, String aiend,
      int ailimit) throws Exception;

  /**
   * get the sections for the given pageTitle
   * 
   * @param pageTitle
   * @return
   * @throws Exception
   */
  public List<S> getSections(String pageTitle) throws Exception;

  /**
   * set the given protectionMarker for this wiki if a page has this
   * protectionMarker and edit will not be done
   * 
   * @param protectionMarker
   */
  public void setProtectionMarker(String protectionMarker);

  /**
   * copy the page for a given title from this wiki to the given target Wiki
   * uses https://www.mediawiki.org/wiki/API:Edit FIXME - make this an API
   * interface function FIXME - create a multi title version
   * 
   * @param targetWiki
   *          - the other wiki (could use a different API implementation ...)
   * @param pageTitle
   *          - the title of the page to copy
   * @param summary
   *          - the summary to use
   * @return - the Edit result
   * @throws Exception
   */
  public Edit copyToWiki(MediawikiApi targetWiki, String pageTitle,
      String summary) throws Exception;

  /**
   * are exceptions thrown when an api error code is received?
   * 
   * @return the throwExceptionOnError
   */
  public boolean isThrowExceptionOnError();

  /**
   * set to true if exceptions should be thrown when api error codes are
   * received default is true
   * 
   * @param throwExceptionOnError
   *          the throwExceptionOnError to set
   */
  public void setThrowExceptionOnError(boolean throwExceptionOnError);

  /**
   * get an ISO time stamp (utility function) FIXME may have to move out of the
   * main API
   * 
   * @return
   */
  public String getIsoTimeStamp();

  /**
   * set the debug mode
   * 
   * @param pDebug
   */
  public void setDebug(boolean pDebug);

  /**
   * get the state of the debug mode
   * 
   * @return - true if debugging is activated
   * @return
   */
  public boolean isDebug();
  
  /**
   * normalize the given page title
   * @param title - a raw page title
   * @return a valid page title see https://www.mediawiki.org/wiki/Manual:Page_title
   * @throws Exception
   */
  public String normalizeTitle(String title) throws Exception;

  /**
   * get the backlinks for the given pagetitle
   * 
   * @param pagetitle
   * @param params
   *          - extra params
   * @limit - the limit for the number of results to return
   * @throws Exception
   */
  public List<Bl> getBacklinks(String pageTitle, String params, int limit)
      throws Exception;

  /**
   * get the imageusage for the given imageTitle
   * 
   * @param imageTitle
   * @param params
   *          - extra params
   * @limit - the limit for the number of results to return
   * @throws Exception
   */
  public List<Iu> getImageUsage(String imageTitle, String params, int limit)
      throws Exception;

  /**
   * get the imageInfos for all images on the given page Title
   * 
   * @param pageTitle
   * @limit - the limit for the number of results to return
   * @throws Exception
   * 
   * @return the list of ImageInfos
   */
  public List<Ii> getImageInfosForPage(String pageTitle, int limit) throws Exception;

} public interface SiteInfo {
  
  /**
   * get the languge of this site
   * @return
   * @throws Exception 
   */
  public String getLang() throws Exception;
  
  /**
   * get the Version of this wiki
   * 
   * @throws Exception
   */
  public String getVersion() throws Exception;
  
  /**
   * get the Namespaces for this wiki
   * @return
   * @throws Exception
   */
  public Map<String,Ns> getNamespaces() throws Exception;
  
  /**
   * get the Namespaces for this wiki
   * @return
   * @throws Exception
   */
  public Map<Integer,Ns> getNamespacesById() throws Exception;
  
  /**
   * get the Namespaces by canonical name for this wiki
   * @return
   * @throws Exception
   */
  public Map<String,Ns> getNamespacesByCanonicalName() throws Exception;
  
  /**
   * get the general siteinfo
   * 
   * @return the general siteinfo
   * @throws Exception
   */
  public General getGeneral() throws Exception;
  
  /**
   * map the given namespace to the target wiki
   * @param ns
   * @param targetWiki
   * @return the namespace name for the target wiki
   * @throws Exception 
   */
  public String mapNamespace(String ns, SiteInfo targetWiki) throws Exception;
} @XmlRootElement(name = "api")
public class Api implements JaxbPersistenceApi<Api> {
	 /**
   * Logging may be enabled by setting debug to true
   */
  protected static java.util.logging.Logger LOGGER = java.util.logging.Logger
      .getLogger("com.bitplan.mediawiki.japi.api");
  
  String servedby;
  protected String rawJson;
  protected Query query;
  protected Login login;
  protected Error error;
  protected Createaccount createaccount;
 
  protected Warnings warnings;
  protected Tokens tokens;
  protected Edit edit;
  protected Delete delete;
  protected Parse parse;
  protected Paraminfo paraminfo;

  /**
   * Ruft den Wert der paraminfo-Eigenschaft ab.
   * 
   * @return
   *     possible object is
   *     {@link Paraminfo }
   *     
   */
  public Paraminfo getParaminfo() {
      return paraminfo;
  }

  /**
   * Legt den Wert der paraminfo-Eigenschaft fest.
   * 
   * @param value
   *     allowed object is
   *     {@link Paraminfo }
   *     
   */
  public void setParaminfo(Paraminfo value) {
      this.paraminfo = value;
  }

  /**
   * @return the servedby
   */
  @XmlAttribute
  public String getServedby() {
    return servedby;
  }

  /**
   * @param servedby
   *          the servedby to set
   */
  public void setServedby(String servedby) {
    this.servedby = servedby;
  }

  public String getRawJson() {
    return rawJson;
  }

  public void setRawJson(String rawJson) {
    this.rawJson = rawJson;
  }

  /**
   * Gets the value of the login property.
   * 
   * @return possible object is {@link Login }
   * 
   */
  public Login getLogin() {
    return login;
  }

  /**
   * Sets the value of the login property.
   * 
   * @param value
   *          allowed object is {@link Login }
   * 
   */
  public void setLogin(Login value) {
    this.login = value;
  }

  /**
   * @return the query
   */
  public Query getQuery() {
    return query;
  }

  /**
   * @param query
   *          the query to set
   */
  public void setQuery(Query query) {
    this.query = query;
  }

  /**
   * Gets the value of the error property.
   * 
   * @return possible object is {@link Error }
   * 
   */
  public Error getError() {
    return error;
  }

  /**
   * Sets the value of the error property.
   * 
   * @param value
   *          allowed object is {@link Error }
   * 
   */
  public void setError(Error value) {
    this.error = value;
  }

  /**
   * Ruft den Wert der warnings-Eigenschaft ab.
   * 
   * @return possible object is {@link Warnings }
   * 
   */
  public Warnings getWarnings() {
    return warnings;
  }

  /**
   * Legt den Wert der warnings-Eigenschaft fest.
   * 
   * @param value
   *          allowed object is {@link Warnings }
   * 
   */
  public void setWarnings(Warnings value) {
    this.warnings = value;
  }

  /**
   * Gets the value of the tokens property.
   * 
   * @return possible object is {@link Tokens }
   * 
   */
  public Tokens getTokens() {
    return tokens;
  }

  /**
   * Sets the value of the tokens property.
   * 
   * @param value
   *          allowed object is {@link Tokens }
   * 
   */
  public void setTokens(Tokens value) {
    this.tokens = value;
  }
  
  /**
   * Ruft den Wert der createaccount-Eigenschaft ab.
   * 
   * @return
   *     possible object is
   *     {@link Createaccount }
   *     
   */
  public Createaccount getCreateaccount() {
      return createaccount;
  }

  /**
   * Legt den Wert der createaccount-Eigenschaft fest.
   * 
   * @param value
   *     allowed object is
   *     {@link Createaccount }
   *     
   */
  public void setCreateaccount(Createaccount value) {
      this.createaccount = value;
  }

  /**
   * Gets the value of the edit property.
   * 
   * @return possible object is {@link Edit }
   * 
   */
  public Edit getEdit() {
    return edit;
  }

  /**
   * @return the delete
   */
  public Delete getDelete() {
    return delete;
  }

  /**
   * @param delete the delete to set
   */
  public void setDelete(Delete delete) {
    this.delete = delete;
  }

  /**
   * Sets the value of the edit property.
   * 
   * @param value
   *          allowed object is {@link Edit }
   * 
   */
  public void setEdit(Edit value) {
    this.edit = value;
  }

  /**
   * Gets the value of the parse property.
   * 
   * @return possible object is {@link Parse }
   * 
   */
  public Parse getParse() {
    return parse;
  }

  /**
   * Sets the value of the parse property.
   * 
   * @param value
   *          allowed object is {@link Parse }
   * 
   */
  public void setParse(Parse value) {
    this.parse = value;
  }
  
  /**
   * allows typed / non static access to JaxbFactory features for
   * 
   * @author wf
   *
   */
  public static class ApiFactory extends JaxbFactory<Api> {
    public ApiFactory() {
      super(Api.class);
    }
  }

  private static ApiFactory apifactory = new ApiFactory();

  /**
   * create a Api from an XML string
   * 
   * @param xml
   *          - xml representation of Page Schema
   * @return the Api unmarshalled from the given xml
   * @throws Exception
   */
  public static Api fromXML(final String xml) throws Exception {
  	Api result=null;
  	try {
  	  result=apifactory.fromXML(xml);
  	} catch (JAXBException je) {
  		LOGGER.log(Level.SEVERE,je.getMessage());
  		LOGGER.log(Level.INFO,xml);
  		throw je;
  	}
    return result;
  }

  /**
   * get my factory
   * 
   * @return the factory
   */
  public JaxbFactoryApi<Api> getFactory() {
    return apifactory;
  }

  /**
   * return me as a Json string
   */
  public String asJson() throws JAXBException {
    return getFactory().asJson(this);
  }

  /**
   * return me as an Xml string
   */
  public String asXML() throws JAXBException {
    return getFactory().asXML(this);
  }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class Bl {

    @XmlAttribute(name = "pageid")
    protected Integer pageid;
    @XmlAttribute(name = "ns")
    protected Integer ns;
    @XmlAttribute(name = "title")
    protected String title;

    /**
     * Ruft den Wert der pageid-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getPageid() {
        return pageid;
    }

    /**
     * Legt den Wert der pageid-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setPageid(Integer value) {
        this.pageid = value;
    }

    /**
     * Ruft den Wert der ns-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getNs() {
        return ns;
    }

    /**
     * Legt den Wert der ns-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setNs(Integer value) {
        this.ns = value;
    }

    /**
     * Ruft den Wert der title-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTitle() {
        return title;
    }

    /**
     * Legt den Wert der title-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTitle(String value) {
        this.title = value;
    }

} public class Delete {

  protected String title;
  protected String reason;
  protected Integer logid;
  /**
   * @return the title
   */
  @XmlAttribute
  public String getTitle() {
    return title;
  }
  /**
   * @param title the title to set
   */
  public void setTitle(String title) {
    this.title = title;
  }
  /**
   * @return the reason
   */
  @XmlAttribute
  public String getReason() {
    return reason;
  }
  /**
   * @param reason the reason to set
   */
  public void setReason(String reason) {
    this.reason = reason;
  }
  /**
   * @return the logid
   */
  @XmlAttribute
  public Integer getLogid() {
    return logid;
  }
  /**
   * @param logid the logid to set
   */
  public void setLogid(Integer logid) {
    this.logid = logid;
  }
  
  public Delete() {}; // make JAXB happy
} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "value"
})
public class Edit {

    @XmlValue
    protected String value;
    @XmlAttribute(name = "new")
    protected String _new;
    @XmlAttribute
    protected String result;
    @XmlAttribute
    protected Integer pageid;
    @XmlAttribute
    protected String title;
    @XmlAttribute
    protected String contentmodel;
    @XmlAttribute
    protected Integer oldrevid;
    @XmlAttribute
    protected Integer newrevid;
    @XmlAttribute
    @XmlSchemaType(name = "dateTime")
    protected XMLGregorianCalendar newtimestamp;

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

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

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

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

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

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

    /**
     * Gets the value of the pageid property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getPageid() {
        return pageid;
    }

    /**
     * Sets the value of the pageid property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setPageid(Integer value) {
        this.pageid = value;
    }

    /**
     * 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 contentmodel property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getContentmodel() {
        return contentmodel;
    }

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

    /**
     * Gets the value of the oldrevid property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getOldrevid() {
        return oldrevid;
    }

    /**
     * Sets the value of the oldrevid property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setOldrevid(Integer value) {
        this.oldrevid = value;
    }

    /**
     * Gets the value of the newrevid property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getNewrevid() {
        return newrevid;
    }

    /**
     * Sets the value of the newrevid property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setNewrevid(Integer value) {
        this.newrevid = value;
    }

    /**
     * Gets the value of the newtimestamp property.
     * 
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public XMLGregorianCalendar getNewtimestamp() {
        return newtimestamp;
    }

    /**
     * Sets the value of the newtimestamp property.
     * 
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public void setNewtimestamp(XMLGregorianCalendar value) {
        this.newtimestamp = value;
    }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "fallback",
    "thumblimits",
    "imagelimits",
    "extensiondistributor"
})
@XmlRootElement
public class General {

    @XmlElement(required = true)
    protected String fallback;
    @XmlElement(required = true)
    protected Thumblimits thumblimits;
    @XmlElement(required = true)
    protected Imagelimits imagelimits;
    @XmlElement(required = true)
    protected Extensiondistributor extensiondistributor;
    @XmlAttribute(name = "mainpage")
    protected String mainpage;
    @XmlAttribute(name = "base")
    @XmlSchemaType(name = "anyURI")
    protected String base;
    @XmlAttribute(name = "sitename")
    protected String sitename;
    @XmlAttribute(name = "logo")
    protected String logo;
    @XmlAttribute(name = "generator")
    protected String generator;
    @XmlAttribute(name = "phpversion")
    protected String phpversion;
    @XmlAttribute(name = "phpsapi")
    protected String phpsapi;
    @XmlAttribute(name = "hhvmversion")
    protected String hhvmversion;
    @XmlAttribute(name = "dbtype")
    protected String dbtype;
    @XmlAttribute(name = "dbversion")
    protected String dbversion;
    @XmlAttribute(name = "imagewhitelistenabled")
    protected String imagewhitelistenabled;
    @XmlAttribute(name = "langconversion")
    protected String langconversion;
    @XmlAttribute(name = "titleconversion")
    protected String titleconversion;
    @XmlAttribute(name = "linkprefixcharset")
    protected String linkprefixcharset;
    @XmlAttribute(name = "linkprefix")
    protected String linkprefix;
    @XmlAttribute(name = "linktrail")
    protected String linktrail;
    @XmlAttribute(name = "legaltitlechars")
    protected String legaltitlechars;
    @XmlAttribute(name = "git-hash")
    protected String gitHash;
    @XmlAttribute(name = "git-branch")
    protected String gitBranch;
    @XmlAttribute(name = "case")
    protected String _case;
    @XmlAttribute(name = "lang")
    protected String lang;
    @XmlAttribute(name = "fallback8bitEncoding")
    protected String fallback8BitEncoding;
    @XmlAttribute(name = "writeapi")
    protected String writeapi;
    @XmlAttribute(name = "timezone")
    protected String timezone;
    @XmlAttribute(name = "timeoffset")
    protected Byte timeoffset;
    @XmlAttribute(name = "articlepath")
    protected String articlepath;
    @XmlAttribute(name = "scriptpath")
    protected String scriptpath;
    @XmlAttribute(name = "script")
    protected String script;
    @XmlAttribute(name = "server")
    protected String server;
    @XmlAttribute(name = "servername")
    @XmlSchemaType(name = "anyURI")
    protected String servername;
    @XmlAttribute(name = "wikiid")
    protected String wikiid;
    @XmlAttribute(name = "time")
    @XmlSchemaType(name = "dateTime")
    protected XMLGregorianCalendar time;
    @XmlAttribute(name = "misermode")
    protected String misermode;
    @XmlAttribute(name = "maxuploadsize")
    protected Integer maxuploadsize;
    @XmlAttribute(name = "favicon")
    protected String favicon;

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

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

    /**
     * Gets the value of the thumblimits property.
     * 
     * @return
     *     possible object is
     *     {@link Thumblimits }
     *     
     */
    public Thumblimits getThumblimits() {
        return thumblimits;
    }

    /**
     * Sets the value of the thumblimits property.
     * 
     * @param value
     *     allowed object is
     *     {@link Thumblimits }
     *     
     */
    public void setThumblimits(Thumblimits value) {
        this.thumblimits = value;
    }

    /**
     * Gets the value of the imagelimits property.
     * 
     * @return
     *     possible object is
     *     {@link Imagelimits }
     *     
     */
    public Imagelimits getImagelimits() {
        return imagelimits;
    }

    /**
     * Sets the value of the imagelimits property.
     * 
     * @param value
     *     allowed object is
     *     {@link Imagelimits }
     *     
     */
    public void setImagelimits(Imagelimits value) {
        this.imagelimits = value;
    }

    /**
     * Gets the value of the extensiondistributor property.
     * 
     * @return
     *     possible object is
     *     {@link Extensiondistributor }
     *     
     */
    public Extensiondistributor getExtensiondistributor() {
        return extensiondistributor;
    }

    /**
     * Sets the value of the extensiondistributor property.
     * 
     * @param value
     *     allowed object is
     *     {@link Extensiondistributor }
     *     
     */
    public void setExtensiondistributor(Extensiondistributor value) {
        this.extensiondistributor = value;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Gets the value of the timeoffset property.
     * 
     * @return
     *     possible object is
     *     {@link Byte }
     *     
     */
    public Byte getTimeoffset() {
        return timeoffset;
    }

    /**
     * Sets the value of the timeoffset property.
     * 
     * @param value
     *     allowed object is
     *     {@link Byte }
     *     
     */
    public void setTimeoffset(Byte value) {
        this.timeoffset = value;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Gets the value of the time property.
     * 
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public XMLGregorianCalendar getTime() {
        return time;
    }

    /**
     * Sets the value of the time property.
     * 
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public void setTime(XMLGregorianCalendar value) {
        this.time = value;
    }

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

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

    /**
     * Gets the value of the maxuploadsize property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getMaxuploadsize() {
        return maxuploadsize;
    }

    /**
     * Sets the value of the maxuploadsize property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setMaxuploadsize(Integer value) {
        this.maxuploadsize = value;
    }

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

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

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class Ii {

    @XmlAttribute(name = "timestamp")
    @XmlSchemaType(name = "dateTime")
    protected XMLGregorianCalendar timestamp;
    @XmlAttribute(name = "user")
    protected String user;
    @XmlAttribute(name = "userid")
    protected Integer userid;
    @XmlAttribute(name = "size")
    protected Integer size;
    @XmlAttribute(name = "width")
    protected Short width;
    @XmlAttribute(name = "height")
    protected Short height;
    @XmlAttribute(name = "parsedcomment")
    protected String parsedcomment;
    @XmlAttribute(name = "comment")
    protected String comment;
    @XmlAttribute(name = "html")
    protected String html;
    @XmlAttribute(name = "canonicaltitle")
    protected String canonicaltitle;
    @XmlAttribute(name = "url")
    protected String url;
    @XmlAttribute(name = "descriptionurl")
    protected String descriptionurl;
    @XmlAttribute(name = "sha1")
    protected String sha1;
    @XmlAttribute(name = "mime")
    protected String mime;
    @XmlAttribute(name = "mediatype")
    protected String mediatype;
    @XmlAttribute(name = "bitdepth")
    protected BigInteger bitdepth;

    /**
     * Ruft den Wert der timestamp-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public XMLGregorianCalendar getTimestamp() {
        return timestamp;
    }

    /**
     * Legt den Wert der timestamp-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public void setTimestamp(XMLGregorianCalendar value) {
        this.timestamp = value;
    }

    /**
     * Ruft den Wert der user-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUser() {
        return user;
    }

    /**
     * Legt den Wert der user-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUser(String value) {
        this.user = value;
    }

    /**
     * Ruft den Wert der userid-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getUserid() {
        return userid;
    }

    /**
     * Legt den Wert der userid-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setUserid(Integer value) {
        this.userid = value;
    }

    /**
     * Ruft den Wert der size-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getSize() {
        return size;
    }

    /**
     * Legt den Wert der size-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setSize(Integer value) {
        this.size = value;
    }

    /**
     * Ruft den Wert der width-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Short }
     *     
     */
    public Short getWidth() {
        return width;
    }

    /**
     * Legt den Wert der width-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Short }
     *     
     */
    public void setWidth(Short value) {
        this.width = value;
    }

    /**
     * Ruft den Wert der height-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Short }
     *     
     */
    public Short getHeight() {
        return height;
    }

    /**
     * Legt den Wert der height-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Short }
     *     
     */
    public void setHeight(Short value) {
        this.height = value;
    }

    /**
     * Ruft den Wert der parsedcomment-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getParsedcomment() {
        return parsedcomment;
    }

    /**
     * Legt den Wert der parsedcomment-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setParsedcomment(String value) {
        this.parsedcomment = value;
    }

    /**
     * Ruft den Wert der comment-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getComment() {
        return comment;
    }

    /**
     * Legt den Wert der comment-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setComment(String value) {
        this.comment = value;
    }

    /**
     * Ruft den Wert der html-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getHtml() {
        return html;
    }

    /**
     * Legt den Wert der html-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setHtml(String value) {
        this.html = value;
    }

    /**
     * Ruft den Wert der canonicaltitle-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCanonicaltitle() {
        return canonicaltitle;
    }

    /**
     * Legt den Wert der canonicaltitle-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCanonicaltitle(String value) {
        this.canonicaltitle = value;
    }

    /**
     * Ruft den Wert der url-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUrl() {
        return url;
    }

    /**
     * Legt den Wert der url-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUrl(String value) {
        this.url = value;
    }

    /**
     * Ruft den Wert der descriptionurl-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getDescriptionurl() {
        return descriptionurl;
    }

    /**
     * Legt den Wert der descriptionurl-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setDescriptionurl(String value) {
        this.descriptionurl = value;
    }

    /**
     * Ruft den Wert der sha1-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getSha1() {
        return sha1;
    }

    /**
     * Legt den Wert der sha1-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setSha1(String value) {
        this.sha1 = value;
    }

    /**
     * Ruft den Wert der mime-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getMime() {
        return mime;
    }

    /**
     * Legt den Wert der mime-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setMime(String value) {
        this.mime = value;
    }

    /**
     * Ruft den Wert der mediatype-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getMediatype() {
        return mediatype;
    }

    /**
     * Legt den Wert der mediatype-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setMediatype(String value) {
        this.mediatype = value;
    }

    /**
     * Ruft den Wert der bitdepth-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    public BigInteger getBitdepth() {
        return bitdepth;
    }

    /**
     * Legt den Wert der bitdepth-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setBitdepth(BigInteger value) {
        this.bitdepth = value;
    }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class Im {

    @XmlAttribute(name = "ns")
    protected Integer ns;
    @XmlAttribute(name = "title")
    protected String title;

    /**
     * Gets the value of the ns property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getNs() {
        return ns;
    }

    /**
     * Sets the value of the ns property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setNs(Integer value) {
        this.ns = value;
    }

    /**
     * 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;
    }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class Img {

    @XmlAttribute(name = "name")
    protected String name;
    @XmlAttribute(name = "timestamp")
    @XmlSchemaType(name = "dateTime")
    protected XMLGregorianCalendar timestamp;
    @XmlAttribute(name = "url")
    protected String url;
    @XmlAttribute(name = "descriptionurl")
    protected String descriptionurl;
    @XmlAttribute(name = "ns")
    protected Integer ns;
    @XmlAttribute(name = "title")
    protected String title;

    /**
     * Ruft den Wert der name-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getName() {
        return name;
    }

    /**
     * Legt den Wert der name-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Ruft den Wert der timestamp-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public XMLGregorianCalendar getTimestamp() {
        return timestamp;
    }

    /**
     * Legt den Wert der timestamp-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *     
     */
    public void setTimestamp(XMLGregorianCalendar value) {
        this.timestamp = value;
    }

    /**
     * Ruft den Wert der url-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getUrl() {
        return url;
    }

    /**
     * Legt den Wert der url-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUrl(String value) {
        this.url = value;
    }

    /**
     * Ruft den Wert der descriptionurl-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getDescriptionurl() {
        return descriptionurl;
    }

    /**
     * Legt den Wert der descriptionurl-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setDescriptionurl(String value) {
        this.descriptionurl = value;
    }

    /**
     * Ruft den Wert der ns-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getNs() {
        return ns;
    }

    /**
     * Legt den Wert der ns-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setNs(Integer value) {
        this.ns = value;
    }

    /**
     * Ruft den Wert der title-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTitle() {
        return title;
    }

    /**
     * Legt den Wert der title-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTitle(String value) {
        this.title = value;
    }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class Iu {

    @XmlAttribute(name = "pageid")
    protected Integer pageid;
    @XmlAttribute(name = "ns")
    protected Integer ns;
    @XmlAttribute(name = "title")
    protected String title;

    /**
     * Ruft den Wert der pageid-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getPageid() {
        return pageid;
    }

    /**
     * Legt den Wert der pageid-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setPageid(Integer value) {
        this.pageid = value;
    }

    /**
     * Ruft den Wert der ns-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getNs() {
        return ns;
    }

    /**
     * Legt den Wert der ns-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setNs(Integer value) {
        this.ns = value;
    }

    /**
     * Ruft den Wert der title-Eigenschaft ab.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTitle() {
        return title;
    }

    /**
     * Legt den Wert der title-Eigenschaft fest.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTitle(String value) {
        this.title = value;
    }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "value"
})
public class Login {

    @XmlValue
    protected String value;
    @XmlAttribute(name = "result")
    protected String result;
    @XmlAttribute(name = "token")
    protected String token;
    @XmlAttribute(name = "cookieprefix")
    protected String cookieprefix;
    @XmlAttribute(name = "sessionid")
    protected String sessionid;
    
    // after successful login
    @XmlAttribute(name = "lguserid")
    protected String lguserid;

    @XmlAttribute(name = "lgusername")
    protected String lgusername;
    
    @XmlAttribute(name = "lgtoken")
    protected String lgtoken;
    
    /**
		 * @return the lguserid
		 */
		public String getLguserid() {
			return lguserid;
		}

		/**
		 * @param lguserid the lguserid to set
		 */
		public void setLguserid(String lguserid) {
			this.lguserid = lguserid;
		}

		/**
		 * @return the lgusername
		 */
		public String getLgusername() {
			return lgusername;
		}

		/**
		 * @param lgusername the lgusername to set
		 */
		public void setLgusername(String lgusername) {
			this.lgusername = lgusername;
		}

		/**
		 * @return the lgtoken
		 */
		public String getLgtoken() {
			return lgtoken;
		}

		/**
		 * @param lgtoken the lgtoken to set
		 */
		public void setLgtoken(String lgtoken) {
			this.lgtoken = lgtoken;
		}

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

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

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

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

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

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

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

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

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

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

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "value"
})
public class P {

    @XmlValue
    protected String value;
    @XmlAttribute(name = "pageid")
    protected Integer pageid;
    @XmlAttribute(name = "ns")
    protected Byte ns;
    @XmlAttribute(name = "title")
    protected String title;

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

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

    /**
     * Gets the value of the pageid property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getPageid() {
        return pageid;
    }

    /**
     * Sets the value of the pageid property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setPageid(Integer value) {
        this.pageid = value;
    }

    /**
     * Gets the value of the ns property.
     * 
     * @return
     *     possible object is
     *     {@link Byte }
     *     
     */
    public Byte getNs() {
        return ns;
    }

    /**
     * Sets the value of the ns property.
     * 
     * @param value
     *     allowed object is
     *     {@link Byte }
     *     
     */
    public void setNs(Byte value) {
        this.ns = value;
    }

    /**
     * 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;
    }

} @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "value"
})
public class S {

    @XmlValue
    protected String value;
    @XmlAttribute(name = "toclevel")
    protected Integer toclevel;
    @XmlAttribute(name = "level")
    protected Integer level;
    @XmlAttribute(name = "line")
    protected String line;
    @XmlAttribute(name = "number")
    protected String number;
    @XmlAttribute(name = "index")
    protected String index;
    @XmlAttribute(name = "fromtitle")
    protected String fromtitle;
    @XmlAttribute(name = "byteoffset")
    protected Short byteoffset;
    @XmlAttribute(name = "anchor")
    protected String anchor;

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

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

    /**
     * Gets the value of the toclevel property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getToclevel() {
        return toclevel;
    }

    /**
     * Sets the value of the toclevel property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setToclevel(Integer value) {
        this.toclevel = value;
    }

    /**
     * Gets the value of the level property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getLevel() {
        return level;
    }

    /**
     * Sets the value of the level property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setLevel(Integer value) {
        this.level = value;
    }

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

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

    /**
     * Gets the value of the number property.
     * 
     * @return
     *     
     */
    public String getNumber() {
        return number;
    }

    /**
     * Sets the value of the number property.
     * 
     * @param value
     *     
     */
    public void setNumber(String value) {
        this.number = value;
    }

    /**
     * Gets the value of the index property.
     * 
     * @return
     *     
     */
    public String getIndex() {
        return index;
    }

    /**
     * Sets the value of the index property.
     * 
     * @param value
     *     
     */
    public void setIndex(String value) {
        this.index = value;
    }

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

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

    /**
     * Gets the value of the byteoffset property.
     * 
     * @return
     *     possible object is
     *     {@link Short }
     *     
     */
    public Short getByteoffset() {
        return byteoffset;
    }

    /**
     * Sets the value of the byteoffset property.
     * 
     * @param value
     *     allowed object is
     *     {@link Short }
     *     
     */
    public void setByteoffset(Short value) {
        this.byteoffset = value;
    }

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

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

}
import java.io.File;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.logging.Level;
import com.bitplan.mediawiki.japi.MediaWikiApiImpl;
import com.bitplan.mediawiki.japi.MediawikiApi;
import com.bitplan.mediawiki.japi.SiteInfo;
import com.bitplan.mediawiki.japi.api.Api;
import com.bitplan.mediawiki.japi.api.Bl;
import com.bitplan.mediawiki.japi.api.Delete;
import com.bitplan.mediawiki.japi.api.Edit;
import com.bitplan.mediawiki.japi.api.General;
import com.bitplan.mediawiki.japi.api.Ii;
import com.bitplan.mediawiki.japi.api.Im;
import com.bitplan.mediawiki.japi.api.Img;
import com.bitplan.mediawiki.japi.api.Iu;
import com.bitplan.mediawiki.japi.api.Login;
import com.bitplan.mediawiki.japi.api.P;
import com.bitplan.mediawiki.japi.api.S;
    return result;
  }
  
  @Override
  public String getPageHtml(String pageTitle) throws Exception {
    String result = wiki.getRenderedText(pageTitle);
    return result;
  }

  @Override
  public String getSectionText(String pageTitle, int sectionNumber)
      throws Exception {
    return wiki.getSectionText(pageTitle, sectionNumber);
  }

  @Override
  public void logout() throws Exception {
    wiki.logout();
  }

  @Override
  public Edit edit(String pageTitle, String text, String summary)
      throws Exception {
    Edit result = this.edit(pageTitle, text, summary, true, false, -2,null,null);
    return result;
  }

  @Override
  public Edit edit(String pageTitle, String text, String summary,
      boolean minor, boolean bot, int sectionNumber,String sectionTitle, Calendar basetime)
      throws Exception {

    Edit result = new Edit();
    String pageContent = getPageContent(pageTitle);
    if (pageContent != null && pageContent.contains(protectionMarker)) {
      LOGGER.log(Level.WARNING, "page " + pageTitle + " is protected!");
    } else {
      if (sectionNumber==-1)
        wiki.edit(pageTitle, text, sectionTitle, minor, bot, sectionNumber,basetime);
      else
        wiki.edit(pageTitle, text, summary, minor, bot, sectionNumber,basetime);
    }
    return result;
  }

  @Override
  /**
   * get a current IsoTimeStamp
   * FIXME redundant implementation same functioin com.bitplan.mediawiki.japi.api
   * @return - the current timestamp
   */
  public String getIsoTimeStamp() {
    TimeZone tz = TimeZone.getTimeZone("UTC");
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
    df.setTimeZone(tz);
    String nowAsISO = df.format(new Date());
    return nowAsISO;
  }

  @Override
  public void setDebug(boolean pDebug) {
    this.debug = pDebug;
  }

  @Override
  public boolean isDebug() {
    return debug;
  }

  @Override
  public void upload(File file, String filename, String contents, String reason)
      throws Exception {
    // simply delegate
    this.wiki.upload(file, filename, contents, reason);
  }

  @Override
  public List<P> getAllPages(String apfrom, int aplimit) throws Exception {
    // FIXME - implement
    return null;
  }

  @Override
  public List<S> getSections(String pageTitle) throws Exception {
    // FIXME implement
    return null;
  }

  @Override
  public Ii getImageInfo(String pageTitle) throws Exception {
    // FIXME implement
    return null;
  }

  @Override
  public void upload(Ii ii, String fileName, String pageContent)
      throws Exception {
    // FIXME implement
  }

  @Override
  public SiteInfo getSiteInfo() throws Exception {
    // FIXME implement
    return null;
  }

  @Override
  public Delete delete(String title, String reason) throws Exception {
    Delete result = new Delete();
    this.wiki.delete(title, reason);
    return result;
  }

  @Override
  public List<Img> getAllImagesByTimeStamp(String aistart, String aiend, int ailimit) {
   // FIXME implement
    return null;
  }

  @Override
  public List<Bl> getBacklinks(String pageTitle, String params, int limit)