Appropriate way to install customized source files ?

English! place to talk about development, programming and coding
Post Reply
omrat
Znuny newbie
Posts: 1
Joined: 05 May 2010, 10:02
Znuny Version: 2.4.7

Appropriate way to install customized source files ?

Post by omrat »

Hello,

What is the appropriate way to customize the existing source files (.dlt, .pm), which belong to package ?
I created package that contains customized files. When I try to install this package I get an error message:
"Message: Can't install/upgrade package, file Kernel/Modules/AgentTicketPhone.pm already used in package ITSMIncidentProblemManagement-2.0.2!"
Thus, how can I install my own version of a file which belongs to an existing package ?

Thanks!
Omrat
tto
Znuny wizard
Posts: 315
Joined: 09 Jan 2007, 15:24
Znuny Version: OTRS 5.0.x
Real Name: Torsten
Company: c.a.p.e. IT GmbH
Location: Chemnitz
Contact:

Re: Appropriate way to install customized source files ?

Post by tto »

omrat wrote: What is the appropriate way to customize the existing source files (.dlt, .pm), which belong to package ?
I created package that contains customized files. When I try to install this package I get an error message:
"Message: Can't install/upgrade package, file Kernel/Modules/AgentTicketPhone.pm already used in package ITSMIncidentProblemManagement-2.0.2!"
Thus, how can I install my own version of a file which belongs to an existing package ?
Hi Omrat,

this is a quit problematic limitaion of the OTRS-package managment if you're programming your own extensions. We faced the same problem when implementing our OTRS::CiCS-extensions for OTRS::ITSM (http://www.cape-it.de - there's a demo system available under http://demo-otrs.cape-it.de/ ). You might want to have a look at this tsunami-extensions contained in OTRS::CiCS. The basic approach ist to use the multiple inheritance which is used in OTRS and put your own modules at the beginning of the @ISA-array. After you have installed OTRS::CiCS you find the following lines in al relevant files:

Code: Select all

#----------- BEGIN required for CiCS-Tsunami framework ---------------------
my %Config;
&Kernel::Config::Load(\%Config);
if( open ( my $Handle, "$Config{Home}/CiCS_Packages" ) ) {
    while ( <$Handle> ){
        chomp;
        if ( $_ && (length($_) > 0) ) {
            unshift(@INC, "$Config{Home}/$_");
        }
    }
    close $Handle;
}
#----------- END required for CiCS-Tsunami framework -----------------------
What it does is reading all lines from a file called CiCS_Packages in <OTRS_HOME> and putting these directories at the beginning of @ISA which is used in all subsequently instantiated objects. Thus your own modules are found first by the perl interpreter when the code is executed. Hope that helps and at least points you in the right direction.

regards, Torsten
Post Reply