46 #ifndef __WTX_DBO_PERMISSIONITEMTPL_H_234e0174_6b7d_11e8_b503_fb1ef3651ec0__ 47 #define __WTX_DBO_PERMISSIONITEMTPL_H_234e0174_6b7d_11e8_b503_fb1ef3651ec0__ 49 #include <Wt/WLocalDateTime.h> 51 #include <Wtx/Dbo/PermissionTableDef.h> 52 #include <Wtx/Dbo/BaseItemTpl.h> 53 #include <Wtx/Dbo/FieldNumber.h> 54 #include <Wtx/Dbo/FieldFloat.h> 55 #include <Wtx/Dbo/FieldInt.h> 56 #include <Wtx/Dbo/FieldBigInt.h> 57 #include <Wtx/Dbo/FieldCurrency.h> 58 #include <Wtx/Dbo/FieldLookup.h> 59 #include <Wtx/Dbo/FieldBoolean.h> 60 #include <Wtx/Dbo/FieldTextLine.h> 61 #include <Wtx/Dbo/FieldTextMemo.h> 62 #include <Wtx/Dbo/FieldDate.h> 63 #include <Wtx/Dbo/FieldDateTime.h> 64 #include <Wtx/Dbo/FieldHasMany.h> 65 #include <Wtx/Dbo/FieldBelongsTo.h> 66 #include <Wtx/Dbo/FieldWeak.h> 68 #ifdef UIDFIELD_FORMAT_UUID 69 #include <uuid/uuid.h> 71 #include <Wt/WRandom.h> 90 createdOn().setValue( Wt::WDateTime( Wt::WLocalDateTime::currentDateTime().date(), Wt::WLocalDateTime::currentDateTime().time() ) );
91 changedOn().setValue( Wt::WDateTime( Wt::WLocalDateTime::currentDateTime().date(), Wt::WLocalDateTime::currentDateTime().time() ) );
93 #ifdef UIDFIELD_FORMAT_UUID 115 uuid_unparse_lower( uuid, uuidout+1 );
118 uidField.setValue( std::string( uuidout ) );
124 uidField().setValue( Wt::WRandom::generateId(20) );
129 pGroup().setValue(0);
138 return C::TableDef();
162 bool setLock(
const std::string & value )
167 Wt::WString(
"{1},{2}")
168 .arg( Wt::WDateTime::currentDateTime().toString(
"yyyyMMddhhmmsszzz").toUTF8() )
184 bool isLocked()
const 186 return sessionLock().value() !=
"";
189 Wt::WDateTime lockTime()
const 191 return Wt::WDateTime::fromString( sessionLock().value(),
"yyyyMMddhhmmsszzz" );
202 template<
class Action>
void persist( Action & a )
205 m_uidField.persist( a, &
TableDef().UidFieldDef );
206 m_pMode.persist( a, &
TableDef().PModeFieldDef );
207 m_createdOn.persist( a, &
TableDef().CreatedOnFieldDef );
208 m_changedOn.persist( a, &
TableDef().ChangedOnFieldDef );
211 m_sessionLock.persist( a, &
TableDef().SessionLockFieldDef );