[tuxdroid-svn] r5068 - in software_suite_v3/smart-core/smart-server/trunk: . data/web_interface/us
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-07-07 10:49:43
|
Author: remi
Date: 2009-07-07 11:51:33 +0200 (Tue, 07 Jul 2009)
New Revision: 5068
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_3.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_4.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_activate.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_disable.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_enable.png
Modified:
software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/attitunes.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/attitunes.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.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/attitunes/Attitune.py
software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py
Log:
* Updated "attitunes" page.
- Filters not yet implemented
- You need attitunes files in the server attitunes directory or in the user attitunes directory.
Modified: software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -63,6 +63,8 @@
"data", "favicon", "favicon.ico"), "/favicon.ico")
# Load wiky scripts
resourcesManager.addDirectoryToServe("/data/web_interface/common/wiky/")
+ # Commons
+ resourcesManager.addDirectoryToServe("/data/web_interface/common/img/")
# Devel web interface
resourcesManager.addDirectoryToServe("/data/web_interface/devel/xsl/")
resourcesManager.addDirectoryToServe("/data/web_interface/devel/css/")
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/attitunes.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/attitunes.css 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/attitunes.css 2009-07-07 09:51:33 UTC (rev 5068)
@@ -9,9 +9,9 @@
div.frame01TopSpace{
margin-top:15px;
font-family:Verdana, Bitstream Vera Sans;
- background-image:url(/data/web_interface/user_01/img/frame_01_top.png);
+ background-image:url(/data/web_interface/user_01/img/frame_01_top_2.png);
background-repeat:no-repeat;
- height:10px;
+ height:40px;
width:855px;
overflow: hidden;
}
@@ -23,8 +23,19 @@
background-repeat:repeat;
height:1px;
width:855px;
+ overflow: hidden;
}
+div.frame01Middle2{
+ font-family:Verdana, Bitstream Vera Sans;
+ display:table;
+ background-image:url(/data/web_interface/user_01/img/frame_01_middle_2.png);
+ background-repeat:repeat;
+ height:1px;
+ width:855px;
+ overflow: hidden;
+}
+
div.frame01Sep{
font-family:Verdana, Bitstream Vera Sans;
display:table;
@@ -32,19 +43,91 @@
background-repeat:repeat;
height:4px;
width:855px;
+ overflow: hidden;
}
+div.frame01Sep2{
+ font-family:Verdana, Bitstream Vera Sans;
+ display:table;
+ background-image:url(/data/web_interface/user_01/img/frame_01_sep_2.png);
+ background-repeat:repeat;
+ height:2px;
+ width:845px;
+ overflow: hidden;
+}
+
+div.frame01Sep2{
+ margin-top:2px;
+ display:table;
+ background-image:url(/data/web_interface/user_01/img/frame_01_sep_2.png);
+ background-repeat:repeat;
+ height:2px;
+ width:845px;
+ overflow: hidden;
+}
+
div.frame01Bottom{
margin-top:0px;
font-family:Verdana, Bitstream Vera Sans;
- background-image:url(/data/web_interface/user_01/img/frame_01_bottom.png);
+ background-image:url(/data/web_interface/user_01/img/frame_01_bottom_3.png);
background-repeat:no-repeat;
height:20px;
width:855px;
overflow: hidden;
}
-.toolsBtnTitle{
+div.attitunesListScrollbox{
+ 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_4.png);
+}
+
+div.attitunesVSpacer{
+ height:34px;
+ width:8px;
+ margin-left:0px;
+ margin-top:0px;
+ display:table;
+ float:left;
+}
+
+.attitunesRowIcon{
+ height:34px;
+ width:34px;
+ margin-left:0px;
+ margin-top:2px;
+ display:table;
+ float:left;
+}
+
+.attitunesRowName{
+ width:470px;
+ 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;
+}
+
+.attitunesBtnTitle{
width:56px;
_width:72px;
height:34px;
@@ -65,31 +148,121 @@
font-family:Verdana, Bitstream Vera Sans;
}
-.toolsBtnStartEnable{
+.attitunesBtnNoTitle{
+ width:32px;
+ height:34px;
+ margin-left:0px;
+ margin-top:2px;
+ display:table;
+ float:left;
+ overflow:hidden;
+}
+
+.attitunesBtnStartEnable{
width:59px;
_width:72px;
padding-left:13px;
background-image:url(/data/web_interface/user_01/img/gadgets_btn_play_enable.png);
}
-.toolsBtnStartEnable:hover{
+.attitunesBtnStartEnable:hover{
background-image:url(/data/web_interface/user_01/img/gadgets_btn_play_activate.png);
}
-.toolsBtnStartActivate{
+.attitunesBtnStartActivate{
width:59px;
_width:72px;
padding-left:13px;
background-image:url(/data/web_interface/user_01/img/gadgets_btn_play_activate.png);
}
-.toolsBtnStartDisable{
+.attitunesBtnStartDisable{
width:59px;
_width:72px;
padding-left:13px;
background-image:url(/data/web_interface/user_01/img/gadgets_btn_play_disable.png);
}
+.attitunesBtnStopEnable{
+ width:53px;
+ _width:72px;
+ padding-left:19px;
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_stop_enable.png);
+}
+
+.attitunesBtnStopEnable:hover{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_stop_activate.png);
+}
+
+.attitunesBtnStopActivate{
+ width:53px;
+ _width:72px;
+ padding-left:19px;
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_stop_activate.png);
+}
+
+.attitunesBtnStopDisable{
+ width:53px;
+ _width:72px;
+ padding-left:19px;
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_stop_disable.png);
+}
+
+.attitunesBtnEdit{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_edit_enable.png);
+}
+
+.attitunesBtnEdit:hover{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_edit_activate.png);
+}
+
+.attitunesBtnEditDisable{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_edit_disable.png);
+}
+
+.attitunesBtnDelete{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_delete_enable.png);
+}
+
+.attitunesBtnDelete:hover{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_delete_activate.png);
+}
+
+.attitunesBtnDeleteDisable{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_delete_disable.png);
+}
+
+.attitunesFilterRadio{
+ width:85px;
+ height:25px;
+ margin-left:0px;
+ margin-top:9px;
+ padding-top:-1px;
+ line-height:25px;
+ font-size:10px;
+ color:#FFFFFF;
+ text-align:center;
+ vertical-align:middle;
+ font-weight:bold;
+ overflow:hidden;
+ text-decoration:none;
+ display:table;
+ float:left;
+ font-family:Verdana, Bitstream Vera Sans;
+}
+
+.attitunesFilterRadioEnable{
+ background-image:url(/data/web_interface/user_01/img/gadgets_filter_radio_enable.png);
+}
+
+.attitunesFilterRadioEnable:hover{
+ background-image:url(/data/web_interface/user_01/img/gadgets_filter_radio_activate.png);
+}
+
+.attitunesFilterRadioActivate{
+ background-image:url(/data/web_interface/user_01/img/gadgets_filter_radio_activate.png);
+}
+
.leightbox {
color: #333;
display: none;
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_3.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_3.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_4.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_activate.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_activate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_disable.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_disable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_enable.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_edit_enable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/attitunes.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/attitunes.xsl 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/attitunes.xsl 2009-07-07 09:51:33 UTC (rev 5068)
@@ -36,9 +36,312 @@
<script type="text/javascript" src="/data/web_interface/user_01/js/lightbox.js"></script>
<script language="javascript">
<![CDATA[
+ var knowedAttitunesFilter = "all_attitunes";
+ var knowedAttitunesDict = null;
+ var knowedPlayingAttituneName = "0";
+ var lastAttituneNameInAction = "0";
+ var lastAttituneIconInAction = "0";
+ var translationStart = "";
+ var translationStop = ""
+ var translationDelete = "";
+
function initialization()
{
+ translationStart = document.getElementById("translationStart").value;
+ translationStop = document.getElementById("translationStop").value;
+ translationDelete = document.getElementById("translationDelete").value;
+ fillAttituneRows("all_attitunes");
+ updatePlayingAttituneName();
}
+
+ function updatePlayingAttituneName()
+ {
+ var result = requestData("/attitune_manager/get_current_playing_attitune",{});
+ if (result != null)
+ {
+ if (!result.containsKey("name"))
+ {
+ setTimeout("updatePlayingAttituneName()", 500);
+ return;
+ }
+ }
+ else
+ {
+ setTimeout("updatePlayingAttituneName()", 500);
+ return;
+ }
+ var name = result.get("name");
+ if (name != knowedPlayingAttituneName)
+ {
+ knowedPlayingAttituneName = name;
+ if (knowedAttitunesDict != null)
+ {
+ var attitunes = knowedAttitunesDict;
+ var attitunesCount = parseInt(attitunes.get("data0").get("count"));
+ for (i = 0; i < attitunesCount; i++)
+ {
+ name = attitunes.get("data0").get("attitune_" + i + "_name");
+ if (thisAttituneIsPlaying(name))
+ {
+ setStartedAttituneButtons(name);
+ disableEditAttituneButtons(name);
+ }
+ else
+ {
+ if (anAttituneIsPlaying())
+ {
+ disableStartStopAttituneButtons(name);
+ enableEditAttituneButtons(name);
+ }
+ else
+ {
+ enableStartStopAttituneButtons(name);
+ enableEditAttituneButtons(name);
+ }
+ }
+ }
+ }
+ }
+ setTimeout("updatePlayingAttituneName()", 500);
+ }
+
+ function fillAttituneRows(filter)
+ {
+ var attitunes = requestData("/attitune_manager/get_attitunes_data",{'filter' : filter});
+ if (attitunes != null)
+ {
+ if (!attitunes.containsKey("data0"))
+ {
+ return;
+ }
+ else
+ {
+ if (attitunes.get("data0").get("count") == '0')
+ {
+ return;
+ }
+ }
+ }
+ else
+ {
+ return;
+ }
+ knowedAttitunesDict = attitunes;
+ knowedPlayingAttituneName = "0";
+ var htmlContent = "";
+ var attitunesCount = parseInt(attitunes.get("data0").get("count"));
+ for (i = 0; i < attitunesCount; i++)
+ {
+ name = attitunes.get("data0").get("attitune_" + i + "_name");
+ icon = attitunes.get("data0").get("attitune_" + i + "_icon");
+ htmlContent += addAttituneRow(name, icon);
+ }
+ document.getElementById("attitunesListScrollbox").innerHTML = htmlContent;
+ // Set png effet for IE6
+ for (i = 0; i < attitunesCount; i++)
+ {
+ var iconId = "attitunesRowIcon_" + attitunes.get("data0").get("attitune_" + i + "_name");
+ setpng(document.getElementById(iconId));
+ }
+ // Show correct filter radio button
+ if (filter == 'all_attitunes')
+ {
+ document.getElementById("attitunesFilterRadioAll").className = "attitunesFilterRadio attitunesFilterRadioActivate";
+ }
+ knowedAttitunesFilter = filter;
+ initializeLightbox();
+ // Scroll up
+ var objDiv = document.getElementById("attitunesListScrollbox");
+ objDiv.scrollTop = 0;
+ }
+
+ function addAttituneRow(name, icon)
+ {
+ var htmlContent = "";
+ var iconId = "attitunesRowIcon_" + name;
+ htmlContent += '<div class="attitunesVSpacer" style="width:10px;"></div>';
+ htmlContent += '<div class="attitunesRowIcon"><img src="' + icon + '" height="34" width="34" id="' + iconId + '"></img></div>';
+ htmlContent += '<div class="attitunesVSpacer" style="width:10px;"></div>';
+ htmlContent += '<span class="attitunesRowName">' + name + '</span>';
+ htmlContent += '<div class="attitunesVSpacer" style="width:10px;"></div>';
+ htmlContent += '<a class="attitunesBtnTitle attitunesBtnStartEnable" id="startId_' + name + '" onclick="javascript:startAttitune(\''+name+'\');return false;" href="#">' + translationStart + '</a>';
+ htmlContent += '<div class="attitunesVSpacer" style="width:8px;"></div>';
+ htmlContent += '<a class="attitunesBtnTitle attitunesBtnStopEnable" id="stopId_' + name + '" onclick="javascript:stopAttitune(\''+name+'\');return false;" href="#">' + translationStop + '</a>';
+ htmlContent += '<div class="attitunesVSpacer" style="width:18px;"></div>';
+ htmlContent += '<a class="attitunesBtnNoTitle attitunesBtnEdit" id="editId_' + name + '" onclick="javascript:setLastAttituneInAction(\''+name+'\');editAttitune();return false;" href="#"></a>';
+ htmlContent += '<div class="attitunesVSpacer" style="width:18px;"></div>';
+ htmlContent += '<a class="attitunesBtnTitle attitunesBtnDelete" id="deleteId_' + name + '" onclick="" href="#" name="lbOn" rel="popupConfirmDelete">' + translationDelete + '</a>';
+ htmlContent += '<div class="frame01Sep2"></div>';
+ return htmlContent;
+ }
+
+ function getAttituneIconFromName(name)
+ {
+ if (knowedAttitunesDict != null)
+ {
+ var attitunes = knowedAttitunesDict;
+ var attitunesCount = parseInt(attitunes.get("data0").get("count"));
+ for (i = 0; i < attitunesCount; i++)
+ {
+ gName = attitunes.get("data0").get("attitune_" + i + "_name");
+ if (gName == name)
+ {
+ return attitunes.get("data0").get("attitune_" + i + "_icon");
+ }
+ }
+ }
+ return "";
+ }
+
+ function disableAllAttituneButtons(name)
+ {
+ disableStartStopAttituneButtons(name);
+ disableEditAttituneButtons(name);
+ }
+
+ function enableAllAttituneButtons(name)
+ {
+ enableStartStopAttituneButtons(name);
+ enableEditAttituneButtons(name);
+ }
+
+ function disableStartStopAttituneButtons(name)
+ {
+ document.getElementById("startId_" + name).className = "attitunesBtnTitle attitunesBtnStartDisable";
+ document.getElementById("stopId_" + name).className = "attitunesBtnTitle attitunesBtnStopDisable";
+ }
+
+ function enableStartStopAttituneButtons(name)
+ {
+ document.getElementById("startId_" + name).className = "attitunesBtnTitle attitunesBtnStartEnable";
+ document.getElementById("stopId_" + name).className = "attitunesBtnTitle attitunesBtnStopEnable";
+ }
+
+ function setStartedAttituneButtons(name)
+ {
+ document.getElementById("startId_" + name).className = "attitunesBtnTitle attitunesBtnStartActivate";
+ document.getElementById("stopId_" + name).className = "attitunesBtnTitle attitunesBtnStopEnable";
+ }
+
+ function disableEditAttituneButtons(name)
+ {
+ document.getElementById("editId_" + name).className = "attitunesBtnNoTitle attitunesBtnEditDisable";
+ document.getElementById("deleteId_" + name).className = "attitunesBtnTitle attitunesBtnDeleteDisable";
+ }
+
+ function enableEditAttituneButtons(name)
+ {
+ document.getElementById("editId_" + name).className = "attitunesBtnNoTitle attitunesBtnEdit";
+ document.getElementById("deleteId_" + name).className = "attitunesBtnTitle attitunesBtnDelete";
+ }
+
+ function thisAttituneIsPlaying(name)
+ {
+ if (name == knowedPlayingAttituneName)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function anAttituneIsPlaying()
+ {
+ if (knowedPlayingAttituneName != "0")
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function startAttitune(name)
+ {
+ if (anAttituneIsPlaying())
+ {
+ return;
+ }
+ getRequest("/attitune_manager/start_attitune_by_name",
+ {'name' : name, 'begin' : '0.0'});
+ }
+
+ function stopAttitune(name)
+ {
+ if (anAttituneIsPlaying())
+ {
+ if (!thisAttituneIsPlaying(name))
+ {
+ return;
+ }
+ }
+ else
+ {
+ return;
+ }
+ getRequest("/attitune_manager/stop_attitune", {});
+ }
+
+ function setLastAttituneInAction(name)
+ {
+ var idx = name.indexOf("_", 0) + 1;
+ name = name.slice(idx, name.length);
+ if (anAttituneIsPlaying())
+ {
+ if (thisAttituneIsPlaying(name))
+ {
+ lastAttituneNameInAction = "0";
+ lastAttituneIconInAction = "0";
+ return false;
+ }
+ }
+ lastAttituneNameInAction = name;
+ lastAttituneIconInAction = getAttituneIconFromName(name);
+ return true;
+ }
+
+ function updatePopupAttituneDeleteContent(name)
+ {
+ if (!setLastAttituneInAction(name))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("popup01AttituneDeleteIcon").src = lastAttituneIconInAction;
+ setpng(document.getElementById("popup01AttituneDeleteIcon"));
+ }
+
+ function deleteAttitune()
+ {
+ if (lastAttituneNameInAction == "0")
+ {
+ return;
+ }
+ var args = {
+ "name" : lastAttituneNameInAction
+ }
+ getRequest("/attitune_manager/remove_attitune", args);
+ lastAttituneNameInAction = "0";
+ fillAttituneRows(knowedAttitunesFilter);
+ }
+
+ function editAttitune()
+ {
+ if (lastAttituneNameInAction == "0")
+ {
+ return;
+ }
+ var language = document.getElementById("language").value;
+ var args = {
+ "name" : lastAttituneNameInAction,
+ "language" : language
+ }
+ getRequest("/wi_user_01/edit_attitune", args);
+ lastAttituneNameInAction = "0";
+ }
]]>
</script>
</head>
@@ -75,17 +378,62 @@
<xsl:value-of select="root/translations/stop"/>
</xsl:attribute>
</xsl:element>
+ <xsl:element name="input">
+ <xsl:attribute name="type">hidden</xsl:attribute>
+ <xsl:attribute name="id">translationDelete</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="root/translations/delete"/>
+ </xsl:attribute>
+ </xsl:element>
<!-- MAIN DIV FRAME -->
<div style="position:absolute;
left:0px;
top:0px;">
- <!-- NOTIFICATION VIEW -->
+ <!-- FILTER BAR VIEW -->
<div class="frame01TopSpace">
+ <div class="attitunesVSpacer" style="width:35px;height:40px;"></div>
+ <xsl:element name="a">
+ <xsl:attribute name="class">attitunesFilterRadio attitunesFilterRadioActivate</xsl:attribute>
+ <xsl:attribute name="id">attitunesFilterRadioAll</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:fillAttituneRows('all_attitunes'); 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="attitunesListScrollbox" id="attitunesListScrollbox"></div>
</div>
<div class="frame01Bottom"></div>
</div>
+ <!-- POPUP CONFIRM DELETE -->
+ <div id="popupConfirmDelete" class="popup01Box" onfocus="updatePopupAttituneDeleteContent(arguments[0]);">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <div class="popup01GadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">popup01AttituneDeleteIcon</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_delete_attitune"/></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:deleteAttitune();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>
</body>
</html>
</xsl:template>
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -40,6 +40,7 @@
self.__attituneMutex = threading.Lock()
self.__attituneRunMutex = threading.Lock()
self.__attituneRunFlag = False
+ self.__attituneRunName = "0"
# Create a gadgets container
self.__attitunesContainer = AttitunesContainer()
self.__attitunesContainer.setOnDirectoryDeployedCallback(self.__onDirectoryDeployed)
@@ -136,12 +137,27 @@
self.__attituneRunMutex.release()
return isRun
+ def isAttituneRun(self):
+ return self.__isAttituneRun()
+
def __setAttituneRun(self, isRun):
self.__attituneRunMutex.acquire()
self.__attituneRunFlag = isRun
self.__attituneRunMutex.release()
+ def __setAttituneRunName(self, name):
+ self.__attituneRunMutex.acquire()
+ self.__attituneRunName = name
+ self.__attituneRunMutex.release()
+
+ def getAttituneRunName(self):
+ self.__attituneRunMutex.acquire()
+ result = self.__attituneRunName
+ self.__attituneRunMutex.release()
+ return result
+
def __attituneStartingLoop(self, attitune, duration):
+ self.__setAttituneRunName(attitune.getDescription().getName())
self.__setAttituneRun(True)
timeout = int(duration * 10)
self.logger.logInfo("Attitune starting [%s]" % (
@@ -153,6 +169,8 @@
time.sleep(0.1)
if timeout == 0:
break
+ self.__setAttituneRunName("0")
+ self.__setAttituneRun(False)
self.logger.logInfo("Attitune stopped [%s]" % (
attitune.getDescription().getName(),))
self.__publishEvents(True, ST_NAME_AM_ATTITUNE_STOPPED,
@@ -251,6 +269,7 @@
self.__attituneMutex.acquire()
if self.__isAttituneRun():
self.__setAttituneRun(False)
+ self.__setAttituneRunName("0")
resourceTuxOSL.clearAll()
resourceTuxDriver.clearAll()
time.sleep(0.2)
@@ -268,7 +287,7 @@
t = threading.Thread(target = async)
t.start()
return True
-
+
def playAttituneSync(self, name, begin):
"""Play an attitune.
@param name: Attitune name.
@@ -288,6 +307,7 @@
self.__attituneMutex.acquire()
if self.__isAttituneRun():
self.__setAttituneRun(False)
+ self.__setAttituneRunName("0")
resourceTuxOSL.clearAll()
resourceTuxDriver.clearAll()
time.sleep(0.2)
@@ -308,6 +328,7 @@
def async():
self.__attituneMutex.acquire()
self.__setAttituneRun(False)
+ self.__setAttituneRunName("0")
resourceTuxOSL.clearAll()
resourceTuxDriver.clearAll()
time.sleep(0.2)
@@ -315,6 +336,26 @@
t = threading.Thread(target = async)
t.start()
+ def getAttitunesDictAll(self):
+ """
+ """
+ result = {}
+ count = 0
+ attitunes = self.getAttitunesContainer().getAttitunes()
+ namesList = []
+ for attitune in attitunes:
+ if attitune.getObserverName() in ["attitunes", "userAttitunes"]:
+ namesList.append(attitune.getDescription().getName())
+ namesList.sort()
+ for attName in namesList:
+ attitune = self.getAttitunesContainer().getAttitune(attName)
+ result["attitune_%d_name" % count] = attName
+ cat = attitune.getDescription().getCategory().lower()
+ result["attitune_%d_icon" % count] = "/data/web_interface/common/img/att_icon_%s.png" % cat
+ count += 1
+ result['count'] = count
+ return result
+
# Create an instance of the resource
resourceAttituneManager = TDSResourceAttituneManager("resourceAttituneManager")
# Register the resource into the resources manager
@@ -452,3 +493,54 @@
# Register the service into the resource
resourceAttituneManager.addService(TDSServiceAttituneManagerRemoveAttitune)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "get_attitunes_data".
+# ------------------------------------------------------------------------------
+class TDSServiceAttituneManagerGetAttitunesData(TDSService):
+
+ def configure(self):
+ self.parametersDict = {
+ 'filter' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "get_attitunes_data"
+ self.comment = "Get attitunes data."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ filter = parameters['filter']
+ if filter == 'all_attitunes':
+ contentStruct['root']['data'] = resourceAttituneManager.getAttitunesDictAll()
+ else:
+ pass
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceAttituneManager.addService(TDSServiceAttituneManagerGetAttitunesData)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "get_current_playing_attitune".
+# ------------------------------------------------------------------------------
+class TDSServiceAttituneManagerGetCurrentPlayingAttitune(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "get_current_playing_attitune"
+ self.comment = "Get the current playing attitune name."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ name = resourceAttituneManager.getAttituneRunName()
+ contentStruct['root']['name'] = name
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceAttituneManager.addService(TDSServiceAttituneManagerGetCurrentPlayingAttitune)
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -13,6 +13,8 @@
ST_NAME_PS_CONTAINER_ERROR = "plugins_server_container_error"
ST_NAME_PS_PLUGIN_LOADED = "plugins_server_plugin_loaded"
ST_NAME_PS_PLUGIN_UNLOADED = "plugins_server_plugin_unloaded"
+ST_NAME_PS_PLUGIN_STARTED = "plugins_server_plugin_started"
+ST_NAME_PS_PLUGIN_STOPPED = "plugins_server_plugin_stopped"
# Plugins server events/statuses list
SW_NAME_PLUGINS_SERVER = [
@@ -20,6 +22,8 @@
ST_NAME_PS_CONTAINER_ERROR,
ST_NAME_PS_PLUGIN_LOADED,
ST_NAME_PS_PLUGIN_UNLOADED,
+ ST_NAME_PS_PLUGIN_STARTED,
+ ST_NAME_PS_PLUGIN_STOPPED,
]
# ------------------------------------------------------------------------------
@@ -223,6 +227,8 @@
def __onPluginStarting(self, pluginInterpreterContext):
plugin = pluginInterpreterContext.getParentPlugin()
+ self.__publishEvents(False, ST_NAME_PS_PLUGIN_STARTED,
+ [plugin.getDescription().getUuid(),])
self.logger.logInfo("Plugin starting [%s] (%s)" % (
plugin.getDescription().getName(),
str(pluginInterpreterContext.getInstanceParameters())))
@@ -237,6 +243,8 @@
if not command.isNotifier():
resourceRobotContentInteractions.getPguContextsManager().setContextIsComplete(
pluginInterpreterContext)
+ self.__publishEvents(False, ST_NAME_PS_PLUGIN_STOPPED,
+ [plugin.getDescription().getUuid(),])
self.logger.logInfo("Plugin stopped [%s]" % (
plugin.getDescription().getName()))
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -466,7 +466,7 @@
self.__onDemandDictForThumbnailBar["gadget_%.2d_icon" % number] = "/%s/icon.png" % ugc.getParentGadget().getDescription().getUuid()
if rel == 0:
self.__onDemandDictForThumbnailBar["gadget_%.2d_description" % number] = ugc.getParentGadget().getDescription().getDescription(ugc.getContainer().getLanguage())
-
+
fillByIndex(-3, 1)
fillByIndex(-2, 2)
fillByIndex(-1, 3)
@@ -1123,6 +1123,11 @@
self.comment = "Resource to handling the robot/content interactions."
self.fileName = RESOURCE_FILENAME
self.__pguContextsManager = PguContextsManager()
+ # Register callback on plugin started/stopped
+ eventsHandler.getEventHandler(ST_NAME_PS_PLUGIN_STARTED).register(
+ self.__onPluginStarted)
+ eventsHandler.getEventHandler(ST_NAME_PS_PLUGIN_STOPPED).register(
+ self.__onPluginStopped)
# Register callback on RC and robot buttons events
eventsHandler.getEventHandler(ST_NAME_HEAD_BUTTON).register(
self.__onHeadBtEvent)
@@ -1150,6 +1155,16 @@
"""
self.__pguContextsManager.stop()
+ def __onPluginStarted(self, *args):
+ pass
+
+ def __onPluginStopped(self, *args):
+ uuid = args[0]
+ # When Attitune Studio is stopped, we need to observe eventual changes
+ # In the deployed attitune directories.
+ if uuid == "548f7a9a-567d-773e-a0dd-102fe68a1b49":
+ resourceAttituneManager.getAttitunesContainer().check()
+
def __onHeadBtEvent(self, *args):
"""
"""
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-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -455,3 +455,43 @@
# Register the service into the resource
resourceWIUser01.addService(TDSServiceWIUser01ApplyGadget)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "edit_attitune".
+# ------------------------------------------------------------------------------
+class TDSServiceWIUser01EditAttitune(TDSService):
+
+ def configure(self):
+ self.parametersDict = {
+ 'name' : 'string',
+ 'language' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "edit_attitune"
+ self.comment = "Edit an attitune with Attitunes Studio."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ name = parameters['name']
+ language = parameters['language']
+ attitunesContainer = resourceAttituneManager.getAttitunesContainer()
+ attitunes = attitunesContainer.getAttitunes()
+ for attitune in attitunes:
+ if attitune.getDescription().getName() == name:
+ attitunePath = attitune.getAttFile()
+ t = threading.Thread(target = resourcePluginsServer.startPlugin,
+ args = (
+ "548f7a9a-567d-773e-a0dd-102fe68a1b49",
+ "run",
+ {
+ 'path' : attitunePath,
+ 'language' : language,
+ }))
+ t.start()
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceWIUser01.addService(TDSServiceWIUser01EditAttitune)
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-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-07 09:51:33 UTC (rev 5068)
@@ -46,6 +46,9 @@
msgid "popup_confirm_delete_gadget"
msgstr ""
+msgid "popup_confirm_delete_attitune"
+msgstr ""
+
msgid "yes"
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-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-07 09:51:33 UTC (rev 5068)
@@ -44,8 +44,11 @@
msgstr "This functionality is not yet implemented."
msgid "popup_confirm_delete_gadget"
-msgstr "This action will delete this gadget. Continue ?"
+msgstr "Delete this gadget ?"
+msgid "popup_confirm_delete_attitune"
+msgstr "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-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-07 09:51:33 UTC (rev 5068)
@@ -44,8 +44,11 @@
msgstr "Cette fonctionnalité n'est pas encore implémentée."
msgid "popup_confirm_delete_gadget"
-msgstr "Etes-vous sûr de vouloir supprimer ce gadget ?"
+msgstr "Supprimer ce gadget ?"
+msgid "popup_confirm_delete_attitune"
+msgstr "Supprimer cette attitune ?"
+
msgid "yes"
msgstr "Oui"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/attitunes/Attitune.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/attitunes/Attitune.py 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/util/attitunes/Attitune.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -20,12 +20,13 @@
# --------------------------------------------------------------------------
# Constructor of the class.
# --------------------------------------------------------------------------
- def __init__(self, parent, dictionary, attFile, workingPath):
+ def __init__(self, parent, dictionary, attFile, workingPath, observerName):
"""Constructor of the class.
@param parent: Parent Gadgets container.
@param dictionary: Gadget structure as dictionary.
@param attFile: ATT file name of the attitune.
@param workingPath: Working path of the attitune.
+ @param observerName: Observer name.
"""
self.__parent = parent
# Save the dictionary
@@ -34,6 +35,8 @@
self.__workingPath = workingPath
# Save the att file name
self.__attFile = attFile
+ # Save the container name
+ self.__observerName = observerName
# Create descriptor
self.__description = AttituneDescription(self,
dictionary['scene']['header'], self.__workingPath)
@@ -114,6 +117,15 @@
return self.__parent
# --------------------------------------------------------------------------
+ # Get the observer name.
+ # --------------------------------------------------------------------------
+ def getObserverName(self):
+ """Get the observer name.
+ @return: A string.
+ """
+ return self.__observerName
+
+ # --------------------------------------------------------------------------
# Get the attitune description object.
# --------------------------------------------------------------------------
def getDescription(self):
Modified: software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py 2009-07-06 15:01:22 UTC (rev 5067)
+++ software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py 2009-07-07 09:51:33 UTC (rev 5068)
@@ -229,6 +229,32 @@
# ==========================================================================
# --------------------------------------------------------------------------
+ # Generate a single name.
+ # --------------------------------------------------------------------------
+ def generateSingleName(self, attName):
+ """Generate a single name.
+ @param attName: Requested name.
+ @return: A single name in the attitunes container.
+ """
+ def checkNameExists(nameToCheck):
+ result = False
+ for attitune in self.getAttitunes():
+ if attitune.getDescription().getName() == nameToCheck:
+ result = True
+ break
+ return result
+ baseAttName = attName
+ if (baseAttName.find("(") > 0) and (baseAttName.find(")") != -1):
+ baseAttName = baseAttName[:baseAttName.find("(") - 1]
+ if baseAttName == "":
+ baseAttName = "Default"
+ i = 0
+ while checkNameExists(attName):
+ i += 1
+ attName = "%s (%d)" % (baseAttName, i)
+ return attName
+
+ # --------------------------------------------------------------------------
# Build an attitune object from a deployed plugin.
# --------------------------------------------------------------------------
def __buildAttitune(self, observerName, fileName, pluginPath, pluginName):
@@ -244,12 +270,14 @@
# Check for "scene.xml"
sceneXmlFile = os.path.join(pluginPath, pluginName, "scene.xml")
sceneXmlDict = fromXML(sceneXmlFile)
+ sceneXmlDict['scene']['header']['name'] = self.generateSingleName(
+ sceneXmlDict['scene']['header']['name'])
if sceneXmlDict == None:
return None, "'scene.xml' not found"
# Create the attitune
try:
attitune = Attitune(self, sceneXmlDict, fileName,
- os.path.join(pluginPath, pluginName))
+ os.path.join(pluginPath, pluginName), observerName)
except:
return None, "Error in 'scene.xml'"
# Add this attitune to the container
|