Skip to content
Snippets Groups Projects
Commit 5b126575 authored by wirecvs's avatar wirecvs
Browse files

autocommit: prepare branch i18n_OO

--HG--
branch : i18n_OO
parents 6567a128 3394a675
No related branches found
No related tags found
No related merge requests found
Showing
with 22 additions and 338 deletions
......@@ -30,6 +30,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
......@@ -393,7 +394,13 @@ public class InstantMessagingGroupChatController extends BasicController impleme
}
if (muc != null && muc.isJoined()) {
muc.changeAvailabilityStatus("chatOpen", Presence.Mode.available);
try {
muc.changeAvailabilityStatus("chatOpen", Presence.Mode.available);
} catch (IllegalStateException e) {
logWarn("Could not change chat status from" + getIdentity().getName(), e);
showWarning("groupchat.not.available");
}
} else {
addMeToRosterList(anonymousInChatroom ? NICKNAME_ANONYMOUS : getIdentity().getName());
}
......
......@@ -102,8 +102,9 @@ public class ModuleConfiguration implements Serializable {
*/
public Boolean getBooleanEntry(String config_key) {
// boolean are stored either as null (no val yet), "true", or "false" (Strings)
String val = (String) get(config_key);
Object val = get(config_key);
if (val == null) return null;
if( val instanceof Boolean) return (Boolean)val;
Boolean set = val.equals("true")? Boolean.TRUE : Boolean.FALSE;
return set;
}
......
......@@ -308,10 +308,15 @@ public class OLATApiAdapter extends LogDelegator implements ch.ethz.pfplms.scorm
// </OLATCE-289>
}
lmsDataBean.setDataAsMap(cmiData);
odatahandler = new LMSDataHandler(scormManager, lmsDataBean, scormSettingsHandler);
odatahandler.updateCMIData(olatScoId);
return "true";
try {
lmsDataBean.setDataAsMap(cmiData);
odatahandler = new LMSDataHandler(scormManager, lmsDataBean, scormSettingsHandler);
odatahandler.updateCMIData(olatScoId);
return "true";
} catch (Exception e) {
logError("Error during commit", e);
return "false";
}
}
/**
......
......@@ -118,6 +118,9 @@ public class LMSDataHandler {
// next update the model with the results from browser.
// updateClientModel(itemId, cmiStrings);
// update prerequisite table
if(status == null) {
status = SequencerModel.ITEM_NOT_ATTEMPTED;
}
addtoPrereqTable(itemId, status, true);
// If an LMSFinish() was made by the sco then we do not need to update
// anything client side
......
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
*/
package org.olat.portal.macartney;
import java.util.Map;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.portal.AbstractPortlet;
import org.olat.core.gui.control.generic.portal.Portlet;
import org.olat.core.gui.translator.PackageTranslator;
import org.olat.core.util.Util;
/**
* Description:<br>
* Displays the the macartney of the day comic strip
* <P>
* Initial Date: 24.08.2005 <br>
* @author gnaegi
*/
public class MacartneyPortlet extends AbstractPortlet {
private Controller runCtr;
/**
* @see org.olat.gui.control.generic.portal.AbstractPortlet#createInstance(org.olat.core.gui.control.WindowControl, org.olat.core.gui.UserRequest, java.util.Map)
*/
public Portlet createInstance(WindowControl wControl, UserRequest ureq, Map configuration) {
Portlet p = new MacartneyPortlet();
p.setName(this.getName());
p.setConfiguration(configuration);
p.setTranslator(new PackageTranslator(Util.getPackageName(MacartneyPortlet.class), ureq.getLocale()));
return p;
}
/**
* @see org.olat.gui.control.generic.portal.Portlet#getTitle()
*/
public String getTitle() {
return getTranslator().translate("macartney.title");
}
/**
* @see org.olat.gui.control.generic.portal.Portlet#getDescription()
*/
public String getDescription() {
return getTranslator().translate("macartney.description");
}
/**
* @see org.olat.gui.control.generic.portal.Portlet#getInitialRunComponent(org.olat.core.gui.control.WindowControl, org.olat.core.gui.UserRequest)
*/
public Component getInitialRunComponent(WindowControl wControl, UserRequest ureq) {
if(this.runCtr != null) runCtr.dispose();
this.runCtr = new MacartneyPortletRunController(ureq, wControl, getConfiguration());
return this.runCtr.getInitialComponent();
}
/**
* @see org.olat.core.gui.control.Disposable#dispose(boolean)
*/
public void dispose() {
disposeRunComponent();
}
/**
* @see org.olat.gui.control.generic.portal.Portlet#getCssClass()
*/
public String getCssClass() {
return "o_portlet_macartney";
}
/**
* @see org.olat.gui.control.generic.portal.Portlet#disposeRunComponent(boolean)
*/
public void disposeRunComponent() {
if (this.runCtr != null) {
this.runCtr.dispose();
this.runCtr = null;
}
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
*/
package org.olat.portal.macartney;
import java.text.DecimalFormat;
import java.util.Map;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.DefaultController;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.translator.PackageTranslator;
import org.olat.core.gui.translator.Translator;
import org.olat.core.helpers.Settings;
import org.olat.core.util.Util;
import org.olat.core.util.coordinate.CoordinatorManager;
import org.olat.core.util.coordinate.SyncerExecutor;
import org.olat.core.util.resource.OresHelper;
import org.olat.properties.Property;
import org.olat.properties.PropertyManager;
/**
* Description:<br>
* Run view controller of macartney portlet
* <P>
* Initial Date: 11.07.2005 <br>
*
* @author gnaegi
*/
public class MacartneyPortletRunController extends DefaultController {
private static final String VELOCITY_ROOT = Util.getPackageVelocityRoot(MacartneyPortlet.class);
private Translator trans;
private VelocityContainer macartneyVC;
private static final String PROPERTY_NAME = "comicStart";
private static final String PROPERTY_CATEGORY = "macartneyPortal";
private static final int maxEpisodes = 468;
private static final long updateInterval = 86400000; // one day in milliseconds
private static long comicStartDate = 0;
/**
* Constructor
*
* @param ureq
* @param imageBaseUri
*/
//o_clusterOK by:se synchronized on MacartneyPortlet class as olatresourceable
protected MacartneyPortletRunController(UserRequest ureq, WindowControl wControl, Map configuration) {
super(wControl);
this.trans = new PackageTranslator(Util.getPackageName(MacartneyPortlet.class), ureq.getLocale());
this.macartneyVC = new VelocityContainer("macartneyVC", VELOCITY_ROOT + "/macartneyPortlet.html", trans, this);
if (comicStartDate == 0) {
CoordinatorManager.getInstance().getCoordinator().getSyncer().doInSync(
OresHelper.createOLATResourceableType(MacartneyPortletRunController.class.getSimpleName()),
new SyncerExecutor() {
@SuppressWarnings("synthetic-access")
public void execute() {
if (comicStartDate!=0) {
// then we shouldn't have gotten here in the first place, but we were
// racing with another userrequest in the same VM!
// let's quit quickly ;)
return;
}
// load comic start date only once
PropertyManager pm = PropertyManager.getInstance();
Property p = pm.findProperty(null, null, null, PROPERTY_CATEGORY, PROPERTY_NAME);
if (p == null) {
// wow first time ever, save current date
p = pm.createPropertyInstance(null, null, null, PROPERTY_CATEGORY, PROPERTY_NAME, null, null, null, null);
pm.saveProperty(p);
}
comicStartDate = p.getCreationDate().getTime();
}
});
}
// time between comic start and now
long timeDelta = (System.currentTimeMillis() - comicStartDate);
// number of increments since comic start
long incrementNumber = (timeDelta / updateInterval);
// module with max episodes to start over again when finished
// + 1 since comic starts at position 1 and not 0
long imageNumber = (incrementNumber % maxEpisodes) + 1;
// calculate current episode url and push to velocity
DecimalFormat df = new DecimalFormat("0000");
String currentEpisodeImage = "loge_" + df.format(imageNumber) + ".jpg";
final String configuredImageBaseUri = (String) configuration.get("imageBaseUri");
if (configuredImageBaseUri.startsWith("http://") || configuredImageBaseUri.startsWith("https://")) {
// feature: if the configured imageBaseUri contains http: or https: already, don't do
// magic "trying-to-detect-the-correct-protocol-via-olat.properties" but use it right away
this.macartneyVC.contextPut("imageBaseUri", configuredImageBaseUri);
} else {
// otherwise do the old magic
this.macartneyVC.contextPut("imageBaseUri", Settings.getURIScheme() + configuredImageBaseUri);
}
this.macartneyVC.contextPut("currentEpisodeImage", currentEpisodeImage);
setInitialComponent(this.macartneyVC);
}
public void event(UserRequest ureq, Component source, Event event) {
// no events to catch
}
protected void doDispose() {
// nothing to dispose
}
}
<!-- Copyright by Alex Macartney, www.macartney.ch - Thanks Alex for supporting OLAT with you comic -->
<a href="http://www.macartney.ch" target="_blank">
<img src="${imageBaseUri}klein/${currentEpisodeImage}" id="o_macartney" border="0" width="100%" alt="Macartney Comic" />
</a>
<br />
<div id="o_macartney_open" class="b_float_right"></div>
<i><a class="b_link_extern" href="http://www.macartney.ch" target="_blank">$r.translate("macartney.copyright")</a></i>
<script type="text/javascript">
/* <![CDATA[ */
Ext.onReady(function(){
## Add large image version at the top of the page. Uses the Prototype library
new Insertion.Top($('b_page_margins'), "<div id='o_macartney_large' style='display: none;'><img src='${imageBaseUri}gross/${currentEpisodeImage}' border='0' alt='Macartney Comic'/><div id='o_macartney_close'></div></div>");
## Add event handlers to slide large image in and out. Uses the Extjs library
## show image when user has mouse over loop tool
Ext.get('o_macartney_open').hover(
function(){ Ext.get('o_macartney_large').fadeIn(); },
function(){ Ext.get('o_macartney_large').fadeOut(); }
);
## close fallback:
## close when user hovers over close icon
Ext.get('o_macartney_close').on('mouseover', function(e){
Ext.get('o_macartney_large').slideOut();
});
## close when user clicks on large image
Ext.get('o_macartney_large').on('click', function(e){
Ext.get('o_macartney_large').slideOut();
});
});
/* ]]> */
</script>
\ No newline at end of file
#Fri Feb 19 23:40:50 CET 2010
macartney.copyright=macartney.ch \u062D\u0642\u0648\u0642 \u0627\u0644\u062A\u0623\u0644\u064A\u0641 \u0648\u0627\u0644\u0646\u0634\u0631 \u0645\u062D\u0641\u0648\u0638\u0629 \u0644\u0640
macartney.description=\u0643\u0644 \u064A\u0648\u0645 \u0647\u0632\u0644\u064A\u0629 \u062C\u062F\u064A\u062F\u0629 \u0644\u0645\u0627\u0643\u0627\u0631\u062A\u0646\u0649
macartney.title="Die Loge" \:\u0647\u0632\u0644\u064A\u0629 \u0645\u0643\u0627\u0631\u062A\u0646\u0649
#Sun May 24 21:10:48 CEST 2009
macartney.copyright=\u0410\u0432\u0442\u043E\u0440\u0441\u043A\u043E \u043F\u0440\u0430\u0432\u043E\: macartney.ch
macartney.description=\u0414\u043D\u0435\u0432\u043D\u0438\u044F\u0442 \u043A\u043E\u043C\u0438\u043A\u0441 \u043E\u0442 Macartney
macartney.title=Macartney \u043A\u043E\u043C\u0438\u043A\u0441\: "Die Loge"
#Mon Mar 02 09:54:14 CET 2009
macartney.copyright=Copyright by macartney.ch
macartney.description=Denn\u011B comics od Macartneyho
macartney.title=Macartney Comic\: "Die Loge"
#Mon Mar 02 09:54:09 CET 2009
macartney.copyright=Copyright macartney.ch
macartney.description=En daglig Macartney tegneseriestribe
macartney.title=Macartney Comic\: "Die Loge"
#Mon Mar 02 09:54:04 CET 2009
macartney.copyright=Eigentum von macartney.ch
macartney.description=T\u00E4glich ein neuer Macartney Comic
macartney.title=Macartney Comic\: Die Loge
#Mon Mar 02 09:54:16 CET 2009
macartney.copyright=Copyright by macartney.ch
macartney.description=\u039A\u03B1\u03B8\u03B7\u03BC\u03B5\u03C1\u03B9\u03BD\u03CC \u03C3\u03C4\u03B9\u03B3\u03BC\u03C5\u03CC\u03C4\u03C5\u03C0\u03BF \u03BA\u03B1\u03C1\u03C4\u03BF\u03CD\u03BD Macartney
macartney.title=\u039A\u03B1\u03C1\u03C4\u03BF\u03CD\u03BD Macartney \: "Die Loge"
#Mon Mar 02 09:54:18 CET 2009
macartney.copyright=Copyright by macartney.ch
macartney.description=A daily Macartney comic strip
macartney.title=Macartney Comic\: "Die Loge"
#Mon Mar 02 09:54:21 CET 2009
macartney.copyright=Copyright by macartney.ch
macartney.description=Cada d\u00EDa un nuevo comic de Macartney
macartney.title=Macartney Comic\: Die Loge
#Mon Mar 02 09:54:13 CET 2009
macartney.copyright=macartney.ch \u062D\u0642 \u0686\u0627\u067E
macartney.description=\u06CC\u06A9 \u06A9\u0627\u0631\u062A\u0648\u0646 \u06A9\u0645\u062F\u06CC \u0631\u0648\u0632\u0627\u0646\u0647 \u0627\u0632 \u0645\u06A9\u0627\u0631\u062A\u0646\u06CC
macartney.title=Macartney Comic\: "Die Loge"/\u06A9\u0645\u062F\u06CC \u0645\u06A9\u0627\u0631\u062A\u0646\u06CC
#Mon Mar 02 09:54:08 CET 2009
macartney.copyright=Propri\u00E9t\u00E9 de macartney.ch
macartney.description=Tous les jours une nouvelle B.D. de Macartney
macartney.title=B.D. Macartney\: Die Loge
#Mon Mar 02 09:54:10 CET 2009
macartney.copyright=Propriet\u00E0 di macartney.ch
macartney.description=Tutti i giorni una nuova vignetta Macartney
macartney.title=Vignetta Macartney
#Thu Apr 16 22:42:13 CEST 2009
macartney.copyright=macartney.ch\u306E\u8457\u4F5C\u6A29
macartney.description=\u30C7\u30A4\u30EA\u30FCMacartney\u30B3\u30DF\u30C3\u30AF\u30B9\u30C8\u30EA\u30C3\u30D7
macartney.title=Macartney\u30B3\u30DF\u30C3\u30AF\: "Die Loge"
#Mon Mar 02 09:54:02 CET 2009
macartney.copyright=Autoriaus teis\u0117s priklauso macartney.ch
macartney.description=Kasdieninei Macartney komiksai
macartney.title=Macartney Comic\: "Die Loge"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment