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;
}
Aggregations