05-09-2007 04:16 AM
05-17-2007 03:41 AM
reference = new Reference(store, row.getNode().getId(), null);
predicate = new Predicate(new Reference[]{reference}, null, null);
nodes = repositoryService.get(predicate);
for (i=0;i < nodes[0].getProperties().length; i++)
{
//Nombre
if (nodes[0].getProperties(i).getName().equals("{http://www.alfresco.org/model/content/1.0}name"))
{
sName = nodes[0].getProperties(i).getValue();
}
06-19-2007 05:19 AM
var myfile = companyhome.childByNamePath(name);
props = myfile.getProperties();
for (i=0;i<props.length;i++){
txt += "<b>" + props[i].getName() + "</b>:" + props[i].getValue() + "<br>";
}
reference = new Reference(store, row.getNode().getId(), null);
predicate = new Predicate(new Reference[]{reference}, null, null);
nodes = repositoryService.get(predicate);
for (i=0;i < nodes[0].getProperties().length; i++)
{
//Nombre
if (nodes[0].getProperties(i).getName().equals("{http://www.alfresco.org/model/content/1.0}name"))
{
sName = nodes[0].getProperties(i).getValue();
}
You can access this way to all properties
06-19-2007 07:42 AM
When i try to display the properties (please see code)
var myfile = companyhome.childByNamePath(name);
props = myfile.getProperties();
for (i=0;i<props.length;i++){
txt += "<b>" + props[i].getName() + "</b>:" + props[i].getValue() + "<br>";
}
the variable "props" has "null" value, not an object, and I don't know why. So I look for the properties when I create the Node "name" (createNode function). What I see in the Java code (please see /HEAD/root/projects/repository/source/java/org/alfresco/repo/jscript/ScriptNode.java) is that properties attribute has "null" value if we don't put anything in properties parameter function.
06-21-2007 11:46 AM
When i try to display the properties (please see code)
var myfile = companyhome.childByNamePath(name);
props = myfile.getProperties();
for (i=0;i<props.length;i++){
txt += "<b>" + props[i].getName() + "</b>:" + props[i].getValue() + "<br>";
}
the variable "props" has "null" value, not an object, and I don't know why. So I look for the properties when I create the Node "name" (createNode function). What I see in the Java code (please see /HEAD/root/projects/repository/source/java/org/alfresco/repo/jscript/ScriptNode.java) is that properties attribute has "null" value if we don't put anything in properties parameter function.
The code the other user posted was for using WebServices - the code you are trying to use is the JavaScript API - they are quite different and methods/properties are accessed using a different syntax.
I suggest you take a look at the examples in the JavaScript API docs:
http://wiki.alfresco.com/wiki/JavaScript_API
then you'll see that the code you are using will not work at all.
Thanks,
Kevin
06-22-2007 07:04 AM
06-27-2007 03:57 AM
package wizard.actions;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
06-27-2007 07:02 AM
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.