AnsweredAssumed Answered

Anleitung aendern einer Javafunktion

Question asked by mahlzeit on Aug 31, 2011
Latest reply on Aug 31, 2011 by mahlzeit
Hallo,

Ich habe eine Funktion generateUserName die ich anpassen moechte. (s.a. [12])
Gefunden habe ich sie in InvitationServiceImpl.class.

Wie stelle ich das an?
(zweilinkejavapfoten)


Meine bisherigen Versuche:

## 1. find class
$ find org -name "*nvit*" -exec grep -i gener {} \; -print

## 2. view class source
$ class=org/alfresco/repo/invitation/InvitationServiceImpl.class
$ ls $class
$ name=`echo $class | sed "s/\.class//"`
$ javap -c $name

## 3. dl source
$ url=http://svn.alfresco.com/repos/alfresco-open-mirror                        $ repo=alfresco/HEAD/root/projects/repository/source/java/
$ wget $url/$repo/$name.java

## 4. edit source
$ bname=`basename $name`
$ cp -p $bname.java $bname.java.org
$ vi $baname.java
$ diff -c $bname.java.org $bname.java
*** InvitationServiceImpl.java.org      Fri Aug 26 12:17:35 2011
— InvitationServiceImpl.java  Wed Aug 31 12:00:09 2011
***************
*** 838,843 ****
— 838,844 —-
          do
          {
              inviteeUserName = usernameGenerator.generateUserName(inviteeFirstName, inviteeLastName, inviteeEmail, i);
+             inviteeUserName = "ext_".inviterUserName."_".inviteeUserName ;
              i++;
          } while (this.personService.personExists(inviteeUserName) && (i < getMaxUserNameGenRetries()));


Aber wie nun weiter?


Danke.
Mahlzeit Heiko

—————————————————-

[12] http://forums1.man.alfresco.com/en/viewtopic.php?f=47&t=25356&sid=d560829084d3e9081213022c4d6a7c5b
invite external user to site
  …I have found out that this is the problem in : InvitationServiceImpl
  Why?

Outcomes