eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PackageId':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: PackageId


Inheritance:

   Object
   |
   +--PackageId

Package:
stx:libbasic
Category:
System-Support-Projects
Version:
rev: 1.33 date: 2022/02/23 08:02:26
user: cg
file: PackageId.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


Represents packageID's.
Knows the relationship between modules and directories in the package-organization.

copyright

COPYRIGHT (c) 2006 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

defaults
o  noProjectID
return the symbol used to tag classes and methods which are loose.
This means: not yet assigned to a particular project.

instance creation
o  from: aStringOrSymbol
(self from:'stx:libbasic') module
(self from:'stx:libbasic') directory

o  module: moduleString directory: directoryString
(PackageId module:'stx' directory:'libbasic') module
(PackageId module:'stx' directory:'libbasic') directory


Instance protocol:

accessing
o  directory
return the directory component. That's the rest after the colon.
The module is typically used to define the project-path or project-id within its
sourcecode repository (which is selected via the module).

Usage example(s):

     (PackageId from:'stx:libbasic') module
     (PackageId from:'stx:libbasic') directory
     (PackageId from:'stx') module
     (PackageId from:'stx') directory
     (PackageId from:'stx:goodies/xml/stx') module
     (PackageId from:'stx:goodies/xml/stx') directory

o  module
return the module component. That's the first component up to the colon.
The module is typically used to select a corresponding sourcecode repository.

Usage example(s):

     (PackageId from:'stx:libbasic') module
     (PackageId from:'stx:libbasic') directory

o  module: moduleString directory: directoryString
(self new module:'stx' directory:'libbasic') module
(self new module:'stx' directory:'libbasic') directory
(self new module:'stx' directory:'goodies/net') module
(self new module:'stx' directory:'goodies/net') directory
(self new module:'stx' directory:'goodies\net') module
(self new module:'stx' directory:'goodies\net') directory

o  packageIdString: aString
the required format is:
module:path
where path is a unix-like path (i.e. containing slashes).
However, for our convenience, also allow for
module/path
and even:
module\ms-dos-path
and convert them as required.
This makes it easier on a doit, by copy-pasting port of a path into a loadPackage
expression

o  string

comparing
o  = aPackageId
compares equal to a corresponding string

Usage example(s):

     'stx:libbasic' asPackageId = 'stx:libbasic'
     'stx:libbasic' asPackageId = 'stx:libbasic' asSymbol asPackageId
     'stx:libbasic' asPackageId = 'stx:libbasic' asPackageId
     'stx:libbasic2' asPackageId = 'stx:libbasic3' asPackageId

o  hash
(comment from inherited method)
return an Integer useful as a hash key for the receiver.
This hash should return same values for objects with same
contents (i.e. use this to hash on structure)

converting
o  asPackageId

o  asString

o  asSymbol

printing
o  printOn: aStream
(comment from inherited method)
append a user printed representation of the receiver to aStream.
The format is suitable for a human - not meant to be read back.

The default here is to output the receiver's class name.
BUT: this method is heavily redefined for objects which
can print prettier.

queries
o  isModuleId
true if this is a module-id only (i.e. no directory component present).
These are not allowed to be used as real projects, but only for organization.
The reason is that this is used as selector to select the sourceCodeManager and
also the manager's repository

o  libraryName
return the name of the library, when compiled to a binary (i.e. dll/so).
To avoid conflicts with the projectDefinition class
(which is named <module>_<directory_components>), we prefix the library name
with 'lib'. This has the added advantage, that under unix, linking can be done with
'-l'shortName.

Usage example(s):

     (PackageId from:'stx:libbasic') libraryName
     (PackageId from:'stx:goodies/xml/stx') libraryName
     (PackageId from:'bosch:dapasx') libraryName
     (PackageId from:'exept:expecco') libraryName

o  packageDirectory
return the pathName of the directory for this package in the file system.
For standalone apps, nil might be returned if the package's folder is not part
of the deployed package.

Usage example(s):

     'stx:libbasic2' asPackageId packageDirectory

o  parentPackage
(PackageId from:'stx:libbasic') parentPackage
(PackageId from:'stx:goodies/xml/stx') parentPackage
(PackageId from:'stx:goodies/xml/stx') parentPackage parentPackage
(PackageId from:'stx:goodies/xml/stx') parentPackage parentPackage parentPackage

o  pathRelativeToTopDirectory
'stx:libbasic' asPackageId pathRelativeToTopDirectory
'stx:goodies/net/ssl' asPackageId pathRelativeToTopDirectory
'bosch:dapasx' asPackageId pathRelativeToTopDirectory

o  pathRelativeToTopDirectory: aDirectory
|top|

top := Smalltalk packagePath first.
'stx:goodies/net/ssl' asPackageId pathRelativeToTopDirectory:top

o  projectDefinitionClass
return the project definition for this package.
Eg. for 'stx:libbasic', this would return the stx_libbasic project definition class.

Usage example(s):

     'stx:libbasic' asPackageId projectDefinitionClass
     'exept/expecco/foo' asPackageId projectDefinitionClass
     'exept/expecco/plugin/manualTest' asPackageId projectDefinitionClass
     'exept:expecco/plugin/manualTest' asPackageId projectDefinitionClass
     'exept_expecco_plugin_manualTest' asPackageId projectDefinitionClass
     'exept/expecco/plugin/edi-edifact' asPackageId projectDefinitionClass

o  projectDefinitionClassName
'stx:libbasic' asPackageId projectDefinitionClassName
'exept/expecco/foo' asPackageId projectDefinitionClassName
'exept/expecco/plugin/manualTest' asPackageId projectDefinitionClassName
'exept:expecco/plugin/manualTest' asPackageId projectDefinitionClassName
'exept_expecco_plugin_manualTest' asPackageId projectDefinitionClassName
'exept/expecco/plugin/edi-edifact' asPackageId projectDefinitionClassName

o  projectDirectory
replace by:

** This is an obsolete interface - do not use it (it may vanish in future versions) **



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 10 Dec 2024 08:50:54 GMT