本文整理汇总了Java中org.dspace.handle.HandleManager类的典型用法代码示例。如果您正苦于以下问题:Java HandleManager类的具体用法?Java HandleManager怎么用?Java HandleManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HandleManager类属于org.dspace.handle包,在下文中一共展示了HandleManager类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disseminateList
import org.dspace.handle.HandleManager; //导入依赖的package包/类
@Override
public void disseminateList(Context context, List<Item> items, OutputStream out) throws CrosswalkException, IOException, SQLException, AuthorizeException {
XWPFDocument document = new XWPFDocument();
for (Item item : items) {
if (canDisseminate(context, item)) {
String citationText = getFirstNonBlankValue(item, "dc", "identifier", "citation");
String abstractText = getFirstNonBlankValue(item, "dc", "description", "abstract");
String handleUrl = HandleManager.getCanonicalForm(item.getHandle());
processSingleItem(document, citationText, abstractText, handleUrl);
} else {
log.warn("Cannot disseminate " + item.getTypeText() + " id=" + item.getID() + ", skipping");
}
}
document.write(out);
out.flush();
}
示例2: findCollections
import org.dspace.handle.HandleManager; //导入依赖的package包/类
private static List<Collection> findCollections(Context context, String identifierString) throws SQLException {
List<Collection> result = new ArrayList<>();
if (identifierString.matches("^\\d+$")) {
int collectionId = Integer.parseInt(identifierString);
Collection collection = Collection.find(context, collectionId);
if (collection != null) {
result.add(collection);
}
}
if (identifierString.matches("^\\d+/\\d+$")) {
DSpaceObject dso = HandleManager.resolveToObject(context, identifierString);
if (dso != null) {
if (dso instanceof Collection) {
result.add((Collection) dso);
} else if (dso instanceof Community) {
Community parent = (Community) dso;
Collections.addAll(result, parent.getAllCollections());
}
}
}
return result;
}
示例3: setup
import org.dspace.handle.HandleManager; //导入依赖的package包/类
@Override
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException {
super.setup(resolver, objectModel, src, par);
try {
this.request = ObjectModelHelper.getRequest(objectModel);
this.response = ObjectModelHelper.getResponse(objectModel);
context = ContextUtil.obtainContext(objectModel);
String handle = par.getParameter("handle");
DSpaceObject dso = HandleManager.resolveToObject(context, handle);
item = (Item) dso;
filename = "cite-" + handle.replaceAll("/", "-") + ".ris";
} catch (SQLException | ParameterException e) {
throw new ProcessingException("Unable to export citation.", e);
}
}
示例4: disseminate
import org.dspace.handle.HandleManager; //导入依赖的package包/类
@Override
public void disseminate(Context context, Item item, OutputStream out) throws CrosswalkException, IOException, SQLException, AuthorizeException {
XWPFDocument document = new XWPFDocument();
String citationText = getFirstNonBlankValue(item, "dc", "identifier", "citation");
String abstractText = getFirstNonBlankValue(item, "dc", "description", "abstract");
String handleUrl = HandleManager.getCanonicalForm(item.getHandle());
processSingleItem(document, citationText, abstractText, handleUrl);
document.write(out);
out.flush();
}
示例5: processLine
import org.dspace.handle.HandleManager; //导入依赖的package包/类
@Override
public String[] processLine(String[] inputLine, int index) throws ConfigurationException, PostProcessingException {
String[] result = inputLine.clone();
result[index] = HandleManager.getCanonicalForm(inputLine[index]);
return result;
}