nmrshiftdb-devel Mailing List for NMRShiftDB (Page 228)
Brought to you by:
steinbeck
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
(170) |
Mar
(120) |
Apr
(191) |
May
(231) |
Jun
(147) |
Jul
(202) |
Aug
(132) |
Sep
(91) |
Oct
(43) |
Nov
(87) |
Dec
(75) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(111) |
Feb
(194) |
Mar
(102) |
Apr
(107) |
May
(88) |
Jun
(121) |
Jul
(166) |
Aug
(75) |
Sep
(89) |
Oct
(116) |
Nov
(117) |
Dec
(52) |
| 2004 |
Jan
(138) |
Feb
(150) |
Mar
(144) |
Apr
(144) |
May
(54) |
Jun
(116) |
Jul
(73) |
Aug
(29) |
Sep
(135) |
Oct
(96) |
Nov
(72) |
Dec
(28) |
| 2005 |
Jan
(32) |
Feb
(9) |
Mar
(69) |
Apr
(108) |
May
(130) |
Jun
(195) |
Jul
(104) |
Aug
(116) |
Sep
(106) |
Oct
(58) |
Nov
(74) |
Dec
(64) |
| 2006 |
Jan
(110) |
Feb
(63) |
Mar
(45) |
Apr
(11) |
May
(122) |
Jun
(106) |
Jul
(26) |
Aug
(48) |
Sep
(67) |
Oct
(105) |
Nov
(81) |
Dec
(6) |
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(11) |
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Stefan K. <sh...@us...> - 2002-03-11 16:08:04
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/html
In directory usw-pr-cvs1:/tmp/cvs-serv1865/src/html
Added Files:
spectrumapplet.jar
Log Message:
This is the submit portlet containing a confirm screen
--- NEW FILE: spectrumapplet.jar ---
PK
´FZõ¤e»;\eI³ö. ´¸´¨ÿ"Bµ>ÿÄh¥¹v§£id¿Öʵµ{_»ÕJAÚõ"Ëbà©ñêý¬h+)ÒÈx^ÞÕ.¶¸10Ú8l2"ºP~ï÷¬`:õ{wRòç¢hosu°>qYd¹þÔ2B9O@$~}ʧÑ:QZLV¿h
@çÄ#*8±:¯¤/iI¢éÁd&n»Ù$CMõå«xÁPü!²I§ñ®DPÊ6<.áa[ç^zê>¥½}é)Øw/Ðe1¤¦V}±"®Kïܤ¢î"pÕ¬´,æ]ß<t¢O¸é8ò6ád¶Õ±÷7hÒ¹ç@¶6«ñÛA«tº´/f˪M±øÁ·Õnf¨&¬Ù´°£à©ÝðéÌrÝI~]iÇfPµg¶j{Sûlj;+xȶ)ùyoÐïi;ûy¦Ø_ÐèâîÝ1îãéÕÕîöüþpjPznΫkRz××óçBA²R1lá©SËçÅÐÇ! æ½Áuìa¤sÿ>ñr¦ôzj-
f
q¿bµ
^²âÕaÚºÝ IÉ-!v:Qİq¼ÏÐóvAÖHejŸ¾ÏJ´?¡³¤âÿVë¿od2JFë½®¼ÿWuÑÝóòæ1¯ÊËëÒòÚ¬HP¥L.E#ÝÞWIWX<Z|\fdÚ<¬óÏL%F,Ä4D
¤jo#ï £yã®Ü4ÄV|Z-·7%~¾ÛoÝVǤmÐRO¼¦±Óë1P7ºV·;ÐHÀV°y3 ¡qh:vHŸòØwl]»mô/Q+§:Þ.äÚyh=¶¿®ÈÉq8ôýE& öcE2ehû³ß´~=¥³ÞIz2tg:@~'° )¯¿PK±6á
(YÍ×-B^µbvØHÚibW÷{µ.̳]×ìlêF*m;ÎÇÍû9+©[äô/>ê)2Á~{óùNJ¡³ÚËhf*6d[êáÓNÒL<`½[@
GNÐûrI:ÂÊÃÔ8A8®%2Dñ°;ÊznÒhWkvlßnÚ=ñx{#ÜVÇ?`iù´1Zèa'-)Ý®.nåÖ#K18+Z£ú~ý¯í·´É!7Nå(ë(ÂqûЧà0züÕ`*ø>1«àü@Æ?Ä
D¯~ßÏ`?ä¬T,§°º9ªÇ̬åd3m#£·rªàǬÿ0`pA½2.²Êø3ñ<Ä`/ú(t:]Æ%¯à
`PÁQ|HÁ1^`¹yÂÃ
ʸ,ãWñ%ëÐá>©à*^Wð®Q°_*x¿ñ_㺷ñ¿ÅuJáÝ[Ó-¿ÃïÀøÀiÖEÑþ\1Á×Âü÷g¼KUÏS=«ÕDtNsÝêÔt&¦:ãÅ´ù 1ªG³ùTké¾ÿÜ^!Ö\*ÛJñ8»X¨PéÕ,-«Û\÷[Â
³d-EÿW«ÞÉx-·äyQ¥R,ïÉÑïµ,mjÀ(ØälõdJ{ÁxLwú
âÛ´
ãõ§L%wdÀ7¡eú¶êb{u±£j©¾\63õJ§E[ßÈò|È=õÒ5*Ìde´øÒîTi½õfÄÓÏÁ×n< 7y3] ÚÔ,Y¢×ÉrÓûr4¶Î³h}f]6©¬_IÓ§fN ¼|BnR&nñï],¯L)®$}¹"ÐC© ¼¬j¸M$U'Dµã<ÃVÔå!£,~ Zn¦÷ð@â82«Ã·²Ù7AïÊ8ÎddÃÍeQßµdoëÿUó5q¿«&Õîg~Î'¸hÄòÕªìµKæËb=Ç{èÍ\&ÎûIÌÁý.Þçâý.>àÊtqÜÅ\ü\|ØÅ4
LÑÁǽç<ÁÓN¥s~ÃÕ˪(¡éíN\Aß7@3<tÚ
I¾EEGÿ¤ï°Ø&$l-Ø!6à^ÑINbÄMNIònº=sXàØkóD}ÉøGmsæüMu7%lâÛßQÆDiF¨s§¤nï]°»°ñUln¢GrÔæÊxÿð´W´yegÞm sVÉë<·Hź¤qºDê¨ÃÓÑæq
çÆ
éb-%û±àN
Ñý
ò.ì í¥=@ýù(áÇ©?¥Þ|úò"i\'üõâ¿©ÿ°S4S¿ þÀ¨uûFtqõ¸Äˤ[guë
½ÜOr
Ú]!·ô¶9mRÜ4áUä #ËÄMÏ#Øõ
î.#Úåë]ÎSírWEY±5l!ï¤#}·¹Ô5]WqÏÈel«o2¶vqo÷]E÷È|
<5~;˸¿Î¦/CV{êMHõÊ·\±A/ôÀ2ªð;*JC 4ܶÒhÛFCí4§s{hoà$ͶñA'}d*oa|Rh×Ë5>ôÁG7áÑÿ
I¤Ú>rNNßÐê
[ÓTOmzÄ5}ʵû¦))©
igU½àþêà#)Åq}}WPÕÌA¢ºxÐcÃ!V¢)Äw[µÝHKZç²PÍ&ÓBÄû1÷ì0õv
WW¾HµF.ô¡°¦I²óLåõ¢¨
aÏå`0A6ù#¹@èé5£Ë[jÀËz¬!
sÇY[R8²¼ãTØáv;\hÎSªFTÅ ¼ÑòÀä'ïYÈô}¯cMsʨ$IUßê8p âhñvÆôÁÉâr| l褮÷
ÆzN¡ÄEÆü?únðkÕ
÷7UG(¶^BYñÅw èsÐró)ã?ÑÍÞó[xüÄyôì½4Ý1ûfÇ|wV)¼?þü«?ý_ï²WU/å³²#o3«Y8¯ãprzZ}ÔGÑ_PKNXl D
ö4·ë*î¦bT
&i
Úx
ðlèÉ{o
ydë°E
M`mÞe?â|qq+/¯éó
´ü>ÝÓÁæîæum¬Á+Ôaý§þ¬U7¡,ÒèL|ür,²oÿ|ì6-ý48MtÁ Ä1ÜL&pÃ)-ÏÓ*MYùAøPK.Q)=
*ø¢ñA£\ðÚÚú]($ø~qnâ_fÎ9wfî,oïϯbeiÌ$¬9ó*bI`Aú¢Ô%ZJ`YIVUJ]S +(1Äï,;à[¬Ò'Û}°C`_8Â?`ê¥KØ[çéáðÓà¦Ê½«jðÝsßNaL/´¬;Ë´-§iöÔ=õÜ
¼?2<UqüO´m^¡Æ×0,Cæg.Cá§t4Ücë2ÈJ´AS,hÈI6IYu¡äzMÓmsç¶&¸Sã¦sãÝ^_¯/lsÐË·ÏϪ-^óiVrëúï±~OÚkæÖ+ÿ¼æÿ*v")
Ðã~4ôB´,²bFÈÕè'DÂØq²)ª$éây²IRi'y§¤Ê¼ÝD¯^»êb(ï@1è S{xøî@ëbä~ðG<¬2Gv*ìmúPKÊtÓ
KÆ¥O«n3ô~F;¨ºdMí¾/ÙYioÂÆK£OÓ_h¯®º38+ î(¢¤á×ÁðA²¼3ÐF°o4]¿Uõ\¿êæýõ uÓ[
k>ö²^
¼fÝ5ñ&íðcªÜ5éÓÆ[&Îã2.¸$Åoã=~ÍÁº>ÎZÆ|Y`öÿ"Ù_¡=Þ÷*·¨c»& jÙç×ÿ1)=lô_FÒÏâJûí"ÂFù¦ôÉÑHg>*ó ý·òÏÒ=?¼æÔÛno¢µz[ÞN²e/s»æ rjµ§Øú¹2
¥ËÏM
SxK"vCC9ÆÛaĦ7!~qJµ÷¨r ãeI@áf@|²
ÈMD§»P1.ÔwyÑúRR_NêEeqBbL)¨Ñ-è19cé§J°,UÙ@ÐhAU
ZGDvU)K£jPRЬ?{;ørd4ñlWê¿Ç¯v|nÈë&]ÝÇp®§û¦ÞG²Ñ>(÷(i+ûP©Q);fÇ»¹Þ^4lã!sc.\·Ô¯1¾S:Wd]²Kµ´=mnv¹±
à MQùB>óàÛíßíØ,ý]ü
¿aí4ã+£Ô1ÂvØ0ø6 8Adå· Ìaä¥p
È%Z¯°çv}Vu¶°MËÏÙл´þøSq,Éÿã7¤ñ¦é90ɼ9żÇi1
(âø
ñ«
Æ@`f×Ý0³·ñ¶J£ zK)äá'©Å¬îápîwZaì*BZÆnbèq®mJ-^
ã¸ÏâÁ0öjXQSñö°GÂxTC%>/ä1Áx\ÈÊñE<ƾ§Dái!Ϩø²´Ïñ
Q|UÅsü¼è|-¯«øt¿Æ·4|ßQñ¿Æ÷dü}±êåL~X÷§>'ÿH~,?ÞO5Äð3?Î/4ü¿Þ¯eéßÈz/ªøµ¸;ßIûßñi_ãÒþI,üs ã¯Òý¿y%È:ÿò/!ÿò!ÿò*¢hTF!é©*
ÃT.ƽ,c-LÓØlÒ5ª él.Í2S¥YL¼(Î2GH¥*«Ò<æ«t
!Ü@ ~Û^ÛCtì2öÃhìvì´5ÐÌóù±¼Î4ö}NÖæ²Ì°@;!´:m¥5`L¶lÊäF,sÛ ·s²C5eæ;{P1`:-CCÓi·ú³9±Ú©ìPX¬pZ¬ýäÙ©r®BÕ
=`¡2Ö^R½Ãjµ×n÷<*µ»ÓxØÒ礳VëÄKÌeÒËnõ¸ÑÞÌdÚ²yËqÝÇÞÉÌn3Ã6SíVÊÜϬÜI,1©ÇChq²>pbzÎnÉdd.ç¼ÝµÒ`.-ÖîsÓ¹"º+ênV¦ÓÎ¥f
kÂøx7nËf²¶¯Äæ{Ünsï"M=Éî>CÅÄuÌlå$àÝ3?¼º/ãfý8 S
9ú±O§jª!Ìv½jìs7ÚéTq wDò°JtZHØù};ÍAcÖj4ì½i«1·½ß8ÀbÕ)I}:-¦%*-Õ1NAÕ°Òcª´L§Si¹N§Q¬¸ÀõûûÌ!-âij |ïJoÝi{rvWnÕ¦\KÛúͬ½Û°9D)1¢VÇ5¼5ìáz:5P#áÔδ¹¯OJ¬¶)É)Ó:.\42ßâ¨tºNgP½N+pNgÒY÷²M§¸Õͧs,rWÑÙYãÒíc¼s+^h]Îlf¢;ùÄæûiöå3¦x²îÿ¼ÏH;®ÉÍ:g/¼´mç8íÆ¬Ó¹¸s!Û߯ÓI&!çÑZZ©M§óq½N-Â[GëuÚ@Ë Õ6϶ÙiçÀÀ$mT©]§M¢têa÷Tè¶Ö|¿É =ÍÛx"¦Sm²
°¨>ÚÐÐÀ;µ²Nºÿ
¬àɧ³[XØaÓl.åÉl®áC2ʸ/ôÕòrÎEÉâç¤K~sr§)CͰÍÁì^sý¸dÈÜ72¹Ìõä.ó*=F&Ï+ú$wNÚ'ÊVHáãé]|¥{µ
?¶bF;äm1Í!¹]Q/¡Fl-åI^ßÉnÈÚ|[VLòèu¯D´Én6¾«²û¼S3cÈs¨Ñ·{«mÈæèR~pû*áF
qjç{ýkJB¯È6Ëéâõ56Ë{õ8Þ½âóÍüX
eLkÀa§úvvÿæiSOæ|ñ*yLû'x¶m£míôÎR¿Zýg÷2â©þóÊ7õä¸È$ãVM=Ã{`
c '/ÛöɵÏóûLrC#Ïi0¿£Ä
öËs+âr Íîà;AÇæBLåä`<0v±o $g!ÉFRDÎÅbþ(³@ÈBA@Dü
·ÛòÆmùÙÅmåø)ÆôjU#À=`F|§cÄǼÏýÈ"¼nLp3¹Ý/@é¨EY¯¢ TZE¸Ê·VÀ´mñ¤ÕãñHEÓ4Á½ãÉàÃP:ïcØhÅzÌrºfl¡
¼±¨©2HïfÃQTöÆ#U#[À<0ÛÀ.Cépgüb¼~ó%ÆÇñ<oôûQ©)`ç°ðî.zÑ¿¿¸.²¤¥\cüÉezO¶«(;¡Õj,Fg]ä4W]IýØIúÊC5)ó`¢[ æ+5¨`v\Ì. ýèúä«
âΧð,C½ëÎkǶÞÁQ¸÷ü౿tEØ[ÒQÄuIÌaèÆºÇî¬{¼þA^ü÷2â
cÈõ:nçyÀ§ß3¡bVÇYbhV`6ª|®Ãõ¾æn%ÄaOså½>öñ&_ÂaÃÜn¡.Of4Õ]_À9]GÆÊ&ÅóÐtÕÃXÚT6¿¬æ#>ª¦ÐæiR=Õw©{·-ªÁ¹nÛÀéWfþ{)sz$Xðxø lFÁ
Ý(õV`?¬÷ZÏbÏ(Ör¾i) -n¬ãN뽨5cX$"F°±+Q}ðô¶D¤]ú'Qlî0ò{aÙaèz
®R«Ê«B7¨¾Ï^Ç*µR©ÝÐ
q¯BzeTU%u³*Úahe3µ;^}&Q¬)WÐ)ÒAODºÃæ'<Sà͸ÑI¥ïr?a{KÑiìP/Ù4W¡·aÞJÀ\tÔynOéÅE·^ª»(ó¼ÓYÂȺ2ÊþCPNÍàu¼ÉEùwÜá%ž»ô²=E÷à©Ó{[qï-%qiQâ}¸µ)½ÅeÞø"KY ènÿh°ýhgð¨¬óß«¬ðA_aK<«èÖÊÑ® {9g
Úä¼#ë/ f_æ¶
þÁmþg²DsQq¿¼£äʵÅÀíò÷_Ãà£%3¯¯èöÛKg^ªè÷;pØYàß³\Q½5#è/` (ú1|ÜõïÊ1ì]:9PÀ%Mßã#Ù5.rd,Él·'Æ]c|&¼rÏxüPKs%GpK
-(-ô¦÷]z@ï^Ð÷öP¤ÄúJüåÍÌþ÷æ½7³£§_}ðaø¦4î®ÀfX|ZÆgH¸GÁ½¸OÆý
dgú³¬y@Á!äåUØ¥ ñ 9äçe<ÀÃ
à2ÇX<VÇñÅ
ø,s*?µ©¶A=n&M'ôì øÏI¦ÖÂRê6:5¬$`ÆÒLj}f6MÊeL
È =cWéãN,=j, 7ÍçD°^UáØ±³ó/ÈØjç]0èöÔc%÷8¨nj5ì(iT
3
Bî¸4ÒkÝîØpi³[&jT¦×S©n#¶ìðQ4r@OQ õD,Ð÷*s]tº,cÂe`-Q,ÈØà®Tç2®Ëööi)má«Mf<vjoVe¥5Ì$GRÍ*Û
#ãJgÜm¤Ó]DîT8Ú}§Co3Uòµ¸ÆÙÅuI¹àÈí~Ǽ)LV±SªAF P¹V;¥¼ÛjÛh&=Úµt@õªhË(ñq}BÛc¤Û&4sW2ÍèSOiÓUqÐTqX.
Àµ¨¥Es+E£*N'y&ìäß×'9¯£Ï*âÈzz½uÜÔ5bu_¦}S¦«{}taîÐLJO|'«¸v¸K
)²hRED4Ô;Ôw·Ò) 7uRÐÍeÓ
éÓTD²hQETUÑUÑ&N)2ïT*NÅ-vX½LcÂÓ&NX|K[úN»8¸`aV{M¯*#Öl¼z<¢PÅÅÿëòn-iÙ.¥Õ ³~B±iÓÌNRÉå¬UØKu`ª¢s~&vq¶*ÖóTѽª8uçóU±V4
Ôl|3ÖTaBtÉb½*6ð¢n×
§öè°ÍêTÌζ8çMb3º·Z[[i§iÃJNÑâ=«¢ý®7MÃì²Pæª7}JOFôQÃÔA9sȾ/õBåΦRªØÂîªâ"1@ñ¡åªXT±ûT±·¥ãFUâ&U±nE!Û¹·R,&p,.VÅ ÆqÀʤGcZªËËNèi« òƵ4í:T|¯t8ÂÛ¨Ú§i§.C²VÅ¥l+ÍngòÇ×¾<¸.£)q¹*Ü¡I;qPW¨âJÜE·Jì±ß0Oiû;86ÒLs^ùrrn*ïHG׫¥5:ö-íÓt#ncbÒHSP¼¯M±²ä£QÕ/í)q:7ywx¿fjºÅn~¸À¤ffôßû5ó¡AS¡ÞOçü¦²DO ¢Áâ;f*céôùðѦ>i´õØ¢%º6ÑéÝ Åjºk'y²É«)QT1\k]Ö1ßâ-#Û©j¡©O»ôõG~}gVKer×]À
kv?ÑÇ¢µ1{Xlfq!OlÅ
ú-A¿çÊøÅC?Êøe·ôd±[zKQ"½¯H^M£zQX=K¡,â;ß}öo+7äÊ
ôFæ
IÒ,ÊsðÓ@Eà*"^9(Û"2ÊH$¨æPÅÔàêÆB21
©ç>"ïÄØE¶¹kòæ6ÒNدNfÌ2ÅÄ<ê9,kfQÃR÷åpµeO`mº9Ô9{X7æI_"RþÙøÂ4'ïVTÞãõ94а:eûq;÷ðG±¼Çí+rX¹G&s8ñ\J¶Ïô
ÑNFosðd{ýºëW³^z«:¤:É`ª:©a_á·Øí"H^ôäkϧð,C³Ïkó[ïþÕ&Ë¡
²DñRy$/ë¸#q{ã:¨&êÖæÇ§èm~¼åf>§ÑSoÊ3·PYpaç·ÝSö£j N=Ó½W¡µ®O×a¯»r µã³ò{]î7ã-.Â"Ôö>s&7¯öÎê;è4ÎìøP}õÓhì(¯£âì8Ó¨íð¿ÎÿHìPtÞ)Gï%Þ
ò¨«í¶ê¯*±Ó-ë±Ïñ@pÁ°¯pÀn¸ÎáÎêgq®;lqZÊÏ
ÊÏÖP½<?.òxm°:9¬s²Ö:iF×ÏbC_´þ06Òô¶hðnZDU4ãî4²Ä»©ü
7}^ÚÞæ
Ç»ÅfÆz¢ÞB;î÷¨ÞKP]8ãBÞ\HK¥Ø.òhÞ7W!sæ]x·YI±6FÚÓ°²Dåé»6ºÕÿ§ä./övùÞÒf=÷áæùK|·Á÷B\â!>[J¸2äù >äB à³oq÷xä0<Óë±Uús®×ýø°» à|á
õRi¦¯ h/§* À\/Ùi(|Ñ©"Vö¦þ.³Ûfý#ø¨Ë>@¡öS{þ,+¥©J¯Ù
8ÇÖ5Àn_f·®áV×Àéàl.÷öK;ÐrY³LºÖKìL»ÿús>^²òâ^Øo+]y /î·ãYFAdÌb3}¨a£9yÐOà.´ÉýöÔäc2Î1ñBZ¨Oá&ïq§KB¶ÌYYaíðwâ.tIüºÐRûøPK ÝúB
|
|
From: Stefan K. <sh...@us...> - 2002-03-11 16:08:04
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv1865/src/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SubmitPortlet.java
Log Message:
This is the submit portlet containing a confirm screen
Index: SubmitPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** SubmitPortlet.java 11 Mar 2002 13:17:39 -0000 1.13
--- SubmitPortlet.java 11 Mar 2002 16:02:12 -0000 1.14
***************
*** 84,88 ****
numberSpectrum.add(figures);
} catch (NumberFormatException ex) {
! messages += "Your input included wrong characters!<br>";
}
shift = "";
--- 84,88 ----
numberSpectrum.add(figures);
} catch (NumberFormatException ex) {
! messages += "<br>Your input included wrong characters!";
}
shift = "";
***************
*** 153,157 ****
if (messages == "") {
//Show confirm screen
! returnValue = "Here the data should be reapeated!<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForDB\"><input type=\"submit\" value=\"Write to Database\"></form>";
} else {
//Display message and show input screen again
--- 153,179 ----
if (messages == "") {
//Show confirm screen
! returnValue = "<table><tr><th colspan=\"3\">Check your submitted data. Click on a line in the spectrum to see the molecule it is assigned to!</th></tr><tr><td>";
! returnValue += "<script LANGUAGE=\"JavaScript1.1\" SRC=\"/jetspeed/nmrshiftdb/marvin.js\"></script>\n";
! returnValue += "<script LANGUAGE=\"JavaScript1.1\">\n";
! returnValue += "<!--\n";
! returnValue += "msview_mayscript = true;\n";
! returnValue += "mview_name = \"MView\";\n";
! returnValue += "mview_begin(\"/jetspeed/nmrshiftdb\", 250, 250);\n";
! //The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up)
! File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol");
! try {
! FileWriter out = new FileWriter(outputFile);
! out.write(subData.getMolecule());
! out.close();
! } catch (Exception e) {
! System.out.println(e.getMessage());
! }
! if (!subData.getMolecule().equals("")) {
! returnValue += "mview_param(\"mol\",\"temp.mol\");\n";
! }
! returnValue += "mview_end();\n";
! returnValue += "//-->\n";
! returnValue += "</script>\n";
! returnValue+= "</td><td width=\"50\"></td><td><applet code=\"org.openscience.nmrshiftdb.applets.DrawSpectrumApplet.class\" archive=\"/jetspeed/nmrshiftdb/spectrumapplet.jar\" width=\"350\" height=\"250\"><param name=spectrum VALUE=\""+subData.getSpectrumForApplet()+"\"><param name=\"markAtoms\" VALUE=\"true\"><param name=\"atomApplet\" VALUE=\"MView\"><param name=\"swing\" VALUE=\"false\"></applet></td></tr></table><br><table><tr><td><form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"correct\"><input type=\"submit\" value=\"Correct your input\"></form></td><td><form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForDB\"><input type=\"submit\" value=\"Write to Database\"></form></td></tr></table>";
} else {
//Display message and show input screen again
***************
*** 159,162 ****
--- 181,188 ----
}
}
+ //User wants to correct his data
+ if (action != null && action.equals("correct")) {
+ returnValue = submitPage(messages, subData);
+ }
//User submitted confirm screen
if (action != null && action.equals("submitSpectrumForDB")) {
***************
*** 189,194 ****
byte[] bfinger = Fingerprinter.getFingerprint(mol).toString().getBytes();
! System.err.println("bfinger.length: " + bfinger.length + "");
! dbmol.setMolecularFormula(bfinger.length + "");
byte[] subfinger = getSubByteArray(bfinger, 8);
dbmol.setFingerprint1((new BigInteger(subfinger)).longValue());
--- 215,220 ----
byte[] bfinger = Fingerprinter.getFingerprint(mol).toString().getBytes();
! //System.err.println("bfinger.length: " + bfinger.length + "");
! //dbmol.setMolecularFormula(bfinger.length + "");
byte[] subfinger = getSubByteArray(bfinger, 8);
dbmol.setFingerprint1((new BigInteger(subfinger)).longValue());
***************
*** 396,399 ****
--- 422,431 ----
//returnValue += "msketch_param(\"background\",\"#FFCCCC\");\n";
returnValue += "msketch_end();\n";
+ returnValue += "//-->\n";
+ returnValue += "</script>\n";
+ returnValue += "<form action=\"/jetspeed/portal/\" method=\"post\" NAME=\"MolForm\">";
+ returnValue += "<input type=\"hidden\" name=\"MolTxt\" value=\"" + subData.getMolecule() + "\">";
+ returnValue += "<input type=\"hidden\" name=\"nmrshiftdbaction\"value=\"submitMolecule\">";
+ returnValue += "<input TYPE=\"submit\" VALUE=\"Submit molecule\" onClick=\"exportMol(\'mol\')\"></form>";
}
else{
***************
*** 414,424 ****
}
returnValue += "mview_end();\n";
}
- returnValue += "//-->\n";
- returnValue += "</script>\n";
- returnValue += "<form action=\"/jetspeed/portal/\" method=\"post\" NAME=\"MolForm\">";
- returnValue += "<input type=\"hidden\" name=\"MolTxt\" value=\"" + subData.getMolecule() + "\">";
- returnValue += "<input type=\"hidden\" name=\"nmrshiftdbaction\"value=\"submitMolecule\">";
- returnValue += "<input TYPE=\"submit\" VALUE=\"Submit molecule\" onClick=\"exportMol(\'mol\')\"></form>";
returnValue += "</td><td height=\"20\">Atom No.</td><td>Shift</td><td>Intensity</td>";
returnValue += "<td rowspan=\"";
--- 446,452 ----
}
returnValue += "mview_end();\n";
+ returnValue += "//-->\n";
+ returnValue += "</script>\n";
}
returnValue += "</td><td height=\"20\">Atom No.</td><td>Shift</td><td>Intensity</td>";
returnValue += "<td rowspan=\"";
|
|
From: Stefan K. <sh...@us...> - 2002-03-11 16:08:04
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/util
In directory usw-pr-cvs1:/tmp/cvs-serv1865/src/java/org/openscience/nmrshiftdb/util
Modified Files:
SubmittingData.java
Added Files:
SignalComparator.java
Log Message:
This is the submit portlet containing a confirm screen
--- NEW FILE: SignalComparator.java ---
package org.openscience.nmrshiftdb.util;
import java.util.*;
/**
*This is implememtation of Comparator used for sorting IntTriples accoring to the first column, i. e. the shift
*
* @author shk3
* @created 4. März 2002
*/
public class SignalComparator implements Comparator{
public int compare(Object obj1, Object obj2){
if(((IntTriple)obj1).value1<((IntTriple)obj2).value1)return(-1);
if(((IntTriple)obj1).value1>((IntTriple)obj2).value1)return(1);
return(0);
}
}
Index: SubmittingData.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/util/SubmittingData.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** SubmittingData.java 6 Mar 2002 16:47:46 -0000 1.4
--- SubmittingData.java 11 Mar 2002 16:02:13 -0000 1.5
***************
*** 181,190 ****
/**
! *Adds a feature to the ToSignalstable attribute of the SubmittingData object
*
! * @param signal The feature to be added to the ToSignalstable attribute
*/
public void addToSignalstable(Object signal) {
signalstable.add(signal);
}
}
--- 181,206 ----
/**
! *Adds a feature (an IntTriple) to the Signalstable attribute of the SubmittingData object
*
! * @param signal The feature to be added to the Signalstable attribute
*/
public void addToSignalstable(Object signal) {
signalstable.add(signal);
+ }
+
+
+ /**
+ *Return the spectrum in a String, formatted as needed for the spectrumApplet
+ *
+ * @return Description of the Returned Value
+ */
+ public String getSpectrumForApplet() {
+ Collections.sort(signalstable,new SignalComparator());
+ String returnValue = "";
+ for (int i = 0; i < signalstable.size(); i++) {
+ IntTriple it = (IntTriple) signalstable.get(i);
+ returnValue += it.value1 + ";" + it.value2 + ";" + it.value3 + "|";
+ }
+ return (returnValue);
}
}
|
|
From: Stefan K. <sk...@us...> - 2002-03-11 13:23:29
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map
In directory usw-pr-cvs1:/tmp/cvs-serv19108/map
Modified Files:
DBAtomMapBuilder.java DBBondMapBuilder.java
DBCanonicalNameMapBuilder.java DBChemicalNameMapBuilder.java
DBMeasurementConditionMapBuilder.java
DBMoleculeMapBuilder.java DBSignalMapBuilder.java
DBSpectrumMapBuilder.java DBSpectrumTypeMapBuilder.java
Log Message:
added fingerprint fields 1-16
Index: DBAtomMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBAtomMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBAtomMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBAtomMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 24,28 ****
/** ATOM.ATOM_ID */
! public static String getDBAtom_AtomId()
{
return getTable() + ".ATOM_ID";
--- 24,28 ----
/** ATOM.ATOM_ID */
! public static String getDBAtom_AtomId()
{
return getTable() + ".ATOM_ID";
***************
*** 73,78 ****
dbMap.addTable(getTable());
TableMap tMap = dbMap.getTable(getTable());
!
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
--- 73,78 ----
dbMap.addTable(getTable());
TableMap tMap = dbMap.getTable(getTable());
!
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
***************
*** 80,84 ****
tMap.addPrimaryKey ( getDBAtom_AtomId(), new Integer(0) );
! tMap.addColumn ( getDBAtom_Symbol(), new String() );
tMap.addColumn ( getDBAtom_SerializedAtom(), new String() );
--- 80,84 ----
tMap.addPrimaryKey ( getDBAtom_AtomId(), new Integer(0) );
! tMap.addColumn ( getDBAtom_Symbol(), new String() );
tMap.addColumn ( getDBAtom_SerializedAtom(), new String() );
Index: DBBondMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBBondMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBBondMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBBondMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 27,31 ****
{
return getTable() + ".BOND_ID";
! }
/** BOND.DEGREE */
--- 27,31 ----
{
return getTable() + ".BOND_ID";
! }
/** BOND.DEGREE */
***************
*** 74,78 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
--- 74,78 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
***************
*** 83,87 ****
tMap.addColumn ( getDBBond_SerializedBond(), new String() );
!
tMap.addForeignKey ( getDBBond_MoleculeId(), new Integer(0) , "MOLECULE" , "MOLECULE_ID" );
--- 83,87 ----
tMap.addColumn ( getDBBond_SerializedBond(), new String() );
!
tMap.addForeignKey ( getDBBond_MoleculeId(), new Integer(0) , "MOLECULE" , "MOLECULE_ID" );
Index: DBCanonicalNameMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBCanonicalNameMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBCanonicalNameMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBCanonicalNameMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 35,39 ****
}
! /** CANONICAL_NAME.TYPE */
public static String getDBCanonicalName_Type()
{
--- 35,39 ----
}
! /** CANONICAL_NAME.TYPE */
public static String getDBCanonicalName_Type()
{
Index: DBChemicalNameMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBChemicalNameMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBChemicalNameMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBChemicalNameMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 55,59 ****
}
! /** gets the databasemap this map builder built. */
public DatabaseMap getDatabaseMap()
{
--- 55,59 ----
}
! /** gets the databasemap this map builder built. */
public DatabaseMap getDatabaseMap()
{
Index: DBMeasurementConditionMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBMeasurementConditionMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBMeasurementConditionMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBMeasurementConditionMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 34,38 ****
return getTable() + ".TEMPERATURE";
}
!
/** MEASUREMENT_CONDITION.FIELD_STRENGTH */
public static String getDBMeasurementCondition_FieldStrength()
--- 34,38 ----
return getTable() + ".TEMPERATURE";
}
!
/** MEASUREMENT_CONDITION.FIELD_STRENGTH */
public static String getDBMeasurementCondition_FieldStrength()
***************
*** 90,94 ****
tMap.addColumn ( getDBMeasurementCondition_FieldStrength(), new Integer(0) );
! tMap.addColumn ( getDBMeasurementCondition_Solvent(), new String() );
tMap.addForeignKey ( getDBMeasurementCondition_UserId(), new Integer(0) , "NMRSHIFTDB_USER" , "USER_ID" );
--- 90,94 ----
tMap.addColumn ( getDBMeasurementCondition_FieldStrength(), new Integer(0) );
! tMap.addColumn ( getDBMeasurementCondition_Solvent(), new String() );
tMap.addForeignKey ( getDBMeasurementCondition_UserId(), new Integer(0) , "NMRSHIFTDB_USER" , "USER_ID" );
Index: DBMoleculeMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBMoleculeMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBMoleculeMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBMoleculeMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 32,36 ****
public static String getDBMolecule_Date()
{
! return getTable() + ".DATE";
}
--- 32,36 ----
public static String getDBMolecule_Date()
{
! return getTable() + ".DATE";
}
***************
*** 77,80 ****
--- 77,176 ----
}
+ /** MOLECULE.FINGERPRINT_1 */
+ public static String getDBMolecule_Fingerprint1()
+ {
+ return getTable() + ".FINGERPRINT_1";
+ }
+
+ /** MOLECULE.FINGERPRINT_2 */
+ public static String getDBMolecule_Fingerprint2()
+ {
+ return getTable() + ".FINGERPRINT_2";
+ }
+
+ /** MOLECULE.FINGERPRINT_3 */
+ public static String getDBMolecule_Fingerprint3()
+ {
+ return getTable() + ".FINGERPRINT_3";
+ }
+
+ /** MOLECULE.FINGERPRINT_4 */
+ public static String getDBMolecule_Fingerprint4()
+ {
+ return getTable() + ".FINGERPRINT_4";
+ }
+
+ /** MOLECULE.FINGERPRINT_5 */
+ public static String getDBMolecule_Fingerprint5()
+ {
+ return getTable() + ".FINGERPRINT_5";
+ }
+
+ /** MOLECULE.FINGERPRINT_6 */
+ public static String getDBMolecule_Fingerprint6()
+ {
+ return getTable() + ".FINGERPRINT_6";
+ }
+
+ /** MOLECULE.FINGERPRINT_7 */
+ public static String getDBMolecule_Fingerprint7()
+ {
+ return getTable() + ".FINGERPRINT_7";
+ }
+
+ /** MOLECULE.FINGERPRINT_8 */
+ public static String getDBMolecule_Fingerprint8()
+ {
+ return getTable() + ".FINGERPRINT_8";
+ }
+
+ /** MOLECULE.FINGERPRINT_9 */
+ public static String getDBMolecule_Fingerprint9()
+ {
+ return getTable() + ".FINGERPRINT_9";
+ }
+
+ /** MOLECULE.FINGERPRINT_10 */
+ public static String getDBMolecule_Fingerprint10()
+ {
+ return getTable() + ".FINGERPRINT_10";
+ }
+
+ /** MOLECULE.FINGERPRINT_11 */
+ public static String getDBMolecule_Fingerprint11()
+ {
+ return getTable() + ".FINGERPRINT_11";
+ }
+
+ /** MOLECULE.FINGERPRINT_12 */
+ public static String getDBMolecule_Fingerprint12()
+ {
+ return getTable() + ".FINGERPRINT_12";
+ }
+
+ /** MOLECULE.FINGERPRINT_13 */
+ public static String getDBMolecule_Fingerprint13()
+ {
+ return getTable() + ".FINGERPRINT_13";
+ }
+
+ /** MOLECULE.FINGERPRINT_14 */
+ public static String getDBMolecule_Fingerprint14()
+ {
+ return getTable() + ".FINGERPRINT_14";
+ }
+
+ /** MOLECULE.FINGERPRINT_15 */
+ public static String getDBMolecule_Fingerprint15()
+ {
+ return getTable() + ".FINGERPRINT_15";
+ }
+
+ /** MOLECULE.FINGERPRINT_16 */
+ public static String getDBMolecule_Fingerprint16()
+ {
+ return getTable() + ".FINGERPRINT_16";
+ }
+
/** MOLECULE.USER_ID */
public static String getDBMolecule_UserId()
***************
*** 104,108 ****
/** the doBuild() method builds the DatabaseMap */
public void doBuild() throws Exception
! {
dbMap = TurbineDB.getDatabaseMap("nmrshiftdb");
--- 200,204 ----
/** the doBuild() method builds the DatabaseMap */
public void doBuild() throws Exception
! {
dbMap = TurbineDB.getDatabaseMap("nmrshiftdb");
***************
*** 113,117 ****
!
tMap.addPrimaryKey ( getDBMolecule_MoleculeId(), new Integer(0) );
--- 209,213 ----
!
tMap.addPrimaryKey ( getDBMolecule_MoleculeId(), new Integer(0) );
***************
*** 131,134 ****
--- 227,262 ----
tMap.addColumn ( getDBMolecule_Fingerprint(), new Object() );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint1(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint2(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint3(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint4(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint5(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint6(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint7(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint8(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint9(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint10(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint11(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint12(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint13(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint14(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint15(), new Long(0) );
+
+ tMap.addColumn ( getDBMolecule_Fingerprint16(), new Long(0) );
tMap.addForeignKey ( getDBMolecule_UserId(), new Integer(0) , "NMRSHIFTDB_USER" , "USER_ID" );
Index: DBSignalMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSignalMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBSignalMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBSignalMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 35,39 ****
}
! /** SIGNAL.SHIFT_1 */
public static String getDBSignal_Shift1()
{
--- 35,39 ----
}
! /** SIGNAL.SHIFT_1 */
public static String getDBSignal_Shift1()
{
***************
*** 91,95 ****
*/
public boolean isBuilt()
! {
if ( dbMap != null )
return true;
--- 91,95 ----
*/
public boolean isBuilt()
! {
if ( dbMap != null )
return true;
Index: DBSpectrumMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSpectrumMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBSpectrumMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBSpectrumMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 1,3 ****
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
--- 1,3 ----
! package org.openscience.nmrshiftdb.om.map;
import java.util.*;
***************
*** 24,28 ****
/** SPECTRUM.SPECTRUM_ID */
! public static String getDBSpectrum_SpectrumId()
{
return getTable() + ".SPECTRUM_ID";
--- 24,28 ----
/** SPECTRUM.SPECTRUM_ID */
! public static String getDBSpectrum_SpectrumId()
{
return getTable() + ".SPECTRUM_ID";
***************
*** 59,68 ****
}
- /** SPECTRUM.FINGERPRINT */
- public static String getDBSpectrum_Fingerprint()
- {
- return getTable() + ".FINGERPRINT";
- }
-
/** SPECTRUM.USER_ID */
public static String getDBSpectrum_UserId()
--- 59,62 ----
***************
*** 86,90 ****
public static String getDBSpectrum_MoleculeId()
{
! return getTable() + ".MOLECULE_ID";
}
--- 80,84 ----
public static String getDBSpectrum_MoleculeId()
{
! return getTable() + ".MOLECULE_ID";
}
***************
*** 132,137 ****
tMap.addColumn ( getDBSpectrum_ReviewFlag(), new String() );
- tMap.addColumn ( getDBSpectrum_Fingerprint(), new Object() );
-
tMap.addForeignKey ( getDBSpectrum_UserId(), new Integer(0) , "NMRSHIFTDB_USER" , "USER_ID" );
--- 126,129 ----
***************
*** 144,146 ****
}
! }
--- 136,138 ----
}
! }
Index: DBSpectrumTypeMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSpectrumTypeMapBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** DBSpectrumTypeMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
--- DBSpectrumTypeMapBuilder.java 11 Mar 2002 13:23:26 -0000 1.5
***************
*** 104,108 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
--- 104,108 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod("IdBroker");
|
|
From: Stefan K. <sk...@us...> - 2002-03-11 13:17:43
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets In directory usw-pr-cvs1:/tmp/cvs-serv16932 Modified Files: ResultPortlet.java SubmitPortlet.java Log Message: by submitting a molecule a fingerprint is written to the database Index: ResultPortlet.java =================================================================== RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/ResultPortlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ResultPortlet.java 19 Feb 2002 17:04:06 -0000 1.2 --- ResultPortlet.java 11 Mar 2002 13:17:39 -0000 1.3 *************** *** 7,10 **** --- 7,16 ---- import org.apache.jetspeed.util.servlet.*; import javax.servlet.http.*; + import org.openscience.cdk.io.MDLReader; + import org.openscience.cdk.Molecule; + import java.io.*; + import org.apache.turbine.util.Log; + import java.util.BitSet; + import org.openscience.cdk.fingerprint.Fingerprinter; /** *************** *** 14,18 **** *@created 12. Februar 2002 */ ! public class ResultPortlet extends AbstractPortlet { /** * Gets the content attribute of the ResultPortlet object --- 20,25 ---- *@created 12. Februar 2002 */ ! public class ResultPortlet extends AbstractPortlet ! { /** * Gets the content attribute of the ResultPortlet object *************** *** 21,31 **** *@return The content value */ ! public ConcreteElement getContent(RunData runData) { HttpServletRequest req = runData.getRequest(); String spec = req.getParameter("spectrum"); ! return (new StringElement("<html><body>Your result is:" + spec + "</body></html>")); } - } - - --- 28,56 ---- *@return The content value */ ! public ConcreteElement getContent(RunData runData) ! { HttpServletRequest req = runData.getRequest(); String spec = req.getParameter("spectrum"); ! ! String struc = ""; ! MDLReader mdlReader = new MDLReader(new StringReader(req.getParameter("MolTxt"))); ! Molecule mol = new Molecule(); ! try ! { ! mol = (Molecule) mdlReader.read(new Molecule()); ! Fingerprinter fprinter = new Fingerprinter(); ! BitSet fprint = fprinter.getFingerprint(mol); ! struc = fprint.toString(); ! } ! catch (Throwable ex) ! { ! Log.debug("Fehler1: " + ex.getMessage()); ! StringWriter strWr = new StringWriter(); ! PrintWriter prWr = new PrintWriter(strWr); ! ex.printStackTrace(prWr); ! Log.debug(strWr.toString()); ! } ! ! return (new StringElement("<html><body>Your result is:" + spec + " <br> fingerprint: " + struc + "<br> getAtomCount " + mol.getAtomCount()+ "</body></html>")); } } Index: SubmitPortlet.java =================================================================== RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** SubmitPortlet.java 8 Mar 2002 10:46:53 -0000 1.12 --- SubmitPortlet.java 11 Mar 2002 13:17:39 -0000 1.13 *************** *** 27,30 **** --- 27,32 ---- import java.io.*; + import java.lang.String; + import java.math.BigInteger; import JSX.*; *************** *** 185,188 **** --- 187,227 ---- dbmol.setMolecularWeight(new MFAnalyser(mol).getMass()); dbmol.setFingerprint(Fingerprinter.getFingerprint(mol).toString().getBytes()); + + byte[] bfinger = Fingerprinter.getFingerprint(mol).toString().getBytes(); + System.err.println("bfinger.length: " + bfinger.length + ""); + dbmol.setMolecularFormula(bfinger.length + ""); + byte[] subfinger = getSubByteArray(bfinger, 8); + dbmol.setFingerprint1((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 16); + dbmol.setFingerprint2((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 24); + dbmol.setFingerprint3((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 32); + dbmol.setFingerprint4((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 40); + dbmol.setFingerprint5((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 48); + dbmol.setFingerprint6((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 56); + dbmol.setFingerprint7((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 64); + dbmol.setFingerprint8((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 72); + dbmol.setFingerprint9((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 80); + dbmol.setFingerprint10((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 88); + dbmol.setFingerprint11((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 96); + dbmol.setFingerprint12((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 104); + dbmol.setFingerprint13((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 112); + dbmol.setFingerprint14((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 120); + dbmol.setFingerprint15((new BigInteger(subfinger)).longValue()); + subfinger = getSubByteArray(bfinger, 128); + dbmol.setFingerprint16((new BigInteger(subfinger)).longValue()); + NmrshiftdbUser user=(NmrshiftdbUser)runData.getUser(); dbmol.setUserId((NumberKey)user.getPrimaryKey()); *************** *** 210,214 **** spectrum.setDBMolecule(dbmol); spectrum.setUserId((NumberKey)user.getPrimaryKey()); ! spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final spectrum.setSpectrumTypeId(new NumberKey(12));//not yet final spectrum.setDBMeasurementCondition(conds); --- 249,253 ---- spectrum.setDBMolecule(dbmol); spectrum.setUserId((NumberKey)user.getPrimaryKey()); ! //spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final spectrum.setSpectrumTypeId(new NumberKey(12));//not yet final spectrum.setDBMeasurementCondition(conds); *************** *** 295,298 **** --- 334,352 ---- } return (new StringElement(returnValue)); + } + + private byte[] getSubByteArray(byte[] b, int pos) + { + byte returnb[] = new byte[8]; + if(pos >= 8 && pos < b.length) + { + for(int i = 0; i <= 7; i++) + { + returnb[i] = b[pos - 8 + i]; + System.err.println("returnb: " + returnb); + System.err.println("b.length: " + b.length + ""); + } + } + return returnb; } |
|
From: Stefan K. <sh...@us...> - 2002-03-08 10:46:58
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv16781/src/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SubmitPortlet.java
Log Message:
New version
Index: SubmitPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** SubmitPortlet.java 7 Mar 2002 17:06:47 -0000 1.11
--- SubmitPortlet.java 8 Mar 2002 10:46:53 -0000 1.12
***************
*** 240,244 ****
Atom[] neighbourAtoms = bonds[i].getAtoms();
for (int k = 0; k < neighbourAtoms.length; k++) {
- DBBondDBAtom bondAtom=new DBBondDBAtom();
//crit=new Criteria();
//crit.add(DBBondDBAtomPeer.ATOM_ID,nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue());
--- 240,243 ----
***************
*** 252,258 ****
//add signals to DB
DBSignal[] signal = new DBSignal[subData.getSignalstable().size()];
- System.err.println("Signale: "+subData.getSignalstable().size());
for (int i = 0; i < subData.getSignalstable().size(); i++) {
- System.err.println(i+"");
signal[i]=new DBSignal();
signal[i].setDimensionality(1);
--- 251,255 ----
***************
*** 316,323 ****
tableSize = subData.getSignalstable().size() + 2;
}
! //The return string is put together (better would be a jsp, butthat's not working
returnValue += "<p><bold>" + messages + "</bold></p>";
returnValue += "<table border=\"3\"><tr><th>Draw your structure</th><th colspan=\"3\">Here the assignment which will be uploaded</th><th>Enter your spectral data here</th></tr><tr><td rowspan=\"";
! returnValue += tableSize + "\">Click on the <a style=\"color:#FFAAAA\">red</a> to draw your molecule, then submit it!<br>";
returnValue += "<script LANGUAGE=\"JavaScript1.1\" SRC=\"/jetspeed/nmrshiftdb/marvin.js\"></script>\n";
returnValue += "<script LANGUAGE=\"JavaScript1.1\">\n";
--- 313,320 ----
tableSize = subData.getSignalstable().size() + 2;
}
! //The return string is put together (better would be a jsp, but that's not working
returnValue += "<p><bold>" + messages + "</bold></p>";
returnValue += "<table border=\"3\"><tr><th>Draw your structure</th><th colspan=\"3\">Here the assignment which will be uploaded</th><th>Enter your spectral data here</th></tr><tr><td rowspan=\"";
! returnValue += tableSize + "\">";
returnValue += "<script LANGUAGE=\"JavaScript1.1\" SRC=\"/jetspeed/nmrshiftdb/marvin.js\"></script>\n";
returnValue += "<script LANGUAGE=\"JavaScript1.1\">\n";
***************
*** 336,363 ****
returnValue += "document.MView.selectAtom(0,b,true);\n";
returnValue += "}\n";
! returnValue += "msketch_mayscript = true;\n";
! returnValue += "msketch_name = \"MSketch\";\n";
! returnValue += "msketch_begin(\"/jetspeed/nmrshiftdb\", 100, 300);\n";
! returnValue += "msketch_param(\"autoscale\", \"true\");\n";
! returnValue += "msketch_param(\"detach\", \"hide\");\n";
! returnValue += "msketch_param(\"menubar\",\"false\");\n";
! returnValue += "msketch_param(\"background\",\"#FFCCCC\");\n";
! returnValue += "msketch_end();\n";
! returnValue += "msview_mayscript = true;\n";
! returnValue += "mview_name = \"MView\";\n";
! returnValue += "mview_begin(\"/jetspeed/nmrshiftdb\", 300, 300);\n";
! //The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up)
! File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol");
! try {
! FileWriter out = new FileWriter(outputFile);
! out.write(subData.getMolecule());
! out.close();
! } catch (Exception e) {
! System.out.println(e.getMessage());
! }
! if (!subData.getMolecule().equals("")) {
! returnValue += "mview_param(\"mol\",\"temp.mol\");\n";
}
- returnValue += "mview_end();\n";
returnValue += "//-->\n";
returnValue += "</script>\n";
--- 333,364 ----
returnValue += "document.MView.selectAtom(0,b,true);\n";
returnValue += "}\n";
! if(subData.getMolecule().equals("")){
! returnValue += "msketch_mayscript = true;\n";
! returnValue += "msketch_name = \"MSketch\";\n";
! returnValue += "msketch_begin(\"/jetspeed/nmrshiftdb\", 350, 350);\n";
! returnValue += "msketch_param(\"autoscale\", \"true\");\n";
! //returnValue += "msketch_param(\"detach\", \"hide\");\n";
! returnValue += "msketch_param(\"menubar\",\"false\");\n";
! //returnValue += "msketch_param(\"background\",\"#FFCCCC\");\n";
! returnValue += "msketch_end();\n";
! }
! else{
! returnValue += "msview_mayscript = true;\n";
! returnValue += "mview_name = \"MView\";\n";
! returnValue += "mview_begin(\"/jetspeed/nmrshiftdb\", 350, 350);\n";
! //The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up)
! File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol");
! try {
! FileWriter out = new FileWriter(outputFile);
! out.write(subData.getMolecule());
! out.close();
! } catch (Exception e) {
! System.out.println(e.getMessage());
! }
! if (!subData.getMolecule().equals("")) {
! returnValue += "mview_param(\"mol\",\"temp.mol\");\n";
! }
! returnValue += "mview_end();\n";
}
returnValue += "//-->\n";
returnValue += "</script>\n";
***************
*** 387,391 ****
}
returnValue += "<tr><td colspan=\"3\" valign=\"bottom\"><input type=\"submit\" value=\"Submit assignments\"></td></tr></form>";
! returnValue += "</table><br><form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitForConfirm\"><center>Chemical name:<input type=\"text\" name=\"chemName\">CAS Number:<input type=\"text\" name=\"casnumber\">Literature:<input type=\"text\" name=\"literature\"></center><br><center>Measurement conditions - temperature (in <sup>0</sup>K):<input type=\"text\" name=\"temperature\"> -Field strength:<input type=\"text\" name=\"fieldStrength\"> -Solvent:<input type=\"text\" name=\"solvent\"></center><br><center><input type=\"submit\" value=\"Write to Database\"></center></form>";
return (returnValue);
}
--- 388,392 ----
}
returnValue += "<tr><td colspan=\"3\" valign=\"bottom\"><input type=\"submit\" value=\"Submit assignments\"></td></tr></form>";
! returnValue += "</table><br><form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitForConfirm\"><center>Chemical name:<input type=\"text\" name=\"chemName\" value=\""+subData.getChemName()+"\">CAS Number:<input type=\"text\" name=\"casnumber\" value=\""+subData.getCasNumber()+"\">Literature:<input type=\"text\" name=\"literature\" value=\""+subData.getLiterature()+"\"></center><br><center>Measurement conditions - temperature (in <sup>0</sup>K):<input type=\"text\" name=\"temperature\" value=\""+subData.getTemperature()+"\"> -Field strength:<input type=\"text\" name=\"fieldStrength\" value=\""+subData.getFieldStrength()+"\"> -Solvent:<input type=\"text\" name=\"solvent\" value=\""+subData.getSolvent()+"\"></center><br><center><input type=\"submit\" value=\"Write to Database\"></center></form>";
return (returnValue);
}
|
|
From: Stefan K. <sh...@us...> - 2002-03-08 10:46:58
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/conf/jetspeed/WEB-INF/templates/vm/navigations/html
In directory usw-pr-cvs1:/tmp/cvs-serv16781/src/conf/jetspeed/WEB-INF/templates/vm/navigations/html
Modified Files:
top.vm
Log Message:
New version
Index: top.vm
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/conf/jetspeed/WEB-INF/templates/vm/navigations/html/top.vm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** top.vm 14 Feb 2002 10:24:26 -0000 1.1
--- top.vm 8 Mar 2002 10:46:53 -0000 1.2
***************
*** 1,79 ****
! <div>
! #if ($data.User.hasLoggedIn())
! <table cellspacing="2" border="0" width="100%">
! <tr valign=top>
! <td align="left" width="100%">
! <FONT class=welcome>$l10n.TOP_TITLE</font><br/>
! ## <sup>Logged in since: $!data.getUser().getLastLogin()</sup>
! </td>
! <td align=center>
! <table cellpadding=1 cellspacing=3 border=0 width=100%>
! <tr>
! <td align=center class=MENUBUTTON><NOBR> <a href="mailto:$!config.getString("mail.support")" tabindex="4">Contact</a> </NOBR></td>
! <td align=center class=MENUBUTTON><NOBR> <a href="$link" tabindex="4">$l10n.HOME</a> </NOBR></td>
! </tr>
! </table>
! </td>
! </tr>
! <tr>
! <td colspan=2 >
! <table cellpadding=1 cellspacing=3 border=0 CLASS=MENUBAR width=100%>
! <tr>
! <td align=center class=MENUBUTTON><a href="$link.setAction("controls.Customize")?reset=on">$l10n.TOP_CUSTOMIZE HTML</a></td>
! <td align=center class=MENUBUTTON><a href="$link.setAction("controls.Customize")?reset=on&mtype=wml">$l10n.TOP_CUSTOMIZE WML</a></td>
! <td align=center class=MENUBUTTON><a href="$link.setPage("EditAccount")">$l10n.TOP_EDITACCOUNT ($data.User.UserName)</a></td>
! <td align=center class=MENUBUTTON><a href="$link.setAction("LogoutUser")">$l10n.TOP_LOGOUT</a></td>
! </tr>
! </table>
! </td>
! </tr>
! </table>
! <HR size=1 color=NAVY>
! #else
!
! <table cellspacing="2" border="0" width="100%">
! <tr valign="top">
! <td>
! <h2><nobr>$l10n.TOP_TITLE</nobr></h2>
!
! <table cellpadding=1 cellspacing=3 border=0>
! <tr>
! <td>
! <table cellpadding=1 cellspacing=3 border=0 class=MENUBAR>
! <tr>
! <td class=MENUBUTTON><a href="$link.setPage("NewAccount")">$l10n.TOP_CREATENEWACCOUNT</a></td>
! </tr>
! </table>
! </td>
! </tr>
! </table>
! </td>
! <td align="right">
! <form method="POST" action="$link" enctype="application/x-www-form-urlencoded">
! <input name="$jlink.ActionKey" type="hidden" value="$config.getString("action.login")" />
! <table border="0" cellspacing="2" cellpadding="1" width="100%" bgcolor=#FFFFFF class=INPUTFORM>
! <tr>
! <td>$l10n.USERFORM_USERNAMEMSG </td>
! <!-- for username value: $!data.Parameters.getString("username") -->
! <td><input size="10" value="" name="username" maxlength="25" type="text" tabindex="1"/></td>
! <td rowspan=2 align=center><small><input name="submit" type="submit" value="Login" tabindex="3" class="BUTON"/></td>
! </tr>
! <tr>
! <td>$l10n.USERFORM_PASSWORDMSG </small></td>
! <td><input size="10" value="" name="password" maxlength="25" type="password" tabindex="2"/></td>
! </tr>
! </table>
! </form>
! </td>
! <td align=center>
! <table cellpadding=1 cellspacing=3 border=0 width=100%>
! <tr>
! <td align=center class=MENUBUTTON><NOBR> <a href="$link" tabindex="4">$l10n.HOME</a> </NOBR></td>
! </tr>
! </table>
! </td>
! </tr>
! </table>
! <HR size=1 color=NAVY>
! #end
! </div>
--- 1,80 ----
! <div>
! #if ($data.User.hasLoggedIn())
! <table cellspacing="2" border="0" width="100%">
! <tr valign=top>
! <td align="left" width="100%">
! <FONT class=welcome>Welcome to NMRShiftDB</font><br/>
! ## <sup>Logged in since: $!data.getUser().getLastLogin()</sup>
! </td>
! <td align=center>
! <table cellpadding=1 cellspacing=3 border=0 width=100%>
! <tr>
! <td align=center class=MENUBUTTON><NOBR> <a href="mailto:$!config.getString("mail.support")" tabindex="4">Contact</a> </NOBR></td>
! <td align=center class=MENUBUTTON><NOBR> <a href="$link" tabindex="4">$l10n.HOME</a> </NOBR></td>
! </tr>
! </table>
! </td>
! </tr>
! <tr>
! <td colspan=2 >
! <table cellpadding=1 cellspacing=3 border=0 CLASS=MENUBAR width=100%>
! <tr>
! <td align=center class=MENUBUTTON><a href="$link.setAction("controls.Customize")?reset=on">$l10n.TOP_CUSTOMIZE HTML</a></td>
! <td align=center class=MENUBUTTON><a href="$link.setAction("controls.Customize")?reset=on&mtype=wml">$l10n.TOP_CUSTOMIZE WML</a></td>
! <td align=center class=MENUBUTTON><a href="$link.setPage("EditAccount")">$l10n.TOP_EDITACCOUNT ($data.User.UserName)</a></td>
! <td align=center class=MENUBUTTON><a href="$link.setAction("LogoutUser")">$l10n.TOP_LOGOUT</a></td>
! </tr>
! </table>
! </td>
! </tr>
! </table>
! <HR size=1 color=NAVY>
! #else
!
! <table cellspacing="2" border="0" width="100%">
! <tr valign="top">
! <td>
! <h2><nobr>Welcome to NMRShiftDB</nobr></h2>
!
! <table cellpadding=1 cellspacing=3 border=0>
! <tr>
! <td>
! <table cellpadding=1 cellspacing=3 border=0 class=MENUBAR>
! <tr>
! <td class=MENUBUTTON><a href="$link.setPage("NewAccount")">$l10n.TOP_CREATENEWACCOUNT</a></td>
! </tr>
! </table>
! </td>
! </tr>
! </table>
! </td>
! <td align="right">
! <form method="POST" action="$link" enctype="application/x-www-form-urlencoded">
! <input name="$jlink.ActionKey" type="hidden" value="$config.getString("action.login")" />
! <table border="0" cellspacing="2" cellpadding="1" width="100%" bgcolor=#FFFFFF class=INPUTFORM>
! <tr>
! <td>$l10n.USERFORM_USERNAMEMSG </td>
! <!-- for username value: $!data.Parameters.getString("username") -->
! <td><input size="10" value="" name="username" maxlength="25" type="text" tabindex="1"/></td>
! <td rowspan=2 align=center><small><input name="submit" type="submit" value="Login" tabindex="3" class="BUTON"/></td>
! </tr>
! <tr>
! <td>$l10n.USERFORM_PASSWORDMSG </small></td>
! <td><input size="10" value="" name="password" maxlength="25" type="password" tabindex="2"/></td>
! </tr>
! </table>
! </form>
! </td>
! <td align=center>
! <table cellpadding=1 cellspacing=3 border=0 width=100%>
! <tr>
! <td align=center class=MENUBUTTON><NOBR> <a href="$link" tabindex="4">$l10n.HOME</a> </NOBR></td>
! </tr>
! </table>
! </td>
! </tr>
! </table>
! <HR size=1 color=NAVY>
! #end
! </div>
!
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 17:06:52
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv16640/src/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SubmitPortlet.java
Log Message:
This is the submit portlet in a working version, but without any extras and without spectrumType and canonicalName
Index: SubmitPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** SubmitPortlet.java 7 Mar 2002 13:55:30 -0000 1.10
--- SubmitPortlet.java 7 Mar 2002 17:06:47 -0000 1.11
***************
*** 130,134 ****
subData.setFieldStrength(fieldStrength);
} catch (NumberFormatException ex) {
! messages += "Your field strength is not a decimal figure!";
}
try {
--- 130,134 ----
subData.setFieldStrength(fieldStrength);
} catch (NumberFormatException ex) {
! messages += "<br>Your field strength is not a decimal figure!";
}
try {
***************
*** 136,140 ****
subData.setTemperature(temp);
} catch (NumberFormatException ex) {
! messages += "Your temperature is not a decimal figure!";
}
if (messages == "") {
--- 136,151 ----
subData.setTemperature(temp);
} catch (NumberFormatException ex) {
! messages += "<br>Your temperature is not a decimal figure!";
! }
! MDLReader mdlreader = new MDLReader(new StringReader(subData.getMolecule()));
! Molecule mol = new Molecule();
! try {
! mol = (Molecule) mdlreader.read(new Molecule());
! } catch (Throwable ex) {
! Log.debug("Fehler1: " + ex.getMessage());
! }
! for(int i=0;i<subData.getSignalstable().size();i++){
! if(((IntTriple) subData.getSignalstable().get(i)).value3==-1||((IntTriple) subData.getSignalstable().get(i)).value3>=mol.getAtomCount())
! messages+="<br>One of your assignments is not a valid atom number, atom numbers go from 0 to "+(mol.getAtomCount()-1)+"!";
}
if (messages == "") {
***************
*** 165,184 ****
System.err.println(dbconn);
Date now=new Date();
! DBMolecule mol2 = new DBMolecule();
! mol2.setDate(now);
! mol2.setStructureFile(subData.getMolecule().getBytes());
! mol2.setMolecularFormula(new MFAnalyser(mol).getMolecularFormula());
! mol2.setSerializedMolecule(XMLTools.getAsXMLString(mol));
! mol2.setCasNumber(subData.getCasNumber());
! mol2.setNmrshiftdbNumber("test3");//not yet final
! mol2.setMolecularWeight(new MFAnalyser(mol).getMass());
! mol2.setFingerprint(Fingerprinter.getFingerprint(mol).toString().getBytes());
NmrshiftdbUser user=(NmrshiftdbUser)runData.getUser();
! mol2.setUserId((NumberKey)user.getPrimaryKey());
! mol2.save(dbconn);
Log.debug("after insert molecule");
//Add chemical name to DB
DBChemicalName chemName=new DBChemicalName();
! chemName.setDBMolecule(mol2);
chemName.setName(subData.getChemName());
chemName.save(dbconn);
--- 176,195 ----
System.err.println(dbconn);
Date now=new Date();
! DBMolecule dbmol = new DBMolecule();
! dbmol.setDate(now);
! dbmol.setStructureFile(subData.getMolecule().getBytes());
! dbmol.setMolecularFormula(new MFAnalyser(mol).getMolecularFormula());
! dbmol.setSerializedMolecule(XMLTools.getAsXMLString(mol));
! dbmol.setCasNumber(subData.getCasNumber());
! dbmol.setNmrshiftdbNumber("test3");//not yet final
! dbmol.setMolecularWeight(new MFAnalyser(mol).getMass());
! dbmol.setFingerprint(Fingerprinter.getFingerprint(mol).toString().getBytes());
NmrshiftdbUser user=(NmrshiftdbUser)runData.getUser();
! dbmol.setUserId((NumberKey)user.getPrimaryKey());
! dbmol.save(dbconn);
Log.debug("after insert molecule");
//Add chemical name to DB
DBChemicalName chemName=new DBChemicalName();
! chemName.setDBMolecule(dbmol);
chemName.setName(subData.getChemName());
chemName.save(dbconn);
***************
*** 197,201 ****
spectrum.setReviewFlag("false");
spectrum.setLiterature(subData.getLiterature());
! spectrum.setDBMolecule(mol2);
spectrum.setUserId((NumberKey)user.getPrimaryKey());
spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final
--- 208,212 ----
spectrum.setReviewFlag("false");
spectrum.setLiterature(subData.getLiterature());
! spectrum.setDBMolecule(dbmol);
spectrum.setUserId((NumberKey)user.getPrimaryKey());
spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final
***************
*** 212,216 ****
dbatoms[i]=new DBAtom();
dbatoms[i].setSymbol(atoms[i].getSymbol());
! dbatoms[i].setDBMolecule(mol2);
dbatoms[i].setSerializedAtom(XMLTools.getAsXMLString(atoms[i]));
dbatoms[i].save(dbconn);
--- 223,227 ----
dbatoms[i]=new DBAtom();
dbatoms[i].setSymbol(atoms[i].getSymbol());
! dbatoms[i].setDBMolecule(dbmol);
dbatoms[i].setSerializedAtom(XMLTools.getAsXMLString(atoms[i]));
dbatoms[i].save(dbconn);
***************
*** 224,228 ****
dbbonds[i].setDegree(new Double(bonds[i].getOrder()).intValue());
dbbonds[i].setSerializedBond(XMLTools.getAsXMLString(bonds[i]));
! dbbonds[i].setDBMolecule(mol2);
dbbonds[i].save(dbconn);
//Add bonds-atoms relationship to DB
--- 235,239 ----
dbbonds[i].setDegree(new Double(bonds[i].getOrder()).intValue());
dbbonds[i].setSerializedBond(XMLTools.getAsXMLString(bonds[i]));
! dbbonds[i].setDBMolecule(dbmol);
dbbonds[i].save(dbconn);
//Add bonds-atoms relationship to DB
***************
*** 308,312 ****
returnValue += "<p><bold>" + messages + "</bold></p>";
returnValue += "<table border=\"3\"><tr><th>Draw your structure</th><th colspan=\"3\">Here the assignment which will be uploaded</th><th>Enter your spectral data here</th></tr><tr><td rowspan=\"";
! returnValue += tableSize + "\">Click to draw your molecule!<br>";
returnValue += "<script LANGUAGE=\"JavaScript1.1\" SRC=\"/jetspeed/nmrshiftdb/marvin.js\"></script>\n";
returnValue += "<script LANGUAGE=\"JavaScript1.1\">\n";
--- 319,323 ----
returnValue += "<p><bold>" + messages + "</bold></p>";
returnValue += "<table border=\"3\"><tr><th>Draw your structure</th><th colspan=\"3\">Here the assignment which will be uploaded</th><th>Enter your spectral data here</th></tr><tr><td rowspan=\"";
! returnValue += tableSize + "\">Click on the <a style=\"color:#FFAAAA\">red</a> to draw your molecule, then submit it!<br>";
returnValue += "<script LANGUAGE=\"JavaScript1.1\" SRC=\"/jetspeed/nmrshiftdb/marvin.js\"></script>\n";
returnValue += "<script LANGUAGE=\"JavaScript1.1\">\n";
***************
*** 331,334 ****
--- 342,346 ----
returnValue += "msketch_param(\"detach\", \"hide\");\n";
returnValue += "msketch_param(\"menubar\",\"false\");\n";
+ returnValue += "msketch_param(\"background\",\"#FFCCCC\");\n";
returnValue += "msketch_end();\n";
returnValue += "msview_mayscript = true;\n";
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:55:34
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv11813/src/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SubmitPortlet.java
Log Message:
New version of submit portlet
Index: SubmitPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** SubmitPortlet.java 6 Mar 2002 16:47:46 -0000 1.9
--- SubmitPortlet.java 7 Mar 2002 13:55:30 -0000 1.10
***************
*** 164,168 ****
dbconn=TurbineDB.getConnection();//save is not working without giving the connection explicitly
System.err.println(dbconn);
- Criteria crit = new Criteria();
Date now=new Date();
DBMolecule mol2 = new DBMolecule();
--- 164,167 ----
***************
*** 174,187 ****
mol2.setNmrshiftdbNumber("test3");//not yet final
mol2.setMolecularWeight(new MFAnalyser(mol).getMass());
! mol2.setFingerprint(subData.getMolecule().getBytes());//Fingerprinter.getFingerprint(mol));
NmrshiftdbUser user=(NmrshiftdbUser)runData.getUser();
mol2.setUserId((NumberKey)user.getPrimaryKey());
mol2.save(dbconn);
- crit.add(DBMoleculePeer.DATE,now);
- NumberKey nkMol=(NumberKey)((DBMolecule)DBMoleculePeer.doSelect(crit,dbconn).get(0)).getPrimaryKey();
Log.debug("after insert molecule");
//Add chemical name to DB
DBChemicalName chemName=new DBChemicalName();
! chemName.setMoleculeId(nkMol);
chemName.setName(subData.getChemName());
chemName.save(dbconn);
--- 173,184 ----
mol2.setNmrshiftdbNumber("test3");//not yet final
mol2.setMolecularWeight(new MFAnalyser(mol).getMass());
! mol2.setFingerprint(Fingerprinter.getFingerprint(mol).toString().getBytes());
NmrshiftdbUser user=(NmrshiftdbUser)runData.getUser();
mol2.setUserId((NumberKey)user.getPrimaryKey());
mol2.save(dbconn);
Log.debug("after insert molecule");
//Add chemical name to DB
DBChemicalName chemName=new DBChemicalName();
! chemName.setDBMolecule(mol2);
chemName.setName(subData.getChemName());
chemName.save(dbconn);
***************
*** 194,199 ****
conds.setUserId((NumberKey)user.getPrimaryKey());
conds.save(dbconn);
- crit=new Criteria();
- NumberKey nkCond=(NumberKey)((DBMeasurementCondition)DBMeasurementConditionPeer.doSelect(crit,dbconn).get(DBMeasurementConditionPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//Always takes the PK with the highist number, not sure if it works, but found no other way to get the PK of the last inserted row
Log.debug("after insert conditions");
//Add spectrum to DB
--- 191,194 ----
***************
*** 202,278 ****
spectrum.setReviewFlag("false");
spectrum.setLiterature(subData.getLiterature());
! spectrum.setMoleculeId(nkMol);
spectrum.setUserId((NumberKey)user.getPrimaryKey());
spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final
spectrum.setSpectrumTypeId(new NumberKey(12));//not yet final
! spectrum.setMeasurementConditionId(nkCond);
spectrum.setSerializedSpectrum(XMLTools.getAsXMLString(spectrum));//really this?
spectrum.setSpecfile(new String("test").getBytes());//Not yet final
spectrum.save(dbconn);
- crit=new Criteria();
- crit.add(DBSpectrumPeer.DATE,now);
- NumberKey nkSpec=(NumberKey)((DBSpectrum)DBSpectrumPeer.doSelect(crit,dbconn).get(0)).getPrimaryKey();
Log.debug("after insert spectrum");
//Add atoms to db
Atom[] atoms = mol.getAtoms();
! System.err.println("atome: "+atoms.length);
! NumberKey[] nkAtom = new NumberKey[atoms.length];
for (int i = 0; i < atoms.length; i++) {
! DBAtom atom=new DBAtom();
! atom.setSymbol(atoms[i].getSymbol());
! atom.setMoleculeId(nkMol);
! atom.setSerializedAtom(XMLTools.getAsXMLString(atoms[i]));
! atom.save(dbconn);
! crit = new Criteria();
! nkAtom[i] = (NumberKey)((DBAtom)DBAtomPeer.doSelect(crit,dbconn).get(DBAtomPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//same problem to find the last inserted row
}
Log.debug("after insert atoms");
//Add bonds to db
Bond[] bonds = mol.getBonds();
! NumberKey[] nkBond = new NumberKey[bonds.length];
for (int i = 0; i < bonds.length; i++) {
! DBBond bond=new DBBond();
! bond.setDegree(new Double(bonds[i].getOrder()).intValue());
! bond.setSerializedBond(XMLTools.getAsXMLString(bonds[i]));
! bond.setMoleculeId(nkMol);
! bond.save(dbconn);
! crit = new Criteria();
! nkBond[i] = (NumberKey)((DBBond)DBBondPeer.doSelect(crit,dbconn).get(DBBondPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//same problem to find the last inserted row
//Add bonds-atoms relationship to DB
Atom[] neighbourAtoms = bonds[i].getAtoms();
for (int k = 0; k < neighbourAtoms.length; k++) {
DBBondDBAtom bondAtom=new DBBondDBAtom();
! Log.debug(i+". bond, "+k+". nachbaratom, pk von bond:"+nkBond[i].getValue()+", pk von atom:"+nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue());
! /*bondAtom.setBondId(nkBond[i]);
! bondAtom.setAtomId(nkAtom[mol.getAtomNumber(neighbourAtoms[k])]);
! bondAtom.save(dbconn);*/
! crit=new Criteria();
! crit.add(DBBondDBAtomPeer.ATOM_ID,nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue());
! crit.add(DBBondDBAtomPeer.BOND_ID,nkBond[i].getValue());
! DBBondDBAtomPeer.doInsert(crit,dbconn);
! Log.debug("saved");
! }
}
Log.debug("after insert bonds");
//add signals to DB
! NumberKey[] nkSignal = new NumberKey[subData.getSignalstable().size()];
for (int i = 0; i < subData.getSignalstable().size(); i++) {
! DBSignal signal=new DBSignal();
! signal.setDimensionality(1);
! signal.setShift1(((IntTriple) subData.getSignalstable().get(i)).value1);
! signal.setIntensity(((IntTriple) subData.getSignalstable().get(i)).value2);
! signal.setSpectrumId(nkSpec);
! signal.setShift2(0);//Not used at the moment
! signal.setShift3(0);
! signal.setShift4(0);
! signal.setShift5(0);
! signal.setSerializedSignal(XMLTools.getAsXMLString("signal"));//not yet final
! signal.save(dbconn);
! crit=new Criteria();
! nkSignal[i] = (NumberKey)((DBSignal)DBSignalPeer.doSelect(crit,dbconn).get(DBSignalPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//same problem to find the last inserted row
! DBSignalDBAtom signalAtom=new DBSignalDBAtom();
! signalAtom.setSignalId(nkSignal[i]);
! signalAtom.setAtomId(new String(""+((IntTriple)subData.getSignalstable().get(i)).value3));
! signalAtom.save(dbconn);
}
Log.debug("after insert signals");
--- 197,264 ----
spectrum.setReviewFlag("false");
spectrum.setLiterature(subData.getLiterature());
! spectrum.setDBMolecule(mol2);
spectrum.setUserId((NumberKey)user.getPrimaryKey());
spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final
spectrum.setSpectrumTypeId(new NumberKey(12));//not yet final
! spectrum.setDBMeasurementCondition(conds);
spectrum.setSerializedSpectrum(XMLTools.getAsXMLString(spectrum));//really this?
spectrum.setSpecfile(new String("test").getBytes());//Not yet final
spectrum.save(dbconn);
Log.debug("after insert spectrum");
//Add atoms to db
Atom[] atoms = mol.getAtoms();
! DBAtom[] dbatoms=new DBAtom[atoms.length];
for (int i = 0; i < atoms.length; i++) {
! dbatoms[i]=new DBAtom();
! dbatoms[i].setSymbol(atoms[i].getSymbol());
! dbatoms[i].setDBMolecule(mol2);
! dbatoms[i].setSerializedAtom(XMLTools.getAsXMLString(atoms[i]));
! dbatoms[i].save(dbconn);
}
Log.debug("after insert atoms");
//Add bonds to db
Bond[] bonds = mol.getBonds();
! DBBond[] dbbonds=new DBBond[bonds.length];
for (int i = 0; i < bonds.length; i++) {
! dbbonds[i]=new DBBond();
! dbbonds[i].setDegree(new Double(bonds[i].getOrder()).intValue());
! dbbonds[i].setSerializedBond(XMLTools.getAsXMLString(bonds[i]));
! dbbonds[i].setDBMolecule(mol2);
! dbbonds[i].save(dbconn);
//Add bonds-atoms relationship to DB
Atom[] neighbourAtoms = bonds[i].getAtoms();
for (int k = 0; k < neighbourAtoms.length; k++) {
DBBondDBAtom bondAtom=new DBBondDBAtom();
! //crit=new Criteria();
! //crit.add(DBBondDBAtomPeer.ATOM_ID,nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue());
! //crit.add(DBBondDBAtomPeer.BOND_ID,nkBond[i].getValue());
! //DBBondDBAtomPeer.doInsert(crit,dbconn);
! java.sql.Statement stmt=dbconn.createStatement();
! stmt.executeUpdate("INSERT INTO BOND_ATOM (BOND_ID, ATOM_ID) VALUES ("+dbbonds[i].getBondId()+","+dbatoms[mol.getAtomNumber(neighbourAtoms[k])].getAtomId()+");");
! }
}
Log.debug("after insert bonds");
//add signals to DB
! DBSignal[] signal = new DBSignal[subData.getSignalstable().size()];
! System.err.println("Signale: "+subData.getSignalstable().size());
for (int i = 0; i < subData.getSignalstable().size(); i++) {
! System.err.println(i+"");
! signal[i]=new DBSignal();
! signal[i].setDimensionality(1);
! signal[i].setShift1(((IntTriple) subData.getSignalstable().get(i)).value1);
! signal[i].setIntensity(((IntTriple) subData.getSignalstable().get(i)).value2);
! signal[i].setDBSpectrum(spectrum);
! signal[i].setShift2(0);//Not used at the moment
! signal[i].setShift3(0);
! signal[i].setShift4(0);
! signal[i].setShift5(0);
! signal[i].setSerializedSignal(XMLTools.getAsXMLString("signal"));//not yet final
! signal[i].save(dbconn);
! //DBSignalDBAtom signalAtom=new DBSignalDBAtom();
! //signalAtom.setSignalId(nkSignal[i]);
! //signalAtom.setAtomId(new String(""+((IntTriple)subData.getSignalstable().get(i)).value3));
! //signalAtom.save(dbconn);
! java.sql.Statement stmt=dbconn.createStatement();
! stmt.executeUpdate("INSERT INTO SIGNAL_ATOM (SIGNAL_ID, ATOM_ID) VALUES ("+signal[i].getSignalId()+","+dbatoms[((IntTriple)subData.getSignalstable().get(i)).value3].getAtomId()+");");
}
Log.debug("after insert signals");
***************
*** 302,324 ****
return (new StringElement(returnValue));
}
-
-
- /**
- *Returns a JSX-stylish serialized string of an object
- *
- * @param o The object to be serialized
- * @return The serialized object
- */
- /*private String serializeObject(Object o) {
- StringWriter strWriter = new StringWriter();
- try {
- ObjOut out = new ObjOut(false, strWriter);
- out.writeObject(o);
- } catch (IOException ex) {
- System.err.println("Fehler bei Serialisierung: "+ex.getMessage());
- }
- return (strWriter.toString());
- }*/
-
/**
--- 288,291 ----
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:55:34
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map
In directory usw-pr-cvs1:/tmp/cvs-serv11813/src/java/org/openscience/nmrshiftdb/om/map
Modified Files:
DBAtomMapBuilder.java DBBondMapBuilder.java
DBCanonicalNameMapBuilder.java DBChemicalNameMapBuilder.java
DBMeasurementConditionMapBuilder.java
DBMoleculeMapBuilder.java DBSignalMapBuilder.java
DBSpectrumMapBuilder.java DBSpectrumTypeMapBuilder.java
Log Message:
New version of submit portlet
Index: DBAtomMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBAtomMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBAtomMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBAtomMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 74,78 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 74,78 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBBondMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBBondMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBBondMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBBondMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 74,78 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 74,78 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBCanonicalNameMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBCanonicalNameMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBCanonicalNameMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBCanonicalNameMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 74,78 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 74,78 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBChemicalNameMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBChemicalNameMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBChemicalNameMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBChemicalNameMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 68,72 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 68,72 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBMeasurementConditionMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBMeasurementConditionMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBMeasurementConditionMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBMeasurementConditionMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 80,84 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 80,84 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBMoleculeMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBMoleculeMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBMoleculeMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBMoleculeMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 110,114 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 110,114 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBSignalMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSignalMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBSignalMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBSignalMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 110,114 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 110,114 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBSpectrumMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSpectrumMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBSpectrumMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBSpectrumMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 116,120 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 116,120 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
Index: DBSpectrumTypeMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSpectrumTypeMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBSpectrumTypeMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBSpectrumTypeMapBuilder.java 7 Mar 2002 13:55:30 -0000 1.4
***************
*** 104,108 ****
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.NATIVE);
--- 104,108 ----
TableMap tMap = dbMap.getTable(getTable());
! tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:55:34
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/conf/jetspeed/WEB-INF/db
In directory usw-pr-cvs1:/tmp/cvs-serv11813/src/conf/jetspeed/WEB-INF/db
Modified Files:
nmrshiftdb-schema.sql populate-mysql.sql
Log Message:
New version of submit portlet
Index: nmrshiftdb-schema.sql
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/conf/jetspeed/WEB-INF/db/nmrshiftdb-schema.sql,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** nmrshiftdb-schema.sql 6 Mar 2002 16:41:15 -0000 1.4
--- nmrshiftdb-schema.sql 7 Mar 2002 13:55:30 -0000 1.5
***************
*** 1,203 ****
! # -----------------------------------------------------------------------
! # MEASUREMENT_CONDITION
! # -----------------------------------------------------------------------
! drop table if exists MEASUREMENT_CONDITION;
!
! CREATE TABLE MEASUREMENT_CONDITION
! (
! MEASUREMENT_CONDITION_ID INTEGER NOT NULL AUTO_INCREMENT,
! TEMPERATURE FLOAT NOT NULL,
! FIELD_STRENGTH INTEGER NOT NULL,
! SOLVENT MEDIUMTEXT NOT NULL,
! USER_ID INTEGER NOT NULL,
! PRIMARY KEY(MEASUREMENT_CONDITION_ID),
FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID)
! );
!
! # -----------------------------------------------------------------------
! # SPECTRUM_TYPE
! # -----------------------------------------------------------------------
! drop table if exists SPECTRUM_TYPE;
!
! CREATE TABLE SPECTRUM_TYPE
! (
! SPECTRUM_TYPE_ID INTEGER NOT NULL AUTO_INCREMENT,
! DIMENSIONALITY INTEGER NOT NULL,
! NAME MEDIUMTEXT NOT NULL,
! ISOTOPE_1 MEDIUMTEXT NOT NULL,
! ISOTOPE_2 MEDIUMTEXT NOT NULL,
! ISOTOPE_3 MEDIUMTEXT NOT NULL,
! ISOTOPE_4 MEDIUMTEXT NOT NULL,
! ISOTOPE_5 MEDIUMTEXT NOT NULL,
! USER_ID INTEGER NOT NULL,
! PRIMARY KEY(SPECTRUM_TYPE_ID),
FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID)
! );
!
! # -----------------------------------------------------------------------
! # SPECTRUM
! # -----------------------------------------------------------------------
! drop table if exists SPECTRUM;
!
! CREATE TABLE SPECTRUM
! (
! SPECTRUM_ID INTEGER NOT NULL AUTO_INCREMENT,
! DATE DATETIME NOT NULL,
! SPECFILE LONGBLOB NOT NULL,
! SERIALIZED_SPECTRUM MEDIUMTEXT NOT NULL,
! LITERATURE MEDIUMTEXT NOT NULL,
! REVIEW_FLAG MEDIUMTEXT NOT NULL,
! FINGERPRINT LONGBLOB NOT NULL,
! USER_ID INTEGER NOT NULL,
! MEASUREMENT_CONDITION_ID INTEGER NOT NULL,
! SPECTRUM_TYPE_ID INTEGER NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(SPECTRUM_ID),
! FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID),
! FOREIGN KEY (MEASUREMENT_CONDITION_ID) REFERENCES MEASUREMENT_CONDITION (MEASUREMENT_CONDITION_ID),
! FOREIGN KEY (SPECTRUM_TYPE_ID) REFERENCES SPECTRUM_TYPE (SPECTRUM_TYPE_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # SIGNAL
! # -----------------------------------------------------------------------
! drop table if exists SIGNAL;
!
! CREATE TABLE SIGNAL
! (
! SIGNAL_ID INTEGER NOT NULL AUTO_INCREMENT,
! DIMENSIONALITY INTEGER NOT NULL,
! SHIFT_1 FLOAT NOT NULL,
! SHIFT_2 FLOAT NOT NULL,
! SHIFT_3 FLOAT NOT NULL,
! SHIFT_4 FLOAT NOT NULL,
! SHIFT_5 FLOAT NOT NULL,
! SERIALIZED_SIGNAL MEDIUMTEXT NOT NULL,
! INTENSITY FLOAT NOT NULL,
! SPECTRUM_ID INTEGER NOT NULL,
! PRIMARY KEY(SIGNAL_ID),
FOREIGN KEY (SPECTRUM_ID) REFERENCES SPECTRUM (SPECTRUM_ID)
! );
!
! # -----------------------------------------------------------------------
! # MOLECULE
! # -----------------------------------------------------------------------
! drop table if exists MOLECULE;
!
! CREATE TABLE MOLECULE
! (
! MOLECULE_ID INTEGER NOT NULL AUTO_INCREMENT,
! DATE DATETIME NOT NULL,
! STRUCTURE_FILE LONGBLOB NOT NULL,
! MOLECULAR_FORMULA MEDIUMTEXT NOT NULL,
! SERIALIZED_MOLECULE MEDIUMTEXT NOT NULL,
! CAS_NUMBER MEDIUMTEXT NOT NULL,
! NMRSHIFTDB_NUMBER MEDIUMTEXT NOT NULL,
! MOLECULAR_WEIGHT FLOAT NOT NULL,
! FINGERPRINT LONGBLOB NOT NULL,
! USER_ID INTEGER NOT NULL,
! PRIMARY KEY(MOLECULE_ID),
FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID)
);
!
! # -----------------------------------------------------------------------
! # ATOM
! # -----------------------------------------------------------------------
! drop table if exists ATOM;
!
! CREATE TABLE ATOM
! (
! ATOM_ID INTEGER NOT NULL AUTO_INCREMENT,
! SYMBOL MEDIUMTEXT NOT NULL,
! SERIALIZED_ATOM MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(ATOM_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # SIGNAL_ATOM
! # -----------------------------------------------------------------------
! drop table if exists SIGNAL_ATOM;
!
! CREATE TABLE SIGNAL_ATOM
! (
! SIGNAL_ID INTEGER NOT NULL,
! ATOM_ID INTEGER NOT NULL,
! PRIMARY KEY(SIGNAL_ID,ATOM_ID),
! INDEX(ATOM_ID),
! FOREIGN KEY (SIGNAL_ID) REFERENCES SIGNAL (SIGNAL_ID),
FOREIGN KEY (ATOM_ID) REFERENCES ATOM (ATOM_ID)
! );
!
! # -----------------------------------------------------------------------
! # BOND
! # -----------------------------------------------------------------------
! drop table if exists BOND;
!
! CREATE TABLE BOND
! (
! BOND_ID INTEGER NOT NULL AUTO_INCREMENT,
! DEGREE INTEGER NOT NULL,
! SERIALIZED_BOND MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(BOND_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # BOND_ATOM
! # -----------------------------------------------------------------------
! drop table if exists BOND_ATOM;
!
! CREATE TABLE BOND_ATOM
! (
! BOND_ID INTEGER NOT NULL,
ATOM_ID INTEGER NOT NULL,
! PRIMARY KEY(BOND_ID,ATOM_ID),
! INDEX(ATOM_ID),
! FOREIGN KEY (BOND_ID) REFERENCES BOND (BOND_ID),
FOREIGN KEY (ATOM_ID) REFERENCES ATOM (ATOM_ID)
! );
!
! # -----------------------------------------------------------------------
! # CHEMICAL_NAME
! # -----------------------------------------------------------------------
! drop table if exists CHEMICAL_NAME;
!
! CREATE TABLE CHEMICAL_NAME
! (
! CHEMICAL_NAME_ID INTEGER NOT NULL AUTO_INCREMENT,
! NAME MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(CHEMICAL_NAME_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # CANONICAL_NAME
! # -----------------------------------------------------------------------
! drop table if exists CANONICAL_NAME;
!
! CREATE TABLE CANONICAL_NAME
! (
! CANONICAL_NAME_ID INTEGER NOT NULL AUTO_INCREMENT,
! NAME MEDIUMTEXT NOT NULL,
! TYPE MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(CANONICAL_NAME_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
!
!
!
!
!
!
!
!
!
!
--- 1,204 ----
! # -----------------------------------------------------------------------
! # MEASUREMENT_CONDITION
! # -----------------------------------------------------------------------
! drop table if exists MEASUREMENT_CONDITION;
!
! CREATE TABLE MEASUREMENT_CONDITION
! (
! MEASUREMENT_CONDITION_ID INTEGER NOT NULL,
! TEMPERATURE FLOAT NOT NULL,
! FIELD_STRENGTH INTEGER NOT NULL,
! SOLVENT MEDIUMTEXT NOT NULL,
! USER_ID INTEGER NOT NULL,
! PRIMARY KEY(MEASUREMENT_CONDITION_ID),
FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID)
! );
!
! # -----------------------------------------------------------------------
! # SPECTRUM_TYPE
! # -----------------------------------------------------------------------
! drop table if exists SPECTRUM_TYPE;
!
! CREATE TABLE SPECTRUM_TYPE
! (
! SPECTRUM_TYPE_ID INTEGER NOT NULL,
! DIMENSIONALITY INTEGER NOT NULL,
! NAME MEDIUMTEXT NOT NULL,
! ISOTOPE_1 MEDIUMTEXT NOT NULL,
! ISOTOPE_2 MEDIUMTEXT NOT NULL,
! ISOTOPE_3 MEDIUMTEXT NOT NULL,
! ISOTOPE_4 MEDIUMTEXT NOT NULL,
! ISOTOPE_5 MEDIUMTEXT NOT NULL,
! USER_ID INTEGER NOT NULL,
! PRIMARY KEY(SPECTRUM_TYPE_ID),
FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID)
! );
!
! # -----------------------------------------------------------------------
! # SPECTRUM
! # -----------------------------------------------------------------------
! drop table if exists SPECTRUM;
!
! CREATE TABLE SPECTRUM
! (
! SPECTRUM_ID INTEGER NOT NULL,
! DATE DATETIME NOT NULL,
! SPECFILE LONGBLOB NOT NULL,
! SERIALIZED_SPECTRUM MEDIUMTEXT NOT NULL,
! LITERATURE MEDIUMTEXT NOT NULL,
! REVIEW_FLAG MEDIUMTEXT NOT NULL,
! FINGERPRINT LONGBLOB NOT NULL,
! USER_ID INTEGER NOT NULL,
! MEASUREMENT_CONDITION_ID INTEGER NOT NULL,
! SPECTRUM_TYPE_ID INTEGER NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(SPECTRUM_ID),
! FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID),
! FOREIGN KEY (MEASUREMENT_CONDITION_ID) REFERENCES MEASUREMENT_CONDITION (MEASUREMENT_CONDITION_ID),
! FOREIGN KEY (SPECTRUM_TYPE_ID) REFERENCES SPECTRUM_TYPE (SPECTRUM_TYPE_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # SIGNAL
! # -----------------------------------------------------------------------
! drop table if exists SIGNAL;
!
! CREATE TABLE SIGNAL
! (
! SIGNAL_ID INTEGER NOT NULL,
! DIMENSIONALITY INTEGER NOT NULL,
! SHIFT_1 FLOAT NOT NULL,
! SHIFT_2 FLOAT NOT NULL,
! SHIFT_3 FLOAT NOT NULL,
! SHIFT_4 FLOAT NOT NULL,
! SHIFT_5 FLOAT NOT NULL,
! SERIALIZED_SIGNAL MEDIUMTEXT NOT NULL,
! INTENSITY FLOAT NOT NULL,
! SPECTRUM_ID INTEGER NOT NULL,
! PRIMARY KEY(SIGNAL_ID),
FOREIGN KEY (SPECTRUM_ID) REFERENCES SPECTRUM (SPECTRUM_ID)
! );
!
! # -----------------------------------------------------------------------
! # MOLECULE
! # -----------------------------------------------------------------------
! drop table if exists MOLECULE;
!
! CREATE TABLE MOLECULE
! (
! MOLECULE_ID INTEGER NOT NULL,
! DATE DATETIME NOT NULL,
! STRUCTURE_FILE LONGBLOB NOT NULL,
! MOLECULAR_FORMULA MEDIUMTEXT NOT NULL,
! SERIALIZED_MOLECULE MEDIUMTEXT NOT NULL,
! CAS_NUMBER MEDIUMTEXT NOT NULL,
! NMRSHIFTDB_NUMBER MEDIUMTEXT NOT NULL,
! MOLECULAR_WEIGHT FLOAT NOT NULL,
! FINGERPRINT LONGBLOB NOT NULL,
! USER_ID INTEGER NOT NULL,
! PRIMARY KEY(MOLECULE_ID),
FOREIGN KEY (USER_ID) REFERENCES NMRSHIFTDB_USER (USER_ID)
);
!
! # -----------------------------------------------------------------------
! # ATOM
! # -----------------------------------------------------------------------
! drop table if exists ATOM;
!
! CREATE TABLE ATOM
! (
! ATOM_ID INTEGER NOT NULL,
! SYMBOL MEDIUMTEXT NOT NULL,
! SERIALIZED_ATOM MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(ATOM_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # SIGNAL_ATOM
! # -----------------------------------------------------------------------
! drop table if exists SIGNAL_ATOM;
!
! CREATE TABLE SIGNAL_ATOM
! (
! SIGNAL_ID INTEGER NOT NULL,
! ATOM_ID INTEGER NOT NULL,
! PRIMARY KEY(SIGNAL_ID,ATOM_ID),
! INDEX(ATOM_ID),
! FOREIGN KEY (SIGNAL_ID) REFERENCES SIGNAL (SIGNAL_ID),
FOREIGN KEY (ATOM_ID) REFERENCES ATOM (ATOM_ID)
! );
!
! # -----------------------------------------------------------------------
! # BOND
! # -----------------------------------------------------------------------
! drop table if exists BOND;
!
! CREATE TABLE BOND
! (
! BOND_ID INTEGER NOT NULL,
! DEGREE INTEGER NOT NULL,
! SERIALIZED_BOND MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(BOND_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # BOND_ATOM
! # -----------------------------------------------------------------------
! drop table if exists BOND_ATOM;
!
! CREATE TABLE BOND_ATOM
! (
! BOND_ID INTEGER NOT NULL,
ATOM_ID INTEGER NOT NULL,
! PRIMARY KEY(BOND_ID,ATOM_ID),
! INDEX(ATOM_ID),
! FOREIGN KEY (BOND_ID) REFERENCES BOND (BOND_ID),
FOREIGN KEY (ATOM_ID) REFERENCES ATOM (ATOM_ID)
! );
!
! # -----------------------------------------------------------------------
! # CHEMICAL_NAME
! # -----------------------------------------------------------------------
! drop table if exists CHEMICAL_NAME;
!
! CREATE TABLE CHEMICAL_NAME
! (
! CHEMICAL_NAME_ID INTEGER NOT NULL,
! NAME MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(CHEMICAL_NAME_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
! # -----------------------------------------------------------------------
! # CANONICAL_NAME
! # -----------------------------------------------------------------------
! drop table if exists CANONICAL_NAME;
!
! CREATE TABLE CANONICAL_NAME
! (
! CANONICAL_NAME_ID INTEGER NOT NULL,
! NAME MEDIUMTEXT NOT NULL,
! TYPE MEDIUMTEXT NOT NULL,
! MOLECULE_ID INTEGER NOT NULL,
! PRIMARY KEY(CANONICAL_NAME_ID),
FOREIGN KEY (MOLECULE_ID) REFERENCES MOLECULE (MOLECULE_ID)
! );
!
!
!
!
!
!
!
!
!
!
!
!
Index: populate-mysql.sql
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/conf/jetspeed/WEB-INF/db/populate-mysql.sql,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** populate-mysql.sql 27 Feb 2002 13:30:45 -0000 1.1
--- populate-mysql.sql 7 Mar 2002 13:55:30 -0000 1.2
***************
*** 38,41 ****
--- 38,55 ----
INSERT INTO ID_TABLE VALUES(6,'TURBINE_ROLE_PERMISSION',100,10);
INSERT INTO ID_TABLE VALUES(7,'TURBINE_USER_GROUP_ROLE',100,10);
+ INSERT INTO ID_TABLE VALUES(8,'MEASUREMENT_CONDITION',100,10);
+ INSERT INTO ID_TABLE VALUES(9,'SPECTRUM_TYPE',100,10);
+ INSERT INTO ID_TABLE VALUES(10,'SPECTRUM',100,10);
+ INSERT INTO ID_TABLE VALUES(11,'SIGNAL',100,10);
+ INSERT INTO ID_TABLE VALUES(12,'MOLECULE',100,10);
+ INSERT INTO ID_TABLE VALUES(13,'ATOM',100,10);
+ INSERT INTO ID_TABLE VALUES(14,'BOND',100,10);
+ INSERT INTO ID_TABLE VALUES(15,'CHEMICAL_NAME',100,10);
+ INSERT INTO ID_TABLE VALUES(16,'CANONICAL_NAME',100,10);
+
+
+
+
+
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:35:27
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/conf/jetspeed/WEB-INF/lib
In directory usw-pr-cvs1:/tmp/cvs-serv5544
Added Files:
turbine-2.2b1-20011124.jar
Log Message:
Removed IDBroker and BasePeer classes, which have been changed by me
--- NEW FILE: turbine-2.2b1-20011124.jar ---
PK
èòrñr
I+
I+
I+
I+
I+
I+
I+
I+
[...3609 lines suppressed...]
I+3x
I+ æË0E
I+U
0
I+ú Å´ÿ
I+nÕ%e¨
I+iLW®¨
I+)/ÓKQ
I+èËëD{
I+PÕµ
I+²ÒC1
I+_Æ
I+
I+cZ×Kë
I+Pnê
I+¡Ú)
I+±ß±0
I+,í¶
I+Þ¬¾û
I+EjÄ6
I+àáôþq
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:34:30
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/om/peer
In directory usw-pr-cvs1:/tmp/cvs-serv5368
Added Files:
BasePeer.java
Log Message:
See beginning of file for changes
--- NEW FILE: BasePeer.java ---
/*Stefan Kuhn: Changed line 782 in order to get it working.
was: .getIdAsBigDecimal(dbCon.getConnection(), keyInfo) );
is: .getIdAsBigDecimal(dbCon.getConnection(), tableName) );
*/
package org.apache.turbine.om.peer;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
[...2187 lines suppressed...]
topString = String.valueOf(limit);
break;
case DB.LIMIT_STYLE_SYBASE:
rcString = String.valueOf(limit);
break;
default:
throw new UnsupportedOperationException("non-native limit is not implemented");
}
// Now set the criteria's limit to return the full
// resultset since the results are limited on the server.
criteria.setLimit(-1);
}
query.setLimit(limitString);
query.setRowcount(rcString);
query.setTop(topString);
}
}
|
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:33:35
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/om/peer In directory usw-pr-cvs1:/tmp/cvs-serv5170/peer Log Message: Directory /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/om/peer added to the repository |
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:33:17
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/util/db In directory usw-pr-cvs1:/tmp/cvs-serv5030 Added Files: IDBroker.java Log Message: See beginning of files for changes --- NEW FILE: IDBroker.java --- /*Stefan Kuhn: Changed line 558 in order to get things working was: dbCon = BasePeer.beginTransaction(databaseName); is: dbCon = BasePeer.beginTransaction(databaseName);*/ package org.apache.turbine.util.db; /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" and * "Apache Turbine" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * "Apache Turbine", nor may "Apache" appear in their name, without * prior written permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ import java.math.BigDecimal; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.Date; import java.util.Enumeration; import java.util.Hashtable; import java.util.List; import org.apache.turbine.om.peer.BasePeer; import org.apache.turbine.services.db.TurbineDB; import org.apache.turbine.services.resources.TurbineResources; import org.apache.turbine.util.Log; import org.apache.turbine.util.TurbineException; import org.apache.turbine.util.db.map.DatabaseMap; import org.apache.turbine.util.db.map.TableMap; import org.apache.turbine.util.db.pool.DBConnection; /** * This method of ID generation is used to ensure that code is * more database independent. For example, MySQL has an auto-increment * feature while Oracle uses sequences. It caches several ids to * avoid needing a Connection for every request. * * This class uses the table ID_TABLE defined in * conf/master/id-table-schema.xml. The columns in ID_TABLE are used as * follows:<br> * * ID_TABLE_ID - The PK for this row (any unique int).<br> * TABLE_NAME - The name of the table you want ids for.<br> * NEXT_ID - The next id returned by IDBroker when it queries the * database (not when it returns an id from memory).<br> * QUANTITY - The number of ids that IDBroker will cache in memory.<br> * <p> * Use this class like this: * <pre> * int id = dbMap.getIDBroker().getNextIdAsInt(null, "TABLE_NAME"); * - or - * BigDecimal[] ids = ((IDBroker)dbMap.getIDBroker()) * .getNextIds("TABLE_NAME", numOfIdsToReturn); * </pre> * * NOTE: When the ID_TABLE must be updated we must ensure that * IDBroker objects running in different JVMs do not overwrite each * other. This is accomplished using using the transactional support * occuring in some databases. Using this class with a database that * does not support transactions should be limited to a single JVM. * * @author <a href="mailto:fra...@cl...">Frank Y. Kim</a> * @author <a href="mailto:joh...@cl...">John D. McNally</a> * @version $Id: IDBroker.java,v 1.1 2002/03/07 13:33:13 shk3 Exp $ */ public class IDBroker implements Runnable, IdGenerator { /** * Fully qualified Table_Name column name */ public static final String TABLE_NAME = "ID_TABLE.TABLE_NAME"; /** * Fully qualified Next_ID column name */ public static final String NEXT_ID = "ID_TABLE.NEXT_ID"; /** * Fully qualified Quantity column name */ public static final String QUANTITY = "ID_TABLE.QUANTITY"; /** The TableMap referencing the ID_TABLE for this IDBroker. */ private TableMap tableMap; /** * The default size of the per-table meta data <code>Hashtable</code> * objects. */ private static final int DEFAULT_SIZE = 40; /** * The cached IDs for each table. * * Key: String table name. * Value: Vector of Integer IDs. */ private Hashtable ids = new Hashtable(DEFAULT_SIZE); /** * The quantity of ids to grab for each table. * * Key: String table name. * Value: Integer quantity. */ private Hashtable quantityStore = new Hashtable(DEFAULT_SIZE); /** * The last time this IDBroker queried the database for ids. * * Key: String table name. * Value: Date of last id request. */ private Hashtable lastQueryTime = new Hashtable(DEFAULT_SIZE); /** * Amount of time for the thread to sleep */ private static final int sleepPeriod = 1 * 60000; /** * The safety Margin */ private static final float safetyMargin = 1.2f; /** * The houseKeeperThread thread */ private Thread houseKeeperThread = null; /** * Are transactions supported? */ private boolean transactionsSupported = false; /** * The value of ONE! */ private static final BigDecimal ONE = new BigDecimal("1"); /** * Creates an IDBroker for the ID table. * * @param tMap A TableMap. */ public IDBroker(TableMap tMap) { this.tableMap = tMap; // Start the housekeeper thread only if prefetch has not been dissabled if (TurbineResources.getBoolean(TurbineResources .DB_IDBROKER_PREFETCH, true)) { houseKeeperThread = new Thread(this); // Indicate that this is a system thread. JVM will quit only when // there are no more active user threads. Settings threads spawned // internally Turbine as daemons allows commandline applications // using Turbine terminate in an orderly manner. houseKeeperThread.setDaemon(true); houseKeeperThread.start(); } // Check for Transaction support. Give warning message if // IDBroker is being used with a database that does not // support transactions. String dbName = tMap.getDatabaseMap().getName(); DBConnection dbCon = null; try { dbCon = TurbineDB.getConnection(dbName); transactionsSupported = dbCon.getConnection() .getMetaData().supportsTransactions(); } catch (Exception e) { transactionsSupported = false; } finally { try { // Return the connection to the pool. TurbineDB.releaseConnection(dbCon); } catch (Exception e) { } } if (!transactionsSupported) { Log.warn ("IDBroker is being used with db '" + dbName + "', which does not support transactions. IDBroker " + "attempts to use transactions to limit the possibility of " + "duplicate key generation. Without transactions, " + "duplicate key generation is possible if multiple JVMs " + "are used or other means are used to write to the database."); } } /** * Returns an id as a primitive int. Note this method does not * require a Connection, it just implements the KeyGenerator * interface. if a Connection is needed one will be requested. * * @param connection A Connection. * @param keyInfo, an Object that contains additional info. * @return An int with the value for the id. * @exception Exception Database error. */ public int getIdAsInt(Connection connection, Object tableName) throws Exception { return getIdAsBigDecimal(null, tableName).intValue(); } /** * Returns an id as a primitive long. Note this method does not * require a Connection, it just implements the KeyGenerator * interface. if a Connection is needed one will be requested. * * @param connection A Connection. * @param tableName, a String that identifies a table. * @return A long with the value for the id. * @exception Exception Database error. */ public long getIdAsLong(Connection connection, Object tableName) throws Exception { return getIdAsBigDecimal(null, tableName).longValue(); } /** * Returns an id as a BigDecimal. Note this method does not * require a Connection, it just implements the KeyGenerator * interface. if a Connection is needed one will be requested. * * @param connection A Connection. * @param tableName, a String that identifies a table.. * @return A BigDecimal id. * @exception Exception Database error. */ public BigDecimal getIdAsBigDecimal(Connection connection, Object tableName) throws Exception { BigDecimal[] id = getNextIds((String)tableName, 1); return id[0]; } /** * Returns an id as a String. Note this method does not * require a Connection, it just implements the KeyGenerator * interface. if a Connection is needed one will be requested. * * @param connection A Connection should be null. * @param tableName, a String that identifies a table. * @return A String id * @exception Exception Database error. */ public String getIdAsString(Connection connection, Object tableName) throws Exception { return getIdAsBigDecimal(null, tableName).toString(); } /** * A flag to determine the timing of the id generation * * @return a <code>boolean</code> value */ public boolean isPriorToInsert() { return true; } /** * A flag to determine the timing of the id generation * * @return a <code>boolean</code> value */ public boolean isPostInsert() { return false; } /** * A flag to determine whether a Connection is required to * generate an id. * * @return a <code>boolean</code> value */ public boolean isConnectionRequired() { return false; } /** * This method returns x number of ids for the given table. * * @param tableName The name of the table for which we want an id. * @param numOfIdsToReturn The desired number of ids. * @return A BigDecimal. * @exception Exception Database error. */ public synchronized BigDecimal[] getNextIds(String tableName, int numOfIdsToReturn) throws Exception { // A note about the synchronization: I (jmcnally) looked at // the synchronized blocks to avoid thread issues that were // being used in this and the storeId method. I do not think // they were being effective, so I synchronized the method. // I have left the blocks that did exist commented in the code // to make it easier for others to take a look, because it // would be preferrable to avoid the synchronization on the // method //storeIDs(tableName,false); List availableIds = (List)ids.get(tableName); if ( availableIds == null || availableIds.size() < numOfIdsToReturn ) { if (availableIds == null) { Log.info ("Forced id retrieval - no available vector"); } else { Log.info ("Forced id retrieval - " + availableIds.size()); } storeIDs(tableName, true); availableIds = (List)ids.get(tableName); } int size = availableIds.size()<numOfIdsToReturn ? availableIds.size() : numOfIdsToReturn; BigDecimal[] results = new BigDecimal[size]; // We assume that availableIds will always come from the ids // Hashtable and would therefore always be the same object for // a specific table. // synchronized (availableIds) // { for (int i=size-1; i>=0; i--) { results[i] = (BigDecimal)availableIds.get(i); availableIds.remove(i); } // } return results; } /** * A background thread that tries to ensure that when someone asks * for ids, that there are already some loaded and that the * database is not accessed. */ public void run() { Log.info("IDBroker thread was started."); Thread thisThread = Thread.currentThread(); while (houseKeeperThread == thisThread) { try { houseKeeperThread.sleep(sleepPeriod); } catch (InterruptedException exc) { // ignored } // Log.info("IDBroker thread checking for more keys."); Enumeration e = ids.keys(); while (e.hasMoreElements()) { String tableName = (String)e.nextElement(); Log.info("IDBroker thread checking for more keys on table: " + tableName); List availableIds = (List)ids.get(tableName); int quantity = getQuantity(tableName).intValue(); if ( quantity > availableIds.size() ) { try { // Second parameter is false because we don't // want the quantity to be adjusted for thread // calls. storeIDs(tableName, false); Log.info("Retrieved more ids for table: " + tableName); } catch (Exception exc) { Log.error("There was a problem getting new IDs for table: " + tableName, exc); } } } } Log.info("IDBroker thread finished."); } /** * Shuts down the IDBroker thread. * * Calling this method stops the thread that was started for this * instance of the IDBroker. This method should be called during * MapBroker Service shutdown. */ public void stop() { houseKeeperThread = null; } /** * Check the frequency of retrieving new ids from the database. * If the frequency is high then we increase the amount (i.e. * quantity column) of ids retrieved on each access. Tries to * alter number of keys grabbed so that IDBroker retrieves a new * set of ID's prior to their being needed. * * @param tableName The name of the table for which we want an id. */ private void checkTiming(String tableName) { // Check if quantity changing is switched on. // If prefetch is turned off, changing quantity does not make sense if (!TurbineResources.getBoolean(TurbineResources .DB_IDBROKER_CLEVERQUANTITY, true) || !TurbineResources.getBoolean(TurbineResources .DB_IDBROKER_PREFETCH, true)) { return; } // Get the last id request for this table. java.util.Date lastTime = (java.util.Date)lastQueryTime.get (tableName); java.util.Date now = new java.util.Date(); if ( lastTime != null) { long thenLong = lastTime.getTime(); long nowLong = now.getTime(); int timeLapse = (int)(nowLong-thenLong); if ( timeLapse < sleepPeriod && timeLapse > 0 ) { Log.info("Unscheduled retrieval of more ids for table: " + tableName); // Increase quantity, so that hopefully this does not // happen again. float rate = getQuantity(tableName).floatValue() / (float)timeLapse; quantityStore.put(tableName, new BigDecimal(Math.ceil(sleepPeriod*rate*safetyMargin))); } } lastQueryTime.put (tableName,now); } /** * Grabs more ids from the id_table and stores it in the ids * Hashtable. If adjustQuantity is set to true the amount of id's * retrieved for each call to storeIDs will be adjusted. * * @param tableName The name of the table for which we want an id. * @param adjustQuantity True if amount should be adjusted. * @exception Exception, a generic exception. */ private void storeIDs(String tableName, boolean adjustQuantity) throws Exception { BigDecimal nextId = null; BigDecimal quantity = null; DatabaseMap dbMap = tableMap.getDatabaseMap(); TableMap tMap = dbMap.getTable(tableName); // Block on the table. Multiple tables are allowed to ask for // ids simultaneously. // synchronized(tMap) see comment in the getNextIds method // { if (adjustQuantity) checkTiming(tableName); DBConnection dbCon = null; try { String databaseName = dbMap.getName(); // Get a connection to the db by starting a // transaction. if (transactionsSupported) { dbCon = BasePeer.beginTransaction(databaseName); } else { dbCon = TurbineDB.getConnection(); } Connection connection = dbCon.getConnection(); // Write the current value of quantity of keys to grab // to the database, primarily to obtain a write lock // on the table/row, but this value will also be used // as the starting value when an IDBroker is // instantiated. quantity = getQuantity(tableName); Criteria criteria = new Criteria(2) .add( QUANTITY, quantity ); Criteria selectCriteria = new Criteria(2) .add( TABLE_NAME, tableName ); criteria.setDbName(dbMap.getName()); selectCriteria.setDbName(dbMap.getName()); BasePeer.doUpdate( selectCriteria, criteria, dbCon ); // Read the next starting ID from the ID_TABLE. BigDecimal[] results = selectRow(connection, tableName); nextId = results[0]; // NEXT_ID column // Update the row based on the quantity in the // ID_TABLE. BigDecimal newNextId = nextId.add(quantity); updateRow(connection, tableName, newNextId.toString() ); if (transactionsSupported) { BasePeer.commitTransaction(dbCon); } } catch (Exception e) { if (transactionsSupported) { BasePeer.rollBackTransaction(dbCon); } throw e; } finally { if (!transactionsSupported) { // Return the connection to the pool. TurbineDB.releaseConnection(dbCon); } } List availableIds = (List)ids.get(tableName); if ( availableIds == null ) { availableIds = new ArrayList(); ids.put( tableName, availableIds ); } // Create the ids and store them in the list of available ids. int numId = quantity.intValue(); for (int i=0; i<numId; i++) { availableIds.add(nextId); nextId = nextId.add(ONE); } // } } /** * This method allows you to get the number of ids that are to be * cached in memory. This is either stored in quantityStore or * read from the db. (ie the value in ID_TABLE.QUANTITY). * * Though this method returns a BigDecimal for the quantity, it is * unlikey the system could withstand whatever conditions would lead * to really needing a large quantity, it is retrieved as a BigDecimal * only because it is going to be added to another BigDecimal. * * @param tableName The name of the table we want to query. * @return An int with the number of ids cached in memory. */ private BigDecimal getQuantity(String tableName) { BigDecimal quantity = null; // If prefetch is turned off we simply return 1 if (!TurbineResources.getBoolean(TurbineResources .DB_IDBROKER_PREFETCH, true)) { return new BigDecimal(1); } // Initialize quantity, if necessary. if (quantityStore.containsKey(tableName)) { quantity = (BigDecimal)quantityStore.get(tableName); } else { DBConnection dbCon = null; try { String databaseName = tableMap.getDatabaseMap().getName(); // Get a connection to the db dbCon = TurbineDB.getConnection(databaseName); Connection connection = dbCon.getConnection(); // Read the row from the ID_TABLE. BigDecimal[] results = selectRow(connection, tableName); // QUANTITY column. quantity = results[1]; quantityStore.put(tableName, quantity); } catch (Exception e) { quantity = new BigDecimal(10); } finally { // Return the connection to the pool. try { TurbineDB.releaseConnection(dbCon); } catch (Exception e) { Log.error("Release of connection failed.", e); } } } return quantity; } /** * Helper method to select a row in the ID_TABLE. * * @param con A Connection. * @param tableName The properly escaped name of the table to * identify the row. * @return A BigDecimal[]. * @exception Exception, a generic exception. */ private BigDecimal[] selectRow(Connection con, String tableName) throws Exception { StringBuffer stmt = new StringBuffer(); stmt.append( "SELECT NEXT_ID, QUANTITY" ) .append( " FROM ID_TABLE" ) .append( " WHERE TABLE_NAME = '" ) .append( tableName ) .append( '\'' ); Statement statement = null; BigDecimal[] results = new BigDecimal[2]; try { statement = con.createStatement(); ResultSet rs = statement.executeQuery( stmt.toString() ); if(rs.next()) { // work around for MySQL which appears to support // getBigDecimal in the source code, but the binary // is throwing an NotImplemented exception. results[0] = new BigDecimal(rs.getString(1)); // next_id results[1] = new BigDecimal(rs.getString(2)); // quantity } else { throw new TurbineException("The table "+tableName+ " does not have a proper entry in the ID_TABLE"); } } finally { if (statement != null) statement.close(); } return results; } /** * Helper method to update a row in the ID_TABLE. * * @param con A Connection. * @param tableName The properly escaped name of the table to identify the * row. * @param id An int with the value to set for the id. * @exception Exception Database error. */ private void updateRow(Connection con, String tableName, String id) throws Exception { StringBuffer stmt = new StringBuffer(id.length() + tableName.length() + 50); stmt.append( "UPDATE ID_TABLE" ) .append( " SET next_id = " ) .append( id ) .append( " WHERE TABLE_NAME = '" ) .append( tableName ) .append( '\'' ); Statement statement = null; try { statement = con.createStatement(); statement.executeUpdate( stmt.toString() ); } finally { if (statement != null) statement.close(); } } } |
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:32:36
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/util/db In directory usw-pr-cvs1:/tmp/cvs-serv4900/db Log Message: Directory /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/util/db added to the repository |
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:32:20
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/util In directory usw-pr-cvs1:/tmp/cvs-serv4802/util Log Message: Directory /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/util added to the repository |
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:31:57
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/om In directory usw-pr-cvs1:/tmp/cvs-serv4622/om Log Message: Directory /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine/om added to the repository |
|
From: Stefan K. <sh...@us...> - 2002-03-07 13:31:34
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine In directory usw-pr-cvs1:/tmp/cvs-serv4433/turbine Log Message: Directory /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/apache/turbine added to the repository |
|
From: Stefan K. <sh...@us...> - 2002-03-06 16:47:49
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets In directory usw-pr-cvs1:/tmp/cvs-serv14015/src/java/org/openscience/nmrshiftdb/portlets Modified Files: SubmitPortlet.java Log Message: New version Index: SubmitPortlet.java =================================================================== RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** SubmitPortlet.java 6 Mar 2002 16:41:16 -0000 1.8 --- SubmitPortlet.java 6 Mar 2002 16:47:46 -0000 1.9 *************** *** 2,7 **** --- 2,9 ---- import org.apache.jetspeed.portal.portlets.AbstractPortlet; + //import org.apache.jetspeed.om.dbpsml.*; import org.apache.turbine.util.RunData; import org.apache.turbine.util.db.*; + import org.apache.turbine.util.db.pool.*; import org.apache.ecs.ConcreteElement; import org.apache.ecs.StringElement; *************** *** 10,13 **** --- 12,16 ---- import org.apache.turbine.om.*; import org.apache.turbine.util.*; + import org.apache.turbine.services.db.*; import org.apache.torque.*; *************** *** 20,23 **** --- 23,28 ---- import org.openscience.cdk.*; import org.openscience.cdk.io.*; + import org.openscience.cdk.tools.*; + import org.openscience.cdk.fingerprint.*; import java.io.*; *************** *** 26,36 **** /** ! * Description of the Class * * @author Stefan Kuhn * @created 18. Februar 2002 */ ! public class SubmitPortlet extends AbstractPortlet ! { /** * Gets the content attribute of the ResultPortlet object --- 31,40 ---- /** ! * This is the portlet handlang submitting spectra/molecules... * * @author Stefan Kuhn * @created 18. Februar 2002 */ ! public class SubmitPortlet extends AbstractPortlet { /** * Gets the content attribute of the ResultPortlet object *************** *** 38,45 **** * @param runData Created by turbine * @return The content to be displayed as the portlet - * @since */ ! public ConcreteElement getContent(RunData runData) ! { HttpServletRequest req = runData.getRequest(); String action = req.getParameter("nmrshiftdbaction"); --- 42,47 ---- * @param runData Created by turbine * @return The content to be displayed as the portlet */ ! public ConcreteElement getContent(RunData runData) { HttpServletRequest req = runData.getRequest(); String action = req.getParameter("nmrshiftdbaction"); *************** *** 50,61 **** String returnValue = ""; //Create new SubmittingData object in case there is none in the session, i. e. no submission currently going on ! if (subData == null) ! { subData = new SubmittingData(); session.setAttribute("subData", subData); } //User submittet new values for the spectrum ! if (action != null && action.equals("submitSpectrumForAssignment")) ! { String spectrum = req.getParameter("spectrum") + '\n'; char[] charSpectrum = spectrum.toCharArray(); --- 52,61 ---- String returnValue = ""; //Create new SubmittingData object in case there is none in the session, i. e. no submission currently going on ! if (subData == null) { subData = new SubmittingData(); session.setAttribute("subData", subData); } //User submittet new values for the spectrum ! if (action != null && action.equals("submitSpectrumForAssignment")) { String spectrum = req.getParameter("spectrum") + '\n'; char[] charSpectrum = spectrum.toCharArray(); *************** *** 65,97 **** boolean addingShift = true; //The string is parsed ! for (int i = 0; i < charSpectrum.length; i++) ! { ! if (charSpectrum[i] == ';') ! { intensity = ""; addingShift = false; ! } ! else ! { ! if (charSpectrum[i] == '\n') ! { IntTriple figures = new IntTriple(); ! if (shift.trim() != "") ! { ! try ! { figures.value1 = (new Integer(shift.trim())).intValue(); ! if (intensity.trim() == "") ! { figures.value2 = 0; ! } ! else ! { figures.value2 = (new Integer(intensity.trim())).intValue(); } numberSpectrum.add(figures); ! } ! catch (NumberFormatException ex) ! { messages += "Your input included wrong characters!<br>"; } --- 65,85 ---- boolean addingShift = true; //The string is parsed ! for (int i = 0; i < charSpectrum.length; i++) { ! if (charSpectrum[i] == ';') { intensity = ""; addingShift = false; ! } else { ! if (charSpectrum[i] == '\n') { IntTriple figures = new IntTriple(); ! if (shift.trim() != "") { ! try { figures.value1 = (new Integer(shift.trim())).intValue(); ! if (intensity.trim() == "") { figures.value2 = 0; ! } else { figures.value2 = (new Integer(intensity.trim())).intValue(); } numberSpectrum.add(figures); ! } catch (NumberFormatException ex) { messages += "Your input included wrong characters!<br>"; } *************** *** 99,111 **** addingShift = true; } ! } ! else ! { ! if (addingShift) ! { shift = shift + charSpectrum[i]; ! } ! else ! { intensity = intensity + charSpectrum[i]; } --- 87,94 ---- addingShift = true; } ! } else { ! if (addingShift) { shift = shift + charSpectrum[i]; ! } else { intensity = intensity + charSpectrum[i]; } *************** *** 114,119 **** } //Values added to the signals table ! for (int i = 0; i < numberSpectrum.size(); i++) ! { subData.addToSignalstable(numberSpectrum.get(i)); } --- 97,101 ---- } //Values added to the signals table ! for (int i = 0; i < numberSpectrum.size(); i++) { subData.addToSignalstable(numberSpectrum.get(i)); } *************** *** 121,134 **** } //User submitted new assignments ! if (action != null && action.equals("submitAssignments")) ! { ! for (int i = 0; i < subData.getSignalstable().size(); i++) ! { ! if (req.getParameter("atomSelect" + i).equals("none")) ! { ((IntTriple) subData.getSignalstable().get(i)).value3 = -1; ! } ! else ! { ((IntTriple) subData.getSignalstable().get(i)).value3 = new Integer(req.getParameter("atomSelect" + i).trim()).intValue(); } --- 103,111 ---- } //User submitted new assignments ! if (action != null && action.equals("submitAssignments")) { ! for (int i = 0; i < subData.getSignalstable().size(); i++) { ! if (req.getParameter("atomSelect" + i).equals("none")) { ((IntTriple) subData.getSignalstable().get(i)).value3 = -1; ! } else { ((IntTriple) subData.getSignalstable().get(i)).value3 = new Integer(req.getParameter("atomSelect" + i).trim()).intValue(); } *************** *** 137,193 **** } //User submitted a molecule in marvin ! if (action != null && action.equals("submitMolecule")) ! { subData.setMolecule(req.getParameter("MolTxt")); returnValue = submitPage(messages, subData); } //User submitted the whole input ! if (action != null && action.equals("submitForConfirm")) ! { subData.setSolvent(req.getParameter("solvent")); subData.setChemName(req.getParameter("chemName")); String fieldStrengthStr = req.getParameter("fieldStrength"); String temperatureStr = req.getParameter("temperature"); ! try ! { int fieldStrength = Integer.parseInt(fieldStrengthStr); subData.setFieldStrength(fieldStrength); ! } ! catch (NumberFormatException ex) ! { messages += "Your field strength is not a decimal figure!"; } ! try ! { long temp = Long.parseLong(temperatureStr); subData.setTemperature(temp); ! } ! catch (NumberFormatException ex) ! { messages += "Your temperature is not a decimal figure!"; } ! if (messages == "") ! { //Show confirm screen returnValue = "Here the data should be reapeated!<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForDB\"><input type=\"submit\" value=\"Write to Database\"></form>"; ! } ! else ! { //Display message and show input screen again returnValue = submitPage(messages, subData); } } ! //User submittet confirm screen ! if (action != null && action.equals("submitSpectrumForDB")) ! { ! //Log.debug(subData.getMolecule()); MDLReader mdlreader = new MDLReader(new StringReader(subData.getMolecule())); Molecule mol = new Molecule(); ! try ! { mol = (Molecule) mdlreader.read(new Molecule()); ! } ! catch (Throwable ex) ! { Log.debug("Fehler1: " + ex.getMessage()); StringWriter strWr = new StringWriter(); --- 114,157 ---- } //User submitted a molecule in marvin ! if (action != null && action.equals("submitMolecule")) { subData.setMolecule(req.getParameter("MolTxt")); returnValue = submitPage(messages, subData); } //User submitted the whole input ! if (action != null && action.equals("submitForConfirm")) { subData.setSolvent(req.getParameter("solvent")); subData.setChemName(req.getParameter("chemName")); + subData.setCasNumber(req.getParameter("casnumber")); + subData.setLiterature(req.getParameter("literature")); String fieldStrengthStr = req.getParameter("fieldStrength"); String temperatureStr = req.getParameter("temperature"); ! try { int fieldStrength = Integer.parseInt(fieldStrengthStr); subData.setFieldStrength(fieldStrength); ! } catch (NumberFormatException ex) { messages += "Your field strength is not a decimal figure!"; } ! try { long temp = Long.parseLong(temperatureStr); subData.setTemperature(temp); ! } catch (NumberFormatException ex) { messages += "Your temperature is not a decimal figure!"; } ! if (messages == "") { //Show confirm screen returnValue = "Here the data should be reapeated!<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForDB\"><input type=\"submit\" value=\"Write to Database\"></form>"; ! } else { //Display message and show input screen again returnValue = submitPage(messages, subData); } } ! //User submitted confirm screen ! if (action != null && action.equals("submitSpectrumForDB")) { ! DBConnection dbconn=null; MDLReader mdlreader = new MDLReader(new StringReader(subData.getMolecule())); Molecule mol = new Molecule(); ! try { mol = (Molecule) mdlreader.read(new Molecule()); ! } catch (Throwable ex) { Log.debug("Fehler1: " + ex.getMessage()); StringWriter strWr = new StringWriter(); *************** *** 197,275 **** } //Add molecule to DB ! try ! { ! //Torque.init("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/WEB-INF/conf/Torque.properties"); ! org.apache.turbine.util.db.pool.DBConnection dbconn = org.apache.turbine.services.db.TurbineDB.getConnection(); System.err.println(dbconn); Criteria crit = new Criteria(); DBMolecule mol2 = new DBMolecule(); ! mol2.setDate(new Date()); ! //mol2.save(); ! //crit.add(DBMoleculePeer.SERIALIZED_MOLECULE,"serializeObject(mol)"); ! //crit.add(DBMoleculePeer.DATE,(java.sql.Date)new java.util.Date()); ! //crit.add(DBMoleculePeer.CAS_NUMBER,45); mol2.save(dbconn); ! System.err.println("juhu"); ! NumberKey nkMol = new NumberKey(); Log.debug("after insert molecule"); //Add chemical name to DB ! crit = new Criteria(); ! crit.add(DBChemicalNamePeer.MOLECULE_ID, nkMol.getValue()); ! crit.add(DBChemicalNamePeer.NAME, subData.getChemName()); //Add spectrum to DB ! crit = new Criteria(); ! crit.add(DBSpectrumPeer.MOLECULE_ID, nkMol.getValue()); ! crit.add(DBSpectrumPeer.REVIEW_FLAG, 'n'); ! NumberKey nkSpectrum = (NumberKey) DBSpectrumPeer.doInsert(crit); //Add atoms to db Atom[] atoms = mol.getAtoms(); NumberKey[] nkAtom = new NumberKey[atoms.length]; ! for (int i = 0; i < atoms.length; i++) ! { crit = new Criteria(); ! crit.add(DBAtomPeer.SYMBOL, atoms[i].getSymbol()); ! crit.add(DBAtomPeer.SERIALIZED_ATOM, serializeObject(atoms[i])); ! crit.add(DBAtomPeer.MOLECULE_ID, nkMol.getValue()); ! nkAtom[i] = (NumberKey) DBAtomPeer.doInsert(crit); } //Add bonds to db Bond[] bonds = mol.getBonds(); NumberKey[] nkBond = new NumberKey[bonds.length]; ! for (int i = 0; i < bonds.length; i++) ! { crit = new Criteria(); ! crit.add(DBBondPeer.DEGREE, bonds[i].getOrder()); ! crit.add(DBBondPeer.SERIALIZED_BOND, serializeObject(bonds[i])); ! crit.add(DBBondPeer.MOLECULE_ID, nkMol.getValue()); ! nkBond[i] = (NumberKey) DBBondPeer.doInsert(crit); //Add bonds-atoms relationship to DB Atom[] neighbourAtoms = bonds[i].getAtoms(); ! for (int k = 0; k < neighbourAtoms.length; k++) ! { ! crit = new Criteria(); ! crit.add(DBBondDBAtomPeer.BOND_ID, nkBond[i].getValue()); ! crit.add(DBBondDBAtomPeer.ATOM_ID, nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue()); ! Object o = DBBondDBAtomPeer.doInsert(crit); } } //add signals to DB NumberKey[] nkSignal = new NumberKey[subData.getSignalstable().size()]; ! for (int i = 0; i < subData.getSignalstable().size(); i++) ! { ! crit = new Criteria(); ! crit.add(DBSignalPeer.DIMENSIONALITY, 1); ! crit.add(DBSignalPeer.SHIFT_1, ((IntTriple) subData.getSignalstable().get(i)).value1); ! crit.add(DBSignalPeer.SPECTRUM_ID, nkSpectrum.getValue()); ! //The serialized signal is not used at the moment //Intensity still missing ! //crit.add(SignalPeer.INTENSITY,((IntTriple)subData.getSignalstable[i]).value2); ! nkSignal[i] = (NumberKey) DBSignalPeer.doInsert(crit); ! crit = new Criteria(); ! crit.add(DBSignalDBAtomPeer.SIGNAL_ID, nkSignal[i].getValue()); ! crit.add(DBSignalDBAtomPeer.ATOM_ID, nkAtom[((IntTriple) subData.getSignalstable().get(i)).value3].getValue()); ! NumberKey nk = (NumberKey) DBSignalDBAtomPeer.doInsert(crit); } } ! catch (Exception ex) ! { Log.debug("Fehler2: " + ex.getMessage()); StringWriter strWr = new StringWriter(); --- 161,282 ---- } //Add molecule to DB ! try { ! dbconn=TurbineDB.getConnection();//save is not working without giving the connection explicitly System.err.println(dbconn); Criteria crit = new Criteria(); + Date now=new Date(); DBMolecule mol2 = new DBMolecule(); ! mol2.setDate(now); ! mol2.setStructureFile(subData.getMolecule().getBytes()); ! mol2.setMolecularFormula(new MFAnalyser(mol).getMolecularFormula()); ! mol2.setSerializedMolecule(XMLTools.getAsXMLString(mol)); ! mol2.setCasNumber(subData.getCasNumber()); ! mol2.setNmrshiftdbNumber("test3");//not yet final ! mol2.setMolecularWeight(new MFAnalyser(mol).getMass()); ! mol2.setFingerprint(subData.getMolecule().getBytes());//Fingerprinter.getFingerprint(mol)); ! NmrshiftdbUser user=(NmrshiftdbUser)runData.getUser(); ! mol2.setUserId((NumberKey)user.getPrimaryKey()); mol2.save(dbconn); ! crit.add(DBMoleculePeer.DATE,now); ! NumberKey nkMol=(NumberKey)((DBMolecule)DBMoleculePeer.doSelect(crit,dbconn).get(0)).getPrimaryKey(); Log.debug("after insert molecule"); //Add chemical name to DB ! DBChemicalName chemName=new DBChemicalName(); ! chemName.setMoleculeId(nkMol); ! chemName.setName(subData.getChemName()); ! chemName.save(dbconn); ! Log.debug("after insert chemName"); ! //Add measurement conditions to db ! DBMeasurementCondition conds=new DBMeasurementCondition(); ! conds.setTemperature(subData.getTemperature()); ! conds.setFieldStrength(subData.getFieldStrength()); ! conds.setSolvent(subData.getSolvent()); ! conds.setUserId((NumberKey)user.getPrimaryKey()); ! conds.save(dbconn); ! crit=new Criteria(); ! NumberKey nkCond=(NumberKey)((DBMeasurementCondition)DBMeasurementConditionPeer.doSelect(crit,dbconn).get(DBMeasurementConditionPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//Always takes the PK with the highist number, not sure if it works, but found no other way to get the PK of the last inserted row ! Log.debug("after insert conditions"); //Add spectrum to DB ! DBSpectrum spectrum=new DBSpectrum(); ! spectrum.setDate(now); ! spectrum.setReviewFlag("false"); ! spectrum.setLiterature(subData.getLiterature()); ! spectrum.setMoleculeId(nkMol); ! spectrum.setUserId((NumberKey)user.getPrimaryKey()); ! spectrum.setFingerprint(subData.getMolecule().getBytes());//not yet final ! spectrum.setSpectrumTypeId(new NumberKey(12));//not yet final ! spectrum.setMeasurementConditionId(nkCond); ! spectrum.setSerializedSpectrum(XMLTools.getAsXMLString(spectrum));//really this? ! spectrum.setSpecfile(new String("test").getBytes());//Not yet final ! spectrum.save(dbconn); ! crit=new Criteria(); ! crit.add(DBSpectrumPeer.DATE,now); ! NumberKey nkSpec=(NumberKey)((DBSpectrum)DBSpectrumPeer.doSelect(crit,dbconn).get(0)).getPrimaryKey(); ! Log.debug("after insert spectrum"); //Add atoms to db Atom[] atoms = mol.getAtoms(); + System.err.println("atome: "+atoms.length); NumberKey[] nkAtom = new NumberKey[atoms.length]; ! for (int i = 0; i < atoms.length; i++) { ! DBAtom atom=new DBAtom(); ! atom.setSymbol(atoms[i].getSymbol()); ! atom.setMoleculeId(nkMol); ! atom.setSerializedAtom(XMLTools.getAsXMLString(atoms[i])); ! atom.save(dbconn); crit = new Criteria(); ! nkAtom[i] = (NumberKey)((DBAtom)DBAtomPeer.doSelect(crit,dbconn).get(DBAtomPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//same problem to find the last inserted row } + Log.debug("after insert atoms"); //Add bonds to db Bond[] bonds = mol.getBonds(); NumberKey[] nkBond = new NumberKey[bonds.length]; ! for (int i = 0; i < bonds.length; i++) { ! DBBond bond=new DBBond(); ! bond.setDegree(new Double(bonds[i].getOrder()).intValue()); ! bond.setSerializedBond(XMLTools.getAsXMLString(bonds[i])); ! bond.setMoleculeId(nkMol); ! bond.save(dbconn); crit = new Criteria(); ! nkBond[i] = (NumberKey)((DBBond)DBBondPeer.doSelect(crit,dbconn).get(DBBondPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//same problem to find the last inserted row //Add bonds-atoms relationship to DB Atom[] neighbourAtoms = bonds[i].getAtoms(); ! for (int k = 0; k < neighbourAtoms.length; k++) { ! DBBondDBAtom bondAtom=new DBBondDBAtom(); ! Log.debug(i+". bond, "+k+". nachbaratom, pk von bond:"+nkBond[i].getValue()+", pk von atom:"+nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue()); ! /*bondAtom.setBondId(nkBond[i]); ! bondAtom.setAtomId(nkAtom[mol.getAtomNumber(neighbourAtoms[k])]); ! bondAtom.save(dbconn);*/ ! crit=new Criteria(); ! crit.add(DBBondDBAtomPeer.ATOM_ID,nkAtom[mol.getAtomNumber(neighbourAtoms[k])].getValue()); ! crit.add(DBBondDBAtomPeer.BOND_ID,nkBond[i].getValue()); ! DBBondDBAtomPeer.doInsert(crit,dbconn); ! Log.debug("saved"); } } + Log.debug("after insert bonds"); //add signals to DB NumberKey[] nkSignal = new NumberKey[subData.getSignalstable().size()]; ! for (int i = 0; i < subData.getSignalstable().size(); i++) { ! DBSignal signal=new DBSignal(); ! signal.setDimensionality(1); ! signal.setShift1(((IntTriple) subData.getSignalstable().get(i)).value1); ! signal.setIntensity(((IntTriple) subData.getSignalstable().get(i)).value2); ! signal.setSpectrumId(nkSpec); ! signal.setShift2(0);//Not used at the moment ! signal.setShift3(0); ! signal.setShift4(0); ! signal.setShift5(0); ! signal.setSerializedSignal(XMLTools.getAsXMLString("signal"));//not yet final ! signal.save(dbconn); ! crit=new Criteria(); ! nkSignal[i] = (NumberKey)((DBSignal)DBSignalPeer.doSelect(crit,dbconn).get(DBSignalPeer.doSelect(crit,dbconn).size()-1)).getPrimaryKey();//same problem to find the last inserted row ! DBSignalDBAtom signalAtom=new DBSignalDBAtom(); ! signalAtom.setSignalId(nkSignal[i]); ! signalAtom.setAtomId(new String(""+((IntTriple)subData.getSignalstable().get(i)).value3)); ! signalAtom.save(dbconn); } + Log.debug("after insert signals"); } ! catch (Exception ex) { Log.debug("Fehler2: " + ex.getMessage()); StringWriter strWr = new StringWriter(); *************** *** 278,286 **** Log.debug(strWr.toString()); } session.removeAttribute("subData"); ! returnValue = "Your spectrum has been submitted and will be reviewed shortly! Thanks for your contribution! For a new submit <a heref=\"http://localhost:8080/jetspeed/portal/pane0/Submit\">click here</a>"; } ! if (action == null) ! { returnValue = submitPage(messages, subData); } --- 285,301 ---- Log.debug(strWr.toString()); } + + finally{ + try{ + TurbineDB.releaseConnection(dbconn); + } + catch (Exception e){ + Log.debug("Error releasing connection: "+e.getMessage()); + } + } session.removeAttribute("subData"); ! returnValue = "Your spectrum has been submitted and will be reviewed shortly! Thanks for your contribution! For a new submit <a href=\"http://localhost:8080/jetspeed/portal/pane0/Submit\">click here</a>"; } ! if (action == null) { returnValue = submitPage(messages, subData); } *************** *** 294,314 **** * @param o The object to be serialized * @return The serialized object - * @since */ ! private String serializeObject(Object o) ! { StringWriter strWriter = new StringWriter(); ! try ! { ObjOut out = new ObjOut(false, strWriter); out.writeObject(o); ! } ! catch (IOException ex) ! { ! System.out.println(ex.getMessage()); } return (strWriter.toString()); ! } ! /** --- 309,324 ---- * @param o The object to be serialized * @return The serialized object */ ! /*private String serializeObject(Object o) { StringWriter strWriter = new StringWriter(); ! try { ObjOut out = new ObjOut(false, strWriter); out.writeObject(o); ! } catch (IOException ex) { ! System.err.println("Fehler bei Serialisierung: "+ex.getMessage()); } return (strWriter.toString()); ! }*/ ! /** *************** *** 318,334 **** * @param subData submittingData object from session * @return The content to be displayed as the portlet - * @since */ ! private String submitPage(String messages, SubmittingData subData) ! { String returnValue = ""; int tableSize; //the number of rows the table for the assignments will have (10 is minimum) ! if (subData.getSignalstable().size() < 10) ! { tableSize = 10; ! } ! else ! { tableSize = subData.getSignalstable().size() + 2; } --- 328,339 ---- * @param subData submittingData object from session * @return The content to be displayed as the portlet */ ! private String submitPage(String messages, SubmittingData subData) { String returnValue = ""; int tableSize; //the number of rows the table for the assignments will have (10 is minimum) ! if (subData.getSignalstable().size() < 10) { tableSize = 10; ! } else { tableSize = subData.getSignalstable().size() + 2; } *************** *** 365,380 **** //The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up) File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol"); ! try ! { FileWriter out = new FileWriter(outputFile); out.write(subData.getMolecule()); out.close(); ! } ! catch (Exception e) ! { System.out.println(e.getMessage()); } ! if (!subData.getMolecule().equals("")) ! { returnValue += "mview_param(\"mol\",\"temp.mol\");\n"; } --- 370,381 ---- //The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up) File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol"); ! try { FileWriter out = new FileWriter(outputFile); out.write(subData.getMolecule()); out.close(); ! } catch (Exception e) { System.out.println(e.getMessage()); } ! if (!subData.getMolecule().equals("")) { returnValue += "mview_param(\"mol\",\"temp.mol\");\n"; } *************** *** 390,412 **** returnValue += tableSize + "\" valign=\"bottom\">Enter one shift per line, the intensity<br>(optional) seperated by ;<br>like<br>56;4<br>64;6<br><form action=\"/jetspeed/portal/\" name=\"spectrumForm\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForAssignment\"><textarea name=\"spectrum\" cols=\"10\" rows=\"10\"></textarea><br><input type=\"submit\" value=\"Submit the Spectrum\"></form></td></tr>"; returnValue += "<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitAssignments\">"; ! for (int i = 0; i < subData.getSignalstable().size(); i++) ! { returnValue += "<tr><td><select name=\"atomSelect" + i + "\" size=\"1\" onChange=\"unselectandselect(this.value)\">"; ! if (((IntTriple) subData.getSignalstable().get(i)).value3 == -1) ! { returnValue += "<OPTION SELECTED>none</option>"; ! } ! else ! { returnValue += "<OPTION>none</option>"; } ! for (int k = 0; k < subData.getSignalstable().size(); k++) ! { ! if (k == ((IntTriple) subData.getSignalstable().get(i)).value3) ! { returnValue += "<option selected>" + (k) + "</option>"; ! } ! else ! { returnValue += "<option>" + (k) + "</option>"; } --- 391,405 ---- returnValue += tableSize + "\" valign=\"bottom\">Enter one shift per line, the intensity<br>(optional) seperated by ;<br>like<br>56;4<br>64;6<br><form action=\"/jetspeed/portal/\" name=\"spectrumForm\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForAssignment\"><textarea name=\"spectrum\" cols=\"10\" rows=\"10\"></textarea><br><input type=\"submit\" value=\"Submit the Spectrum\"></form></td></tr>"; returnValue += "<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitAssignments\">"; ! for (int i = 0; i < subData.getSignalstable().size(); i++) { returnValue += "<tr><td><select name=\"atomSelect" + i + "\" size=\"1\" onChange=\"unselectandselect(this.value)\">"; ! if (((IntTriple) subData.getSignalstable().get(i)).value3 == -1) { returnValue += "<OPTION SELECTED>none</option>"; ! } else { returnValue += "<OPTION>none</option>"; } ! for (int k = 0; k < subData.getSignalstable().size(); k++) { ! if (k == ((IntTriple) subData.getSignalstable().get(i)).value3) { returnValue += "<option selected>" + (k) + "</option>"; ! } else { returnValue += "<option>" + (k) + "</option>"; } *************** *** 415,422 **** } returnValue += "<tr><td colspan=\"3\" valign=\"bottom\"><input type=\"submit\" value=\"Submit assignments\"></td></tr></form>"; ! returnValue += "</table><br><form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitForConfirm\"><center>Chemical name:<input type=\"text\" name=\"chemName\"></center><br><center>Measurement conditions - temperature (in <sup>0</sup>K):<input type=\"text\" name=\"temperature\"> -Field strength:<input type=\"text\" name=\"fieldStrength\"> -Solvent:<input type=\"text\" name=\"solvent\"></center><br><center><input type=\"submit\" value=\"Write to Database\"></center></form>"; return (returnValue); } } - - --- 408,413 ---- } returnValue += "<tr><td colspan=\"3\" valign=\"bottom\"><input type=\"submit\" value=\"Submit assignments\"></td></tr></form>"; ! returnValue += "</table><br><form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitForConfirm\"><center>Chemical name:<input type=\"text\" name=\"chemName\">CAS Number:<input type=\"text\" name=\"casnumber\">Literature:<input type=\"text\" name=\"literature\"></center><br><center>Measurement conditions - temperature (in <sup>0</sup>K):<input type=\"text\" name=\"temperature\"> -Field strength:<input type=\"text\" name=\"fieldStrength\"> -Solvent:<input type=\"text\" name=\"solvent\"></center><br><center><input type=\"submit\" value=\"Write to Database\"></center></form>"; return (returnValue); } } |
|
From: Stefan K. <sh...@us...> - 2002-03-06 16:47:49
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/util
In directory usw-pr-cvs1:/tmp/cvs-serv14015/src/java/org/openscience/nmrshiftdb/util
Modified Files:
SubmittingData.java
Log Message:
New version
Index: SubmittingData.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/util/SubmittingData.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SubmittingData.java 5 Mar 2002 09:29:04 -0000 1.3
--- SubmittingData.java 6 Mar 2002 16:47:46 -0000 1.4
***************
*** 16,19 ****
--- 16,21 ----
long temperature = 0;
String chemName = "";
+ String casNumber = "";
+ String literature = "";
***************
*** 39,42 ****
--- 41,64 ----
/**
+ *Sets the casNumber attribute of the SubmittingData object
+ *
+ * @param casNumber The new casNumber value
+ */
+ public void setCasNumber(String casNumber) {
+ this.casNumber = casNumber;
+ }
+
+
+ /**
+ *Sets the literature attribute of the SubmittingData object
+ *
+ * @param literature The new literature value
+ */
+ public void setLiterature(String literature) {
+ this.literature = literature;
+ }
+
+
+ /**
*Sets the fieldStrength attribute of the SubmittingData object
*
***************
*** 85,88 ****
--- 107,130 ----
public String getChemName() {
return (chemName);
+ }
+
+
+ /**
+ *Gets the casNumber attribute of the SubmittingData object
+ *
+ * @return The casNumber value
+ */
+ public String getCasNumber() {
+ return (casNumber);
+ }
+
+
+ /**
+ *Gets the literature attribute of the SubmittingData object
+ *
+ * @return The literature value
+ */
+ public String getLiterature() {
+ return (literature);
}
|
|
From: Stefan K. <sk...@us...> - 2002-03-06 16:41:23
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv11083/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SubmitPortlet.java
Log Message:
modified om files
Index: SubmitPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** SubmitPortlet.java 5 Mar 2002 09:29:04 -0000 1.7
--- SubmitPortlet.java 6 Mar 2002 16:41:16 -0000 1.8
***************
*** 31,35 ****
* @created 18. Februar 2002
*/
! public class SubmitPortlet extends AbstractPortlet {
/**
* Gets the content attribute of the ResultPortlet object
--- 31,36 ----
* @created 18. Februar 2002
*/
! public class SubmitPortlet extends AbstractPortlet
! {
/**
* Gets the content attribute of the ResultPortlet object
***************
*** 37,42 ****
* @param runData Created by turbine
* @return The content to be displayed as the portlet
*/
! public ConcreteElement getContent(RunData runData) {
HttpServletRequest req = runData.getRequest();
String action = req.getParameter("nmrshiftdbaction");
--- 38,45 ----
* @param runData Created by turbine
* @return The content to be displayed as the portlet
+ * @since
*/
! public ConcreteElement getContent(RunData runData)
! {
HttpServletRequest req = runData.getRequest();
String action = req.getParameter("nmrshiftdbaction");
***************
*** 47,56 ****
String returnValue = "";
//Create new SubmittingData object in case there is none in the session, i. e. no submission currently going on
! if (subData == null) {
subData = new SubmittingData();
session.setAttribute("subData", subData);
}
//User submittet new values for the spectrum
! if (action != null && action.equals("submitSpectrumForAssignment")) {
String spectrum = req.getParameter("spectrum") + '\n';
char[] charSpectrum = spectrum.toCharArray();
--- 50,61 ----
String returnValue = "";
//Create new SubmittingData object in case there is none in the session, i. e. no submission currently going on
! if (subData == null)
! {
subData = new SubmittingData();
session.setAttribute("subData", subData);
}
//User submittet new values for the spectrum
! if (action != null && action.equals("submitSpectrumForAssignment"))
! {
String spectrum = req.getParameter("spectrum") + '\n';
char[] charSpectrum = spectrum.toCharArray();
***************
*** 60,80 ****
boolean addingShift = true;
//The string is parsed
! for (int i = 0; i < charSpectrum.length; i++) {
! if (charSpectrum[i] == ';') {
intensity = "";
addingShift = false;
! } else {
! if (charSpectrum[i] == '\n') {
IntTriple figures = new IntTriple();
! if (shift.trim() != "") {
! try {
figures.value1 = (new Integer(shift.trim())).intValue();
! if (intensity.trim() == "") {
figures.value2 = 0;
! } else {
figures.value2 = (new Integer(intensity.trim())).intValue();
}
numberSpectrum.add(figures);
! } catch (NumberFormatException ex) {
messages += "Your input included wrong characters!<br>";
}
--- 65,97 ----
boolean addingShift = true;
//The string is parsed
! for (int i = 0; i < charSpectrum.length; i++)
! {
! if (charSpectrum[i] == ';')
! {
intensity = "";
addingShift = false;
! }
! else
! {
! if (charSpectrum[i] == '\n')
! {
IntTriple figures = new IntTriple();
! if (shift.trim() != "")
! {
! try
! {
figures.value1 = (new Integer(shift.trim())).intValue();
! if (intensity.trim() == "")
! {
figures.value2 = 0;
! }
! else
! {
figures.value2 = (new Integer(intensity.trim())).intValue();
}
numberSpectrum.add(figures);
! }
! catch (NumberFormatException ex)
! {
messages += "Your input included wrong characters!<br>";
}
***************
*** 82,89 ****
addingShift = true;
}
! } else {
! if (addingShift) {
shift = shift + charSpectrum[i];
! } else {
intensity = intensity + charSpectrum[i];
}
--- 99,111 ----
addingShift = true;
}
! }
! else
! {
! if (addingShift)
! {
shift = shift + charSpectrum[i];
! }
! else
! {
intensity = intensity + charSpectrum[i];
}
***************
*** 92,96 ****
}
//Values added to the signals table
! for (int i = 0; i < numberSpectrum.size(); i++) {
subData.addToSignalstable(numberSpectrum.get(i));
}
--- 114,119 ----
}
//Values added to the signals table
! for (int i = 0; i < numberSpectrum.size(); i++)
! {
subData.addToSignalstable(numberSpectrum.get(i));
}
***************
*** 98,106 ****
}
//User submitted new assignments
! if (action != null && action.equals("submitAssignments")) {
! for (int i = 0; i < subData.getSignalstable().size(); i++) {
! if (req.getParameter("atomSelect" + i).equals("none")) {
((IntTriple) subData.getSignalstable().get(i)).value3 = -1;
! } else {
((IntTriple) subData.getSignalstable().get(i)).value3 = new Integer(req.getParameter("atomSelect" + i).trim()).intValue();
}
--- 121,134 ----
}
//User submitted new assignments
! if (action != null && action.equals("submitAssignments"))
! {
! for (int i = 0; i < subData.getSignalstable().size(); i++)
! {
! if (req.getParameter("atomSelect" + i).equals("none"))
! {
((IntTriple) subData.getSignalstable().get(i)).value3 = -1;
! }
! else
! {
((IntTriple) subData.getSignalstable().get(i)).value3 = new Integer(req.getParameter("atomSelect" + i).trim()).intValue();
}
***************
*** 109,138 ****
}
//User submitted a molecule in marvin
! if (action != null && action.equals("submitMolecule")) {
subData.setMolecule(req.getParameter("MolTxt"));
returnValue = submitPage(messages, subData);
}
//User submitted the whole input
! if (action != null && action.equals("submitForConfirm")) {
subData.setSolvent(req.getParameter("solvent"));
subData.setChemName(req.getParameter("chemName"));
String fieldStrengthStr = req.getParameter("fieldStrength");
String temperatureStr = req.getParameter("temperature");
! try {
int fieldStrength = Integer.parseInt(fieldStrengthStr);
subData.setFieldStrength(fieldStrength);
! } catch (NumberFormatException ex) {
messages += "Your field strength is not a decimal figure!";
}
! try {
long temp = Long.parseLong(temperatureStr);
subData.setTemperature(temp);
! } catch (NumberFormatException ex) {
messages += "Your temperature is not a decimal figure!";
}
! if (messages == "") {
//Show confirm screen
returnValue = "Here the data should be reapeated!<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForDB\"><input type=\"submit\" value=\"Write to Database\"></form>";
! } else {
//Display message and show input screen again
returnValue = submitPage(messages, subData);
--- 137,177 ----
}
//User submitted a molecule in marvin
! if (action != null && action.equals("submitMolecule"))
! {
subData.setMolecule(req.getParameter("MolTxt"));
returnValue = submitPage(messages, subData);
}
//User submitted the whole input
! if (action != null && action.equals("submitForConfirm"))
! {
subData.setSolvent(req.getParameter("solvent"));
subData.setChemName(req.getParameter("chemName"));
String fieldStrengthStr = req.getParameter("fieldStrength");
String temperatureStr = req.getParameter("temperature");
! try
! {
int fieldStrength = Integer.parseInt(fieldStrengthStr);
subData.setFieldStrength(fieldStrength);
! }
! catch (NumberFormatException ex)
! {
messages += "Your field strength is not a decimal figure!";
}
! try
! {
long temp = Long.parseLong(temperatureStr);
subData.setTemperature(temp);
! }
! catch (NumberFormatException ex)
! {
messages += "Your temperature is not a decimal figure!";
}
! if (messages == "")
! {
//Show confirm screen
returnValue = "Here the data should be reapeated!<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForDB\"><input type=\"submit\" value=\"Write to Database\"></form>";
! }
! else
! {
//Display message and show input screen again
returnValue = submitPage(messages, subData);
***************
*** 140,150 ****
}
//User submittet confirm screen
! if (action != null && action.equals("submitSpectrumForDB")) {
//Log.debug(subData.getMolecule());
MDLReader mdlreader = new MDLReader(new StringReader(subData.getMolecule()));
Molecule mol = new Molecule();
! try {
mol = (Molecule) mdlreader.read(new Molecule());
! } catch (Throwable ex) {
Log.debug("Fehler1: " + ex.getMessage());
StringWriter strWr = new StringWriter();
--- 179,193 ----
}
//User submittet confirm screen
! if (action != null && action.equals("submitSpectrumForDB"))
! {
//Log.debug(subData.getMolecule());
MDLReader mdlreader = new MDLReader(new StringReader(subData.getMolecule()));
Molecule mol = new Molecule();
! try
! {
mol = (Molecule) mdlreader.read(new Molecule());
! }
! catch (Throwable ex)
! {
Log.debug("Fehler1: " + ex.getMessage());
StringWriter strWr = new StringWriter();
***************
*** 154,160 ****
}
//Add molecule to DB
! try {
//Torque.init("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/WEB-INF/conf/Torque.properties");
! org.apache.turbine.util.db.pool.DBConnection dbconn=org.apache.turbine.services.db.TurbineDB.getConnection();
System.err.println(dbconn);
Criteria crit = new Criteria();
--- 197,204 ----
}
//Add molecule to DB
! try
! {
//Torque.init("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/WEB-INF/conf/Torque.properties");
! org.apache.turbine.util.db.pool.DBConnection dbconn = org.apache.turbine.services.db.TurbineDB.getConnection();
System.err.println(dbconn);
Criteria crit = new Criteria();
***************
*** 181,185 ****
Atom[] atoms = mol.getAtoms();
NumberKey[] nkAtom = new NumberKey[atoms.length];
! for (int i = 0; i < atoms.length; i++) {
crit = new Criteria();
crit.add(DBAtomPeer.SYMBOL, atoms[i].getSymbol());
--- 225,230 ----
Atom[] atoms = mol.getAtoms();
NumberKey[] nkAtom = new NumberKey[atoms.length];
! for (int i = 0; i < atoms.length; i++)
! {
crit = new Criteria();
crit.add(DBAtomPeer.SYMBOL, atoms[i].getSymbol());
***************
*** 191,195 ****
Bond[] bonds = mol.getBonds();
NumberKey[] nkBond = new NumberKey[bonds.length];
! for (int i = 0; i < bonds.length; i++) {
crit = new Criteria();
crit.add(DBBondPeer.DEGREE, bonds[i].getOrder());
--- 236,241 ----
Bond[] bonds = mol.getBonds();
NumberKey[] nkBond = new NumberKey[bonds.length];
! for (int i = 0; i < bonds.length; i++)
! {
crit = new Criteria();
crit.add(DBBondPeer.DEGREE, bonds[i].getOrder());
***************
*** 199,203 ****
//Add bonds-atoms relationship to DB
Atom[] neighbourAtoms = bonds[i].getAtoms();
! for (int k = 0; k < neighbourAtoms.length; k++) {
crit = new Criteria();
crit.add(DBBondDBAtomPeer.BOND_ID, nkBond[i].getValue());
--- 245,250 ----
//Add bonds-atoms relationship to DB
Atom[] neighbourAtoms = bonds[i].getAtoms();
! for (int k = 0; k < neighbourAtoms.length; k++)
! {
crit = new Criteria();
crit.add(DBBondDBAtomPeer.BOND_ID, nkBond[i].getValue());
***************
*** 208,212 ****
//add signals to DB
NumberKey[] nkSignal = new NumberKey[subData.getSignalstable().size()];
! for (int i = 0; i < subData.getSignalstable().size(); i++) {
crit = new Criteria();
crit.add(DBSignalPeer.DIMENSIONALITY, 1);
--- 255,260 ----
//add signals to DB
NumberKey[] nkSignal = new NumberKey[subData.getSignalstable().size()];
! for (int i = 0; i < subData.getSignalstable().size(); i++)
! {
crit = new Criteria();
crit.add(DBSignalPeer.DIMENSIONALITY, 1);
***************
*** 221,225 ****
NumberKey nk = (NumberKey) DBSignalDBAtomPeer.doInsert(crit);
}
! } catch (Exception ex) {
Log.debug("Fehler2: " + ex.getMessage());
StringWriter strWr = new StringWriter();
--- 269,275 ----
NumberKey nk = (NumberKey) DBSignalDBAtomPeer.doInsert(crit);
}
! }
! catch (Exception ex)
! {
Log.debug("Fehler2: " + ex.getMessage());
StringWriter strWr = new StringWriter();
***************
*** 231,235 ****
returnValue = "Your spectrum has been submitted and will be reviewed shortly! Thanks for your contribution! For a new submit <a heref=\"http://localhost:8080/jetspeed/portal/pane0/Submit\">click here</a>";
}
! if (action == null) {
returnValue = submitPage(messages, subData);
}
--- 281,286 ----
returnValue = "Your spectrum has been submitted and will be reviewed shortly! Thanks for your contribution! For a new submit <a heref=\"http://localhost:8080/jetspeed/portal/pane0/Submit\">click here</a>";
}
! if (action == null)
! {
returnValue = submitPage(messages, subData);
}
***************
*** 243,253 ****
* @param o The object to be serialized
* @return The serialized object
*/
! private String serializeObject(Object o) {
StringWriter strWriter = new StringWriter();
! try {
ObjOut out = new ObjOut(false, strWriter);
out.writeObject(o);
! } catch (IOException ex) {
System.out.println(ex.getMessage());
}
--- 294,309 ----
* @param o The object to be serialized
* @return The serialized object
+ * @since
*/
! private String serializeObject(Object o)
! {
StringWriter strWriter = new StringWriter();
! try
! {
ObjOut out = new ObjOut(false, strWriter);
out.writeObject(o);
! }
! catch (IOException ex)
! {
System.out.println(ex.getMessage());
}
***************
*** 262,273 ****
* @param subData submittingData object from session
* @return The content to be displayed as the portlet
*/
! private String submitPage(String messages, SubmittingData subData) {
String returnValue = "";
int tableSize;
//the number of rows the table for the assignments will have (10 is minimum)
! if (subData.getSignalstable().size() < 10) {
tableSize = 10;
! } else {
tableSize = subData.getSignalstable().size() + 2;
}
--- 318,334 ----
* @param subData submittingData object from session
* @return The content to be displayed as the portlet
+ * @since
*/
! private String submitPage(String messages, SubmittingData subData)
! {
String returnValue = "";
int tableSize;
//the number of rows the table for the assignments will have (10 is minimum)
! if (subData.getSignalstable().size() < 10)
! {
tableSize = 10;
! }
! else
! {
tableSize = subData.getSignalstable().size() + 2;
}
***************
*** 304,315 ****
//The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up)
File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol");
! try {
FileWriter out = new FileWriter(outputFile);
out.write(subData.getMolecule());
out.close();
! } catch (Exception e) {
System.out.println(e.getMessage());
}
! if (!subData.getMolecule().equals("")) {
returnValue += "mview_param(\"mol\",\"temp.mol\");\n";
}
--- 365,380 ----
//The mol is put into the MView applet via a file (Problem: If two people write at the same time, the files are messed up)
File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol");
! try
! {
FileWriter out = new FileWriter(outputFile);
out.write(subData.getMolecule());
out.close();
! }
! catch (Exception e)
! {
System.out.println(e.getMessage());
}
! if (!subData.getMolecule().equals(""))
! {
returnValue += "mview_param(\"mol\",\"temp.mol\");\n";
}
***************
*** 325,339 ****
returnValue += tableSize + "\" valign=\"bottom\">Enter one shift per line, the intensity<br>(optional) seperated by ;<br>like<br>56;4<br>64;6<br><form action=\"/jetspeed/portal/\" name=\"spectrumForm\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForAssignment\"><textarea name=\"spectrum\" cols=\"10\" rows=\"10\"></textarea><br><input type=\"submit\" value=\"Submit the Spectrum\"></form></td></tr>";
returnValue += "<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitAssignments\">";
! for (int i = 0; i < subData.getSignalstable().size(); i++) {
returnValue += "<tr><td><select name=\"atomSelect" + i + "\" size=\"1\" onChange=\"unselectandselect(this.value)\">";
! if (((IntTriple) subData.getSignalstable().get(i)).value3 == -1) {
returnValue += "<OPTION SELECTED>none</option>";
! } else {
returnValue += "<OPTION>none</option>";
}
! for (int k = 0; k < subData.getSignalstable().size(); k++) {
! if (k == ((IntTriple) subData.getSignalstable().get(i)).value3) {
returnValue += "<option selected>" + (k) + "</option>";
! } else {
returnValue += "<option>" + (k) + "</option>";
}
--- 390,412 ----
returnValue += tableSize + "\" valign=\"bottom\">Enter one shift per line, the intensity<br>(optional) seperated by ;<br>like<br>56;4<br>64;6<br><form action=\"/jetspeed/portal/\" name=\"spectrumForm\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForAssignment\"><textarea name=\"spectrum\" cols=\"10\" rows=\"10\"></textarea><br><input type=\"submit\" value=\"Submit the Spectrum\"></form></td></tr>";
returnValue += "<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitAssignments\">";
! for (int i = 0; i < subData.getSignalstable().size(); i++)
! {
returnValue += "<tr><td><select name=\"atomSelect" + i + "\" size=\"1\" onChange=\"unselectandselect(this.value)\">";
! if (((IntTriple) subData.getSignalstable().get(i)).value3 == -1)
! {
returnValue += "<OPTION SELECTED>none</option>";
! }
! else
! {
returnValue += "<OPTION>none</option>";
}
! for (int k = 0; k < subData.getSignalstable().size(); k++)
! {
! if (k == ((IntTriple) subData.getSignalstable().get(i)).value3)
! {
returnValue += "<option selected>" + (k) + "</option>";
! }
! else
! {
returnValue += "<option>" + (k) + "</option>";
}
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om
In directory usw-pr-cvs1:/tmp/cvs-serv11083/java/org/openscience/nmrshiftdb/om
Modified Files:
BaseDBBondDBAtom.java BaseDBBondDBAtomPeer.java
BaseDBSignalDBAtom.java BaseDBSignalDBAtomPeer.java
BaseNmrshiftdbUserPeer.java
Log Message:
modified om files
Index: BaseDBBondDBAtom.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/BaseDBBondDBAtom.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** BaseDBBondDBAtom.java 6 Mar 2002 12:34:23 -0000 1.3
--- BaseDBBondDBAtom.java 6 Mar 2002 16:41:16 -0000 1.4
***************
*** 342,345 ****
--- 342,401 ----
+
+
+
+
+
+
+ private final SimpleKey[] pks = new SimpleKey[2];
+ private final ComboKey comboPK = new ComboKey(pks);
+ /**
+ * Set the PrimaryKey with an ObjectKey
+ */
+ public void setPrimaryKey(ObjectKey key) throws Exception
+ {
+ SimpleKey[] keys = (SimpleKey[])key.getValue();
+ setBondId((NumberKey)keys[0]);
+ setAtomId((NumberKey)keys[1]);
+ }
+
+ /**
+ * Set the PrimaryKey using SimpleKeys.
+ *
+ * @param NumberKey bond_id
+ * @param NumberKey atom_id
+ */
+ public void setPrimaryKey( NumberKey bond_id, NumberKey atom_id)
+ throws Exception {
+ setBondId(bond_id);
+ setAtomId(atom_id);
+ }
+
+ /**
+ * Set the PrimaryKey with Strings.
+ *
+ * @param String bond_id
+ * @param String atom_id
+ */
+ public void setPrimaryKey( String bond_id, String atom_id)
+ throws Exception {
+ setBondId(new NumberKey(bond_id));
+ setAtomId(new NumberKey(atom_id));
+ }
+
+ /**
+ * Set the PrimaryKey using a String.
+ */
+ public void setPrimaryKey(String key) throws Exception
+ {
+ int prevPos = 0;
+
+ int colonPos = key.indexOf(':', prevPos);
+ setBondId( new NumberKey(key.substring(prevPos, colonPos)) );
+ prevPos = colonPos + 1;
+ colonPos = key.indexOf(':', prevPos);
+ setAtomId( new NumberKey(key.substring(prevPos, colonPos)) );
+ prevPos = colonPos + 1;
+ }
***************
*** 351,355 ****
public ObjectKey getPrimaryKey()
{
! return getPrimaryKey();
}
--- 407,413 ----
public ObjectKey getPrimaryKey()
{
! pks[0] = getBondId();
! pks[1] = getAtomId();
! return comboPK;
}
***************
*** 395,399 ****
! return copyObj;
}
}
--- 453,459 ----
! copyObj.setBondId((NumberKey)null);
! copyObj.setAtomId((NumberKey)null);
! return copyObj;
}
}
Index: BaseDBBondDBAtomPeer.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/BaseDBBondDBAtomPeer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** BaseDBBondDBAtomPeer.java 6 Mar 2002 12:34:23 -0000 1.3
--- BaseDBBondDBAtomPeer.java 6 Mar 2002 16:41:16 -0000 1.4
***************
*** 260,264 ****
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! BasePeer.doUpdate( selectCriteria, criteria );
}
--- 260,266 ----
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! selectCriteria.put( BOND_ID, criteria.remove(BOND_ID) );
! selectCriteria.put( ATOM_ID, criteria.remove(ATOM_ID) );
! BasePeer.doUpdate( selectCriteria, criteria );
}
***************
*** 275,279 ****
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! BasePeer.doUpdate( selectCriteria, criteria, dbCon );
}
--- 277,283 ----
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! selectCriteria.put( BOND_ID, criteria.remove(BOND_ID) );
! selectCriteria.put( ATOM_ID, criteria.remove(ATOM_ID) );
! BasePeer.doUpdate( selectCriteria, criteria, dbCon );
}
***************
*** 404,408 ****
Criteria criteria = new Criteria();
SimpleKey[] keys = (SimpleKey[])pk.getValue();
! Vector v = doSelect(criteria, dbcon);
if ( v.size() != 1)
{
--- 408,414 ----
Criteria criteria = new Criteria();
SimpleKey[] keys = (SimpleKey[])pk.getValue();
! criteria.add( BOND_ID, keys[0] );
! criteria.add( ATOM_ID, keys[1] );
! Vector v = doSelect(criteria, dbcon);
if ( v.size() != 1)
{
***************
*** 416,419 ****
--- 422,480 ----
+ /**
+ * retrieve object using using pk values.
+ *
+ * @param NumberKey bond_id
+ * @param NumberKey atom_id
+ */
+ public static DBBondDBAtom retrieveByPK(
+ NumberKey bond_id
+ , NumberKey atom_id
+ ) throws Exception
+ {
+ DBConnection db = null;
+ DBBondDBAtom retVal = null;
+ try
+ {
+ db = TurbineDB.getConnection( mapBuilder.getDatabaseMap().getName() );
+ retVal = retrieveByPK(
+ bond_id
+ , atom_id
+ , db);
+ }
+ finally
+ {
+ if (db != null)
+ TurbineDB.releaseConnection(db);
+ }
+ return(retVal);
+ }
+
+ /**
+ * retrieve object using using pk values.
+ *
+ * @param NumberKey bond_id
+ * @param NumberKey atom_id
+ * @param DBConnection dbcon
+ */
+ public static DBBondDBAtom retrieveByPK(
+ NumberKey bond_id
+ , NumberKey atom_id
+ ,DBConnection dbcon ) throws Exception
+ {
+
+ Criteria criteria = new Criteria(5);
+ criteria.add( BOND_ID, bond_id );
+ criteria.add( ATOM_ID, atom_id );
+ Vector v = doSelect(criteria, dbcon);
+ if ( v.size() != 1)
+ {
+ throw new Exception("Failed to select one and only one row.");
+ }
+ else
+ {
+ return (DBBondDBAtom) v.firstElement();
+ }
+ }
Index: BaseDBSignalDBAtom.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/BaseDBSignalDBAtom.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** BaseDBSignalDBAtom.java 6 Mar 2002 12:34:24 -0000 1.3
--- BaseDBSignalDBAtom.java 6 Mar 2002 16:41:16 -0000 1.4
***************
*** 342,345 ****
--- 342,401 ----
+
+
+
+
+
+
+ private final SimpleKey[] pks = new SimpleKey[2];
+ private final ComboKey comboPK = new ComboKey(pks);
+ /**
+ * Set the PrimaryKey with an ObjectKey
+ */
+ public void setPrimaryKey(ObjectKey key) throws Exception
+ {
+ SimpleKey[] keys = (SimpleKey[])key.getValue();
+ setSignalId((NumberKey)keys[0]);
+ setAtomId((NumberKey)keys[1]);
+ }
+
+ /**
+ * Set the PrimaryKey using SimpleKeys.
+ *
+ * @param NumberKey signal_id
+ * @param NumberKey atom_id
+ */
+ public void setPrimaryKey( NumberKey signal_id, NumberKey atom_id)
+ throws Exception {
+ setSignalId(signal_id);
+ setAtomId(atom_id);
+ }
+
+ /**
+ * Set the PrimaryKey with Strings.
+ *
+ * @param String signal_id
+ * @param String atom_id
+ */
+ public void setPrimaryKey( String signal_id, String atom_id)
+ throws Exception {
+ setSignalId(new NumberKey(signal_id));
+ setAtomId(new NumberKey(atom_id));
+ }
+
+ /**
+ * Set the PrimaryKey using a String.
+ */
+ public void setPrimaryKey(String key) throws Exception
+ {
+ int prevPos = 0;
+
+ int colonPos = key.indexOf(':', prevPos);
+ setSignalId( new NumberKey(key.substring(prevPos, colonPos)) );
+ prevPos = colonPos + 1;
+ colonPos = key.indexOf(':', prevPos);
+ setAtomId( new NumberKey(key.substring(prevPos, colonPos)) );
+ prevPos = colonPos + 1;
+ }
***************
*** 351,355 ****
public ObjectKey getPrimaryKey()
{
! return getPrimaryKey();
}
--- 407,413 ----
public ObjectKey getPrimaryKey()
{
! pks[0] = getSignalId();
! pks[1] = getAtomId();
! return comboPK;
}
***************
*** 395,399 ****
! return copyObj;
}
}
--- 453,459 ----
! copyObj.setSignalId((NumberKey)null);
! copyObj.setAtomId((NumberKey)null);
! return copyObj;
}
}
Index: BaseDBSignalDBAtomPeer.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/BaseDBSignalDBAtomPeer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** BaseDBSignalDBAtomPeer.java 6 Mar 2002 12:34:24 -0000 1.3
--- BaseDBSignalDBAtomPeer.java 6 Mar 2002 16:41:16 -0000 1.4
***************
*** 260,264 ****
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! BasePeer.doUpdate( selectCriteria, criteria );
}
--- 260,266 ----
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! selectCriteria.put( SIGNAL_ID, criteria.remove(SIGNAL_ID) );
! selectCriteria.put( ATOM_ID, criteria.remove(ATOM_ID) );
! BasePeer.doUpdate( selectCriteria, criteria );
}
***************
*** 275,279 ****
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! BasePeer.doUpdate( selectCriteria, criteria, dbCon );
}
--- 277,283 ----
Criteria selectCriteria = new
Criteria(mapBuilder.getDatabaseMap().getName(), 2);
! selectCriteria.put( SIGNAL_ID, criteria.remove(SIGNAL_ID) );
! selectCriteria.put( ATOM_ID, criteria.remove(ATOM_ID) );
! BasePeer.doUpdate( selectCriteria, criteria, dbCon );
}
***************
*** 404,408 ****
Criteria criteria = new Criteria();
SimpleKey[] keys = (SimpleKey[])pk.getValue();
! Vector v = doSelect(criteria, dbcon);
if ( v.size() != 1)
{
--- 408,414 ----
Criteria criteria = new Criteria();
SimpleKey[] keys = (SimpleKey[])pk.getValue();
! criteria.add( SIGNAL_ID, keys[0] );
! criteria.add( ATOM_ID, keys[1] );
! Vector v = doSelect(criteria, dbcon);
if ( v.size() != 1)
{
***************
*** 416,419 ****
--- 422,480 ----
+ /**
+ * retrieve object using using pk values.
+ *
+ * @param NumberKey signal_id
+ * @param NumberKey atom_id
+ */
+ public static DBSignalDBAtom retrieveByPK(
+ NumberKey signal_id
+ , NumberKey atom_id
+ ) throws Exception
+ {
+ DBConnection db = null;
+ DBSignalDBAtom retVal = null;
+ try
+ {
+ db = TurbineDB.getConnection( mapBuilder.getDatabaseMap().getName() );
+ retVal = retrieveByPK(
+ signal_id
+ , atom_id
+ , db);
+ }
+ finally
+ {
+ if (db != null)
+ TurbineDB.releaseConnection(db);
+ }
+ return(retVal);
+ }
+
+ /**
+ * retrieve object using using pk values.
+ *
+ * @param NumberKey signal_id
+ * @param NumberKey atom_id
+ * @param DBConnection dbcon
+ */
+ public static DBSignalDBAtom retrieveByPK(
+ NumberKey signal_id
+ , NumberKey atom_id
+ ,DBConnection dbcon ) throws Exception
+ {
+
+ Criteria criteria = new Criteria(5);
+ criteria.add( SIGNAL_ID, signal_id );
+ criteria.add( ATOM_ID, atom_id );
+ Vector v = doSelect(criteria, dbcon);
+ if ( v.size() != 1)
+ {
+ throw new Exception("Failed to select one and only one row.");
+ }
+ else
+ {
+ return (DBSignalDBAtom) v.firstElement();
+ }
+ }
Index: BaseNmrshiftdbUserPeer.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/BaseNmrshiftdbUserPeer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** BaseNmrshiftdbUserPeer.java 6 Mar 2002 12:34:24 -0000 1.7
--- BaseNmrshiftdbUserPeer.java 6 Mar 2002 16:41:16 -0000 1.8
***************
*** 9,34 ****
import org.apache.turbine.util.*;
import org.apache.turbine.util.db.*;
! import org.apache.turbine.util.db.map.*;
! import org.apache.turbine.util.db.pool.DBConnection;
! import org.apache.turbine.services.db.TurbineDB;
! import org.apache.turbine.util.TurbineException;
!
! // Local classes
! import org.openscience.nmrshiftdb.om.map.*;
!
! /**
! */
! public abstract class BaseNmrshiftdbUserPeer
extends TurbineUserPeerAdapter
! {
!
! /** number of columns for this peer */
! public static final int numColumns = 1;
!
! /** A class that can be returned by this peer. */
protected static final String CLASSNAME_DEFAULT =
! "org.openscience.nmrshiftdb.om.NmrshiftdbUser";
!
! /** A class that can be returned by this peer. */
protected static final Class CLASS_DEFAULT = initClass();
--- 9,34 ----
import org.apache.turbine.util.*;
import org.apache.turbine.util.db.*;
! import org.apache.turbine.util.db.map.*;
! import org.apache.turbine.util.db.pool.DBConnection;
! import org.apache.turbine.services.db.TurbineDB;
! import org.apache.turbine.util.TurbineException;
!
! // Local classes
! import org.openscience.nmrshiftdb.om.map.*;
!
! /**
! */
! public abstract class BaseNmrshiftdbUserPeer
extends TurbineUserPeerAdapter
! {
!
! /** number of columns for this peer */
! public static final int numColumns = 1;
!
! /** A class that can be returned by this peer. */
protected static final String CLASSNAME_DEFAULT =
! "org.openscience.nmrshiftdb.om.NmrshiftdbUser";
!
! /** A class that can be returned by this peer. */
protected static final Class CLASS_DEFAULT = initClass();
|
|
From: Stefan K. <sk...@us...> - 2002-03-06 16:41:23
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map
In directory usw-pr-cvs1:/tmp/cvs-serv11083/java/org/openscience/nmrshiftdb/om/map
Modified Files:
DBBondDBAtomMapBuilder.java DBSignalDBAtomMapBuilder.java
Log Message:
modified om files
Index: DBBondDBAtomMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBBondDBAtomMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBBondDBAtomMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBBondDBAtomMapBuilder.java 6 Mar 2002 16:41:16 -0000 1.4
***************
*** 66,72 ****
! tMap.addForeignKey ( getDBBondDBAtom_BondId(), new Integer(0) , "BOND" , "BOND_ID" );
! tMap.addForeignKey ( getDBBondDBAtom_AtomId(), new Integer(0) , "ATOM" , "ATOM_ID" );
}
--- 66,72 ----
! tMap.addForeignPrimaryKey ( getDBBondDBAtom_BondId(), new Integer(0) , "BOND" , "BOND_ID" );
! tMap.addForeignPrimaryKey ( getDBBondDBAtom_AtomId(), new Integer(0) , "ATOM" , "ATOM_ID" );
}
Index: DBSignalDBAtomMapBuilder.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/om/map/DBSignalDBAtomMapBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DBSignalDBAtomMapBuilder.java 6 Mar 2002 12:34:24 -0000 1.3
--- DBSignalDBAtomMapBuilder.java 6 Mar 2002 16:41:16 -0000 1.4
***************
*** 66,72 ****
! tMap.addForeignKey ( getDBSignalDBAtom_SignalId(), new Integer(0) , "SIGNAL" , "SIGNAL_ID" );
! tMap.addForeignKey ( getDBSignalDBAtom_AtomId(), new Integer(0) , "ATOM" , "ATOM_ID" );
}
--- 66,72 ----
! tMap.addForeignPrimaryKey ( getDBSignalDBAtom_SignalId(), new Integer(0) , "SIGNAL" , "SIGNAL_ID" );
! tMap.addForeignPrimaryKey ( getDBSignalDBAtom_AtomId(), new Integer(0) , "ATOM" , "ATOM_ID" );
}
|
|
From: Stefan K. <sk...@us...> - 2002-03-06 16:41:20
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/html
In directory usw-pr-cvs1:/tmp/cvs-serv11083/html
Modified Files:
searchBySpectrum.html
Log Message:
modified om files
Index: searchBySpectrum.html
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/html/searchBySpectrum.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** searchBySpectrum.html 19 Feb 2002 17:37:57 -0000 1.3
--- searchBySpectrum.html 6 Mar 2002 16:41:15 -0000 1.4
***************
*** 5,9 ****
<style></style>
</head>
! <body><form action="/jetspeed/portal/" method="post"><input type="hidden" name="nmrshiftdbaction" value="searchBySpectrum"><textarea name="spectrum" cols="10" rows="10"></textarea><input type="submit" value="search"><form> </body>
</html>
--- 5,44 ----
<style></style>
</head>
! <body>
! <form action="/jetspeed/portal/" method="post">
! <input type="hidden" name="nmrshiftdbaction" value="searchBySpectrum">
! <textarea name="spectrum" cols="10" rows="10">
! </textarea><input type="submit" value="search">
! <form>
!
! <script LANGUAGE="JavaScript1.1" SRC="/jetspeed/nmrshiftdb/marvin.js"></script>
! <script LANGUAGE="JavaScript1.1">
! <!--
! function exportMol(format) {
! if(document.MSketch != null) {
! var s = document.MSketch.getMol(format);
! s = unix2local(s);
! document.MolForm.MolTxt.value=s;
! } else {
! alert("Cannot import molecule: no JavaScript to Java communication in your browser.");
! }
! }
! function unselectandselect(b){
! document.MView.selectAllAtoms(0,false);
! document.MView.selectAtom(0,b,true);
! }
! msketch_mayscript = true;
! msketch_name = "MSketch";
! msketch_begin("/jetspeed/nmrshiftdb", 100, 300);
!
! msketch_end();
! msview_mayscript = true;
! mview_name = "MView";
! mview_begin("/jetspeed/nmrshiftdb", 300, 300);
! mview_end();
! //-->
! </script>
!
! </body>
</html>
|