00001 /* 00002 link.hpp 00003 00004 hyperlink object abstraction 00005 00006 Copyright (late) 2004 by D.K. McCombs. 00007 ====================================== 00008 www.w3sys.com 00009 00010 */ 00011 #ifndef link_hpp 00012 #define link_hpp 00013 00014 #include "ocTypes.h" 00015 #include "ocString.h" 00016 #include "read_write_base.hpp" 00017 #include "openLogger.h" 00018 00019 using namespace std; 00020 /* 00021 links database table... 00022 00023 CREATE TABLE links 00024 ( 00025 id bigint not null primary key auto_increment, 00026 site_id bigint NOT NULL, 00027 name text, 00028 url text, 00029 target text 00030 ); 00031 00032 */ 00033 class link: public read_write_base 00034 { 00035 public: 00036 identifier id; 00037 long long site_id; 00038 string name; 00039 string url; 00040 string target; 00041 00042 link():read_write_base(),id(0LL),site_id(0LL) 00043 { 00044 // set name 00045 data_name("metasite.links"); 00046 // add fields 00047 addDXMap( new llongXfer("id", &id )); 00048 addDXMap( new llongXfer("site_id", &site_id )); 00049 addDXMap( new stringXfer("name", &name )); 00050 addDXMap( new stringXfer("url", &url )); 00051 addDXMap( new stringXfer("target", &target )); 00052 } 00053 00054 /* 00055 Event hooks for business logic 00056 ========================= 00057 // Done before any action - a false return prevents action 00058 virtual bool ivalidate( void ) { return true; } 00059 virtual bool uvalidate( changeMap & changes ) { return true; } 00060 virtual bool dvalidate( void ) { return true; } 00061 00062 // Done after any action - a false return sets a warning 00063 virtual bool isupplemental( void ){ return true; } 00064 virtual bool usupplemental( changeMap & changes ){ return true; } 00065 virtual bool dsupplemental( void ){ return true; } 00066 virtual bool ssupplemental( void ){ return true; } 00067 */ 00068 00069 }; 00070 #endif
1.5.5