11-20-2006 05:42 AM
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:org/alfresco/sample/jcr/facturaModel-context.xml");
// Retrieve Repository
Repository repository = (Repository)context.getBean("JCR.Repository");
// Login to workspace
// Note: Default workspace is the one used by Alfresco Web Client which contains all the Spaces
// and their documents
Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
// Retrieve a node
Node myNode = (Node) session.getItem("app:company_home");
System.out.println("Company home node: path=" + myNode.getPath() + ", type=" + myNode.getPrimaryNodeType().getName());
Node facturas = myNode.addNode("fac:facturas", "cm:folder");
facturas.setProperty("cm:name", "Facturas");
facturas.setProperty("cm:description", "");
do
{
line = buffer.readLine(); //leo la primera linea
if(line == null) break;
x.parsear(line); //parseo la siguiente linea
Node fac1 = facturas.addNode("fac:entry" + cnt, "fac:factura");
for(int i=0;i<4;i++)
{
if(i == 3) //añado el contenido, la imagen escaneada
{
//fac1.setProperty("cm:content", resource.getInputStream());
}
else
{
fac1.setProperty(campos[i], x.lista[i]); //Add a property
}
}
session.save(); //Persist the changes mySession.save();
cnt++;
}while(true);
session.logout();
System.out.println("¡¡¡Transferencia Completada!!!");
System.exit(0);
[/size]11-20-2006 07:20 AM
Exception in thread "main" java.io.FileNotFoundException: class path resource [org/alfresco/jcr/example/wikiImage.gif] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:137)
at org.alfresco.sample.jcr.WIKIExample.main(WIKIExample.java:145)
11-21-2006 04:40 AM
11-21-2006 06:56 AM
ClassPathResource resource = new ClassPathResource("org/alfresco/jcr/example/wikiImage.gif");
ClassPathResource resource = new ClassPathResource("org/alfresco/sample/jcr/wikiImage.gif");
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.