[tuxdroid-svn] r5175 - in software_suite_v3/smart-core/smart-server/trunk: data/web_interface/user
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-07-27 14:53:06
|
Author: remi
Date: 2009-07-27 16:52:50 +0200 (Mon, 27 Jul 2009)
New Revision: 5175
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_4.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_5.png
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Added "Online" page.
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css 2009-07-27 14:52:50 UTC (rev 5175)
@@ -76,6 +76,16 @@
overflow: hidden;
}
+div.frame01Bottom2{
+ margin-top:0px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/frame_01_bottom_4.png);
+ background-repeat:no-repeat;
+ height:20px;
+ width:855px;
+ overflow: hidden;
+}
+
div.gadgetsListScrollbox{
height:465px;
width:845px;
@@ -91,6 +101,21 @@
background-image:url(/data/web_interface/user_01/img/frame_01_middle_3.png);
}
+div.gadgetsListScrollbox2{
+ height:465px;
+ width:845px;
+ border-color:black;
+ border-style:solid;
+ border-width:0px;
+ background-color:#DCDADB;
+ overflow-y:auto;
+ overflow-x:hidden;
+ margin-left:5px;
+ margin-right:5px;
+ margin-top:0px;
+ background-image:url(/data/web_interface/user_01/img/frame_01_middle_5.png);
+}
+
div.gadgetsVSpacer{
height:34px;
width:8px;
@@ -127,6 +152,24 @@
font-family:Verdana, Bitstream Vera Sans;
}
+.gadgetsRowName2{
+ width:680px;
+ height:34px;
+ margin-left:0px;
+ margin-top:2px;
+ display:table;
+ float:left;
+ line-height:34px;
+ font-size:12px;
+ color:#000;
+ text-align:left;
+ vertical-align:middle;
+ font-weight:bold;
+ overflow:hidden;
+ text-decoration:none;
+ font-family:Verdana, Bitstream Vera Sans;
+}
+
.gadgetsBtnTitle{
width:56px;
_width:72px;
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_4.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_5.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-27 14:52:50 UTC (rev 5175)
@@ -53,7 +53,16 @@
translationStart = document.getElementById("translationStart").value;
translationStop = document.getElementById("translationStop").value;
translationDelete = document.getElementById("translationDelete").value;
- fillGadgetRows("on_demand");
+ var configureUuid = document.getElementById("configure_uuid").value;
+ if (configureUuid != "NULL")
+ {
+ fillGadgetRows("all_gadgets");
+ clickMe("configureId_" + configureUuid);
+ }
+ else
+ {
+ fillGadgetRows("on_demand");
+ }
updatePlayingGadgetUuid();
}
@@ -519,6 +528,14 @@
<xsl:value-of select="root/language"/>
</xsl:attribute>
</xsl:element>
+ <!-- UUID STORAGE -->
+ <xsl:element name="input">
+ <xsl:attribute name="type">hidden</xsl:attribute>
+ <xsl:attribute name="id">configure_uuid</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="root/uuid"/>
+ </xsl:attribute>
+ </xsl:element>
<!-- SOME TRANSLATIONS FOR JS -->
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-07-27 14:52:50 UTC (rev 5175)
@@ -11,6 +11,8 @@
<script src="/data/web_interface/user_01/js/common.js" type="text/javascript"/>
<script language="javascript">
<![CDATA[
+ var uuid = "NULL";
+
function showContent()
{
var menu = document.getElementById("menu").value;
@@ -28,33 +30,34 @@
if (menu == "livewithtux")
{
menuLeft.className = "menuLeftActivate";
- frameUrl = "/wi_user_01/livewithtux?uuid=NULL";
+ frameUrl = "/wi_user_01/livewithtux?";
}
else if (menu == "gadgets")
{
menuCenter1.className = "menuCenterActivate";
- frameUrl = "/wi_user_01/gadgets?uuid=NULL";
+ frameUrl = "/wi_user_01/gadgets?";
}
else if (menu == "attitunes")
{
menuCenter2.className = "menuCenterActivate";
- frameUrl = "/wi_user_01/attitunes?uuid=NULL";
+ frameUrl = "/wi_user_01/attitunes?";
}
else if (menu == "tools")
{
menuCenter3.className = "menuCenterActivate";
- frameUrl = "/wi_user_01/tools?uuid=NULL";
+ frameUrl = "/wi_user_01/tools?";
}
else if (menu == "online")
{
menuRight.className = "menuRightActivate";
- frameUrl = "/wi_user_01/online?uuid=NULL";
+ frameUrl = "/wi_user_01/online?";
}
else
{
menuLeft.className = "menuLeftActivate";
- frameUrl = "/wi_user_01/page_livewithtux?uuid=NULL";
+ frameUrl = "/wi_user_01/page_livewithtux?";
}
+ frameUrl += "uuid=" + uuid;
frameUrl += "&language=" + document.getElementById('language').value;
frameUrl += "&skin='" + document.getElementById('skin').value + "'";
frameUrl += "&rndParam=" + Math.random();
@@ -67,6 +70,13 @@
document.getElementById("menu").value = menuName;
showContent();
}
+
+ function gotoGadgetsConfigure(thisUuid)
+ {
+ uuid = thisUuid;
+ gotoMenu("gadgets");
+ uuid = "NULL";
+ }
]]>
</script>
</head>
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl 2009-07-27 14:52:50 UTC (rev 5175)
@@ -9,6 +9,7 @@
<html>
<head>
<link href="/data/web_interface/user_01/css/online.css" rel="stylesheet" type="text/css"/>
+ <link href="/data/web_interface/user_01/css/gadgets.css" rel="stylesheet" type="text/css"/>
<!-- CSS HACKS FOR BROWSERS -->
<xsl:choose>
<!-- IE -->
@@ -36,9 +37,234 @@
<script type="text/javascript" src="/data/web_interface/user_01/js/lightbox.js"></script>
<script language="javascript">
<![CDATA[
+ var lastGadgetSymbolicNameInAction = "0";
+ var lastGadgetNameInAction = "0";
+ var lastGadgetIconInAction = "0";
+ var knowedGadgetsDict = null;
+ var knowedGadgetsFilter = "all_gadgets";
+
function initialization()
{
+ fillGadgetRows("all_gadgets");
}
+
+ function fillGadgetRows(filter)
+ {
+ var language = document.getElementById("language").value;
+ var gadgets = requestData("/gadgets_server/get_online_gadgets_data",
+ {
+ 'filter' : filter,
+ 'language' : language
+ });
+ if (gadgets != null)
+ {
+ if (!gadgets.containsKey("data0"))
+ {
+ return;
+ }
+ }
+ else
+ {
+ return;
+ }
+ knowedGadgetsDict = gadgets;
+ var htmlContent = "";
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ symbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ name = gadgets.get("data0").get("gadget_" + i + "_name");
+ icon = gadgets.get("data0").get("gadget_" + i + "_iconFile");
+ isAnUpdate = gadgets.get("data0").get("gadget_" + i + "_isAnUpdate");
+ htmlContent += addGadgetRow(symbolicName, name, icon, isAnUpdate);
+ }
+ document.getElementById("gadgetsListScrollbox").innerHTML = htmlContent;
+ // Set png effet for IE6
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ var iconId = "gadgetsRowIcon_" + gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ setpng(document.getElementById(iconId));
+ }
+ // Show correct filter radio button
+ if (filter == 'all_gadgets')
+ {
+ document.getElementById("gadgetsFilterRadioAll").className = "gadgetsFilterRadio gadgetsFilterRadioActivate";
+ }
+ else
+ {
+ document.getElementById("gadgetsFilterRadioAll").className = "gadgetsFilterRadio gadgetsFilterRadioActivate";
+ }
+ knowedGadgetsFilter = filter;
+ initializeLightbox();
+ // Scroll up
+ var objDiv = document.getElementById("gadgetsListScrollbox");
+ objDiv.scrollTop = 0;
+ }
+
+ function addGadgetRow(symbolicName, name, icon, isAnUpdate)
+ {
+ var htmlContent = "";
+ var iconId = "gadgetsRowIcon_" + symbolicName;
+ htmlContent += '<div class="gadgetsVSpacer" style="width:10px;"></div>';
+ htmlContent += '<div class="gadgetsRowIcon"><img src="' + icon + '" height="34" width="34" id="' + iconId + '"></img></div>';
+ htmlContent += '<div class="gadgetsVSpacer" style="width:10px;"></div>';
+ htmlContent += '<span class="gadgetsRowName2">' + name + '</span>';
+ htmlContent += '<div class="gadgetsVSpacer" style="width:18px;"></div>';
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnHelp" id="helpId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="windowGadgetHelp"></a>';
+ htmlContent += '<div class="gadgetsVSpacer" style="width:8px;"></div>';
+ if (isAnUpdate == "True")
+ {
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDuplicate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmUpdate"></a>';
+ }
+ else
+ {
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDuplicate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmDownload"></a>';
+ }
+ htmlContent += '<div class="frame01Sep2"></div>';
+ return htmlContent;
+ }
+
+ function getGadgetNameFromSymbolicName(symbolicName)
+ {
+ if (knowedGadgetsDict != null)
+ {
+ var gadgets = knowedGadgetsDict;
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ gSymbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ if (gSymbolicName == symbolicName)
+ {
+ return gadgets.get("data0").get("gadget_" + i + "_name");
+ }
+ }
+ }
+ return "";
+ }
+
+ function getGadgetIconFromSymbolicName(symbolicName)
+ {
+ if (knowedGadgetsDict != null)
+ {
+ var gadgets = knowedGadgetsDict;
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ gSymbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ if (gSymbolicName == symbolicName)
+ {
+ return gadgets.get("data0").get("gadget_" + i + "_iconFile");
+ }
+ }
+ }
+ return "";
+ }
+
+ function getGadgetScgFromSymbolicName(symbolicName)
+ {
+ if (knowedGadgetsDict != null)
+ {
+ var gadgets = knowedGadgetsDict;
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ gSymbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ if (gSymbolicName == symbolicName)
+ {
+ return gadgets.get("data0").get("gadget_" + i + "_scgFile");
+ }
+ }
+ }
+ return "";
+ }
+
+ function setLastGadgetInAction(symbolicName)
+ {
+ var idx = symbolicName.indexOf("_", 0) + 1;
+ symbolicName = symbolicName.slice(idx, symbolicName.length);
+ lastGadgetSymbolicNameInAction = symbolicName;
+ lastGadgetNameInAction = getGadgetNameFromSymbolicName(symbolicName);
+ lastGadgetIconInAction = getGadgetIconFromSymbolicName(symbolicName);
+ return true;
+ }
+
+ function updateWindowGadgetHelpContent(symbolicName)
+ {
+ if (!setLastGadgetInAction(symbolicName))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("windowGadgetHelpIcon").src = lastGadgetIconInAction;
+ setpng(document.getElementById("windowGadgetHelpIcon"));
+ document.getElementById("windowGadgetHelpTitle").firstChild.nodeValue = lastGadgetNameInAction;
+ var skin = document.getElementById("skin").value;
+ var language = document.getElementById("language").value;
+ var src = "/wi_user_01/online_gadget_help?symbolic_name=" + lastGadgetSymbolicNameInAction;
+ src += "&language=" + language;
+ src += "&skin=" + skin;
+ src += "&rndParam=" + Math.random();
+ document.getElementById("windowGadgetHelpContentIFrame").src = src;
+ }
+
+ function updatePopupGadgetDownloadContent(symbolicName)
+ {
+ if (!setLastGadgetInAction(symbolicName))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("popup01GadgetDownloadIcon").src = lastGadgetIconInAction;
+ setpng(document.getElementById("popup01GadgetDownloadIcon"));
+ }
+
+ function updatePopupGadgetUpdateContent(symbolicName)
+ {
+ if (!setLastGadgetInAction(symbolicName))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("popup01GadgetUpdateIcon").src = lastGadgetIconInAction;
+ setpng(document.getElementById("popup01GadgetUpdateIcon"));
+ }
+
+ function downloadGadget()
+ {
+ if (lastGadgetSymbolicNameInAction == "0")
+ {
+ return;
+ }
+ var scgFile = getGadgetScgFromSymbolicName(lastGadgetSymbolicNameInAction);
+ var args = {
+ "path" : scgFile
+ }
+ getRequest("/gadgets_server/insert_gadget", args);
+ symbolicName = lastGadgetSymbolicNameInAction;
+ lastGadgetSymbolicNameInAction = "0";
+ var idx = symbolicName.indexOf("_", 0) + 1;
+ symbolicName = symbolicName.slice(idx, symbolicName.length);
+ if (window.top.gotoGadgetsConfigure)
+ {
+ window.top.gotoGadgetsConfigure(symbolicName);
+ }
+ }
+
+ function updateGadget()
+ {
+ if (lastGadgetSymbolicNameInAction == "0")
+ {
+ return;
+ }
+ var scgFile = getGadgetScgFromSymbolicName(lastGadgetSymbolicNameInAction);
+ var args = {
+ "path" : scgFile
+ }
+ getRequest("/gadgets_server/insert_gadget", args);
+ lastGadgetSymbolicNameInAction = "0";
+ fillGadgetRows(knowedGadgetsFilter);
+ setTimeout('clickMe("popupUpdatedShow")', 500);
+ }
]]>
</script>
</head>
@@ -81,11 +307,131 @@
top:0px;">
<!-- NOTIFICATION VIEW -->
<div class="frame01TopSpace">
+ <div class="gadgetsVSpacer" style="width:35px;height:40px;"></div>
+ <xsl:element name="a">
+ <xsl:attribute name="class">gadgetsFilterRadio gadgetsFilterRadioActivate</xsl:attribute>
+ <xsl:attribute name="id">gadgetsFilterRadioAll</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:fillGadgetRows('all_gadgets'); return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/all"/>
+ </xsl:element>
</div>
- <div class="frame01Middle" style="height:495px;">
+ <div class="frame01Middle" style="height:465px;">
+ <div class="gadgetsListScrollbox2" id="gadgetsListScrollbox"></div>
</div>
- <div class="frame01Bottom"></div>
+ <div class="frame01Bottom2"></div>
</div>
+ <!-- POPUP CONFIRM DOWNLOAD -->
+ <div id="popupConfirmDownload" class="popup01Box" onfocus="updatePopupGadgetDownloadContent(arguments[0]);">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <div class="popup01GadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">popup01GadgetDownloadIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+ <xsl:attribute name="height">34</xsl:attribute>
+ <xsl:attribute name="width">34</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="popup01Message"><xsl:value-of select="root/translations/popup_confirm_download_gadget"/></span>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:downloadGadget();return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/yes"/>
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="id">closeLightbox</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/no"/>
+ </xsl:element>
+ </div>
+ <div class="popupFrame01Bottom"></div>
+ </div>
+ <!-- POPUP CONFIRM UPDATE -->
+ <div id="popupConfirmUpdate" class="popup01Box" onfocus="updatePopupGadgetUpdateContent(arguments[0]);">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <div class="popup01GadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">popup01GadgetUpdateIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+ <xsl:attribute name="height">34</xsl:attribute>
+ <xsl:attribute name="width">34</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="popup01Message"><xsl:value-of select="root/translations/popup_confirm_update_gadget"/></span>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:updateGadget();return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/yes"/>
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="id">closeLightbox</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/no"/>
+ </xsl:element>
+ </div>
+ <div class="popupFrame01Bottom"></div>
+ </div>
+ <!-- POPUP GADGET IS UP TO DATE -->
+ <div id="popupGadgetUpToDate" class="popup01Box" onfocus="return true;">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <span class="popup01Message" style="width:409px;text-align:center;"><xsl:value-of select="root/translations/popup_gadget_has_been_updated"/></span>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/close"/>
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="id">popupUpdatedShow</xsl:attribute>
+ <xsl:attribute name="name">lbOn</xsl:attribute>
+ <xsl:attribute name="rel">popupGadgetUpToDate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute>
+ </xsl:element>
+ </div>
+ <div class="popupFrame01Bottom"></div>
+ </div>
+ <!-- WINDOW GADGET HELP -->
+ <div id="windowGadgetHelp" class="window01Box" onfocus="updateWindowGadgetHelpContent(arguments[0]);" style="height:350px; margin-top:65px;">
+ <div class="windowFrame01Top">
+ <div class="windowGadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">windowGadgetHelpIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+ <xsl:attribute name="height">33</xsl:attribute>
+ <xsl:attribute name="width">33</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="windowTitle" id="windowGadgetHelpTitle"> . </span>
+ </div>
+ <div class="windowFrame01Middle" style="height:290px;">
+ <iframe class="windowContentIFrame"
+ id="windowGadgetHelpContentIFrame"
+ name="windowGadgetHelpContentIFrame"
+ frameborder="0"
+ scrolling="no"
+ style="height:240px"
+ src="">
+ </iframe>
+ <div style="display:table;float:left;height:34px;width:370px"></div>
+ <xsl:element name="a">
+ <xsl:attribute name="class">windowBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/close"/>
+ </xsl:element>
+ </div>
+ <div class="windowFrame01Bottom"></div>
+ </div>
</body>
</html>
</xsl:template>
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -301,7 +301,40 @@
# Register the service into the resource
resourceGadgetsServer.addService(TDSServiceGadgetsServerGetGadgetData)
+# ------------------------------------------------------------------------------
+# Declaration of the service "get_online_gadgets_data".
+# ------------------------------------------------------------------------------
+class TDSServiceGadgetsServerGetOnlineGadgetsData(TDSService):
+ def configure(self):
+ self.parametersDict = {
+ 'filter' : 'string',
+ 'language' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "get_online_gadgets_data"
+ self.comment = "Get the data of the online gadgets."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ filter = parameters['filter']
+ language = parameters['language']
+ gadgetsOnlineContainer = resourceGadgetsServer.getGadgetsContainer().getGadgetsOnlineContainer()
+ gadgetsOnlineContainer.update()
+ data = gadgetsOnlineContainer.getData("fr", filter)
+ if data == None:
+ contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
+ else:
+ contentStruct['root']['data'] = data
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceGadgetsServer.addService(TDSServiceGadgetsServerGetOnlineGadgetsData)
+
+
# ------------------------------------------------------------------------------
# Declaration of the service "start_gadget".
# ------------------------------------------------------------------------------
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -3,6 +3,7 @@
# ==============================================================================
from translation.Translation import Translation
+from util.misc import URLTools
# ------------------------------------------------------------------------------
# Declaration of the resource "wi_user_01".
@@ -191,6 +192,7 @@
self.parametersDict = {
'language' : 'string',
'skin' : 'string',
+ 'uuid' : 'string',
}
self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
self.exclusiveExecution = False
@@ -203,10 +205,16 @@
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
language = parameters['language']
skin = parameters['skin']
+ uuid = parameters['uuid']
+ for ugc in resourceUgcServer.getUgcContainer().getUgcs():
+ if ugc.getParentGadget().getDescription().getUuid() == uuid:
+ uuid = ugc.getDescription().getUuid()
+ break
contentStruct['root']['data'] = {}
contentStruct['root']['translations'] = resourceWIUser01.translations.getTranslations(language)
contentStruct['root']['skin'] = skin
contentStruct['root']['language'] = language
+ contentStruct['root']['uuid'] = uuid
self.haveXsl = True
self.xslPath = "/data/web_interface/%s/xsl/gadgets.xsl" % skin
return headersStruct, contentStruct
@@ -441,6 +449,54 @@
resourceWIUser01.addService(TDSServiceWIUser01GadgetHelp)
# ------------------------------------------------------------------------------
+# Declaration of the service "online_gadget_help".
+# ------------------------------------------------------------------------------
+class TDSServiceWIUser01OnlineGadgetHelp(TDSService):
+
+ def configure(self):
+ self.parametersDict = {
+ 'symbolic_name' : 'string',
+ 'language' : 'string',
+ 'skin' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "online_gadget_help"
+ self.comment = "Show the online gadget help."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ symbolicName = parameters['symbolic_name']
+ language = parameters['language']
+ skin = parameters['skin']
+ data = None
+ onlineGadget = resourceGadgetsServer.getGadgetsContainer().getGadgetsOnlineContainer().getOnlineGadgetBySymbolicName(symbolicName)
+ if onlineGadget != None:
+ helpUrl = onlineGadget.getHelpFile(language)
+ helpContent = URLTools.URLDownloadToString(helpUrl)
+ if helpContent != None:
+ data = {
+ 'description' : {
+ 'helpFile' : helpContent,
+ }
+ }
+ if data == None:
+ contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
+ else:
+ contentStruct['root']['data'] = data
+ contentStruct['root']['skin'] = skin
+ contentStruct['root']['language'] = language
+ contentStruct['root']['translations'] = resourceWIUser01.translations.getTranslations(language)
+ self.haveXsl = True
+ self.xslPath = "/data/web_interface/%s/xsl/gadget_help.xsl" % skin
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceWIUser01.addService(TDSServiceWIUser01OnlineGadgetHelp)
+
+# ------------------------------------------------------------------------------
# Declaration of the service "apply_gadget".
# ------------------------------------------------------------------------------
class TDSServiceWIUser01ApplyGadget(TDSService):
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-27 14:52:50 UTC (rev 5175)
@@ -46,6 +46,15 @@
msgid "popup_confirm_delete_gadget"
msgstr ""
+msgid "popup_confirm_download_gadget"
+msgstr ""
+
+msgid "popup_confirm_update_gadget"
+msgstr ""
+
+msgid "popup_gadget_has_been_updated"
+msgstr ""
+
msgid "popup_confirm_delete_attitune"
msgstr ""
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-27 14:52:50 UTC (rev 5175)
@@ -44,10 +44,19 @@
msgstr "This functionality is not yet implemented."
msgid "popup_confirm_delete_gadget"
-msgstr "Delete this gadget ?"
+msgstr "Do you want to delete this gadget ?"
+msgid "popup_confirm_download_gadget"
+msgstr "Do you want to download this gadget ?"
+
+msgid "popup_confirm_update_gadget"
+msgstr "Do you want to update this gadget ?"
+
+msgid "popup_gadget_has_been_updated"
+msgstr "The gadget is now up to date."
+
msgid "popup_confirm_delete_attitune"
-msgstr "Delete this attitune ?"
+msgstr "Do you want to delete this attitune ?"
msgid "yes"
msgstr "Yes"
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-27 14:52:50 UTC (rev 5175)
@@ -44,10 +44,19 @@
msgstr "Cette fonctionnalité n'est pas encore implémentée."
msgid "popup_confirm_delete_gadget"
-msgstr "Supprimer ce gadget ?"
+msgstr "Voulez-vous supprimer ce gadget ?"
+msgid "popup_confirm_download_gadget"
+msgstr "Voulez-vous télécharger ce gadget ?"
+
+msgid "popup_confirm_update_gadget"
+msgstr "Voulez-vous mettre à jour ce gadget ?"
+
+msgid "popup_gadget_has_been_updated"
+msgstr "Le gadget a été mis à jour."
+
msgid "popup_confirm_delete_attitune"
-msgstr "Supprimer cette attitune ?"
+msgstr "Voulez-vous supprimer cette attitune ?"
msgid "yes"
msgstr "Oui"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -121,6 +121,18 @@
return result
# --------------------------------------------------------------------------
+ # Get the target platform.
+ # --------------------------------------------------------------------------
+ def getPlatform(self):
+ """Get the target platform.
+ @return: <all|linux|windows>
+ """
+ if self.__dictionary.has_key('platform'):
+ return self.__dictionary['platform']
+ else:
+ return "all"
+
+ # --------------------------------------------------------------------------
# Get the scg file.
# --------------------------------------------------------------------------
def getScgFile(self):
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -166,6 +166,7 @@
gadgetData['defaultLanguage'] = gadget.getDescription().getDefaultLanguage()
gadgetData['category'] = gadget.getDescription().getCategory()
gadgetData['author'] = gadget.getDescription().getAuthor()
+ gadgetData['platform'] = gadget.getDescription().getPlatform()
gadgetData['name'] = {}
gadgetData['description'] = {}
gadgetData['helpFile'] = {}
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -26,6 +26,7 @@
"""Constructor of the class.
@param gadgetsContainer: Gadgets container object.
"""
+ self.__gadgetsContainer = gadgetsContainer
self.__gadgetsOnline = []
self.__gadgetsCount = 0
self.__mutex = threading.Lock()
@@ -94,6 +95,23 @@
return result
# --------------------------------------------------------------------------
+ # Get an online gadget by it symbolic name.
+ # --------------------------------------------------------------------------
+ def getOnlineGadgetBySymbolicName(self, symbolicName):
+ """Get an online gadget by it symbolic name.
+ @param symbolicName: Symbolic name of the online gadget.
+ @return: The online gadget or None.
+ """
+ self.__mutex.acquire()
+ result = None
+ for onlineGadget in self.__gadgetsOnline:
+ if onlineGadget.getSymbolicName() == symbolicName:
+ result = onlineGadget
+ break
+ self.__mutex.release()
+ return result
+
+ # --------------------------------------------------------------------------
# Get the online gadgets data dictionary.
# --------------------------------------------------------------------------
def getData(self, language, category = "all_gadgets"):
@@ -102,6 +120,27 @@
@param category: Gadget category as filter.
@return: A dictionary.
"""
+ def getSplitedVersion(version):
+ vList = version.split(".")
+ for i, v in enumerate(vList):
+ try:
+ vList[i] = int(v)
+ except:
+ vList[i] = 0
+ if len(vList) < 3:
+ if len(vList) < 2:
+ if len(vList) < 1:
+ vList.append(0)
+ vList.append(0)
+ vList.append(0)
+ return vList
+ def cmpVersionGt(v1, v2):
+ for i in range(3):
+ if v1[i] > v2[i]:
+ return True
+ elif v1[i] < v2[i]:
+ return False
+ return False
result = {}
onlineGadgets = self.getOnlineGadgets()
i = 0
@@ -109,22 +148,50 @@
for onlineGadget in onlineGadgets:
cat = onlineGadget.getCategory()
if not cat.lower() in categories:
- categories.append(cat)
+ categories.append(cat.lower())
+ # Check the category
if category != "all_gadgets":
if cat.lower() != category.lower():
continue
- data = {}
- data['name'] = onlineGadget.getName(language)
- data['symbolicName'] = onlineGadget.getSymbolicName()
- data['description'] = onlineGadget.getDescription(language)
- data['category'] = onlineGadget.getCategory()
- data['defaultLanguage'] = onlineGadget.getDefaultLanguage()
- data['author'] = onlineGadget.getAuthor()
- data['version'] = onlineGadget.getVersion()
- data['helpFile'] = onlineGadget.getHelpFile(language)
- data['iconFile'] = onlineGadget.getIconFile()
- data['scgFile'] = onlineGadget.getScgFile()
- result["gadget_%d" % i] = data
+ # Check the language
+ if not onlineGadget.getDefaultLanguage() in ["all", "English", language]:
+ continue
+ # Check the platform
+ gadgetPlatform = onlineGadget.getPlatform()
+ if gadgetPlatform != "all":
+ if gadgetPlatform == "windows":
+ if os.name != "nt":
+ continue
+ else:
+ if os.name == "nt":
+ continue
+ # Check for gadget already present
+ isAnUpdate = False
+ abort = False
+ splOnlineGadgetVersion = getSplitedVersion(onlineGadget.getVersion())
+ onlineGadgetUuid = onlineGadget.getSymbolicName().replace("gadget_", "")
+ for gadget in self.__gadgetsContainer.getGadgets():
+ if onlineGadgetUuid == gadget.getDescription().getUuid():
+ splGadgetVersion = getSplitedVersion(gadget.getDescription().getVersion())
+ if cmpVersionGt(splOnlineGadgetVersion, splGadgetVersion):
+ isAnUpdate = True
+ else:
+ abort = True
+ break
+ if abort:
+ continue
+ # Fill info to the result dict
+ result["gadget_%d_name" % i] = onlineGadget.getName(language)
+ result["gadget_%d_symbolicName" % i] = onlineGadget.getSymbolicName()
+ result["gadget_%d_description" % i] = onlineGadget.getDescription(language)
+ result["gadget_%d_category" % i] = onlineGadget.getCategory()
+ result["gadget_%d_defaultLanguage" % i] = onlineGadget.getDefaultLanguage()
+ result["gadget_%d_author" % i] = onlineGadget.getAuthor()
+ result["gadget_%d_version" % i] = onlineGadget.getVersion()
+ result["gadget_%d_helpFile" % i] = onlineGadget.getHelpFile(language)
+ result["gadget_%d_iconFile" % i] = onlineGadget.getIconFile()
+ result["gadget_%d_scgFile" % i] = onlineGadget.getScgFile()
+ result["gadget_%d_isAnUpdate" % i] = isAnUpdate
i += 1
result['gadgets_count'] = i
result['categories_count'] = len(categories)
|