Search in sources :

Example 1 with ExtensionSummary

use of org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionSummary in project xwiki-platform by xwiki.

the class AbstractExtensionRESTResource method createExtensionSummaryFromQueryResult.

protected ExtensionSummary createExtensionSummaryFromQueryResult(Object[] entry) {
    ExtensionSummary extension;
    ExtensionVersionSummary extensionVersion;
    int versionIndex = EPROPERTIES_INDEX.get(EPROPERTIES_SUMMARY[EPROPERTIES_SUMMARY.length - 1]) + 1;
    if (entry.length == versionIndex) {
        // It's a extension summary without version
        extension = this.extensionObjectFactory.createExtensionSummary();
        extensionVersion = null;
    } else {
        extension = extensionVersion = this.extensionObjectFactory.createExtensionVersionSummary();
        extensionVersion.setVersion((String) entry[versionIndex]);
    }
    extension.setId(this.<String>getQueryValue(entry, XWikiRepositoryModel.PROP_EXTENSION_ID));
    extension.setType(this.<String>getQueryValue(entry, XWikiRepositoryModel.PROP_EXTENSION_TYPE));
    extension.setName(this.<String>getQueryValue(entry, XWikiRepositoryModel.PROP_EXTENSION_NAME));
    return extension;
}
Also used : ExtensionVersionSummary(org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionVersionSummary) ExtensionSummary(org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionSummary)

Aggregations

ExtensionSummary (org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionSummary)1 ExtensionVersionSummary (org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionVersionSummary)1