From bdad09417260a282a129357905451337579d0a74 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sat, 19 Jun 2010 08:29:08 +0000 Subject: [PATCH] UserList and UserInfo responsehandlers implemented --- Builder/IISMainHandler/build.txt | 2 +- Common/dataobjects/AnonymousUserSettings.cs | 6 + Common/dataobjects/IUserSettings.cs | 4 + Common/dataobjects/User.cs | 17 ++ IISMainHandler/HandlersFactory.cs | 4 + IISMainHandler/IISMainHandler.csproj | 2 + .../handlers/response/UserInfoHandler.cs | 32 +++ .../handlers/response/UserListHandler.cs | 34 +++ static/images/addtobook.gif | Bin 0 -> 228 bytes static/images/graph.gif | Bin 0 -> 882 bytes static/images/heart.gif | Bin 0 -> 355 bytes static/images/sendprivate.gif | Bin 0 -> 262 bytes static/images/sundial.gif | Bin 0 -> 959 bytes static/images/viewposts.gif | Bin 0 -> 204 bytes templates/Full/UserInfo.xslt | 209 ++++++++++++++++++ templates/Full/UserList.xslt | 96 ++++++++ templates/Full/elems/Header.xslt | 2 +- 17 files changed, 406 insertions(+), 2 deletions(-) create mode 100644 IISMainHandler/handlers/response/UserInfoHandler.cs create mode 100644 IISMainHandler/handlers/response/UserListHandler.cs create mode 100644 static/images/addtobook.gif create mode 100644 static/images/graph.gif create mode 100644 static/images/heart.gif create mode 100644 static/images/sendprivate.gif create mode 100644 static/images/sundial.gif create mode 100644 static/images/viewposts.gif create mode 100644 templates/Full/UserInfo.xslt create mode 100644 templates/Full/UserList.xslt diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index e0c1820..8a32cf7 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -244 \ No newline at end of file +250 \ No newline at end of file diff --git a/Common/dataobjects/AnonymousUserSettings.cs b/Common/dataobjects/AnonymousUserSettings.cs index 10aa0b7..346efb1 100644 --- a/Common/dataobjects/AnonymousUserSettings.cs +++ b/Common/dataobjects/AnonymousUserSettings.cs @@ -18,5 +18,11 @@ namespace FLocal.Common.dataobjects { } } + public int usersPerPage { + get { + return 50; + } + } + } } diff --git a/Common/dataobjects/IUserSettings.cs b/Common/dataobjects/IUserSettings.cs index a0b3922..3077401 100644 --- a/Common/dataobjects/IUserSettings.cs +++ b/Common/dataobjects/IUserSettings.cs @@ -14,5 +14,9 @@ namespace FLocal.Common.dataobjects { get; } + int usersPerPage { + get; + } + } } diff --git a/Common/dataobjects/User.cs b/Common/dataobjects/User.cs index 83b636a..e87fdf2 100644 --- a/Common/dataobjects/User.cs +++ b/Common/dataobjects/User.cs @@ -156,5 +156,22 @@ namespace FLocal.Common.dataobjects { ); } + public static IEnumerable getUsers(Diapasone diapasone, UserContext context) { + return User.LoadByIds( + from stringId in Config.instance.mainConnection.LoadIdsByConditions( + User.TableSpec.instance, + new EmptyCondition(), + diapasone, + new JoinSpec[0], + new SortSpec[] { + new SortSpec( + User.TableSpec.instance.getIdSpec(), + true + ), + } + ) select int.Parse(stringId) + ); + } + } } diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index 1d2dca2..8d30371 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -29,6 +29,10 @@ namespace FLocal.IISHandler { return new handlers.response.LoginHandler(); case "migrateaccount": return new handlers.response.MigrateAccountHandler(); + case "users": + return new handlers.response.UserListHandler(); + case "user": + return new handlers.response.UserInfoHandler(); case "static": return new handlers.StaticHandler(context.requestParts); case "do": diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index f42e8e2..7b8a8b4 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -64,9 +64,11 @@ + + diff --git a/IISMainHandler/handlers/response/UserInfoHandler.cs b/IISMainHandler/handlers/response/UserInfoHandler.cs new file mode 100644 index 0000000..a8d0ca3 --- /dev/null +++ b/IISMainHandler/handlers/response/UserInfoHandler.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Xml.Linq; +using FLocal.Common; +using FLocal.Common.dataobjects; +using FLocal.Core; +using FLocal.Core.DB; +using FLocal.Core.DB.conditions; + +namespace FLocal.IISHandler.handlers.response { + + class UserInfoHandler : AbstractGetHandler { + + override protected string templateName { + get { + return "UserInfo.xslt"; + } + } + + override protected XElement[] getSpecificData(WebContext context) { + User user = User.LoadById(int.Parse(context.requestParts[1])); + return new XElement[] { + user.exportToXmlForViewing(context), + }; + } + + } + +} \ No newline at end of file diff --git a/IISMainHandler/handlers/response/UserListHandler.cs b/IISMainHandler/handlers/response/UserListHandler.cs new file mode 100644 index 0000000..c4419b4 --- /dev/null +++ b/IISMainHandler/handlers/response/UserListHandler.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Xml.Linq; +using FLocal.Common; +using FLocal.Common.dataobjects; +using FLocal.Core.DB; + +namespace FLocal.IISHandler.handlers.response { + + class UserListHandler : AbstractGetHandler { + + override protected string templateName { + get { + return "UserList.xslt"; + } + } + + override protected XElement[] getSpecificData(WebContext context) { + PageOuter pageOuter = PageOuter.createFromGet(context.requestParts, context.userSettings.usersPerPage); + IEnumerable users = User.getUsers(pageOuter, context); + return new XElement[] { + new XElement("users", + from user in users select user.exportToXmlForViewing(context), + pageOuter.exportToXml(2, 5, 2) + ) + }; + } + + } + +} \ No newline at end of file diff --git a/static/images/addtobook.gif b/static/images/addtobook.gif new file mode 100644 index 0000000000000000000000000000000000000000..de5e78cc98956c731a603bde47b487eaa5bab4fd GIT binary patch literal 228 zcmZ?wbhEHblwlBJ*v!E29|(T@zi|D+ejwPffBlB_4ebr}74-~YDIkdk6o0a?iZF08 z=zzpQW-zc!H1KrMo>cLyckOfW?UiBQIypN9j<}X)qzgJ)GbTz@e|@0D(0uTVRA|Ij zu|o_3PZ})lK8fJoF{6pemEncboJ(F;x8+!I$E-h)9`bBMl%v%4X=;2Xw^^#^)!&qG zVyn#eEvzeTWbSTe%kgF_;>d7{Zs2U1$!70V=v`Da-B5O_)}qClvnR}&y+W-?%XM9F JnT#NVH2@quRSWBOu42EApP(iQ-2SEot5fsEF6l=?(w4$F<^~6KQgPDWNlg;!XGy4JHi%Dvpm)vcCgQRZbyK%2SqND%6Mp4JBCQ7>qX3Xwj@*sAHZ- zScG~%#uB-QTex~%C`g)zS(w-!C~89!X7|hwry_`Qhx|^Sw_yZ;$Qx@9E*e{nwW^f4tj&<2Pe{BOMvupX2XFYj#dy@?-H{P8;+^OUyeJ!7GYHHfI1eU-P#EhQ z*i2)$@XZh8a%eQr>tQg!XoT4eiv?CIC<-`AI2YH4?*||y4$;-2=PJdv>c<=_2&ln61JbUKbf1>7xxwsh)#55^W!y|X-OOP zr%bjZbEZpI(}y1AY~`N2-J<&^OhT1lpPiy?)TFgf*Q*#gVohd~Sfo`cMvqx?T&qzl l<)f1G3sNB)8@^l~Af-c+>%_|7YJwq~cMt8(V{C!&{{o27jZFXm literal 0 HcmV?d00001 diff --git a/static/images/sendprivate.gif b/static/images/sendprivate.gif new file mode 100644 index 0000000000000000000000000000000000000000..241797d8516fdb4729c7a63bb1b197647513b905 GIT binary patch literal 262 zcmZ?wbhEHblwjazIKsg29|(T_|NrCvzwiG(e*FCY{rms_jnAApvw#2ogS!qM*m+?8 zj{W<#@7ud=@Bf)I*RI~y(LJT1p&>IfGb1A-G1)yV(9g=oN=HkRiHV7kk&yvxAdrLu z#h)y!A`H?DIv^2{oeZqa57hdWteE;@+1eblc`H|LGBLZn;blyP_VQWou9E{bs`Ny? zk{2B4YG%_rX7a>D=xD+&lL&X$)`X1SG0)@sVCP9su7YzrR7+FM( zG7=ITn^^eRStL3Vl9;>1jM;9ySfJd*#vPPYV=?K;Nj46hbysd|dU9lnVkDcy0pkOn zbHqh6WC9jsFwW;n)$&N#l5x6ETv#Wxz`-%NmxCkbidSeOBQs-HmX4=`!&PQRo(fiL qqlJu2EPM<8o|?ws$)0(08xOE^x15n{=Dd z?T;BAOb5+H!`OB=Oe~qwS1?t_Uo_U2b?W3ZONAEno0%+ckkwzfhATVy#q~nVJX14O hwmc>_=C%ecQHQ?P+DWxNjqUAI)n=7TatJb50{~PPNEHA8 literal 0 HcmV?d00001 diff --git a/templates/Full/UserInfo.xslt b/templates/Full/UserInfo.xslt new file mode 100644 index 0000000..c418fd3 --- /dev/null +++ b/templates/Full/UserInfo.xslt @@ -0,0 +1,209 @@ + + + + + + + + +
+ + + + +
+ Ïåðñîíàëüíàÿ èíôîðìàöèÿ î +
+
+ + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Email + + Not implemented + + Picture +
+ Èìÿ + + Not implemented +
+ Òèòóë + + +
+ Èòîãî ñîîáùåíèé + + +
+ Ðåéòèíã + + Not implemented +
+ Äîìàøíÿÿ ñòðàíèöà + + Not implemented +
+ Ðîä çàíÿòèé + + Not implemented +
+ Õîááè + + Not implemented +
+ Ðàñïîëîæåíèå + + +
+ Áèîãðàôèÿ + + +
+ Íîìåð ICQ + + Not implemented +
+ Ïîë (gender) + + Not implemented +
+ Äàòà ðåãèñòðàöèè + + +
+ Ïîñëåäíèé ðàç îíëàéí + + Not implemented +
+ Ïîäïèñü + + +
+ Ñèìïàòèè + + +
+ Penalties + + Not implemented +
+ Êîììåíòàðèé + + Not implemented +
+ + + Ïîñëàòü ëè÷íîå ñîîáùåíèå + + | + + + Èñòîðèÿ + + | + + + Äîáàâèòü â àäðåñíóþ êíèãó + + | + + + Ïîêàçàòü âñå ñîîáùåíèÿ ïîëüçîâàòåëÿ + + | + + + Ñòàòèñòèêà + +
+
+
+
+ +
\ No newline at end of file diff --git a/templates/Full/UserList.xslt b/templates/Full/UserList.xslt new file mode 100644 index 0000000..1e456d6 --- /dev/null +++ b/templates/Full/UserList.xslt @@ -0,0 +1,96 @@ + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + Ïîëüçîâàòåëü + + + + Ñòàòóñ + + + + Äîìàøíÿÿ ñòðàíèöà + + + + Èòîãî ñîîáùåíèé + + + + Íîìåð ICQ + + + + Ðåéòèíã + + + + Äàòà ðåãèñòðàöèè + +
+ + + + +
+ ñòðàíèöû: + + /UserList// + +
+
+
+
+ + + + + + /User// + + + + + Ïîëüçîâàòåëü + + + Not implemented + + + + + + Not implemented + + + Not implemented + + + + + + + +
\ No newline at end of file diff --git a/templates/Full/elems/Header.xslt b/templates/Full/elems/Header.xslt index 845390e..ff5a7a6 100644 --- a/templates/Full/elems/Header.xslt +++ b/templates/Full/elems/Header.xslt @@ -58,7 +58,7 @@ Âûõîä | - Ïîëüçîâàòåëè + Ïîëüçîâàòåëè