/** * author: Marcel Genzmehr * 17.08.2011 */ package org.docear.plugin.core.workspace.creator; import java.net.URI; import org.docear.plugin.core.workspace.node.LinkTypeMyPublicationsNode; import org.freeplane.n3.nanoxml.XMLElement; import org.freeplane.plugin.workspace.model.AWorkspaceNodeCreator; import org.freeplane.plugin.workspace.model.AWorkspaceTreeNode; /** * */ public class LinkTypeMyPublicationsCreator extends AWorkspaceNodeCreator { public static final String LINK_TYPE_MYPUBLICATIONS = "my_publications"; /*********************************************************************************** * CONSTRUCTORS **********************************************************************************/ /*********************************************************************************** * METHODS **********************************************************************************/ /*********************************************************************************** * REQUIRED METHODS FOR INTERFACES **********************************************************************************/ public AWorkspaceTreeNode getNode(XMLElement data) { String type = data.getAttribute("type", LINK_TYPE_MYPUBLICATIONS); LinkTypeMyPublicationsNode node = new LinkTypeMyPublicationsNode(type); //TODO: add missing attribute handling String path = data.getAttribute("path", null); String name = data.getAttribute("name", null); if (path == null || name == null) { return null; } node.setLinkPath(URI.create(path)); node.setName(name); return node; } }