cancel
Showing results for 
Search instead for 
Did you mean: 

Custom user profile by add new properties

barthys
Champ in-the-making
Champ in-the-making
Hi
Can every one can help me to personalize user profile by adding news properties.
I try to change it on the user profile page according someco tutorial and it works well but in admin console I don't see the news properties that I added when I go to modify user information.

My question how to change both user profile page by adding news properties and permit the administrator to see them in the admin console to able to change them.


Thanks for all for your help
7 REPLIES 7

niketapatel
Star Contributor
Star Contributor
Hi

To add your new properties in admin console user page, you need to change this webscript - /components/console/users located at

share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\console\usersgroups

And you have already changed user profile - /components/profile/userprofile

Hope it helps!

barthys
Champ in-the-making
Champ in-the-making
Thanks you very much I will try your indications and return to you.

barthys
Champ in-the-making
Champ in-the-making
please when I follow  your instructions we see that the file users.get.js in the aborescence share \ WEB-INF \ classes \ alfresco \ Site-webscripts \ org \ alfresco \ components \ console \ usersgroups and this file does not contain the properties
that I want to show in the admin console  against the aborescence share \ components \ console include a file: users.js that contains s the properties of the user

   // About section fields
               var firstName = person.firstName,
                  lastName = person.lastName,
                  fullName = firstName + ' ' + (lastName ? lastName : "");
               fnSetter("-view-title", fullName);
               fnSetter("-view-name", fullName);
               fnSetter("-view-jobtitle", person.jobtitle);
               fnSetter("-view-organization", person.organization);
               // biography is a special html field
               var bio = person.persondescription ? person.persondescription : "";
               Dom.get(parent.id + "-view-bio").innerHTML = bio.replace(/\n/g, "<br/>");
              
               // Contact section fields
               fnSetter("-view-location", person.location);
               fnSetter("-view-email", person.email);
               fnSetter("-view-telephone", person.telephone);
               fnSetter("-view-mobile", person.mobile);
               fnSetter("-view-skype", person.skype);
               fnSetter("-view-instantmsg", person.instantmsg);
               fnSetter("-view-googleusername", person.googleusername);
              
               // Company section fields
               fnSetter("-view-companyname", person.organization);
               // build the company address up and set manually - encoding each value
               var addr = "";
               addr += person.companyaddress1 ? ($html(person.companyaddress1) + "<br/>") : "";
               addr += person.companyaddress2 ? ($html(person.companyaddress2) + "<br/>") : "";
               addr += person.companyaddress3 ? ($html(person.companyaddress3) + "<br/>") : "";
               addr += person.companypostcode ? ($html(person.companypostcode) + "<br/>") : "";
               Dom.get(parent.id + "-view-companyaddress").innerHTML = addr;
               fnSetter("-view-companytelephone", person.companytelephone);
               fnSetter("-view-companyfax", person.companyfax);
               fnSetter("-view-companyemail", person.companyemail);
  
I thought that  adding new properties like the same syntax  it will be ok ;here that i have done:
         //news property adding by me

               fnSetter("-view-Matricule", person.Matricule);
               fnSetter("-view-DateDeNaissance", person.DateDeNaissance);
               fnSetter("-view-LieuDeNaisance", person.LieuDeNaisance);
               fnSetter("-view-NomduPere", person.NomduPere);
               fnSetter("-view-NomDeLaMere", person.NomDeLaMere);
               fnSetter("-view-Sexe", person.Sexe);
               fnSetter("-view-SituationMatrimoniale", person.SituationMatrimoniale);
               fnSetter("-view-Telephone", person.Telephone);
               fnSetter("-view-NombreEnfant", person.NombreEnfant);
               fnSetter("-view-Religion", person.Religion);
               fnSetter("-view-ETHNIE", person.ETHNIE);
              
               fnSetter("-view-LieuHabitation", person.LieuHabitation);
               fnSetter("-view-Direction", person.Direction);
               fnSetter("-view-Service", person.Service);

  and I have added in this file  users.get.html.ftl like that :
               <!– added by me –>
<div class="header-bar">${msg("label.inf")}</div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.matricule")}:</span>
                  <span id="${el}-view-Matricule" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.datenaiss")}:</span>
                  <span id="${el}-view-DateDeNaissance" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.lieun")}:</span>
                  <span id="${el}-view-LieuDeNaisance" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.np")}:</span>
                  <span id="${el}-view-NomduPere" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.nm")}:</span>
                  <span id="${el}-view-NomDeLaMere" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.sexe")}:</span>
                  <span id="${el}-view-Sexe" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.stm")}:</span>
                  <span id="${el}-view-SituationMatrimoniale" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.tel")}:</span>
                  <span id="${el}-view-Telephone" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.cel")}:</span>
                  <span id="${el}-view-Cellulaire" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.ne")}:</span>
                  <span id="${el}-view-NombreEnfant" class="field-value"></span>
               </div>
                <div class="field-row">
                  <span class="field-label-right">${msg("label.reli")}:</span>
                  <span id="${el}-view-Religion" class="field-value"></span>
               </div>
                <div class="field-row">
                  <span class="field-label-right">${msg("label.etn")}:</span>
                  <span id="${el}-view-ETHNIE" class="field-value"></span>
               </div>
                <div class="field-row">
                  <span class="field-label-right">${msg("label.telephone")}:</span>
                  <span id="${el}-view-telephone" class="field-value"></span>
               </div>
               <!– –>           
               <div class="header-bar">${msg("label.emp")}</div>
                               <div class="field-row">
                  <span class="field-label-right">${msg("label.dir")}:</span>
                  <span id="${el}-view-Direction" class="field-value"></span>
               </div>
                <div class="field-row">
                  <span class="field-label-right">${msg("label.ser")}:</span>
                  <span id="${el}-view-Service" class="field-value"></span>
               </div>
according the names I had put in the model by the new property not visible in the user profile information in the admin console.


here the error log

org.springframework.extensions.webscripts.WebScriptException: 03010001 The content node was not specified so the content cannot be streamed to the client: classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js
    at org.alfresco.repo.web.scripts.content.StreamContent.execute(StreamContent.java:156)
    at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:422)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)


Thanks you for your help my is exactly 4.3.a

barthys
Champ in-the-making
Champ in-the-making
please when I follow  your instructions we see that the file users.get.js in the aborescence share \ WEB-INF \ classes \ alfresco \ Site-webscripts \ org \ alfresco \ components \ console \ usersgroups and this file does not contain the properties
that I want to show in the admin console  against the aborescence share \ components \ console include a file: users.js that contains s the properties of the user

I thought that  adding new properties like the same syntax  it will be ok ;here that i have done:
         //news property adding by me

               fnSetter("-view-Matricule", person.Matricule);
               fnSetter("-view-DateDeNaissance", person.DateDeNaissance);
               fnSetter("-view-LieuDeNaisance", person.LieuDeNaisance);
               fnSetter("-view-NomduPere", person.NomduPere);
               fnSetter("-view-NomDeLaMere", person.NomDeLaMere);
               fnSetter("-view-Sexe", person.Sexe);
               fnSetter("-view-SituationMatrimoniale", person.SituationMatrimoniale);
               fnSetter("-view-Telephone", person.Telephone);
               fnSetter("-view-NombreEnfant", person.NombreEnfant);
               fnSetter("-view-Religion", person.Religion);
               fnSetter("-view-ETHNIE", person.ETHNIE);
              
               fnSetter("-view-LieuHabitation", person.LieuHabitation);
               fnSetter("-view-Direction", person.Direction);
               fnSetter("-view-Service", person.Service);

  and I have added in this file  users.get.html.ftl like that :
               <!– added by me –>
<div class="header-bar">${msg("label.inf")}</div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.matricule")}:</span>
                  <span id="${el}-view-Matricule" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.datenaiss")}:</span>
                  <span id="${el}-view-DateDeNaissance" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.lieun")}:</span>
                  <span id="${el}-view-LieuDeNaisance" class="field-value"></span>
               </div>
               <div class="field-row">
                  <span class="field-label-right">${msg("label.np")}:</span>
                  <span id="${el}-view-NomduPere" class="field-value"></span>
               </div>
           
           ….
according the names I had put in the model by the new property not visible in the user profile information in the admin console.
but not visible in the user profil by thee admin console. Thanks for your help

barthys
Champ in-the-making
Champ in-the-making
here the error log

org.springframework.extensions.webscripts.WebScriptException: 03010001 The content node was not specified so the content cannot be streamed to the client: classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js
    at org.alfresco.repo.web.scripts.content.StreamContent.execute(StreamContent.java:156)
    at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:422)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

stacy
Champ on-the-rise
Champ on-the-rise
how can I add the custom attributes to the user profile in alfresco 5.0.1 version. I am new to alfresco so descriptive answer would be helpful

thanks in advance

Alfresco version 5.0.1

luiscesarinfo
Confirmed Champ
Confirmed Champ

Hi guys ... I'm really new on alfresco and I'm trying to add an extra field at User form. I followed this tutorial from Mr Potts, however I'm using the Alfresco version 5.0.d and I think something changed because it does not works. 

Is there someone who tried make this changes and can help me?

Thanks in advance.