Adding children to store root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2006 08:44 PM
I have been trying a few things, have been getting unexpected results, and now I am confused. So here are my questions:
Is there anything special about adding a node (say, a folder) directly as a child of a store root? I have a store with protocol "workspace" – will the following code work for adding a folder directly under the store root:
// this.storeRef points to the store I am interested in.NodeRef rootNode = nodeService.getRootNode(this.storeRef);// Creating a folder as a direct child of storeRefChildAssociationRef childAssocRef = nodeService.createNode(rootNode, ContentModel.PROP_CONTAINS, QName.createQName( NamespaceService.CONTENT_MODEL_1_0_URI, folderName), ContentModel.TYPE_FOLDER);
Does it matter whether I use ContentModel.PROP_CONTAINS or some other QName as the assocTypeQName when adding a child to a store's root?
What are the differences between creating child associations and creating plain-jane associations (NodeService#createAssociation())? I think one of the differences is that (recursive) searching under a parent node will search those nodes related through child associations, but not those related through plain associations – is this correct?
If I don't put any "PATH:" term in my Lucene search, does the whole store get searched? For example, if I construct a query like this:
String query = "+TYPE:\"" + ContentModel.TYPE_FOLDER.toString() + "\"";
will I get back a list of all the folders in the store being searched? Will the assocTypeQName I use while adding children make a difference to the results of the above query?
I apologize for asking so many questions in a single post, but I am getting confused by some of the results I am seeing :-).
Thanks.
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 05:12 AM
Is there a wiki or documentation about the structure of the database (a entity-relationship diagram)?
Where can I check the properties values of a node person (from node people) in the database by sql command line?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 06:43 AM
select string_value, guid from node_properties where protocol='user' and qname='{http://www.alfresco.org/model/user/1.0}username';
Get the value the "guid" column value for the user you are interested in, then execute something like this to see all the properties for that user instance:select * from node_properties where guid='9e86231c-9cb7-11da-a085-9f5761485f4e';
Remember that the passwords field is encrypted.Hope this helps,
Kevin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 11:39 AM
Please would you mind telling me where the node 'People' ("/sys

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 01:08 PM
Another question… in the function startWizardForEdit from NewUserWizard what does this code means:
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
What is this id? the uuid of the node?
If I am creating 2 different nodes during this newuserwizard, how will he choose which uuid to use? How can I be sure that if I create two different nodes in sys:system I will have different uuid for the children of the first node and the children of the second node?
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 02:51 AM
I am able to create a new node Functions under System. Then I create nodes function in Functions. But in the NodeBrowser it appears that the node function I create has the same uuid than the node person that I create at the same time. Can it be due to nodebrowser bug? or because I am badly using userTransaction?
Then I wanted to add a class FunctionsBean similar to UsersBean to display all functions in my jsp page users.jsp however I have error message in my jsp page saying that it cannot find my functionService, where should I define the bean functionService and the bean FunctionsBean? in faces-config, in application-context, in authentication-context, in network-protocol..?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 10:56 AM
<a:richList id="users-list" binding="#{UsersBean.usersRichList}" viewMode="details" pageSize="10"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
value="#{UsersBean.users}" var="r" initialSortColumn="userName" initialSortDescending="true">

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 04:00 AM
UsersBean is a JSF managed bean, as such it is defined in the JSF configuration files (in our case faces-config-beans.xml). The JSF framework instantiates the bean when it is required. The NodeService is also defined in the config file as a managed property, this means the nodeService object is "injected" into the bean, ready for your code to use.
I would highly recommend doing some background reading on JSF, there are several great sites with loads of articles and tutorials, some we've found useful are:
http://www.jsftutorials.net
http://www.jsfcentral.com
http://www-128.ibm.com/developerworks/library/j-jsf1 (series of 4 articles introducing JSF)
These may help answer a few of your questions and give you a better insight into how the Alfresco web client works.
Hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 05:07 AM
http://www.theserverside.com/resources/article.jsp?l=SpringFramework
http://www.springframework.org/documentation
Thanks,
Kevin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 09:26 AM
Now I am getting into troubles while doing this:
List<ChildAssociationRef> childRefs = nodeService.getChildAssocs(functionRef);
although my nodeService and functionRef seem correct (good reference):
functionRef= workspace://SpacesStore/e79e7952-a87a-11da-ab9f-0774da8876d0
nodeService= org.alfresco.repo.node.db.DbNodeServiceImpl@1e932fcf
storeRef= workspace://SpacesStore
And I get this error message:
A system error happened during the operation: Bad credentials presented
What kind of error is it? Can it be due to my insertion of nodes in the repository (when I add a node Functions under system and some nodes function in Functions)?
Thanks again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2006 05:21 AM
List<ChildAssocRef> answer = nodeService.selectNodes(rootNodeRef, "*", null, namespacePrefixResolver, false);
I guess it is a mistake, nodeService has no selectNodes. We should use searchService right?
