use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project grpc-gcp-java by GoogleCloudPlatform.
the class ListDocuments method listDocumentsCall.
public void listDocumentsCall() {
System.out.println("\n:: Listing all Documents ::\n");
FirestoreBlockingStub blockingStub = new GRPCFirebaseClientFactory().createFirebaseClient().getBlockingStub();
ListDocumentsRequest ldr = ListDocumentsRequest.newBuilder().setParent("projects/firestoretestclient/databases/(default)/documents").setCollectionId("GrpcTestData").build();
try {
ListDocumentsResponse listDocumentsResponse = blockingStub.listDocuments(ldr);
List<Document> allDocs = listDocumentsResponse.getDocumentsList();
DrawDocument dd = new DrawDocument();
for (Document doc : allDocs) {
dd.draw(doc);
}
Menu menu = new Menu();
menu.draw();
System.out.println("Finished call...");
} catch (Exception e) {
System.out.println("Error executing streaming stub call: " + (e.getMessage() + "\n" + e.getCause().toString()));
}
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project MigrationMiner by hussien89aa.
the class CollectorClient method listOfJavaProjectLibrary.
// read Android Java pom.xml file
public String listOfJavaProjectLibrary(String projectVersionPath) {
// String appProjectPath= projectVersionPath + "/pom.xml";
if (projectVersionPath.length() == 0) {
System.err.println("project doensot have pom.xml file");
return "";
}
String versionLibraries = "";
System.out.println("Search for library at :" + projectVersionPath);
try {
File inputFile = new File(projectVersionPath);
SAXBuilder saxBuilder = new SAXBuilder();
Document document = saxBuilder.build(inputFile);
Element root = document.getRootElement();
// get public properties for library version
HashMap<String, String> propertiesList = new HashMap<String, String>();
try {
Element properties = getchild(root, "properties");
List<Element> propertiesListNode = properties.getChildren();
for (int temp = 0; temp < propertiesListNode.size(); temp++) {
Element property = propertiesListNode.get(temp);
propertiesList.put("${" + property.getName() + "}", property.getValue());
}
} catch (Exception ex) {
}
/*
* DEBUG for (String element : propertiesList.keySet()) {
* System.out.println(element +":"+ propertiesList.get(element)); }
*/
// get library info
Element dependencyManagement = getchild(root, "dependencyManagement");
Element dependencies = null;
if (dependencyManagement != null) {
dependencies = getchild(dependencyManagement, "dependencies");
} else {
// dependencies may lives under root
dependencies = getchild(root, "dependencies");
}
List<Element> dependencytList = dependencies.getChildren();
for (int temp = 0; temp < dependencytList.size(); temp++) {
Element dependency = dependencytList.get(temp);
List<Element> librariesList = dependency.getChildren();
String groupId = "";
String artifactId = "";
String version = "";
for (int temp1 = 0; temp1 < librariesList.size(); temp1++) {
Element libraryInfo = librariesList.get(temp1);
if (libraryInfo.getName().equals("groupId"))
groupId = libraryInfo.getValue();
if (libraryInfo.getName().equals("artifactId"))
artifactId = libraryInfo.getValue();
if (libraryInfo.getName().equals("version")) {
version = libraryInfo.getValue();
if (version.startsWith("${")) {
version = propertiesList.get(version);
}
}
}
String libraryLink = groupId + ":" + artifactId + ":" + version;
if (versionLibraries.length() == 0) {
versionLibraries = libraryLink;
} else {
if (versionLibraries.contains(libraryLink) == false) {
versionLibraries = versionLibraries + "," + libraryLink;
}
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("Found libraries-> " + versionLibraries);
return versionLibraries;
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project hello-world by wuming-hero.
the class JdomTest method xmlToString.
/**
* 将xml文件转换为String串
*
* @return
*/
@Test
public void xmlToString() throws JDOMException, IOException {
String path = this.getClass().getClassLoader().getResource("file/xml/test.xml").getPath();
SAXBuilder reader = new SAXBuilder();
Document document = reader.build(new File(path));
// 指定输出格式
Format format = Format.getPrettyFormat();
// 设置编码格式
format.setEncoding("UTF-8");
XMLOutputter outputter = new XMLOutputter(format);
StringWriter out = new StringWriter();
outputter.output(document, out);
System.out.println(out.toString());
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendSetAsPrimaryObjectOperation.
/**
* Sends set-as-primary-object operation message.
*
* @param userid id of user who triggered the operation
* @param pids objects whose primary object has changed
* @return id of operation message
*/
public String sendSetAsPrimaryObjectOperation(String userid, Collection<PID> pids) {
Element contentEl = createAtomEntry(userid, pids.iterator().next(), CDRActions.SET_AS_PRIMARY_OBJECT);
Element updateEl = new Element(CDRActions.SET_AS_PRIMARY_OBJECT.getName(), CDR_MESSAGE_NS);
contentEl.addContent(updateEl);
Element subjects = new Element("subjects", CDR_MESSAGE_NS);
updateEl.addContent(subjects);
for (PID sub : pids) {
subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath()));
}
Document msg = contentEl.getDocument();
sendMessage(msg);
LOG.debug("sent set-as-primary-object operation JMS message using JMS template: {}", this.getJmsTemplate());
return getMessageId(msg);
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendOperationMessage.
/**
* Sends a message indicating that an action has occurred on a collection of objects
*
* @param userid id of user who triggered the operation
* @param pids objects affected.
* @return id of operation message
*/
public String sendOperationMessage(String userid, CDRActions action, Collection<PID> pids) {
Element contentEl = createAtomEntry(userid, pids.iterator().next(), action);
Element editAclEl = new Element(action.getName(), CDR_MESSAGE_NS);
contentEl.addContent(editAclEl);
Element subjects = new Element("subjects", CDR_MESSAGE_NS);
editAclEl.addContent(subjects);
for (PID sub : pids) {
subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath()));
}
Document msg = contentEl.getDocument();
sendMessage(msg);
LOG.debug("sent publish operation JMS message using JMS template: {}", this.getJmsTemplate());
return getMessageId(msg);
}
Aggregations