Esempio n. 1
0
class StandardAbapAuthSelectionOptionMixin:

    SIGN = Column(
        String,
        nullable=False,
        default=InclusionChoice.INCLUDE,
        qt_label='Incl./Excl.',
        qt_description=
        'Should the specified items be included or excluded? Default is to include them',
        choices=InclusionChoice.CHOICES)

    OPTION = Column(
        String,
        nullable=False,
        default=OptionChoice.EQ,
        qt_label='Sel. Option',
        qt_description='Selection option',
        choices=OptionChoice.CHOICES,
    )

    LOW = Column(
        String(12),
        nullable=False,
        qt_label='Lower Range Value',
        qt_description='Lower Range Value. Must be specified.',
    )

    HIGH = Column(
        String(12),
        nullable=True,
        qt_label='Higher Range Value',
        qt_description='Higher Range Value. Optional.',
    )
Esempio n. 2
0
class AbapSpoolParams_BAPIXMPRNT_Mixin:

    DESTIN = Column(String(4), qt_label='Spool Output Device', nullable=False)

    PRINTIMM = Column(Boolean,
                      qt_label='Immediate Spool Print',
                      choices=YesNoChoice.CHOICES,
                      default=YesNoChoice.NO,
                      nullable=False)

    RELEASE = Column(Boolean,
                     qt_label='Immediate Spool Deletion',
                     choices=YesNoChoice.CHOICES,
                     default=YesNoChoice.NO,
                     nullable=False)

    COPIES = Column(Integer, qt_label='Number of Spool Copies', nullable=True)

    PRIARCMODE = Column(Boolean,
                        qt_label='Print: Archiving mode',
                        choices=YesNoChoice.CHOICES,
                        default=YesNoChoice.NO,
                        nullable=True)

    SHOWPASSWD = Column(String(12),
                        qt_label='Print: Authorization',
                        nullable=True)

    SAPBANNER = Column(Boolean,
                       qt_label='Print: SAP Cover Page',
                       choices=YesNoChoice.CHOICES,
                       default=YesNoChoice.NO,
                       nullable=True)
    BANNERPAGE = Column(Boolean,
                        qt_label='Spool Cover Sheet',
                        choices=YesNoChoice.CHOICES,
                        default=YesNoChoice.NO,
                        nullable=True)

    EXPIRATION = Column(Integer,
                        qt_label='Spool Retention Period',
                        nullable=True)

    PRINTRECEIP = Column(String(12),
                         qt_label='Spool Receipient Name',
                         nullable=True)

    NUMLINES = Column(Integer, qt_label='Page Lenth of List', nullable=True)

    NUMCOLUMNS = Column(Integer, qt_label='Line Width of List', nullable=True)
Esempio n. 3
0
class CheckTreeStructure(QtModelMixin, Base, BaseMixin, TableNameMixin):

    __tablename__ = 'checks_metadata'

    __table_args__ = (UniqueConstraint("type", "name"), {
        'extend_existing': True
    })

    id = Column(Integer, primary_key=True, qt_show=False)

    parent_id = Column(Integer,
                       ForeignKey('checks_metadata.id'),
                       qt_label='Parent Key',
                       qt_show=False)

    name = Column(String(250),
                  nullable=False,
                  qt_label='Folder or Check Name',
                  qt_description='Name of the check or folder',
                  qt_show=True)

    description = Column(
        RichString,
        nullable=True,
        qt_label='Check Description',
        qt_description='Brief description what the check does',
    )

    children = relationship(
        'CheckTreeStructure',
        cascade="all, delete-orphan",
        backref=backref("parent_node", remote_side=id),
    )

    type = Column(
        String(250),
        nullable=False,
        qt_label='Node Type',
        qt_description='Node Type',
    )

    __qtmap__ = [name, description]

    __icon__ = ':Folder'

    __mapper_args__ = {
        'polymorphic_identity': 'CheckFolder',
        'polymorphic_on': type,
    }
class ActionAbapRsusr002__IT_PROF1(Base, StandardAuthSelectionOptionMixin,
                                   BaseMixin):
    """ Selection Options for Profiles """
    __tablename__ = pluginName + '__IT_PROF1'

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(12),
        nullable=False,
        qt_label='Profile Name',
        qt_description='Profile Name',
    )

    HIGH = Column(
        String(12),
        nullable=True,
        qt_label='Profile Name',
        qt_description='Profile Name',
    )
Esempio n. 5
0
class StandardAuthSelectionOptionMixin(QtModelMixin):

    SIGN = Column(
        String,
        name='SIGN',
        nullable=False,
        default=SystemAbapIncludeChoice.INCLUDE,
        qt_label='Incl./Excl.',
        qt_description=
        'Should the specified items be included or excluded? Default is to include them',
        choices=SystemAbapIncludeChoice.CHOICES,
    )

    OPTION = Column(
        Integer,
        name='OPTION',
        nullable=False,
        default=SystemAbapOptionChoice.EQ,
        qt_label='Sel. Option',
        qt_description='Selection option',
        choices=SystemAbapOptionChoice.CHOICES,
    )

    LOW = Column(
        String(12),
        name='LOW',
        nullable=False,
        qt_label='Lower Range Value',
        qt_description='Lower Range Value. Must be specified.',
    )

    HIGH = Column(
        String(12),
        name='HIGH',
        nullable=True,
        qt_label='Higher Range Value',
        qt_description='Higher Range Value. Optional.',
    )

    __qtmap__ = [SIGN, OPTION, LOW, HIGH]
class ActionAbapRsusr002__IT_UREF(Base, StandardAuthSelectionOptionMixin,
                                  BaseMixin):
    """ Selection Options for Reference Users """
    __tablename__ = pluginName + '__IT_UREF'
    __table_args__ = {'extend_existing': True}

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(12),
        nullable=False,
        qt_label='Reference User',
        qt_description='Refernce User',
    )

    HIGH = Column(
        String(12),
        nullable=True,
        qt_label='Reference User',
        qt_description='Refernce User',
    )
class ActionAbapRsusr002__IT_OBJCT(Base, StandardAuthSelectionOptionMixin,
                                   BaseMixin):

    __tablename__ = pluginName + '__IT_OBJCT'
    __table_args__ = {'extend_existing': True}

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(10),
        nullable=False,
        qt_label='Authorization Object',
        qt_description='Authorization Object',
    )

    HIGH = Column(
        String(10),
        nullable=True,
        qt_label='Authorzation Object',
        qt_description='Authorization Object',
    )
class ActionAbapRsusr002__IT_SECPOL(Base, StandardAuthSelectionOptionMixin,
                                    BaseMixin):
    """ Selection Options for Security Policy """
    __tablename__ = pluginName + '__IT_SECPOL'
    __table_args__ = {'extend_existing': True}

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(40),
        nullable=False,
        qt_label='Security Policy',
        qt_description='Security Policy. Must be specified.',
    )

    HIGH = Column(
        String(40),
        nullable=True,
        qt_label='Security Policy',
        qt_description='Security Policy (Upper range limit). Optional.',
    )
class ActionAbapRsusr002__IT_UGROUP(Base, StandardAuthSelectionOptionMixin,
                                    BaseMixin):
    """ Selection Options for User Groups  """

    __tablename__ = pluginName + '__IT_UGROUP'
    __table_args__ = {'extend_existing': True}

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(12),
        nullable=False,
        qt_label='User Group',
        qt_description='User Goup. Must be specified.',
    )

    HIGH = Column(
        String(12),
        nullable=True,
        qt_label='User Group',
        qt_description='User Group (Upper range limit). Optional.',
    )
class ActionAbapRsusr002__IT_SNC(Base, StandardAuthSelectionOptionMixin,
                                 BaseMixin):
    """ Selection Options for SNC """

    __tablename__ = pluginName + '__IT_SNC'
    __table_args__ = {'extend_existing': True}

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(255),
        nullable=False,
        qt_label='SNC: Printable Name',
        qt_description='SNC Printable Name',
    )

    HIGH = Column(
        String(255),
        nullable=True,
        qt_label='SNC: Printable Name',
        qt_description='SNC: Printable Name',
    )
class ActionAbapRsusr002__IT_USER(Base, StandardAuthSelectionOptionMixin,
                                  BaseMixin):
    """ Selection Options for Users"""
    __tablename__ = pluginName + '__IT_USER'

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    LOW = Column(
        String(12),
        nullable=False,
        default='',
        qt_label='User Name in User Master Record',
        qt_description='User Name in User Master Record. Must be specified.',
    )

    HIGH = Column(
        String(12),
        nullable=True,
        default='',
        qt_label='User Name in User Master Record',
        qt_description=
        'User Name in User Master Record (Upper range limit). Optional.',
    )
class ActionAbapRsusr002__params(QtModelMixin, Base, BaseMixin):
    """ The config data for the RSUSR002 plugin. Possible Parameters of the Function Module:

    ok: IT_USER	TYPE	SUSR_T_RANGE_4_XUBNAME	                     	Benutzerliste
    ok: IT_GROUP	TYPE	SUSR_T_SEL_OPT_GROUP	                     	Benutzergruppeliste
    ok: IT_UGROUP	TYPE	SUSR_T_SEL_OPT_GROUP	                     	Selektionsoptionen für Benutzergruppe
    ok: IT_UALIAS	TYPE	SUSR_T_SEL_OPT_ALIAS	                     	Selektionsoptionen für Alias
    ok: IT_UTYPE	TYPE	SUSR_T_SEL_OPT_UTYPE	                     	Selektionsoptionen für Benutzetyp
    ok: IT_SECPOL	TYPE	SUSR_T_SEL_OPT_SECPOL	                     	Selektionsoptionen für Sicherheitsrichtlinie
    ok: IT_SNC	TYPE	SUSR_T_SEL_OPT_SNC	                     	Selektionsoptionen für SNC
    ok: IV_USER_LOCK	TYPE	SUIM_LOCK_SEL	                     	Sperrestatus Y=gesperrt, N=nicht gesperrt, Space = irrelevant
    ok: IV_PWD_LOCK	TYPE	SUIM_LOCK_SEL	                     	Sperrestatus Y=gesperrt, N=nicht gesperrt, Space = irrelevant
    ok: IV_LOCK	TYPE	BOOLE_D	                     	Alle Benutzer mit Administrator- oder Kennwortspe: TRUE (='X') und FALSE (=' ')
    ok: IV_UNLOCK	TYPE	BOOLE_D	                     	Nur Benutzer ohne Sperren: TRUE (='X') und FALSE (=' ')
    ok: IV_FDATE	TYPE	CDDATUM	                     	Ablauf Gültigkeit von
    ok: IV_TDATE	TYPE	CDDATUM	                     	Ablauf Gültigkeit bis
    later: IT_LIC_TYPE	TYPE	SUSR_T_SEL_OPT_LIC_TYPE	                     	Selektionsoptionen für Lizenztypen
    later: IT_ACCNT	TYPE	SUSR_T_SEL_OPT_ACCNT	                     	Selektionsoptionen für Account-Id
    later: IT_KOSTL	TYPE	SUSR_T_SEL_OPT_KOSTL	                     	Selektionsoptionen für Kostenstelle
    later: IT_STCOD	TYPE	SUSR_T_SEL_OPT_STCOD	                     	Selektionsoptionen für Startmenü
    later: IT_LANGU	TYPE	SUSR_T_SEL_OPT_LANGU	                     	Selektionsoptionen für Sprache
    later: IV_DCPFM	TYPE	SUSR_T_SEL_OPT_DCPFM	                     	Dezimaldarstellung
    later: IV_DATFM	TYPE	SUSR_T_SEL_OPT_DATFM	                     	Datumsdarstellung
    later: IV_TIMEFM	TYPE	SUSR_T_SEL_OPT_TIMEFM	                     	Zeitformat (12-/24-Stundenangabe)
    later: IT_SPLD	TYPE	SUSR_T_SEL_OPT_SPLD	                     	Selektionsoptionen für Gerätenamen
    later: IV_TZONE	TYPE	TZNZONE	                     	Zeitzone
    later: IV_CATTK	TYPE	BOOLE_D	                     	Datenelement zur Domäne BOOLE: TRUE (='X') und FALSE (=' ')
    later: IT_PARID	TYPE	SUSR_T_SEL_OPT_PARID	                     	Selektionsoptionen für Set-/Get-Paramter-Id

    ok: IV_TCODE	TYPE	TCODE	                     	Transaktionscode
    ok: IV_START_TX	TYPE	BOOLE_D	                     	nur ausführbare Transaktion
    ok: IT_UREF	TYPE	SUSR_T_SEL_OPT_REF	                     	Selektionsoptionen für Referenzbenutzer
    ok: IT_ACTGRPS	TYPE	SUSR_T_SEL_OPT_AGR	                     	Selektionsoptionen für Rolle
    ok: IT_PROF1	TYPE	SUSR_T_SEL_OPT_PROF	                     	Selektionsoptionen für Profile
    ok: IV_PROF2	TYPE	XUPROFNAME	                     	Berechtigungsprofil in Benutzerstammpflege
    ok: IV_PROF3	TYPE	XUPROFNAME	                     	Berechtigungsprofil in Benutzerstammpflege
    ok: IV_CONV1	TYPE	BOOLE_D	                     	Datenelement zur Domäne BOOLE: TRUE (='X') und FALSE (=' ')
    ok: IV_AUTH_FLD	TYPE	FIELDNAME	                     	Feldname
    ok: IV_AUTH_VAL	TYPE	XUVAL	                     	Berechtigungswert
    ok: IT_OBJCT	TYPE	SUSR_T_SEL_OPT_OBJECT	                     	Selektionsoptionen für Berechtigungsobjekte
    ok: IT_AUTH	TYPE	SUSR_T_SEL_OPT_AUTH	                     	Selektionsoptionen für Berechtigungen
    ok: IV_CONV	TYPE	BOOLE_D	                     	Datenelement zur Domäne BOOLE: TRUE (='X') und FALSE (=' ')
    ok: IT_VALUES	TYPE	SUSR_T_SEL_OPT_VAL	                     	Übergabestruk. für Abgrenzungen bei Sel. nach Berecht.werten


    """

    __tablename__ = pluginName + '__params'

    __table_args__ = {'extend_existing': True}

    check = relationship(pluginName, back_populates="params")

    id = Column(Integer, ForeignKey('checks_metadata.id'), primary_key=True)

    param_set_name = Column(String,
                            qt_label='Parameter Set Name',
                            qt_description='Parameter Set Description')

    IT_USER = qtRelationship(pluginName + '__IT_USER',
                             qt_label='User',
                             cascade="all, delete-orphan")
    IT_GROUP = qtRelationship(pluginName + '__IT_GROUP',
                              qt_label='Group for Authorization',
                              cascade="all, delete-orphan")
    IT_UGROUP = qtRelationship(pluginName + '__IT_UGROUP',
                               qt_label='User group (general)',
                               cascade="all, delete-orphan")
    IT_UALIAS = qtRelationship(pluginName + '__IT_UALIAS',
                               qt_label='Alias',
                               cascade="all, delete-orphan")
    IT_UTYPE = qtRelationship(pluginName + '__IT_UTYPE',
                              qt_label='User Type',
                              cascade="all, delete-orphan")
    IT_SECPOL = qtRelationship(pluginName + '__IT_SECPOL',
                               qt_label='Security Policy',
                               cascade="all, delete-orphan")
    IT_SNC = qtRelationship(pluginName + '__IT_SNC',
                            qt_label='SNC Name',
                            cascade="all, delete-orphan")

    IV_USER_LOCK = Column(String,
                          nullable=False,
                          default=ActionAbapSuimLockStatusChoice.IGNORE,
                          qt_label='Administrator Lock',
                          qt_description='Administrator Lock Status',
                          choices=ActionAbapSuimLockStatusChoice.CHOICES)

    IV_PWD_LOCK = Column(String,
                         nullable=False,
                         default=ActionAbapSuimLockStatusChoice.IGNORE,
                         qt_label='Invalid Password Locks',
                         qt_description='Invalid Password Locks',
                         choices=ActionAbapSuimLockStatusChoice.CHOICES)

    IV_LOCK = Column(
        Boolean,
        default=False,
        qt_label='All Users with Admin and Password Locks',
        qt_description='All Users with Admin and Password Locks',
    )

    IV_UNLOCK = Column(
        Boolean,
        default=True,
        qt_label='Only Unlocked Users',
        qt_description='Only Unlocked Users',
    )

    IV_FDATE = Column(
        String,
        qt_label='Valid From Date',
        qt_description='Valid From Date',
    )

    IV_TDATE = Column(
        String,
        qt_label='Valid To Date',
        qt_description='Valid To Date',
    )

    IV_TCODE = Column(
        String(20),
        default='',
        qt_label='Transaction Code',
        qt_description='Transaction Code',
    )

    IV_START_TX = Column(
        Boolean,
        default=True,
        qt_label='Only Executable Transactions',
        qt_description='Only Executable Transactions',
    )

    IT_UREF = qtRelationship(pluginName + '__IT_UREF',
                             qt_label='Reference User',
                             cascade="all, delete-orphan")

    IT_ACTGRPS = qtRelationship(pluginName + '__IT_ACTGRPS',
                                qt_label='Role',
                                cascade="all, delete-orphan")

    IT_PROF1 = qtRelationship(pluginName + '__IT_PROF1',
                              qt_label='Profile Name',
                              cascade="all, delete-orphan")

    IV_PROF2 = Column(
        String(12),
        nullable=True,
        qt_label='AND Profile',
        qt_description='Additional Authorization Profile Name',
    )

    IV_PROF3 = Column(
        String(12),
        nullable=True,
        qt_label='AND Profile',
        qt_description='Authorization Profile Name',
    )

    IV_CONV1 = Column(
        Boolean,
        default=False,
        qt_label='Always Convert Value',
        qt_description='Always Convert Value',
    )

    IV_AUTH_FLD = Column(
        String(12),
        nullable=True,
        qt_label='Authorization Field',
        qt_description='Authorization Field',
    )

    IV_AUTH_VAL = Column(
        String(12),
        nullable=True,
        qt_label='Authorization Value',
        qt_description='Authorization Value',
    )

    IT_OBJCT = qtRelationship(pluginName + '__IT_OBJCT',
                              qt_label='Authorization Object',
                              cascade="all, delete-orphan")
    IT_AUTH = qtRelationship(pluginName + '__IT_AUTH',
                             qt_label='Authorization',
                             cascade="all, delete-orphan")

    IV_CONV = Column(
        Boolean,
        default=False,
        qt_label='Always Convert Value',
        qt_description='Always Convert Value',
    )

    IT_VALUES = qtRelationship(pluginName + '__IT_VALUES')

    __qtmap__ = [
        param_set_name, IV_PWD_LOCK, IV_TCODE, IT_USER, IT_GROUP, IT_UGROUP
    ]
class ActionAbapRsusr002__IT_VALUES(QtModelMixin, Base, BaseMixin):
    """ Sel. According to Authorization Values """

    __tablename__ = pluginName + '__IT_VALUES'

    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey(pluginName + '__params.id'))

    NR = Column(
        String(1),
        nullable=False,
        qt_label='Auth. Name',
        qt_description='Auth. Name',
    )

    OBJCT = Column(
        String(10),
        nullable=False,
        qt_label='Auth. Object',
        qt_description='Auth. Object',
    )

    FIELD = Column(
        String(10),
        nullable=False,
        qt_label='Value',
        qt_description='Value',
    )

    VAL1 = Column(
        String(40),
        nullable=False,
        qt_label='Value',
        qt_description='Value',
    )

    VAL2 = Column(
        String(40),
        nullable=True,
        qt_label='Value',
        qt_description='Value',
    )

    VAL3 = Column(
        String(40),
        nullable=True,
        qt_label='Value',
        qt_description='Value',
    )

    VAL4 = Column(
        String(40),
        nullable=True,
        qt_label='Value',
        qt_description='Value',
    )

    VAL5 = Column(
        String(40),
        nullable=True,
        qt_label='Value',
        qt_description='Value',
    )
Esempio n. 14
0
class SystemAbap(generic.models.GenericSystem):
    """ ABAP System Specification
    """

    __tablename__ = 'systems_ABAP'
    __table_args__ = {'extend_existing': True}

    __icon__ = ':Server'

    id = Column(Integer,
                ForeignKey('systems.id'),
                primary_key=True,
                qt_show=False)

    sid = Column(String(32),
                 unique=False,
                 nullable=False,
                 default='NEW',
                 qt_label='SID',
                 qt_description='Unique System Identifier')

    tier = Column(
        String(32),
        nullable=True,
        default='Unspecified',
        qt_label='Tier',
        qt_description=
        'Tier the system resides in (for example DEV, PRD, or others)',
    )

    rail = Column(
        String(32),
        nullable=True,
        default='Unspecified',
        qt_label='Rail',
        qt_description='The rail the system resides in (N, N+1)',
    )

    enabled = Column(
        Boolean,
        default=YesNoChoice.YES,
        choices=YesNoChoice.CHOICES,
        qt_label='Enabled',
        qt_description='System enabled',
    )

    snc_partnername = Column(
        String(250),
        nullable=True,
        qt_label="SNC Partner Name",
        qt_description="SNC Partner Name",
    )

    snc_qop = Column(
        String,
        nullable=True,
        default=SystemAbapSncChoice.MAX,
        qt_label='SNC QoP',
        qt_description='SNC Quality of Protection',
        choices=SystemAbapSncChoice.CHOICES,
    )

    use_snc = Column(
        Boolean,
        default=YesNoChoice.YES,
        choices=YesNoChoice.CHOICES,
        qt_label='Use SNC',
        qt_description='Use a secured connection',
    )

    default_client = Column(
        String(3),
        unique=False,
        nullable=False,
        default='000',
        qt_label='Default Client',
        qt_description=
        'The client that should be used for client independent checks',
    )

    ms_hostname = Column(
        String(250),
        nullable=True,
        qt_label='MS Hostname',
        qt_description=
        'Specify the Message Server for load balanced connections',
    )

    ms_sysnr = Column(
        String(2),
        default='00',
        nullable=True,
        qt_label='MS SysNr.',
        qt_description='System Number of the message server',
    )

    ms_logongroup = Column(
        String(32),
        nullable=True,
        qt_label='Logon Group',
        default='PUBLIC',
        qt_description='Logon Group to use for load balanced connections',
    )

    as_hostname = Column(
        String(250),
        nullable=True,
        qt_label='AS Hostname',
        qt_description=
        'Application Server Hostname, to be used in case load balancing should not be used.',
    )

    as_sysnr = Column(String(2),
                      nullable=True,
                      default='00',
                      qt_label='AS SysNr.',
                      qt_description='System Number of the application server')

    __mapper_args__ = {
        'polymorphic_identity': 'systems_ABAP',
    }

    __qtmap__ = [
        generic.models.GenericSystem.name,
        generic.models.GenericSystem.description,
        generic.models.GenericSystem.category, sid, tier, rail, enabled,
        snc_partnername, snc_qop, use_snc, default_client, ms_hostname,
        ms_sysnr, ms_logongroup, as_hostname, as_sysnr
    ]

    def _icon(self):
        return ":SAP"

    def getDefaultClient(self):

        for client in self.children:
            if client.client == self.default_client:
                return client
        raise ValueError('No definition of default client for the system')
Esempio n. 15
0
class Abap_BPJOBSTEP_Mixin:

    PROGRAM = Column(String(128), nullable=True, qt_label='Program Name')

    TYP = Column(String(1),
                 nullable=True,
                 qt_description=
                 'Identification of Step as ABAP, ext. command or program',
                 qt_label='Step Type')

    PARAMETER = Column(String(255),
                       nullable=True,
                       qt_description='Parameters of external program',
                       qt_label='Ext. Prog. Params')

    OPSYSTEM = Column(String(10),
                      nullable=True,
                      choices=AbapAppServerOsChoices,
                      qt_label='App Server OS')

    AUTHCKNAM = Column(
        String(12),
        qt_label='Step User',
        qt_description='Background User Name for Authorization Check',
        nullable=True)

    LISTIDENT = Column(
        String(10),
        qt_label='Job Output Id',
        qt_description='ID of batch job output list in the spool',
        nullable=True)

    XPGPID = Column(String(10),
                    qt_label='ID of ext. Program',
                    qt_description='ID of External Program',
                    nullable=True)

    XPGTGTSYS = Column(String(32),
                       qt_label='Target System',
                       qt_description='Target System to Run Background Job',
                       nullable=True)

    XPGRFCDEST = Column(
        String(32),
        qt_label='Logical Destination',
        qt_description='Logical Destination (Specified in function call)',
        nullable=True)

    LANGUAGE = Column(String(10),
                      choices=AbapLanguageChoices.CHOICES,
                      default=AbapLanguageChoices.EN,
                      qt_label='Language',
                      qt_description='Language',
                      nullable=True)

    STATUS = Column(String(1),
                    qt_label='Step Status',
                    qt_description='Language',
                    nullable=True)

    CONNCNTL = Column(String(1),
                      qt_label='Control Flag for ext. Prog',
                      qt_description='Language',
                      nullable=True)
Esempio n. 16
0
class AbapSpoolParams_BAPIPRIPAR_Mixin:
    PDEST = Column(String(4),
                   qt_label='Spool Output Device',
                   nullable=True,
                   name='PDEST',
                   default='LP01')

    PRCOP = Column(Integer,
                   qt_label='Number of Spool Copies',
                   name='PRCOP',
                   nullable=True)

    PLIST = Column(String(12),
                   qt_label='Spool Request',
                   name='PLIST',
                   nullable=True)

    PRTXT = Column(String(68),
                   qt_label='Spool Description',
                   name='PRTXT',
                   nullable=True)

    PRIMM = Column(Boolean,
                   qt_label='Immediate Spool Print',
                   choices=YesNoChoice.CHOICES,
                   default=YesNoChoice.NO,
                   name='PRIMM',
                   nullable=False)

    PRREL = Column(Boolean,
                   qt_label='Immediate Spool Deletion',
                   choices=YesNoChoice.CHOICES,
                   name='PRREL',
                   nullable=True)

    PRNEW = Column(Boolean,
                   qt_label='Immediate Spool Deletion',
                   choices=YesNoChoice.CHOICES,
                   name='PRNEW',
                   nullable=True)

    PEXPI = Column(Integer,
                   qt_label='Spool Retention Period',
                   nullable=True,
                   name='PEXPI')

    LINCT = Column(Integer,
                   qt_label='Page Lenth of List',
                   name='LINCT',
                   nullable=True)

    LINSZ = Column(Integer,
                   qt_label='Line Width of List',
                   name='LINSZ',
                   nullable=True)

    PAART = Column(String(68),
                   qt_label='Spool Format',
                   nullable=True,
                   name='PAART')

    PRBIG = Column(Boolean,
                   qt_label='Spool Cover Sheet',
                   choices=YesNoChoice.CHOICES,
                   nullable=True,
                   name='PRBIG')

    PRSAP = Column(Boolean,
                   qt_label='Print: SAP Cover Page',
                   choices=YesNoChoice.CHOICES,
                   nullable=True,
                   name='PRSAP')

    PRREC = Column(String(12),
                   qt_label='Spool Receipient Name',
                   nullable=True,
                   name='PRREC')

    PRABT = Column(String(12),
                   qt_label='Spool Department Name',
                   nullable=True,
                   name='PRABT')

    PRBER = Column(String(12),
                   qt_label='Print: Authorization',
                   nullable=True,
                   name='PRBER')

    PRDSN = Column(String(6),
                   qt_label='Spool File',
                   nullable=True,
                   name='PRDSN')

    PTYPE = Column(String(12),
                   qt_label='Print: Type of Spool Request',
                   nullable=True,
                   name='PTYPE')

    ARMOD = Column(Boolean,
                   qt_label='Print: Archiving mode',
                   choices=YesNoChoice.CHOICES,
                   nullable=True,
                   name='ARMOD')

    FOOTL = Column(Boolean,
                   qt_label='Print: Output Footer',
                   choices=YesNoChoice.CHOICES,
                   nullable=True,
                   name='FOOTL')

    PRIOT = Column(Integer,
                   qt_label='Print: Spool Request Priority',
                   nullable=True,
                   name='PRIOT')

    PRUNX = Column(Boolean,
                   qt_label='Print: Host Spool Cover Page',
                   choices=YesNoChoice.CHOICES,
                   nullable=True,
                   name='PRUNX')
Esempio n. 17
0
class SystemAbapClient(generic.models.GenericSystemTreeNode,
                       PasswordKeyringMixin):
    """ Contains ABAP specific information"""
    __tablename__ = 'SystemAbapClient'
    __table_args__ = {'extend_existing': True}
    __mapper_args__ = {
        'polymorphic_identity': 'SystemAbapClient',
    }

    __icon__ = ':Brief'

    id = Column(Integer,
                ForeignKey('systems.id'),
                primary_key=True,
                qt_show=False)

    client = Column(
        String(3),
        nullable=False,
        qt_label='Client',
        qt_description='The 3 digit number that describes the client',
    )

    use_sso = Column(
        Boolean,
        default=YesNoChoice.YES,
        choices=YesNoChoice.CHOICES,
        qt_label='Use SSO',
        qt_description='Use Single Sign On',
    )
    username = Column(String(40),
                      default='<initial>',
                      nullable=True,
                      qt_label='Username',
                      qt_description='Username to logon to the ABAP Client')

    __qtmap__ = [
        client, generic.models.GenericSystem.description, use_sso, username
    ]

    def __init__(self, **kwargs):
        uuid_string = str(uuid.uuid4())
        self.keyring_uuid = uuid_string
        self.client = kwargs.get('client')
        self.description = kwargs.get('description')
        self.username = kwargs.get('username')
        self.password = kwargs.get('password')
        self.use_sso = kwargs.get('use_sso')

    def _icon(self):
        return ":Client"

    def getDefaultClient(self):

        parent = self.parent_node
        return parent.getDefaultClient()

    def logon_info(self):
        snc_qop = None
        snc_partnername = None
        logon_info = {}
        self.logger = logging.getLogger('{}.{}'.format(
            __name__, self.__class__.__name__))
        abap_system = self.parent_node
        if abap_system:
            sysid = abap_system.sid
            logon_info[
                'sysid'] = sysid  #technically only required for load balancing, but we specify it
            # anyway since it's handy down the road.
            logon_info['client'] = self.client
            if abap_system.ms_hostname and abap_system.ms_sysnr and abap_system.ms_logongroup:
                mshost = abap_system.ms_hostname
                msserv = '36' + abap_system.ms_sysnr
                group = abap_system.ms_logongroup
                self.logger.debug(
                    'Logon using Load Balancing. mshost: %s, msserv: %s, sysid: %s, group: %s',
                    mshost, msserv, sysid, group)
                logon_info['mshost'] = mshost
                logon_info['msserv'] = msserv
                logon_info['group'] = group
            elif abap_system.as_hostname and abap_system.as_sysnr:
                logon_info['ashost'] = abap_system.as_hostname
                logon_info['sysnr'] = abap_system.as_sysnr
                self.logger.debug(
                    'Logon using direct as connection. ashost: %s, sysnr: %s',
                    logon_info['ashost'], logon_info['sysnr'])
            else:
                return False

            if abap_system.use_snc:
                snc_qop = abap_system.snc_qop
                snc_partnername = abap_system.snc_partnername
                self.logger.debug('Use SNC: snc_qop: %s, snc_partnername: %s',
                                  snc_qop, snc_partnername)

                if CONFIG['systemtype_ABAP'].get('snc.library'):
                    snc_lib = CONFIG['systemtype_ABAP'].get('snc.library')
                    self.logger.debug('SNC Lib specified in config: %s',
                                      snc_lib)
                    logon_info['snc_lib'] = snc_lib

            if self.use_sso and abap_system.use_snc:
                snc_myname = get_snc_name()
                self.logger.debug('Use SSO: snc_myname: %s', snc_myname)

                if snc_myname and snc_partnername and snc_qop:
                    self.logger.debug(
                        'Use SNC: snc_qop: %s, snc_partnername: %s, snc_myname: %s',
                        snc_qop, snc_partnername, snc_myname)
                    logon_info['snc_qop'] = snc_qop
                    logon_info['snc_partnername'] = snc_partnername
                    logon_info['snc_myname'] = snc_myname

                else:
                    self.logger.error(
                        'SSO usage configured, but parameters are incomplete: '
                        'snc_qop: %s, snc_partnername: %s, snc_myname: %s',
                        snc_qop, snc_partnername, snc_myname)
                    return False
            else:
                user = self.username
                passwd = self.password

                if user and passwd:
                    if CONFIG['application'].getboolean(
                            'app.log_sensitive_info'):
                        self.logger.debug('no SSO: user: %s, passwd: %s', user,
                                          passwd)
                    else:
                        self.logger.debug('no SSO: user: %s, passwd: XXXXXXXX',
                                          user)

                    logon_info['user'] = user
                    logon_info['passwd'] = passwd
                else:
                    self.logger.error(
                        'No SSO, but username or Password missing')
                    return False
        return logon_info