return value;
}
private void processOutline(Element outline, IPersistable parent, List<IEntity> importedEntities, DateFormat dateFormat) {
IEntity type = null;
Long id = null;
String title = null;
String link = null;
String homepage = null;
String description = null;
/* Interpret Attributes */
List<?> attributes = outline.getAttributes();
for (Iterator<?> iter = attributes.iterator(); iter.hasNext();) {
Attribute attribute = (Attribute) iter.next();
String name = attribute.getName();
/* Link */
if (name.toLowerCase().equals(Attributes.XML_URL.get().toLowerCase()))
link = attribute.getValue();
/* Title */
else if (name.toLowerCase().equals(Attributes.TITLE.get()))
title = attribute.getValue();
/* Text */
else if (title == null && name.toLowerCase().equals(Attributes.TEXT.get()))
title = attribute.getValue();
/* Homepage */
else if (name.toLowerCase().equals(Attributes.HTML_URL.get().toLowerCase()))
homepage = attribute.getValue();
/* Description */
else if (name.toLowerCase().equals(Attributes.DESCRIPTION.get()))
description = attribute.getValue();
}
/* RSSOwl Namespace Attributes */
Attribute idAttribute = outline.getAttribute(Attributes.ID.get(), RSSOWL_NS);
if (idAttribute != null)
id = Long.valueOf(idAttribute.getValue());
boolean isSet = Boolean.parseBoolean(outline.getAttributeValue(Attributes.IS_SET.get(), RSSOWL_NS));
/* Outline is a Folder */
if (link == null && title != null) {
type = Owl.getModelFactory().createFolder(null, isSet ? null : (IFolder) parent, title);
/* Assign old ID value */
if (id != null)
type.setProperty(ID_KEY, id);
if (isSet)
importedEntities.add(type);
}
/* Outline is a BookMark */
else {
URI uri = link != null ? URIUtils.createURI(link) : null;
if (uri != null) {
/* If no Scheme is Provided, use HTTP as default */
if (uri.getScheme() == null)
uri = URIUtils.createURI(URIUtils.HTTP + link);
/* Create the BookMark */
FeedLinkReference feedLinkRef = new FeedLinkReference(uri);
type = Owl.getModelFactory().createBookMark(null, (IFolder) parent, feedLinkRef, title != null ? title : link);
/* Assign old ID value */
if (id != null)
type.setProperty(ID_KEY, id);
/* Store Description if set */
if (StringUtils.isSet(description))
type.setProperty(ITypeImporter.DESCRIPTION_KEY, description);
/* Store Homepage if set */
if (StringUtils.isSet(homepage))
type.setProperty(ITypeImporter.HOMEPAGE_KEY, homepage);
}
}
/* In case this Outline Element did not represent a Entity */
if (type == null)