Ananas Library 0.9.5
aCatalogue Class Reference

#include <acatalogue.h>

Inheritance diagram for aCatalogue:
aObject

Public Slots

virtual int New (bool child)
 
virtual int New ()
 
virtual int Delete ()
 
virtual int newGroup (Q_ULLONG parentId)
 
virtual int newElement (Q_ULLONG parentId)
 
virtual int Update ()
 
virtual int Copy ()
 
virtual int Select (bool grouponly=false)
 
void UnSelect (bool grouponly=false)
 
virtual int selectByLevel (int level)
 
virtual int selectByGroup (Q_ULLONG idg)
 
virtual Q_ULLONG idGroupByElement (Q_ULLONG ide)
 
virtual int groupSelect (Q_ULLONG idg)
 
virtual QVariant GetElementValue (QVariant ide, const QString &fname)
 
virtual bool FindById (QString el_id)
 
virtual Q_ULLONG delElement ()
 
virtual Q_ULLONG delGroup (Q_ULLONG idg, QValueList< Q_ULLONG > &listDelId)
 
Q_ULLONG setMarkDeletedElement (Q_ULLONG el_id, bool del)
 
Q_ULLONG setMarkDeletedGroup (Q_ULLONG gr_id, bool del)
 
void getMarkDeletedList (Q_ULLONG idg, QValueList< Q_ULLONG > &listDelId)
 
virtual bool isGroupMarkDeleted ()
 
virtual bool isElementMarkDeleted ()
 
virtual bool Next ()
 
virtual bool Prev ()
 
virtual bool First ()
 
virtual bool Last ()
 
virtual bool NextInGroupTable ()
 
virtual bool PrevInGroupTable ()
 
virtual bool FirstInGroupTable ()
 
virtual bool LastInGroupTable ()
 
virtual int GroupNew (bool reparent=false)
 
virtual int GroupDelete ()
 
virtual int GroupMarkDeleted ()
 
virtual int GroupUpdate ()
 
virtual int GroupSelect ()
 
virtual int GroupSetGroup (aCatalogue *cat)
 
virtual QVariant GroupValue (const QString &name)
 
virtual int GroupSetValue (const QString &name, const QVariant &value)
 
virtual QVariant GroupSysValue (const QString &name)
 
virtual int GroupSetSysValue (const QString &name, const QVariant &value)
 
virtual QStringList getUserFields ()
 
virtual QStringList getGroupUserFields ()
 
- Public Slots inherited from aObject
virtual QString Uid ()
 
virtual bool IsSelected ()
 Checks if object selected.
 
virtual bool IsMarkDeleted (const QString &tname="")
 Checks "Deleted" marker.
 
virtual bool IsMarked ()
 Checks "Marked" marker.
 
virtual int SetMarkDeleted (bool Deleted, const QString &tablename="")
 Устанавливает признак логического удаления объекта (записи SQL таблицы)
 
virtual int SetMarked (bool Marked)
 Выставляет отметку на объекте.
 
virtual int New ()
 Add new object record in database.
 
virtual int Copy ()
 
virtual int Delete ()
 
virtual int Update ()
 Update curent selected object record to database.
 
virtual int Conduct ()
 
virtual int UnConduct ()
 
virtual bool IsConducted ()
 
virtual QString Kind (const QString &name=QString::null)
 
virtual QVariant Value (const QString &name, const QString &tableName="")
 Return field value of the primary object database table.
 
virtual int SetValue (const QString &name, const QVariant &value, const QString &tableName="")
 Set field value of the primary object database table.
 
virtual QVariant sysValue (const QString &name, const QString &tableName="")
 Gets system field value.
 
virtual int setSysValue (const QString &name, QVariant value, const QString &tableName="")
 Sets system field value.
 
virtual int SetFilter (const QString &valname, const QVariant &value)
 Задает фильтр записей/объектов
 
virtual int ClearFilter ()
 Чистит фильтр записей/объектов.
 
virtual int TableSetFilter (const QString &tname, const QString &valname, const QVariant &value)
 Устанавливает вильтр записей табличной части объекта.
 
virtual int TableClearFilter (const QString &tname)
 Чистит фильтр записей указанной табличной части объекта.
 
virtual bool IsFiltred ()
 Показывает наличие активного фильтра
 

Public Member Functions

 aCatalogue (aCfgItem context, aDatabase *adb=0)
 
 aCatalogue (QString name, aDatabase *adb=0)
 
virtual ERR_Code initObject ()
 
- Public Member Functions inherited from aObject
 aObject (QObject *parent=0, const char *name=0)
 
 aObject (const QString &oname, aDatabase *adb, QObject *parent=0, const char *name=0)
 
 aObject (aCfgItem context, aDatabase *adb, QObject *parent=0, const char *name=0)
 
virtual ~aObject ()
 Virtual destructor. .
 
virtual bool checkStructure ()
 Not implemented.
 
ERR_Code init ()
 Tune on metadata object and it's database tables.
 
ERR_Code decodeDocNum (QString nm, QString &pref, int &num)
 Осуществляет выделение символьного префикса из строки.
 
virtual ERR_Code select (Q_ULLONG id)
 
Q_ULLONG getUid ()
 Возвращает уникальный идентификатор объекта из базы данных.
 
bool selected (const QString &tablename="")
 Показывает задан ли текущий объект или запись в его табличной части.
 
ERR_Code select (const QString &query, const QString &tableName="")
 Осуществляет SQL запрос.
 
aDataTabletable (const QString &name="")
 Return the table of object by it's name.
 
virtual Q_ULLONG docId ()
 Returns document database id.
 
virtual bool Next (const QString &tableName="")
 Перемещает указатель на следующую запись SQL таблицы.
 
virtual bool Prev (const QString &tableName="")
 Перемещает указатель на предыдующую запись SQL таблицы.
 
virtual bool First (const QString &tableName="")
 Перемещает указатель на первую запись SQL таблицы.
 
virtual bool Last (const QString &tableName="")
 Перемещает указатель на последнюю запись SQL таблицы.
 
virtual int TableUpdate (const QString &tablename)
 
virtual QString displayString ()
 Возвращает строку, предназначенную для отображения пользователю объекта сложного типа.
 
virtual int LastErrorCode ()
 
virtual QString LastErrorMessage ()
 

Protected Member Functions

virtual aCfgItem displayStringContext ()
 Возвращает контекст (узел дерева) метаданных для вычисления строкового представления сложного типа.
 
- Protected Member Functions inherited from aObject
virtual ERR_Code setObject (aCfgItem newobject)
 Sets new object type after create.
 
bool isInited ()
 
void setInited (bool flag)
 
ERR_Code tableInsert (const QString &dbname, aCfgItem obj, const QString &name="")
 Insert table name and its link into internal buffer.
 
ERR_Code tableInsert (const QString &dbname, const QString &name="")
 Insert table name and its link into internal buffer.
 
ERR_Code tableRemove (const QString &name="")
 Remove table from buffer.
 
virtual QVariant tValue (const QString &tablename, const QString &name)
 Return field value of the secondary object database table.
 
virtual ERR_Code setTValue (const QString &tablename, const QString &name, const QVariant &value)
 Set field value of the secondary object database table.
 
virtual QString trSysName (const QString &sname)
 Not implemented.
 
void setSelected (bool sel, const QString &tablename="")
 Явно задает состояние выбранности объекта или записи его табличной части.
 
virtual ERR_Code setTFilter (const QString &tname, const QString &valname, const QVariant &value)
 Устанавливает вильтр записей табличной части объекта.
 
virtual ERR_Code clearTFilter (const QString &tname)
 Чистит фильтр записей указанной табличной части объекта.
 
void setLastError (int, QString)
 Задает значения свойствам lastErrorCode и lastErrorMessage класса
 

Additional Inherited Members

- Public Attributes inherited from aObject
aCfgmd
 
aCfgItem obj
 
aDatabasedb
 
- Protected Attributes inherited from aObject
bool concrete
 

Detailed Description

Not visual object used for working with catalogues in database. Used as interface between database and script or wObjects*

Constructor & Destructor Documentation

◆ aCatalogue() [1/2]

aCatalogue::aCatalogue ( aCfgItem context,
aDatabase * adb = 0 )

References initObject().

◆ aCatalogue() [2/2]

aCatalogue::aCatalogue ( QString name,
aDatabase * adb = 0 )

References initObject().

Member Function Documentation

◆ Copy

ERR_Code aCatalogue::Copy ( )
virtualslot

References aObject::Copy().

◆ delElement

Q_ULLONG aCatalogue::delElement ( )
virtualslot

Delets element only. Don't supports link one to many.

Returns
id of deleted element.

References aLog::print(), aObject::setSelected(), and aObject::table().

Referenced by delGroup().

◆ Delete

ERR_Code aCatalogue::Delete ( )
virtualslot

◆ delGroup

Q_ULLONG aCatalogue::delGroup ( Q_ULLONG idg,
QValueList< Q_ULLONG > & listDelId )
virtualslot

Delets group with child elements and groups.

Parameters
idg(in) - id deleted group.
listDelId(in,out) - list of id deleted elements and groups.

References delElement(), delGroup(), GroupSysValue(), aLog::print(), aObject::setSelected(), and aObject::table().

Referenced by delGroup().

◆ displayStringContext()

aCfgItem aCatalogue::displayStringContext ( )
protectedvirtual

Возвращает контекст (узел дерева) метаданных для вычисления строкового представления сложного типа.

Reimplemented from aObject.

References aCfg::find().

◆ FindById

bool aCatalogue::FindById ( QString el_id)
virtualslot

Find and move cursor to the element with ID=el_id

References aObject::table().

◆ getGroupUserFields

QStringList aCatalogue::getGroupUserFields ( )
virtualslot

Gets list user and calculation fields in table of Groups.

References aObject::table().

◆ getMarkDeletedList

void aCatalogue::getMarkDeletedList ( Q_ULLONG idg,
QValueList< Q_ULLONG > & listDelId )
slot

Mark deleted group with child elements and groups.

Parameters
idg(in) - id mark deleted group.
listDelId(in,out) - list of id mark deleted elements and groups.

References getMarkDeletedList(), GroupSysValue(), aObject::sysValue(), and aObject::table().

Referenced by getMarkDeletedList().

◆ getUserFields

QStringList aCatalogue::getUserFields ( )
virtualslot

Gets list user and calculation fields in table of elements.

References aObject::table().

◆ GroupSelect

int aCatalogue::GroupSelect ( )
virtualslot

Select group. Get group id from current element and select group table with this id.

Returns
Error code

References aObject::selected(), and aObject::table().

◆ GroupSysValue

QVariant aCatalogue::GroupSysValue ( const QString & name)
virtualslot

Gets system field value in table of group.

Parameters
name(in) - field name.
Returns
field value or QVariant::Invalid if no field.

References aObject::table().

Referenced by delGroup(), and getMarkDeletedList().

◆ idGroupByElement

Q_ULLONG aCatalogue::idGroupByElement ( Q_ULLONG ide)
virtualslot

Gets id of group on the id of element

Parameters
ide(in) - id of element.
Returns
id of group.

References aObject::setSelected(), aObject::sysValue(), and aObject::table().

◆ initObject()

ERR_Code aCatalogue::initObject ( )
virtual

◆ New [1/2]

ERR_Code aCatalogue::New ( )
virtualslot

References New().

Referenced by New().

◆ New [2/2]

ERR_Code aCatalogue::New ( bool child)
virtualslot

◆ newElement

ERR_Code aCatalogue::newElement ( Q_ULLONG parentId)
virtualslot

Inserts new element in elements table

Parameters
parentId(in) - id parent group.

References aObject::setSelected(), and aObject::table().

◆ newGroup

ERR_Code aCatalogue::newGroup ( Q_ULLONG parentId)
virtualslot

Inserts new group in groups table

Parameters
parentId(in) - id parent group, or 0 if no parent.

References aLog::print(), aObject::setSelected(), and aObject::table().

◆ Select

ERR_Code aCatalogue::Select ( bool grouponly = false)
virtualslot

◆ selectByLevel

int aCatalogue::selectByLevel ( int level)
virtualslot

Select groups depth level.

Parameters
level(in) - level

References aObject::setSelected(), and aObject::table().

◆ setMarkDeletedElement

Q_ULLONG aCatalogue::setMarkDeletedElement ( Q_ULLONG id_el,
bool del )
slot

Mark deleted element only. Don't supports link one to many.

Returns
id of deleted element.

References aObject::select(), aObject::SetMarkDeleted(), aDataTable::sysValue(), aObject::table(), and Update().

◆ UnSelect

void aCatalogue::UnSelect ( bool grouponly = false)
slot

◆ Update

ERR_Code aCatalogue::Update ( )
virtualslot

The documentation for this class was generated from the following files: