| 2 |
* |
* |
| 3 |
* $Revision$ |
* $Revision$ |
| 4 |
* $Log$ |
* $Log$ |
| 5 |
|
* Revision 1.38 2005/01/15 00:39:16 aga |
| 6 |
|
* ・x_xnpaccount_item_basicの構造を変更. |
| 7 |
|
* |
| 8 |
* Revision 1.37 2005/01/14 10:36:59 aga |
* Revision 1.37 2005/01/14 10:36:59 aga |
| 9 |
* ・index関係の処理を追加. |
* ・index関係の処理を追加. |
| 10 |
* ・insertAccountでprivate indexを作成するよう修正. |
* ・insertAccountでprivate indexを作成するよう修正. |
| 2999 |
} |
} |
| 3000 |
|
|
| 3001 |
sql = "SELECT tx.index_id, tx.parent_index_id, tx.uid, tx.gid, tx.open_level, tx.sort_number " |
sql = "SELECT tx.index_id, tx.parent_index_id, tx.uid, tx.gid, tx.open_level, tx.sort_number " |
| 3002 |
" , ti.item_type_id, ti.item_subtype, ti.uid, ti.title, ti.keywords, ti.description, ti.last_update_date, ti.creation_date " |
" , ti.item_type_id, ti.creation_date, ti.uid, ti.title, ti.keywords, ti.description, ti.last_update_date " |
| 3003 |
" FROM " + indexTable + " AS tx " + |
" FROM " + indexTable + " AS tx " + |
| 3004 |
" LEFT JOIN " + itemTable + " AS ti on tx.index_id = ti.item_id " |
" LEFT JOIN " + itemTable + " AS ti on tx.index_id = ti.item_id " |
| 3005 |
" LEFT JOIN " + groupUserLinkTable + " AS tlink on tlink.gid = tx.gid and tlink.uid = " + uidString + |
" LEFT JOIN " + groupUserLinkTable + " AS tlink on tlink.gid = tx.gid and tlink.uid = " + uidString + |
| 3019 |
SQLBindCol( hstmt, 6, SQL_C_ULONG, &sortNumber, 0, lens+5 ); |
SQLBindCol( hstmt, 6, SQL_C_ULONG, &sortNumber, 0, lens+5 ); |
| 3020 |
|
|
| 3021 |
SQLBindCol( hstmt, 7, SQL_C_ULONG, &itemTypeID, 0, lens+6 ); |
SQLBindCol( hstmt, 7, SQL_C_ULONG, &itemTypeID, 0, lens+6 ); |
| 3022 |
SQLBindCol( hstmt, 8, SQL_C_CHAR , &subtype, XNP_ITEM_SUBTYPE_LEN+1, lens+7 ); |
SQLBindCol( hstmt, 8, SQL_C_ULONG, &creationDate, 0, lens+7 ); |
| 3023 |
SQLBindCol( hstmt, 9, SQL_C_ULONG, &contributorUID, 0, lens+8 ); |
SQLBindCol( hstmt, 9, SQL_C_ULONG, &contributorUID, 0, lens+8 ); |
| 3024 |
SQLBindCol( hstmt,10, SQL_C_CHAR , &title, XNP_ITEM_TITLE_LEN+1, lens+9 ); |
SQLBindCol( hstmt,10, SQL_C_CHAR , &title, XNP_ITEM_TITLE_LEN+1, lens+9 ); |
| 3025 |
SQLBindCol( hstmt,11, SQL_C_CHAR , &keywords, XNP_ITEM_KEYWORDS_LEN+1, lens+10 ); |
SQLBindCol( hstmt,11, SQL_C_CHAR , &keywords, XNP_ITEM_KEYWORDS_LEN+1, lens+10 ); |
| 3026 |
SQLBindCol( hstmt,12, SQL_C_CHAR , &description, XNP_ITEM_DESCRIPTION_LEN+1, lens+11 ); |
SQLBindCol( hstmt,12, SQL_C_CHAR , &description, XNP_ITEM_DESCRIPTION_LEN+1, lens+11 ); |
| 3027 |
SQLBindCol( hstmt,13, SQL_C_ULONG, &lastUpdateDate, 0, lens+12 ); |
SQLBindCol( hstmt,13, SQL_C_ULONG, &lastUpdateDate, 0, lens+12 ); |
|
SQLBindCol( hstmt,14, SQL_C_ULONG, &creationDate, 0, lens+13 ); |
|
| 3028 |
|
|
| 3029 |
index_t *index = new index_t[len]; |
index_t *index = new index_t[len]; |
| 3030 |
int i = 0; |
int i = 0; |
| 3031 |
while ( i < len && ( sqlcode = SQLFetch( hstmt ) ) == SQL_SUCCESS ){ |
while ( i < len && ( sqlcode = SQLFetch( hstmt ) ) == SQL_SUCCESS ){ |
|
if ( lens[ 7] == SQL_NULL_DATA ) subtype[0] = '\0'; |
|
| 3032 |
if ( lens[ 9] == SQL_NULL_DATA ) title[0] = '\0'; |
if ( lens[ 9] == SQL_NULL_DATA ) title[0] = '\0'; |
| 3033 |
if ( lens[10] == SQL_NULL_DATA ) keywords[0] = '\0'; |
if ( lens[10] == SQL_NULL_DATA ) keywords[0] = '\0'; |
| 3034 |
if ( lens[11] == SQL_NULL_DATA ) description[0] = '\0'; |
if ( lens[11] == SQL_NULL_DATA ) description[0] = '\0'; |
| 3039 |
index[i].setOpenLevel( openLevel ); |
index[i].setOpenLevel( openLevel ); |
| 3040 |
index[i].setSortNumber( sortNumber ); |
index[i].setSortNumber( sortNumber ); |
| 3041 |
index[i].setItemTypeID( itemTypeID ); |
index[i].setItemTypeID( itemTypeID ); |
|
index[i].setSubtype( (char *)subtype ); |
|
| 3042 |
index[i].setContributorUID( contributorUID ); |
index[i].setContributorUID( contributorUID ); |
| 3043 |
index[i].setTitle( (char *)title ); |
index[i].setTitle( (char *)title ); |
| 3044 |
index[i].setKeywords( (char *)keywords ); |
index[i].setKeywords( (char *)keywords ); |
| 3736 |
", uid = " + unsignedIntToString(newIndex->getContributorUID()) + |
", uid = " + unsignedIntToString(newIndex->getContributorUID()) + |
| 3737 |
", last_update_date = " + unsignedIntToString(newIndex->getLastUpdateDate()) + |
", last_update_date = " + unsignedIntToString(newIndex->getLastUpdateDate()) + |
| 3738 |
", creation_date = " + unsignedIntToString(newIndex->getCreationDate()) + |
", creation_date = " + unsignedIntToString(newIndex->getCreationDate()) + |
| 3739 |
", item_subtype = ?, title = ?, keywords = ?, description = ? " |
", description = ?, title = ?, keywords = ? " |
| 3740 |
" where item_id = " + unsignedIntToString(newIndex->getIndexID()) ); |
" where item_id = " + unsignedIntToString(newIndex->getIndexID()) ); |
| 3741 |
sqlcode = SQLPrepare(hstmt, (SQLCHAR*)sql.c_str(), SQL_NTS); |
sqlcode = SQLPrepare(hstmt, (SQLCHAR*)sql.c_str(), SQL_NTS); |
| 3742 |
if( sqlcode == SQL_SUCCESS || sqlcode == SQL_SUCCESS_WITH_INFO ){ |
if( sqlcode == SQL_SUCCESS || sqlcode == SQL_SUCCESS_WITH_INFO ){ |
| 3743 |
SQLINTEGER cb1 = SQL_NTS, cb2 = SQL_NTS, cb3 = SQL_NTS, cb4 = SQL_NTS; |
SQLINTEGER cb1 = SQL_NTS, cb2 = SQL_NTS, cb3 = SQL_NTS; |
| 3744 |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_SUBTYPE_LEN, 0, (SQLCHAR *)newIndex->getSubtype(), 0, &cb1 ); |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_DESCRIPTION_LEN, 0, (SQLCHAR *)newIndex->getDescription(), 0, &cb1 ); |
| 3745 |
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_TITLE_LEN, 0, (SQLCHAR *)newIndex->getTitle(), 0, &cb2 ); |
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_TITLE_LEN, 0, (SQLCHAR *)newIndex->getTitle(), 0, &cb2 ); |
| 3746 |
SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_KEYWORDS_LEN, 0, (SQLCHAR *)newIndex->getKeywords(), 0, &cb3 ); |
SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_KEYWORDS_LEN, 0, (SQLCHAR *)newIndex->getKeywords(), 0, &cb3 ); |
|
SQLBindParameter(hstmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ITEM_DESCRIPTION_LEN, 0, (SQLCHAR *)newIndex->getDescription(), 0, &cb4 ); |
|
| 3747 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 3748 |
result = RES_OK; |
result = RES_OK; |
| 3749 |
} |
} |