cancel
Showing results for 
Search instead for 
Did you mean: 

Spaces, Share and Alfresco woes

cybertoast
Champ in-the-making
Champ in-the-making
I'm confused about how spaces created in the /alfresco repository differ from sites created in /share, and how the two interact with each other. Specifically my problem is that sub-spaces that I create in /alfresco are not visible in /share, and this is causing me problems. (I've read the wiki pages about not creating sites in /alfresco for use in /share, but in my case I actually do need to do something similar, so would like to understand what exactly the problem is!)

I can create a "site" in /share, say called Home. This shows up under the Company Home > Sites space in /alfresco. From /alfresco I can create another space under Sites > Home, like Foo (so Sites > Home > documentLibrary > Foo), and this shows up when I navigate to documentlibrary in /share.

But if I directly create a space in /alfresco (Sites > userhome, for instance), this does NOT show up in /share (going to /share/page/site/userhome/documentlibrary). Site-finder does not find this site either.

So what's going on during creation of a /share site that I need to do manually to create the site in /alfresco and have it be visible in /share?

The reason for this question is to have a simple (and hopefully code-free) way of having user's spaces be autocreated by LDAP and have them visible in the My Sites dashlet in share. My plan is to create all the home folders under /Sites/UserHome/documentLibrary (I can change the authentication-services-context.xml file to set the userHomesFolderProvider's path to ${spaces.company_home.childname}/${spaces.sites.childname}/${spaces.user_homes.childname} or something similar).
4 REPLIES 4

jck
Champ in-the-making
Champ in-the-making
Hi,
You could directly have user homes in /Share/People/documentLibrary/user1 … usern and then manage user space to set permissions and allow directory access or not.

It's what we've done and it worked well.

JC

cybertoast
Champ in-the-making
Champ in-the-making
jck,
I like the suggestion but could you provide a bit more detail please on how you got /Share/People to be visible in a share dashlet. It seems that only things that sites can only be created under the Sites space. So I've got Company Home > Sites > UserHome (or People) Site > documentlibrary. Are you saying that you have Company Home > People > documentlibrary, and have that visible in Share somehow? That's exactly the problem that I'm unable to overcome since I can't create a root-level space in Share, and if I create Company Home > People in /alfresco I can't access it in Share.

The other issue is that I have LDAP as my auth model and my users' home folders are automatically created under the /User Homes space. Did you have to alter the authentication-service-context.xml file to point the userhome to a different location?

I know I can do all this manually when I create users but I want to be able to have my users' homes created automatically when their account is created (upon login).

Thanks!

cybertoast
Champ in-the-making
Champ in-the-making
Seems I can't change the userHomesHomeFolderProvider as easily as I thought. I want this provider to create user's folders in Sites/userhome/documentlibrary. I figured that I could change the authentication-services-context.xml file to set the path to whatever I wanted:

    <bean name="userHomesHomeFolderProvider" class="org.alfresco.repo.security.person.UIDBasedHomeFolderProvider" parent="baseHomeFolderProvider">
        <property name="path">
           <!– <value>/${spaces.company_home.childname}/${spaces.user_homes.childname}</value> –>
           <value>/${spaces.company_home.childname}/${spaces.sites.childname}/${spaces.user_homes.childname}/documentlibrary</value>
        </property>
        <property name="storeUrl">
           <value>${spaces.store}</value>
        </property>
        <property name="onCreatePermissionsManager">
            <ref bean="defaultOnCreatePermissionsManager" />
        </property>
        <property name="onReferencePermissionsManager">
            <ref bean="defaultOnReferencePermissionsManager" />
        </property>
    </bean>
.. and change the bootstrap-spaces.properties file to set the name of the new space that I have:

spaces.user_homes.name=userhome

I've create a site from /share called User Homes with a url of userhome, and this shows up in /alfresco as Sites > userhome and has a documentLibrary space under it.

But the error I get when I try to log in a new user is:

10:51:23,222  ERROR [web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: Non-unique path: found : /app:company_home/st:sites/app:user_homes/documentLibrary 0
java.lang.IllegalStateException: Non-unique path: found : /app:company_home/st:sites/app:user_homes/documentLibrary 0
   at org.alfresco.repo.security.person.AbstractHomeFolderProvider.resolvePath(AbstractHomeFolderProvider.java:259)
   at org.alfresco.repo.security.person.AbstractHomeFolderProvider.getPathNodeRef(AbstractHomeFolderProvider.java:244)
   at org.alfresco.repo.security.person.UIDBasedHomeFolderProvider.getHomeFolder(UIDBasedHomeFolderProvider.java:84)
   at org.alfresco.repo.security.person.AbstractHomeFolderProvider$OnCreateNode.doWork(AbstractHomeFolderProvider.java:298)
   at org.alfresco.repo.security.person.AbstractHomeFolderProvider$OnCreateNode.doWork(AbstractHomeFolderProvider.java:283)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:514)
   at org.alfresco.repo.security.person.AbstractHomeFolderProvider.onCreateNode(AbstractHomeFolderProvider.java:270)
   at org.alfresco.repo.security.person.HomeFolderManager.makeHomeFolder(HomeFolderManager.java:147)
   at org.alfresco.repo.security.person.HomeFolderManager.onCreateNode(HomeFolderManager.java:125)
   at org.alfresco.repo.security.person.PersonServiceImpl.onCreateNode(PersonServiceImpl.java:846)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.policy.JavaBehaviour$JavaMethodInvocationHandler.invoke(JavaBehaviour.java:179)
   at $Proxy18.onCreateNode(Unknown Source)

Why does Alfresco think that the path I provided is non-unique?

cybertoast
Champ in-the-making
Champ in-the-making
My understanding of the content-model and JCR and xpath-search is what was missing. In order to change the path, the correct syntax is:

<value>/${spaces.company_home.childname}/${spaces.sites.childname}/cm:userhome/cm:documentLibrary</value>
which is basically <value>app:company_name/st:sites/cm:userhome/cm:documentLibrary. userhome is the site that I created in Share.

What I still don't understand is why

<value>/${spaces.company_home.childname}/${spaces.sites.childname}/${spaces.user_homes.childname}/documentlibrary</value>
gives me the "non-unique path" error. I understand that app:user_homes is different from cm:userhome, but I should be able to set app:user_homes to point to my Sites > userhome space, but don't quite get how!

Any pointers on what I should read to understand all this better?