IDavinciServerConstants.EP_TAG_AJAXLIBRARY);
this.installedLibraries = new Library[extensions.size()];
int count = -1;
for (Iterator iterator = extensions.iterator(); iterator.hasNext();) {
count++;
IConfigurationElement libraryElement = (IConfigurationElement) iterator
.next();
String id = libraryElement
.getAttribute(IDavinciServerConstants.EP_ATTR_METADATA_ID);
String version = libraryElement
.getAttribute(IDavinciServerConstants.EP_ATTR_METADATA_VERSION);
if (id == null || version == null || id.equals("")
|| version.equals("")) {
System.err
.println("Problem reading library data, no ID or Version defined :"
+ libraryElement.getName());
}
Library libInfo = findLibrary(id, version);
if (libInfo == null) {
libInfo = new BundleLibraryInfo(id, version);
this.installedLibraries[count] = libInfo;
}
String required = libraryElement
.getAttribute(IDavinciServerConstants.EP_ATTR_REQUIRED);
((BundleLibraryInfo) libInfo).setRequired(required);
IConfigurationElement[] libraryPathElements = libraryElement
.getChildren(IDavinciServerConstants.EP_TAG_LIBRARYPATH);
for (int i = 0; i < libraryPathElements.length; i++) {
String virtualPath = libraryPathElements[i]
.getAttribute(IDavinciServerConstants.EP_ATTR_LIBRARYPATH_NAME);
String bundlePath = libraryPathElements[i]
.getAttribute(IDavinciServerConstants.EP_ATTR_LIBRARYPATH_LOCATION);
String source = libraryPathElements[i]
.getAttribute(IDavinciServerConstants.EP_ATTR_LIBRARYPATH_SOURCE);
((BundleLibraryInfo) libInfo).setBasePath(bundlePath, virtualPath, source);
}
if (libInfo instanceof BundleLibraryInfo) {
((BundleLibraryInfo) libInfo).bundleBase = getLibraryBundle(libraryElement);
}
IConfigurationElement[] meta = libraryElement.getChildren("metadata");
for (int i = 0; i < meta.length; i++) {
libInfo.setMetadataPath(meta[i].getAttribute("location"));
}