cancel
Showing results for 
Search instead for 
Did you mean: 

SlingshotUserFactory.java changed?

jriker1
Champ in-the-making
Champ in-the-making
I have downloaded the latest head version and was implementing my customizations that were done in prior versions.  All went well until I tried to compile.  It contained messages like:

  ….site\SlingshotUserFactory.java:114: cannot find symbol
    [javac] symbol  : variable CM_DIVISION
    [javac] location: class org.alfresco.web.site.SlingshotUserFactory
    [javac]             writer.writeValue(CM_DIVISION, user.getDivision());

This worked fine before however now errors compiling.  Changes I made to this file were just:

writer.writeValue(CM_DIVISION, user.getDivision());

If I search the working set for JobTitle which is also in the same file I get the same number of results returned.  The only think I notice is that the includes now are totally different on this class and it's surf based now.  Otherwise looks very similar but not acting the same.
Thanks.

jR
13 REPLIES 13

mikeh
Star Contributor
Star Contributor
SVN HEAD is a bit unstable at the moment due to the big SURF changes. Try again in a day or two.

Thanks,
Mike

jriker1
Champ in-the-making
Champ in-the-making
Thanks Mike.  I didn't get the latest head version since I noticed it reference temporarily merging to head.  Went for the head version right before it.  Revision I'm using is 17879 if it matters.  If you think it's safer to go back some revisions let me know which revision to pull else I'll wait.

Thanks.

JR

mikeh
Star Contributor
Star Contributor
HEAD just passed all the unit tests on the build machine, so try grabbing it again now.

Cheers,
Mike

jriker1
Champ in-the-making
Champ in-the-making
Thanks Mike.  Note my build was fine without the modification I listed at the start of this thread.  It was just when I added this to the file it was complaining.  This is the same customization I did in 3.2 so not sure if the method to add a new attribute to a user has changed since then and this won't work however will go thru and implement my customizations again to see.

JR

jriker1
Champ in-the-making
Champ in-the-making
Latest head seems broken.  If I download the head I get 45415 files.  My prior download a moth or so ago gave me 63225 files.

mrogers
Star Contributor
Star Contributor
Was that prior to the removal of Surf, and the Web Studio Projects?

mikeh
Star Contributor
Star Contributor
Web Studio, Webscript Framework and Web Framework projects are all now part of Spring Surf.

The build machine does a clean svn checkout and build, so the number of files is probably correct.

Thanks,
Mike

jriker1
Champ in-the-making
Champ in-the-making
Thanks Mike.  What revision should the latest head version be?  Also I couldn't find for example AlfrescoUserFactory.java in my last dump which I have modified in the past to add attributes to a user such as their employee number pulled from the AD.

Also noticed in ScriptUser.java that items like:

    public void setInstantMsg(String value)
    {
        this.user.setInstantMsg(value);
    }

are no longer in there where I also used to add changes for adding a new attribute to user. 

Thanks.

JR

jriker1
Champ in-the-making
Champ in-the-making
Any updates on how to add an attribute to the user?  Below are changes that were made that I noticed:

AlfrescoUserFactory.java is gone
ScriptUser.java doesn't seem to store most of the set and get functions anymore
user.java doesn't seem to store the prop's directly or have the set and get functions either

What I normally did:

  • Add cm: values to contentModel.xml
  • Add QName values to ContentModel.java
  • Added the appropriate labels in slingshot.properties
  • Added one of my attributes to the div in my-profile.get.html.ftl so it shows
  • Added appropriate entries in userprofile.get.html.ftl
  • In the SlingshotUserFactory.java added the appropriate writer.WriteValue get entries
  • Added get and set values for the new attributes in ScriptUser.java
  • Added CM_ references to the http string in AlfrescoUserFactory.java
  • In User.java added PROP_ static strings and get/set functions


  • I can still do this except for the items I listed are missing or look like the method of implementing things has changed.  Any thoughts on how to implement adding an attribute to a user profile in the current release?

    Looking thru the code and using InstantMsg as an example.  I find the following files need to be edited to add a new attribute.  Can anyone comfirm?

    root/projects/remote-api/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.lib.ftl"
    root/projects/repository/config/alfresco/model/contentModel.xml
    root/projects/repository/source/java/org/alfresco/model/ContentModel.java
    root/projects/slingshot/config/alfresco/site-webscripts/org/alfresco/components/console/users.get.html.ftl
    root/projects/slingshot/config/alfresco/site-webscripts/org/alfresco/components/dashlets/my-profile.get.html.ftl
    root/projects/slingshot/config/alfresco/site-webscripts/org/alfresco/components/profile/userprofile.get.html.ftl
    root/projects/slingshot/source/java/org/alfresco/web/site/SlingshotUserFactory.java
    root/projects/slingshot/source/web/components/console/users.js
    root/projects/slingshot/source/web/components/profile/profile.js
    Thanks.

    JR
    Getting started

    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.