} else {
store = this.basketManager.getBriefcase();
}
final Event e = new AddItemEvent(store, ci);
final AttributesImpl ai = new AttributesImpl();
String newLink = service.getComponentManager().getLinkService().getLinkURI(e);
// check for bockmark
final String bookmark = attr.getValue("bookmark");
if ( bookmark != null && bookmark.length() > 0) {
int pos = newLink.indexOf('?') + 1;
final char separator;
if ( bookmark.indexOf('?') == -1 ) {
separator = '?';
} else {
separator = '&';
}
newLink = bookmark + separator + newLink.substring(pos);
}
ai.addCDATAAttribute("href", newLink);
final String linkElementName = this.parameters.getParameter("link-element", this.defaultLinkElement);
final String linkElementNS = this.parameters.getParameter("link-element-ns", this.defaultLinkElementNS);
XMLUtils.startElement(this.contentHandler, linkElementNS, linkElementName, ai);
} catch (ServiceException se) {
throw new SAXException("Unable to lookup portal service.", se);
} finally {
this.manager.release(service);
}
} else if ( SHOW_ACTIONS_ELEMENT.equals(name) ) {
// basket or briefcase
final List actions;
final String storeName = (attr.getValue("store") == null ? this.defaultStoreName : attr.getValue("store"));
if ("basket".equalsIgnoreCase(storeName) ) {
actions = this.basketManager.getBasketActions();
} else {
actions = this.basketManager.getBriefcaseActions();
}
final String checkedAction = attr.getValue("checked");
final Iterator i = actions.iterator();
AttributesImpl a = new AttributesImpl();
while ( i.hasNext() ) {
final BasketManager.ActionInfo current = (ActionInfo) i.next();
a.addCDATAAttribute("name", current.name);
if ( current.name.equals(checkedAction) ) {
a.addCDATAAttribute("checked", "true");
}
XMLUtils.createElement(this.xmlConsumer, "action", a);
a.clear();
}
}
}