本文整理汇总了Java中org.apache.abdera.factory.Factory类的典型用法代码示例。如果您正苦于以下问题:Java Factory类的具体用法?Java Factory怎么用?Java Factory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Factory类属于org.apache.abdera.factory包,在下文中一共展示了Factory类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEditMediaIRIStream
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
/**
* Creates a edit link for every derivate of a mcrobject.
*
* @param mcrObjId the mcrobject id as String
* @return returns a Stream which contains links to every derivate.
*/
public static Stream<Link> getEditMediaIRIStream(final String collection, final String mcrObjId)
throws SwordError {
return MCRSword.getCollection(collection).getDerivateIDsofObject(mcrObjId).map(derivateId -> {
final Factory abderaFactory = Abdera.getNewFactory();
final Stream<IRI> editMediaFileIRIStream = getEditMediaFileIRIStream(collection, derivateId);
return Stream
.concat(Stream.of(getEditMediaHrefOfDerivate(collection, derivateId)), editMediaFileIRIStream)
.map(link -> {
final Link newLinkElement = abderaFactory.newLink();
newLinkElement.setHref(link.toString());
newLinkElement.setRel("edit-media");
return newLinkElement;
});
}).flatMap(s -> s);
}
示例2: processGETServiceDocumentRequest
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private void processGETServiceDocumentRequest(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException {
org.apache.abdera.model.Service service = abdera.newService();
Factory factory = abdera.getFactory();
String servletURL = getServletURL(req);
service.addWorkspace(buildCoreModel(factory, servletURL));
service.addWorkspace(buildSOAPWSDLModel(factory, servletURL));
service.addWorkspace(buildQueryModel(factory, servletURL));
service.addWorkspace(buildXSDModel(factory, servletURL));
service.addWorkspace(buildSOAModel(factory, servletURL));
service.addWorkspace(buildPolicyModel(factory, servletURL));
service.addWorkspace(buildWSDLModel(factory, servletURL));
service.addWorkspace(buildServiceImplementation(factory, servletURL));
resp.setContentType(APPLICATION_ATOMSVC_XML);
resp.setStatus(200);
serializeOutput(resp, (FOMService) service);
}
示例3: buildCoreModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildCoreModel(Factory factory, String servletURL) {
Workspace coreModel = factory.newWorkspace();
coreModel.setTitle("Core Model");
Collection[] children =
{
buildChildCollection(factory, servletURL, "/core/XmlDocument",
"XML Documents",
"application/xml", "XML Document", "XmlDocument"),
buildChildCollection(factory, servletURL, "/core/document",
"Documents",
"application/octet-stream", "Document", "Document")
};
for (Collection child : children) {
coreModel.addCollection(child);
}
coreModel.addCollection(
buildParentCollection(factory, servletURL, children, "/core",
"Core Model Objects"));
return coreModel;
}
示例4: buildSOAPWSDLModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildSOAPWSDLModel(Factory factory, String servletURL) {
Workspace soapWsdlModel = factory.newWorkspace();
soapWsdlModel.setTitle("SOAP WSDL Model");
Collection[] children =
{
buildChildCollection(factory, servletURL, "/soapWsdl/SoapBinding",
"SOAP Bindings", null, "SOAP Binding", "SoapBinding"),
buildChildCollection(factory, servletURL, "/soapWsdl/SoapAddress",
"SOAP Addresses", null, "SOAP Address", "SoapAddress")
};
for (Collection child : children) {
soapWsdlModel.addCollection(child);
}
soapWsdlModel.addCollection(
buildParentCollection(factory, servletURL, children, "/soapWsdl",
"SOAP WSDL Model Objects"));
return soapWsdlModel;
}
示例5: buildSOAModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildSOAModel(Factory factory, String servletURL) {
Workspace soaModel = factory.newWorkspace();
soaModel.setTitle("SOA Model");
String[] types = {"Service Contract", "Orchestration Process", "Choreography Process",
"Service Interface", "Collaboration Process", "Process", "Actor", "Collaboration",
"Composition", "Element", "Event", "Orchestration", "Policy Subject", "Effect",
"Information Type", "Task", "System", "Service", "Policy", "Choreography"};
List<Collection> children = new LinkedList<Collection>();
for (String type1 : types) {
String type2 = type1.replace(" ", "");
Collection child = buildChildCollection(factory, servletURL, "/soa/" + type2, type1,
"application/atom+xml; type=entry", type2, type1);
soaModel.addCollection(child);
children.add(child);
}
soaModel.addCollection(
buildParentCollection(factory, servletURL,
children.toArray(new Collection[children.size()]), "/soa",
"SOA Model Objects"));
return soaModel;
}
示例6: buildPolicyModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildPolicyModel(Factory factory, String servletURL) {
Workspace policyModel = factory.newWorkspace();
policyModel.setTitle("Policy Model");
Collection[] children =
{
buildChildCollection(factory, servletURL,
"/policy/PolicyExpression", "Policy Expressions", null,
"Policy Expressions", "PolicyExpression"),
buildChildCollection(factory, servletURL,
"/policy/PolicyAttachment", "Policy Attachments", null,
"Policy Attachment", "PolicyAttachment"),
buildChildCollection(factory, servletURL,
"/policy/PolicyDocument", "Policy Documents", "application/xml",
"Policy Document", "PolicyDocument")
};
for (Collection child : children) {
policyModel.addCollection(child);
}
policyModel.addCollection(
buildParentCollection(factory, servletURL, children, "/policy",
"Policy Model Objects"));
return policyModel;
}
示例7: buildParentCollection
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Collection buildParentCollection(Factory factory, String servletURL,
Collection[] children,
String href, String title) {
Collection parent = factory.newCollection().setHref(servletURL + href);
parent.setTitle(title);
List<Category> categories = new LinkedList<Category>();
for (Collection child : children) {
categories.add(child.getCategories().get(0).getCategoriesWithScheme().get(0));
}
parent.setAcceptsNothing().addCategories(categories, true, null);
return parent;
}
示例8: buildChildCollection
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Collection buildChildCollection(Factory factory, String servletURL, String href,
String title, String accept, String label,
String term) {
Collection collection = factory.newCollection().setHref(servletURL + href);
collection.setTitle(title);
if (accept != null) {
collection.setAccept(accept);
} else {
collection.setAcceptsNothing();
}
collection.addCategories(factory.newCategories().setFixed(true).addCategory(
factory.newCategory().setScheme("urn:x-s-ramp:2010:type").setTerm(term).setLabel(
label)));
return collection;
}
示例9: buildServiceImplementation
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildServiceImplementation(Factory factory, String servletURL) {
Workspace serviceImplementation = factory.newWorkspace();
serviceImplementation.setTitle("Service Implementation");
Collection[] children =
{
buildChildCollection(factory, servletURL,
"/serviceImplementation/ServiceOperation", "Service Operations",
"application/atom+xml; type=entry", "Service Operation",
"ServiceOperation"),
buildChildCollection(factory, servletURL,
"/serviceImplementation/Organization",
"Organizations", "application/atom+xml; type=entry", "Organization",
"Organization"),
buildChildCollection(factory, servletURL,
"/serviceImplementation/ServiceInstance",
"Service Instances", "application/atom+xml; type=entry",
"Service Instance", "ServiceInstance"),
buildChildCollection(factory, servletURL,
"/serviceImplementation/ServiceEndpoint",
"Service Endpoints", "application/atom+xml; type=entry",
"Service Endpoint", "ServiceEndpoint")
};
for (Collection child : children) {
serviceImplementation.addCollection(child);
}
serviceImplementation.addCollection(
buildParentCollection(factory, servletURL, children, "/serviceImplementation",
"Service Implementation Objects"));
return serviceImplementation;
}
示例10: buildXSDModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildXSDModel(Factory factory, String servletURL) {
Workspace xsdModel = factory.newWorkspace();
xsdModel.setTitle("XSD Model");
Collection[] children =
{
buildChildCollection(factory, servletURL,
"/xsd/XsdType", "XSD Types", null, "XSD Type", "XsdType"),
buildChildCollection(factory, servletURL,
"/xsd/ElementDeclaration", "Element Declarations", null,
"Element Declaration", "ElementDeclaration"),
buildChildCollection(factory, servletURL,
"/xsd/AttributeDeclaration", "Attribute Declarations", null,
"Attribute Declaration", "AttributeDeclaration"),
buildChildCollection(factory, servletURL,
"/xsd/ComplexTypeDeclaration", "Complex Type Declarations",
null, "Complex Type Declaration", "ComplexTypeDeclaration"),
buildChildCollection(factory, servletURL,
"/xsd/SimpleTypeDeclaration", "Simple Type Declarations",
null, "Simple Type Declaration", "SimpleTypeDeclaration"),
buildChildCollection(factory, servletURL,
"/xsd/XsdDocument", "XSD Documents", "application/xml",
"XSD Document", "XsdDocument")
};
for (Collection child : children) {
xsdModel.addCollection(child);
}
xsdModel.addCollection(
buildParentCollection(factory, servletURL, children, "/xsd",
"XSD Model Objects"));
return xsdModel;
}
示例11: buildQueryModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildQueryModel(Factory factory, String servletURL) {
Workspace queryModel = factory.newWorkspace();
queryModel.setTitle("Query Model");
queryModel.addCollection(
buildChildCollection(factory, servletURL, "/query", "Query Model Objects",
"application/atom+xml; type=entry", "Query", "query"));
return queryModel;
}
示例12: buildWSDLModel
import org.apache.abdera.factory.Factory; //导入依赖的package包/类
private Workspace buildWSDLModel(Factory factory, String servletURL) {
Workspace wsdlModel = factory.newWorkspace();
wsdlModel.setTitle("WSDL Model");
Collection[] children =
{
buildChildCollection(factory, servletURL,
"/wsdl/BindingOperationOutput", "Binding Operation Outputs", null,
"Binding Operation Output", "BindingOperationOutput"),
buildChildCollection(factory, servletURL,
"/wsdl/BindingOperationInput", "Binding Operation Inputs", null,
"Binding Operation Input", "BindingOperationInput"),
buildChildCollection(factory, servletURL,
"/wsdl/BindingOperationFault", "Binding Operation Faults", null,
"Binding Operation Fault", "BindingOperationFault"),
buildChildCollection(factory, servletURL,
"/wsdl/BindingOperation", "Binding Operations", null,
"Binding Operation", "BindingOperation"),
buildChildCollection(factory, servletURL,
"/wsdl/Binding", "Bindings", null,
"Binding", "Binding"),
buildChildCollection(factory, servletURL,
"/wsdl/Operation", "Operations", null,
"Operation", "Operation"),
buildChildCollection(factory, servletURL,
"/wsdl/OperationOutput", "Operation Outputs", null,
"Operation Output", "OperationOutput"),
buildChildCollection(factory, servletURL,
"/wsdl/OperationInput", "Operation Inputs", null,
"Operation Input", "OperationInput"),
buildChildCollection(factory, servletURL,
"/wsdl/Part", "Parts", null,
"Part", "Part"),
buildChildCollection(factory, servletURL,
"/wsdl/Message", "Messages", null,
"Message", "Message"),
buildChildCollection(factory, servletURL,
"/wsdl/Port", "Ports", null,
"Port", "Port"),
buildChildCollection(factory, servletURL,
"/wsdl/Fault", "Faults", null,
"Fault", "Fault"),
buildChildCollection(factory, servletURL,
"/wsdl/PortType", "Port Types", null,
"Port Type", "PortType"),
buildChildCollection(factory, servletURL,
"/wsdl/WsdlService", "WSDL Services",
"application/atom+xml; type=entry",
"WSDL Service", "WsdlService"),
buildChildCollection(factory, servletURL,
"/wsdl/WsdlExtension", "WSDL Extensions", null,
"WSDL Extension", "WsdlExtension"),
buildChildCollection(factory, servletURL,
"/wsdl/WsdlDocument", "WSDL Documents", "application/xml",
"WSDL Document", "WsdlDocument")
};
for (Collection child : children) {
wsdlModel.addCollection(child);
}
wsdlModel.addCollection(
buildParentCollection(factory, servletURL, children, "/wsdl",
"WSDL Model Objects"));
return wsdlModel;
}