11-27-2009 03:29 AM
11-27-2009 04:51 AM
11-27-2009 05:16 AM
11-28-2009 08:29 AM
if (rsScan.next()) {
ubaciUAlfresko();
}
protected void ubaciUAlfresko() {
UserTransaction trx = serviceRegistry.getTransactionService().getUserTransaction();
try {
trx.begin();
}
catch (NotSupportedException e1) {
e1.printStackTrace();
}
catch (SystemException e1) {
e1.printStackTrace();
}
Session session = null;
Node companyHome = null;
try {
session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
Node rootNode = session.getRootNode();
companyHome = rootNode.getNode("app:company_home");
}
catch (LoginException e) {
e.printStackTrace();
}
catch (RepositoryException e) {
e.printStackTrace();
}
/*try {
is = new FileInputStream(tifSlika);
}
catch (FileNotFoundException e1) {
e1.printStackTrace();
}*/
Node mjesec;
try {
mjesec = companyHome.getNode("ARHIVA/"+ISO9075.encode(godina_potpisivanja)+"/"+ISO9075.encode(mjesec_potpisivanja));
Node ugovor = mjesec.addNode(tifId,"telekom:ugovor");
ugovor.setProperty("cm:content", new FileInputStream(tifSlika));
ugovor.save();
trx.commit();
azurirajPutanju(mjesec_potpisivanja,godina_potpisivanja, tifId);
}
catch (Exception e) {
try {
System.out.println("Trying rollback:");
trx.rollback();
}
catch (Exception e1) {
System.out.println("Rollback failed!");
e1.printStackTrace();
}
e.printStackTrace();
}
try {
session.save();
}
catch (Exception e) {
e.printStackTrace();
}
/*finally {
try {
is.close();
}
catch (IOException e) {
e.printStackTrace();
}
}*/
session.logout();
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.