<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sebthom.de &#187; IT</title>
	<atom:link href="http://sebthom.de/category/it/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebthom.de</link>
	<description>Selbständiger IT Berater - Java, J2EE, WebSphere Portal, Lotus Domino</description>
	<lastBuildDate>Sun, 20 May 2012 22:59:38 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Bash: Capturing stderr in a variable while still printing to the console.</title>
		<link>http://sebthom.de/158-bash-capturing-stderr-variable/lang/de/</link>
		<comments>http://sebthom.de/158-bash-capturing-stderr-variable/lang/de/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 22:56:53 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[stderr]]></category>
		<category><![CDATA[stdout]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=158</guid>
		<description><![CDATA[     <link rel="alternate" type="application/atom+xml" title="sebthom.de Category: IT" href="http://sebthom.de/category/it/lang/de/feed/" />
     <link rel="alternate" type="application/atom+xml" title="sebthom.de Category: Linux" href="http://sebthom.de/category/it/linux/lang/de/feed/" />
Storing the stdout output of a command in a variable and displaying it is simple: OUTPUT=$(command) echo $OUTPUT If you have longer running commands where you want to display stdout in realtime and also store it in a variable you can tee the output to stderr: OUTPUT=$(command &#124; tee /dev/stderr) OUTPUT=$(command &#124; tee /proc/self/fd/2) OUTPUT=$(command [...]]]></description>
			<content:encoded><![CDATA[<p>Storing the stdout output of a command in a variable and displaying it is simple:</p>
<pre class="perl" name="code">
OUTPUT=$(command)
echo $OUTPUT
</pre>
<p>If you have longer running commands where you want to display stdout in realtime and also store it in a variable you can tee the output to stderr:</p>
<pre class="perl" name="code">
OUTPUT=$(command | tee /dev/stderr)
</pre>
<pre class="perl" name="code">
OUTPUT=$(command | tee /proc/self/fd/2)
</pre>
<pre class="perl" name="code">
OUTPUT=$(command | tee >(cat - >&#038;2))
</pre>
<p>If you have longer running commands where you want to display stdout/stderr in realtime and also store stderr in a variable it gets a bit complicated.<br />
However, this can be achieved by switching stdout and stderr and then teeing the new stdout (which is stderr now) back to stderr for console output.</p>
<pre class="perl" name="code">
ERROR=$(command 3>&#038;1 1>&#038;2 2>&#038;3 | tee /dev/stderr)
</pre>
<pre class="perl" name="code">
ERROR=$(command 3>&#038;1 1>&#038;2 2>&#038;3 | tee /proc/self/fd/2)
</pre>
<pre name="code" class="bash">
ERROR=$(command 3>&#038;1 1>&#038;2 2>&#038;3 | tee >(cat - >&#038;2))
</pre>
<p>Good reading:<br />
<a href="http://mywiki.wooledge.org/BashFAQ/002" rel="nofollow" >Bash FAQ: How can I store the return value/output of a command in a variable?</a></p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=158" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2011. |
<a href="http://sebthom.de/158-bash-capturing-stderr-variable/lang/de/">Permalink</a> |
<a href="http://sebthom.de/158-bash-capturing-stderr-variable/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/158-bash-capturing-stderr-variable/lang/de/&amp;title=Bash: Capturing stderr in a variable while still printing to the console.">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/bash/" rel="nofollow tag">bash</a>, <a href="http://sebthom.de/tag/stderr/" rel="nofollow tag">stderr</a>, <a href="http://sebthom.de/tag/stdout/" rel="nofollow tag">stdout</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/158-bash-capturing-stderr-variable/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring EMF Teneo with Hibernate, Commons DBCP, Spring Hibernate Transaction Manager, and the OpenSessionInViewFilter</title>
		<link>http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/lang/de/</link>
		<comments>http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/lang/de/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 16:26:40 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[dbcp]]></category>
		<category><![CDATA[emf]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[teneo]]></category>
		<category><![CDATA[transaction]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=152</guid>
		<description><![CDATA[While trying to get an application working with]]></description>
			<content:encoded><![CDATA[<p>While trying to get an application working with <a href="http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install" rel="nofollow" EMF Teneo</a>, <a href="http://www.hibernate.org/">Hibernate</a>, <a href="http://commons.apache.org/dbcp/" rel="nofollow" >Commons DBCP</a>, <a href="http://static.springsource.org/spring/docs/current/spring-framework-reference/html/orm.html#orm-hibernate-tx-declarative/" rel="nofollow" >Spring Hibernate Transaction Manager</a> and the <a href="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html" rel="nofollow" >OpenSessionInViewFilter</a> I encountered several unexpected issues. Here is an example of a working configuration for this software stack. Read the comments below the XML file for some explanations.</p>
<p><b>HbDataStoreWithDataSource.java:</b></p>
<pre class="java" name="code">
package de.sebthom.util;

import java.sql.*;
import java.util.Properties;
import javax.sql.DataSource;
import org.eclipse.emf.teneo.PersistenceOptions;
import org.eclipse.emf.teneo.hibernate.HbSessionDataStore;
import org.hibernate.HibernateException;
import org.hibernate.cfg.*;
import org.hibernate.connection.ConnectionProvider;

/**
 * @author Sebastian Thomschke
 */
public class HbDataStoreWithDataSource extends HbSessionDataStore {
  public final static class CustomConnectionProvider implements ConnectionProvider {
    private DataSource ds;

    public void close() throws HibernateException { }

    public void closeConnection(final Connection conn) throws SQLException {
      conn.close();
    }

    public void configure(final Properties props) throws HibernateException {
      ds = _CONFIG_TIME_DS_HOLDER.get();
    }

    public Connection getConnection() throws SQLException {
      return ds.getConnection();
    }

   public boolean supportsAggressiveRelease() {
     return false;
   }
  }

  private static final long serialVersionUID = 1L;
  private static HbDataStoreWithDataSource INSTANCE;

  /**
   * the data source holder acts as a thread safe bridge between the DSConnectionProvider which is instantiated by Hibernate internally
   * and the data source injected into the session factory during spring configuration time.
   */
  private static final ThreadLocal<DataSource> _CONFIG_TIME_DS_HOLDER = new ThreadLocal<DataSource>();

  public static HbDataStoreWithDataSource getInstance() {
		return INSTANCE;
  }

  private final Properties props = new Properties();

  public HbDataStoreWithDataSource() {
    INSTANCE = this;

    props.setProperty(PersistenceOptions.ADD_INDEX_FOR_FOREIGN_KEY, "true");
    props.setProperty(PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "false");
    props.setProperty(PersistenceOptions.FETCH_ASSOCIATION_EXTRA_LAZY, "false");

    // tell Teneo to not change the table names, we do this using Hibernate's ImprovedNamingStrategy
    props.setProperty(PersistenceOptions.SQL_CASE_STRATEGY, "none");
    props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH, "-1");
  }

  protected Configuration createConfiguration() {
    Configuration cfg = super.createConfiguration();
    cfg.setNamingStrategy(ImprovedNamingStrategy.INSTANCE);

    // only if a DS is injected we register our connection provider
    if (_CONFIG_TIME_DS_HOLDER.get() != null)
      cfg.setProperty(Environment.CONNECTION_PROVIDER, CustomConnectionProvider.class.getName());
    return cfg;
  }

  public void setDataSource(final DataSource ds) {
    _CONFIG_TIME_DS_HOLDER.set(ds);
  }

  public final void setHibernateProperties(final Properties hibernateProperties) {
    throw new UnsupportedOperationException();
  }

  public final void setPersistenceProperties(final Properties persistenceOptions) {
    throw new UnsupportedOperationException();
  }

  public void setProperties(final Properties props) {
    this.props.putAll(props);
    super.setProperties(this.props);
  }
}
</pre>
<p><b>web.xml:</b></p>
<pre class="xml" name="code">
<filter>
  <filter-name>openSessionInViewFilter</filter-name>
  <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    <init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
    </init-param>
    <init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>realSessionFactory</param-value>
    </init-param>
</filter>
<filter-mapping>
  <filter-name>openSessionInViewFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>
</pre>
<p><b>applicationContext.xml:</b></p>
<pre class="xml" name="code">
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" default-lazy-init="false">

  <context:property-placeholder location="WEB-INF/application.spring.properties"></context:property-placeholder>

  <bean id="dataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
      <bean class="org.apache.commons.dbcp.BasicDataSource" init-method="createDataSource" destroy-method="close">
<property name="driverClassName">${jdbc.driverClassName}</property>
<property name="url">${jdbc.url}</property>
<property name="username">${jdbc.username}</property>
<property name="password">${jdbc.password}</property>
<property name="defaultAutoCommit">false</property>
<property name="maxActive">${jdbc.maxConnections}</property>
<property name="maxIdle">${jdbc.minConnections}</property>
<property name="maxWait">10000</property>
<property name="initialSize">${jdbc.minConnections}</property>
<property name="validationQuery">${jdbc.validationQuery}</property>
<property name="testOnBorrow">false</property>
<property name="testWhileIdle">true</property>
<property name="timeBetweenEvictionRunsMillis">1200000</property>
<property name="minEvictableIdleTimeMillis">1800000</property>
<property name="numTestsPerEvictionRun">5</property>
      </bean>
    </property>
  </bean>

  <bean id="teneoSessionFactory" class="de.sebthom.util.HbSessionDataStoreWithDataSource" init-method="initialize" p:name="myDataStore" p:dataSource-ref="dataSource">
<property name="properties"><value>
      hibernate.dialect=${hibernate.dialect}
      hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto}
      hibernate.jdbc.batch_size=2000
      hibernate.show_sql=${hibernate.show_sql}
      hibernate.transaction.auto_close_session=false
      hibernate.current_session_context_class=org.springframework.orm.hibernate3.SpringSessionContext
      hibernate.transaction.factory_class=org.springframework.orm.hibernate3.SpringTransactionFactory
    </value></property>
<property name="EPackageClasses">
<list><value>com.acme.ShopPackageImpl</value></list></property>
  </bean>

  <bean id="realSessionFactory" factory-bean="teneoSessionFactory" factory-method="getSessionFactory"></bean>

  <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" p:sessionFactory-ref="realSessionFactory" p:nestedTransactionAllowed="true" p:earlyFlushBeforeCommit="true"></bean>

  <tx:annotation-driven transaction-manager="transactionManager"></tx:annotation-driven>

</beans>
</pre>
<p><b>Comments:</b></p>
<ol>
<li><b>VERY IMPORTANT:</b>The <b>HibernateTransactionManager</b> does NOT get the teneoSessionFactory(HbSessionDataStore) object passed in as sessionFactory, but the underlying Hibernate SessionFactory that can be retrieved from the HbSessionDataStore via the getSessionFactory() method. Not doing so will result in duplicate Hibernate Sessions completely breaking the transaction managment. This happens because in that case the TransactionSynchronizationManager will sometimes internally bind the hibernate session to the current thread based on different keys and thus does not find it again. Here are some stacktraces showing the problem:
<pre>
TransactionSynchronizationManager.bindResource(Object, Object) line: 170
at OpenSessionInViewFilter.doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) line: 183
=> results in TransactionSynchronizationManager.bindResource(<b>HbSessionDataStore</b>, SessionHolder) => as key the <b>Teneo SessionFactory</b> is used

TransactionSynchronizationManager.bindResource(Object, Object) line: 170
at SessionFactoryUtils.doGetSession(SessionFactory, Interceptor, SQLExceptionTranslator, boolean) line: 339
at SessionFactoryUtils.doGetSession(SessionFactory, boolean) line: 256
at SpringSessionContext.currentSession() line: 60
at SessionFactoryImpl.getCurrentSession() line: 700
at HbSessionDataStore(HbBaseSessionDataStore).getCurrentSession() line: 161
=> results in TransactionSynchronizationManager.bindResource(<b>SessionFactoryImpl</b>, SessionHolder) => as key the <b>Hibernate SessionFactory</b> is used

TransactionSynchronizationManager.bindResource(Object, Object) line: 170
at HibernateTransactionManager.doBegin(Object, TransactionDefinition) line: 577
at HibernateTransactionManager(AbstractPlatformTransactionManager).getTransaction(TransactionDefinition) line: 371
at TransactionInterceptor(TransactionAspectSupport).createTransactionIfNecessary(PlatformTransactionManager, TransactionAttribute, String) line: 316
at TransactionInterceptor.invoke(MethodInvocation) line: 105
at ReflectiveMethodInvocation.proceed() line: 172
=> results in TransactionSynchronizationManager.bindResource(<b>HbSessionDataStore</b>, SessionHolder) => as key the <b>Teneo SessionFactory</b> is used
</pre>
<li><b>defaultAutoCommit</b> is set to <b>false</b> to ensure that Spring has full control over the transaction and that the connection pool is not committing statements automatically based on it&#8217;s own strategies.
<li>The example uses an extended version of the <b>org.eclipse.emf.teneo.hibernate.HbSessionDataStore</b> class that allows the usage of a DataSource object and that configures Teneo to not alter the table, column names but let&#8217;s Hibernate handle this via its ImprovedNamingStrategy.
<li><b>hibernate.transaction.auto_close_session</b> is set to <b>false</b> to avoid &#8220;SessionException: Session is closed!&#8221; in conjunction with the OpenSessionInViewListener.
<li><b>hibernate.current_session_context_class</b> and <b>hibernate.transaction.factory_class</b> are set to special Spring implementations to avoid &#8220;org.hibernate.HibernateException: No CurrentSessionContext configured!&#8221; when not using Spring Hibernate Template via HibernateDAOSupport. It is not recommended to use the Hibernate Template anymore, see <a href="http://blog.springsource.com/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/" rel="nofollow" >http://blog.springsource.com/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/</a>
</ol>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=152" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/lang/de/">Permalink</a> |
<a href="http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/lang/de/&amp;title=Configuring EMF Teneo with Hibernate, Commons DBCP, Spring Hibernate Transaction Manager, and the OpenSessionInViewFilter">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/dbcp/" rel="nofollow tag">dbcp</a>, <a href="http://sebthom.de/tag/emf/" rel="nofollow tag">emf</a>, <a href="http://sebthom.de/tag/hibernate/" rel="nofollow tag">hibernate</a>, <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/persistence/" rel="nofollow tag">persistence</a>, <a href="http://sebthom.de/tag/spring/" rel="nofollow tag">spring</a>, <a href="http://sebthom.de/tag/teneo/" rel="nofollow tag">teneo</a>, <a href="http://sebthom.de/tag/transaction/" rel="nofollow tag">transaction</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using EMF ECore model objects with Wicket components</title>
		<link>http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/lang/de/</link>
		<comments>http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/lang/de/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 19:56:26 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ecore]]></category>
		<category><![CDATA[emf]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=146&#038;langswitch_lang=de</guid>
		<description><![CDATA[Apache Wicket uses so called model objects to bind data objects to Wicket components. The framework provides a number of model implementations to access data objects and their properties in various ways. The PropertyModel implementation for example is used to access and set the value of a Java object using reflection. EPropertyModel If you are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wicket.apache.org" rel="nofollow" target="_blank" >Apache Wicket</a> uses so called <a href="https://cwiki.apache.org/WICKET/working-with-wicket-models.html" rel="nofollow"  target="_blank">model objects</a> to bind data objects to Wicket components. The framework provides a number of model implementations to access data objects and their properties in various ways. The <a href="https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-PropertyModels" rel="nofollow"  target="_blank">PropertyModel</a> implementation for example is used to access and set the value of a Java object using reflection.</p>
<h3>EPropertyModel</h3>
<p>If you are working with <a href="http://www.eclipse.org/modeling/emf/" rel="nofollow" target="_blank" >EMF (Eclipse Modeling Framework)</a> generated model classes you can also use PropertyModels to bind structural features (properties in EMF terminology) of an EObject to a Wicket component. E.g. if your EObject has an attribute called &#8220;comment&#8221; you could instantiate a model like this</p>
<pre class="java" name="code">IModel model = new PropertyModel(myEObject, "comment");
</pre>
<p>This approach has several disadvantages. First, the name of the attribute is declared as a String and not as a compile-time reference to the actual attribute. This means the application could break during runtime if you have renamed the attribute at one point and forgot to also change the String value. Second, this property model uses runtime reflection which is a slow alternative to compile time based access.<br />
Java classes generated from EMF Models by default extend the <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.4.3/org/eclipse/emf/ecore/EObject.html" rel="nofollow"  target="_blank">EObject</a> class which provides a compile-time reflection API. Using the generic eGet and eSet methods any public property of the EObject can be accessed. The EMF Generator also generates a Package class for each EMF package that holds a Literals interface listing all available attributes and references of all generated EClasses of the given package. If you lets say have an EClass &#8220;Ticket&#8221; with the attribute &#8220;comment&#8221; in the package &#8220;com.acme.service&#8221; you could utilize the compile time reflection API as follows:</p>
<pre class="java" name="code">EAttribute commentAttribute = com.acme.service.ServicePackage.Literals.TICKET__COMMENT;
Ticket newTicket = com.acme.service.ServiceFactory.eINSTANCE.create(Ticket.class);
newTicket.eSet(commentAttribute, "my comment");
</pre>
<p>Using the EMF compile-time reflection API I created a generic EMF ECore Feature Model implementation that leverages the compile-time references to structural features. Most of the code is actually related to working around the fact that EAttributes and EReferences are not serializable but which they should to be part safely referenced in a model that potentially is serialized by Wicket between requests.</p>
<pre class="java" name="code">import org.apache.wicket.model.IDetachable;
import org.apache.wicket.model.IObjectClassAwareModel;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;

/**
 * A property model to bind an attribute of an EMF ECore object
 *
 * @author Sebastian Thomschke
 */
@SuppressWarnings("unchecked")
public class EFeatureModel&lt;T&gt; implements IObjectClassAwareModel&lt;T&gt;
{
	private static final long serialVersionUID = 1L;

	private transient EStructuralFeature feat;
	private String featContainerClassName;
	private String featName;
	private String featPackageNsURI;

	private EObject target;

	public EFeatureModel(EObject target, EStructuralFeature efeature)
	{
		this.target = target;
		this.feat = efeature;
		this.featName = efeature.getName();
		this.featContainerClassName = efeature.getContainerClass().getName();
		this.featPackageNsURI = ((EPackage) efeature.eContainer().eContainer()).getNsURI();
	}

	public void detach()
	{
		if (target instanceof IDetachable) ((IDetachable) target).detach();
	}

	public EStructuralFeature getFeature()
	{
		if (feat == null)
		{
			EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(featPackageNsURI);
			for (Object eClassifierItem : ePackage.getEClassifiers())
			{
				EClassifier eClassifier = (EClassifier) eClassifierItem;
				if (eClassifier.getInstanceClass().getName().equals(featContainerClassName))
					feat = ((EClass) eClassifier).getEStructuralFeature(featName);
			}
		}
		return feat;
	}

	public T getObject()
	{
		return (T) target.eGet(getFeature());
	}

	public Class&lt;T&gt; getObjectClass()
	{
		return getFeature().getEType().getInstanceClass();
	}

	public void setObject(T object)
	{
		// do nothing if the object is the same instance that is returned by the getter
		// this is esp. important for collection properties
		if (target.eGet(getFeature()) == object) return;

		target.eSet(getFeature(), object);
	}

	@Override
	public String toString()
	{
		return new StringBuilder("Model:classname=[").append(getClass().getName()).append("]").append(":target=[")
				.append(target).append("]").toString();
	}
}</pre>
<p>Using this new model implementation is as simple as using the PropertyModel provided by Wicket:</p>
<pre class="java" name="code">IModel model = new EFeatureModel(myTicket, com.acme.service.ServicePackage.Literals.TICKET__COMMENT);
</pre>
<p>You can now fully enjoy the compile-time safeness of your EMF model.</p>
<h3>Making EObjects serializable</h3>
<p>Wicket usually serializes components and their associated models between HTTP requests. If you are using the provided EPropertyModel your EObject classes must implement the Serializable interface. To achieve this, simply extend the EObject interface with the Serializables interface and set &#8220;Root Extends Interface&#8221; property in your genmodel configuration to this interface.</p>
<pre class="java" name="code">
/**
 * @author Sebastian Thomschke
 */
public interface SerializableEObject extends EObject, Serializable {
}
</pre>
<p>When you now regenerate the model classes they will extend the SerializableEObject interface and Wicket will stop complaining about objects in the model being not serializable.</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=146" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/lang/de/">Permalink</a> |
<a href="http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/lang/de/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/lang/de/&amp;title=Using EMF ECore model objects with Wicket components">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/eclipse/" rel="nofollow tag">eclipse</a>, <a href="http://sebthom.de/tag/ecore/" rel="nofollow tag">ecore</a>, <a href="http://sebthom.de/tag/emf/" rel="nofollow tag">emf</a>, <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/reflection/" rel="nofollow tag">reflection</a>, <a href="http://sebthom.de/tag/wicket/" rel="nofollow tag">wicket</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/feed/lang/de/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Tomcat 6 on Debian Squeeze</title>
		<link>http://sebthom.de/142-installing-tomcat-6-debian-squeeze/lang/de/</link>
		<comments>http://sebthom.de/142-installing-tomcat-6-debian-squeeze/lang/de/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 16:07:35 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[port 80]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[quercus]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[vhost]]></category>
		<category><![CDATA[virtual servers]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=142</guid>
		<description><![CDATA[This post describes how to setup Tomcat 6 on Debian Squeeze. The configured Tomcat serves requests on port 80 without the need of an additional web server. This is especially good for virtual servers (VPS) providing limit memory. It also has multiple virtual hosts configured, each with it&#8217;s own webapp with context root / and [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes how to setup Tomcat 6 on Debian Squeeze. The configured Tomcat serves requests on port 80 without the need of an additional web server. This is especially good for virtual servers (VPS) providing limit memory. It also has multiple virtual hosts configured, each with it&#8217;s own webapp with context root / and optional support for PHP via the Quercus PHP implementation.</p>
<h3>Installing Sun Java 6</h3>
<p>Ensure the non-free section is enabled for the APT repository configuration in /etc/apt/sources.list, e.g. &#8220;deb http://ftp.de.debian.org/debian testing main contrib non-free&#8221;</p>
<pre name="code" class="php">
apt-get update
apt-get install sun-java6-jdk
echo 'JAVA_HOME="/usr/lib/jvm/java-6-sun"' >> /etc/environment
echo 'JRE_HOME="/usr/lib/jvm/java-6-sun/jre"' >> /etc/environment
</pre>
<h3>Installing Tomcat 6</h3>
<pre  name="code" class="php">
apt-get install tomcat6 tomcat6-admin
/etc/init.d/tomcat6 stop
</pre>
<h3>Creating standard Tomcat directory layout</h3>
<pre name="code" class="php">
mkdir /opt/tomcat
cd /opt/tomcat
ln -s /etc/tomcat6/ conf
ln -s /usr/share/tomcat6/bin/ bin
ln -s /usr/share/tomcat6/lib/ lib
ln -s /var/lib/tomcat6/webapps webapps
ln -s /var/log/tomcat6/ logs
</pre>
<h3>Creating a Tomcat admin user</h3>
<p>In /opt/tomcat/conf/tomcat-users.xml add an entry like:</p>
<pre name="code" class="xml">
&lt;user name="ADMIN_USERNAME" password="ADMIN_PASSWORD" roles="admin,manager" /&gt;
</pre>
<h3>Setting up virtual hosts</h3>
<p>For each virtual host execute the following command. Replace &#8220;mydomain.com&#8221; with the desired virtual host name, but omit the &#8220;www.&#8221; part.</p>
<pre name="code" class="php">
mkdir -p /opt/tomcat/webapps.mydomain.com/ROOT
</pre>
<p>In the &lt;Engine&gt; tag of &#8220;/opt/tomcat/conf/server.xml&#8221; add one host entry for each virtual host.</p>
<pre name="code" class="xml">
&lt;Host name="mydomain.com" appBase="/opt/tomcat/webapps.mydomain.com"&gt;
    &lt;Alias&gt;www.mydomain.com&gt;/Alias&gt;
    &lt;Valve className="org.apache.catalina.valves.AccessLogValve" prefix="mydomain_access_log." suffix=".txt" pattern="common"/&gt;
&lt;/Host&gt;
</pre>
<p>The &lt;Alias&gt; tag tells Tomcat to redirect from www.mydomain.com to mydomain.com.<br />
The &lt;Valve&gt; tag enables access logging in the standard logging format.</p>
<h3>Using xinetd to configure port 80 for Tomcat</h3>
<p>Binding a service on port 80 requires root permissions. Thus we use port forwarding to &#8220;bind&#8221; Tomcat to port 80. My VPS does not support the use of &#8220;iptables -j REDIRECT&#8221; therefore I am using xinetd as a web proxy.<br />
Ensure that no other service is listening on port 80/443:</p>
<pre name="code" class="php">
netstat -pan | grep ":80\|:443"
</pre>
<p>Register the required xinetd services:</p>
<pre name="code" class="php">
echo echo "
service www
{
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
        bind            = 88.80.198.181
        port            = 80
        redirect        = localhost 8080
        disable         = no
        flags           = REUSE
        log_type        = FILE /var/log/wwwaccess.log
        log_on_success  -= PID HOST DURATION EXIT

        per_source      = UNLIMITED
        instances       = UNLIMITED
}

service https
{
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
        bind            = 88.80.198.181
        port            = 443
        redirect        = localhost 8443
        disable         = no
        flags           = REUSE
        log_type        = FILE /var/log/httpsaccess.log
        log_on_success  -= PID HOST DURATION EXIT

        per_source      = UNLIMITED
        instances       = UNLIMITED
}
" > /etc/init.d/tomcat
/etc/init.d/xinetd restart
</pre>
<p>If you want to use a different service name, e.g. &#8220;tomcat&#8221; instead of &#8220;www&#8221; you must add this service to /var/services, e.g. &#8220;tomcat 80/tcp&#8221;<br />
In /opt/tomcat/conf/server.xml modify the &lt;Connector&gt; as follows:</p>
<pre name="code" class="xml">
&lt;Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" proxyPort="80" address="127.0.0.1" /&gt;
</pre>
<p>This binds Tomcat to localhost. It also tells Tomcat that port 80 is the proxy port which is necessary for correct URL generation.<br />
From now on the Tomcat admin applications are only accessible via localhost. You can use SSH port forwarding to still access the applications from your workstation&#8217;s web browser. E.g. if you are using <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" rel="nofollow" >PuTTY</a> you can use this command line option &#8220;-L 8080:localhost:8080&#8243; to forward the server&#8217;s local 8080 port to your workstation&#8217;s local 8080 port. On your workstation&#8217;s browser you then simply enter <a href="http://localhost:8080/manager/html" rel="nofollow" >http://localhost:8080/manager/html</a> and are connected to the server&#8217;s Tomcat admin application.</p>
<h3>Enabling PHP support (optional)</h3>
<p>Download <a href="http://quercus.caucho.com/" rel="nofollow" >Quercus</a>.</p>
<pre name="code" class="php">
mkdir -p /opt/downloads
wget -o /opt/downloads/quercus-4.0.3.war http://caucho.com/download/quercus-4.0.3.war
</pre>
<p>Install Quercus as a shared library.</p>
<pre name="code" class="php">
unzip -j /opt/downloads/quercus-4.0.3.war \*.jar -d /opt/tomcat/lib
</pre>
<p>Enable PHP support for the virtual hosts by installing the quercus web.xml. For each virtual host execute:</p>
<pre name="code" class="php">
unzip /opt/downloads/quercus-4.0.3.war *web.xml -d /opt/tomcat/webapps.mydomain.com/ROOT
</pre>
<h3>Starting Tomcat</h3>
<pre name="code" class="php">
/etc/init.d/tomcat start
</pre>
<h3>References</h3>
<ul>
<li><a href="http://www.ibm.com/developerworks/java/library/l-secjav.html#h5" rel="nofollow" >Securing Linux for Java services: The port dilemma</a>
<li><a href="http://ruleoftech.com/journal/redirecting-http-and-https-traffic-to-tomcats-ports" rel="nofollow" >Redirect HTTP and HTTPS traffic to Tomcat&#8217;s ports</a>
<li><a href="http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html" rel="nofollow" >Tomcat 6: Virtual Hosting How To</a>
<li><a href="http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html" rel="nofollow" >Tomcat 6: Classloader How To</a>
<li><a href="http://www.ex-parrot.com/pete/tomcat-vhost.html" rel="nofollow" >Virtual Hosting with Tomcat</a>
<li><a href="http://wiki.caucho.com/Quercus:_Tomcat" rel="nofollow" >Quercus: Tomcat</a>
<li><a href="http://www.ubuntugeek.com/how-to-install-tomcat-6-on-ubuntu-9-04-jaunty.html" rel="nofollow" >How to install Tomcat 6 on Ubuntu 9.04 (Jaunty)</a>
</ul>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=142" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/142-installing-tomcat-6-debian-squeeze/lang/de/">Permalink</a> |
<a href="http://sebthom.de/142-installing-tomcat-6-debian-squeeze/lang/de/#comments">8 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/142-installing-tomcat-6-debian-squeeze/lang/de/&amp;title=Installing Tomcat 6 on Debian Squeeze">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/port-80/" rel="nofollow tag">port 80</a>, <a href="http://sebthom.de/tag/port-forwarding/" rel="nofollow tag">port forwarding</a>, <a href="http://sebthom.de/tag/quercus/" rel="nofollow tag">quercus</a>, <a href="http://sebthom.de/tag/tomcat/" rel="nofollow tag">tomcat</a>, <a href="http://sebthom.de/tag/vhost/" rel="nofollow tag">vhost</a>, <a href="http://sebthom.de/tag/virtual-servers/" rel="nofollow tag">virtual servers</a>, <a href="http://sebthom.de/tag/vps/" rel="nofollow tag">VPS</a>, <a href="http://sebthom.de/tag/xinetd/" rel="nofollow tag">xinetd</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/142-installing-tomcat-6-debian-squeeze/feed/lang/de/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Leveraging PyDev&#8217;s auto completion for indirectly created objects</title>
		<link>http://sebthom.de/140-leveraging-pydevs-auto-completion-indirectly-created-objects/lang/de/</link>
		<comments>http://sebthom.de/140-leveraging-pydevs-auto-completion-indirectly-created-objects/lang/de/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 23:29:00 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Jython]]></category>
		<category><![CDATA[pydev]]></category>
		<category><![CDATA[pydoc]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rtype]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=140</guid>
		<description><![CDATA[This is just a quick tip how to enable auto completion in PyDev for indirectly created objects. By default, PyDev has no problems in presenting you the possible object attributes and methods on a variable if that variable gets a new object instance assigned directly in the code. For example, when you first type &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick tip how to enable auto completion in <a href="http://pydev.org" rel="nofollow" >PyDev</a> for indirectly created objects. </p>
<p>By default, PyDev has no problems in presenting you the possible object attributes and methods on a variable if that variable gets a new object instance assigned directly in the code. </p>
<p>For example, when you first type &#8230;</p>
<pre name="code" class="python">mybook = Book()</pre>
<p>&#8230; and in the next line you enter &#8230;</p>
<pre name="code" class="python">mybook.</pre>
<p>&#8230; PyDev will dutifully present you the statically declared features for the Book class in a popup.</p>
<p>If you however get that Book instance as the result of another method, e.g. &#8230;</p>
<pre name="code" class="python">mybook = bookstore.findBook("foobar")</pre>
<p>&#8230; PyDev currently seems to be helpless. </p>
<p>Because of Python&#8217;s dynamic nature it is of course a bit harder for an IDE to figure out what kind of objects may a method. But PyDev could for example honor the @return / @rtype <a href="http://epydoc.sourceforge.net/manual-epytext.html" rel="nofollow" >PyDoc</a> annotations (which you can add to the findBook&#8217;s method declaration) but currently it just does not.</p>
<p>To still have autocompletion you have two options:</p>
<ol>
<li> Temporarily instantiate a Book object in the code.
<pre name="code" class="python">
mybook = Book()
mybook = bookstore.findBook("foobar")
mybook. #--> now you have auto completion
</pre>
<p>This has the drawback, that if you forget to remove the first line before you finish coding an unneccessary Book instance will be created on every execution during runtime.</p>
<li> Use an assertion to ensure that the mybook variable contains an object of type Book
<pre name="code" class="python">
mybook = bookstore.findBook("foobar")
assert isinstance(mybook, Book)
mybook. #--> now you have auto completion
</pre>
</ol>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=140" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/140-leveraging-pydevs-auto-completion-indirectly-created-objects/lang/de/">Permalink</a> |
<a href="http://sebthom.de/140-leveraging-pydevs-auto-completion-indirectly-created-objects/lang/de/#comments">3 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/140-leveraging-pydevs-auto-completion-indirectly-created-objects/lang/de/&amp;title=Leveraging PyDev&#8217;s auto completion for indirectly created objects">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/jython/" rel="nofollow tag">Jython</a>, <a href="http://sebthom.de/tag/pydev/" rel="nofollow tag">pydev</a>, <a href="http://sebthom.de/tag/pydoc/" rel="nofollow tag">pydoc</a>, <a href="http://sebthom.de/tag/python/" rel="nofollow tag">python</a>, <a href="http://sebthom.de/tag/rtype/" rel="nofollow tag">rtype</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/140-leveraging-pydevs-auto-completion-indirectly-created-objects/feed/lang/de/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>OVal 1.40 released</title>
		<link>http://sebthom.de/139-oval-140-released/lang/de/</link>
		<comments>http://sebthom.de/139-oval-140-released/lang/de/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 20:42:38 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=139</guid>
		<description><![CDATA[I am happy to announce the immediate availability of Version 1.40 OVal the Object Validation Framework for Java. This release fixes some minor issues and provides the following two new features: 1. Enabling/disabling constraints based on the object state: Using the newly introduced when attribute for constraints it is possible to specify under which circumstances [...]]]></description>
			<content:encoded><![CDATA[<p>I am happy to announce the immediate availability of Version 1.40 OVal the Object Validation Framework for Java. This release fixes some minor issues and provides the following two new features:</p>
<p><b>1. Enabling/disabling constraints based on the object state:</b><br />
Using the newly introduced <i>when</i> attribute for constraints it is possible to specify under which circumstances the constraint will be considered during object validation. The <i>when</i> attribute holds a formula in one of the supported scripting languages. If the formula returns true, the constraint will be activated for the current validation cycle otherwise it is ignored. In the following example the alias attribute must have a value only when the name attribute is not set.</p>
<pre name="code" class="java">
public class User {
   private String name;

   @NotNull(when = "groovy:_this.name == null")
   private String alias;

   // . . .
}
</pre>
<p><b>2. Fine grain control over how constraints are applied on arrays, maps, collections and their elements</b><br />
The newly introduced attribute <i>appliesTo</i> allows you to specify if and how a constraint declared for a map, a collection or an array is applied to their elements as well or exclusively. See the following example how this works:</p>
<pre name="code" class="java">
public class BusinessObject {

   // the ids field may be null, but if it is not null
   // none of it's items must be null
   @NotNull(appliesTo = { ConstraintTarget.VALUES })
   private String[] ids;

   // only the field itself must not be null,
   // the list can contain null values
   @NotNull(appliesTo = { ConstraintTarget.CONTAINER })
   private List items;

   // the field must not be null as well as all keys
   // and values of the map
   @NotNull(appliesTo = { ConstraintTarget.CONTAINER, ConstraintTarget.KEYS, ConstraintTarget.VALUES })
   private Map itemsByGroup;

   // . . .
}
</pre>
<p><b>Download</b><br />
You can get the lates binaries and source files of OVal from here: http://sourceforge.net/projects/oval/files/</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=139" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2009. |
<a href="http://sebthom.de/139-oval-140-released/lang/de/">Permalink</a> |
<a href="http://sebthom.de/139-oval-140-released/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/139-oval-140-released/lang/de/&amp;title=OVal 1.40 released">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/139-oval-140-released/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing WebSphere Portal in a local network</title>
		<link>http://sebthom.de/138-installing-websphere-portal-local-network/lang/de/</link>
		<comments>http://sebthom.de/138-installing-websphere-portal-local-network/lang/de/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 21:32:05 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[WebSphere Portal]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[websphere portal]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=138</guid>
		<description><![CDATA[Recently I had to setup some WebSphere Portal 6.1 installations in VMWares within a private network. Unfortunately the portal installer aborted with the following message &#8220;EJPIC0067E: Portal requires a fully qualified host name that is recoganized by the DNS Server.&#8221; Even when adding the fully qualified hostname to the hosts file the installer may still [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to setup some WebSphere Portal 6.1 installations in VMWares within a private network. Unfortunately the portal installer aborted with the following message &#8220;EJPIC0067E: Portal requires a fully qualified host name that is recoganized by the DNS Server.&#8221; Even when adding the fully qualified hostname to the hosts file the installer may still fail with the same message.<br />
The workaround is to disable the hostname check by invoking the portal installer with the following parameter specified: <strong>-W nodeHost.active=&#8221;False&#8221;</strong>. You should however only do this for test or development installations.</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=138" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2009. |
<a href="http://sebthom.de/138-installing-websphere-portal-local-network/lang/de/">Permalink</a> |
<a href="http://sebthom.de/138-installing-websphere-portal-local-network/lang/de/#comments">3 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/138-installing-websphere-portal-local-network/lang/de/&amp;title=Installing WebSphere Portal in a local network">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/deployment/" rel="nofollow tag">deployment</a>, <a href="http://sebthom.de/tag/websphere-portal/" rel="nofollow tag">websphere portal</a>, <a href="http://sebthom.de/tag/workaround/" rel="nofollow tag">workaround</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/138-installing-websphere-portal-local-network/feed/lang/de/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Comparing version numbers in Jython / Python</title>
		<link>http://sebthom.de/136-comparing-version-numbers-in-jython-pytho/lang/de/</link>
		<comments>http://sebthom.de/136-comparing-version-numbers-in-jython-pytho/lang/de/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 23:03:57 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Jython]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=136</guid>
		<description><![CDATA[Here comes a function to compare version numbers of e.g. Maven artifacts in Jython / Python. import re def cmpver(vA, vB): """ Compares two version number strings @param vA: first version string to compare @param vB: second version string to compare @author Sebastian Thomschke @return negative if vA < vB, zero if vA == vB, [...]]]></description>
			<content:encoded><![CDATA[<p>Here comes a function to compare version numbers of e.g. Maven artifacts in Jython / Python.</p>
<pre name="code" class="python">
import re

def cmpver(vA, vB):
    """
    Compares two version number strings
    @param vA: first version string to compare
    @param vB: second version string to compare
    @author <a href="http://sebthom.de/">Sebastian Thomschke</a>
    @return negative if vA < vB, zero if vA == vB, positive if vA > vB.

    Examples:
    >>> cmpver("0", "1")
    -1
    >>> cmpver("1", "0")
    1
    >>> cmpver("1", "1")
    0
    >>> cmpver("1.0", "1.0")
    0
    >>> cmpver("1.0", "1")
    0
    >>> cmpver("1", "1.0")
    0
    >>> cmpver("1.1.0", "1.0.1")
    1
    >>> cmpver("1.0.1", "1.1.1")
    -1
    >>> cmpver("0.3-SNAPSHOT", "0.3")
    -1
    >>> cmpver("0.3", "0.3-SNAPSHOT")
    1
    >>> cmpver("1.3b", "1.3c")
    -1
    >>> cmpver("1.14b", "1.3c")
    1
    """
    if vA == vB: return 0

    def num(s):
        if s.isdigit(): return int(s)
        return s

    seqA = map(num, re.findall('\d+|\w+', vA.replace('-SNAPSHOT', '')))
    seqB = map(num, re.findall('\d+|\w+', vB.replace('-SNAPSHOT', '')))

    # this is to ensure that 1.0 == 1.0.0 in cmp(..)
    lenA, lenB = len(seqA), len(seqB)
    for i in range(lenA, lenB): seqA += (0,)
    for i in range(lenB, lenA): seqB += (0,)

    rc = cmp(seqA, seqB)

    if rc == 0:
        if vA.endswith('-SNAPSHOT'): return -1
        if vB.endswith('-SNAPSHOT'): return 1
    return rc
</pre>
<p>Theoretically lines 43 &#8211; 49 could be written in a more compact way but using the short circuit evaluations (as below) lead to wrong results &#8211; at least in Jython 2.1:</p>
<pre name="code" class="python">
    seqa = map(lambda s: s.isdigit() and int(s) or s, re.findall('\d+|\w+', vA.replace('-SNAPSHOT', '')))
    seqb = map(lambda s: s.isdigit() and int(s) or s, re.findall('\d+|\w+', vB.replace('-SNAPSHOT', '')))
</pre>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=136" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2009. |
<a href="http://sebthom.de/136-comparing-version-numbers-in-jython-pytho/lang/de/">Permalink</a> |
<a href="http://sebthom.de/136-comparing-version-numbers-in-jython-pytho/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/136-comparing-version-numbers-in-jython-pytho/lang/de/&amp;title=Comparing version numbers in Jython / Python">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/jython/" rel="nofollow tag">Jython</a>, <a href="http://sebthom.de/tag/python/" rel="nofollow tag">python</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/136-comparing-version-numbers-in-jython-pytho/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running TomCat 6 in Debug Mode under Windows</title>
		<link>http://sebthom.de/135-running-tomcat-6-debug-mode-windows/lang/de/</link>
		<comments>http://sebthom.de/135-running-tomcat-6-debug-mode-windows/lang/de/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:55:02 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=135</guid>
		<description><![CDATA[While tracing some problems in one of my grails applications I had the need to do step debugging on a remote Tomcat server. Eventually I came up with the following lines to launch TomCat in debug mode: @echo off set JPDA_TRANSPORT="dt_socket" set JPDA_ADDRESS="8000" set JPDA_SUSPEND="y" catalina.bat jpda start Simply create a debug.bat file in TomCat&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>While tracing some problems in one of my grails applications I had the need to do step debugging on a remote Tomcat server. Eventually I came up with the following lines to launch TomCat in debug mode:</p>
<pre>
@echo off
set JPDA_TRANSPORT="dt_socket"
set JPDA_ADDRESS="8000"
set JPDA_SUSPEND="y"
catalina.bat jpda start
</pre>
<p>Simply create a <b>debug.bat</b> file in TomCat&#8217;s <b>bin</b> directory and add these lines.</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=135" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2009. |
<a href="http://sebthom.de/135-running-tomcat-6-debug-mode-windows/lang/de/">Permalink</a> |
<a href="http://sebthom.de/135-running-tomcat-6-debug-mode-windows/lang/de/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/135-running-tomcat-6-debug-mode-windows/lang/de/&amp;title=Running TomCat 6 in Debug Mode under Windows">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/135-running-tomcat-6-debug-mode-windows/feed/lang/de/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Determine the user who logged on via SSH</title>
		<link>http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/lang/de/</link>
		<comments>http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/lang/de/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 16:16:23 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/</guid>
		<description><![CDATA[Today we had the need to determine the initial id of a user who logged onto a Linux box via SSH and executed the su command. When the su command is issued the effective user is changed and whoami or id commands will report that new user id instead. For anyone who is interested, that [...]]]></description>
			<content:encoded><![CDATA[<p>Today we had the need to determine the initial id of a user who logged onto a Linux box via SSH and executed the <b>su</b> command. When the <b>su</b> command is issued the effective user is changed and <b>whoami</b> or <b>id</b> commands will report that new user id instead.</p>
<p>For anyone who is interested, that is what we came up to put the initial user id into a variable named ${LOGIN_USER}</p>
<pre>LOGIN_USER=`who -m`; LOGIN_USER=${LOGIN_USER%% *}</pre>
<p>or alternatively</p>
<pre>LOGIN_USER=`who -m | cut -d' ' -f1`</pre>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=134" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2009. |
<a href="http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/lang/de/">Permalink</a> |
<a href="http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/lang/de/&amp;title=Determine the user who logged on via SSH">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/bash/" rel="nofollow tag">bash</a>, <a href="http://sebthom.de/tag/linux/" rel="nofollow tag">Linux</a>, <a href="http://sebthom.de/tag/username/" rel="nofollow tag">username</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/134-determine-the-user-who-logged-on-via-ssh/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lotus Notes [Send only] und [Send and File] Schaltfl&#228;chen f&#252;r Outlook 2003</title>
		<link>http://sebthom.de/119-lotus-notes-send-only-send-and-file-buttons-for-outlook-2003/lang/de/</link>
		<comments>http://sebthom.de/119-lotus-notes-send-only-send-and-file-buttons-for-outlook-2003/lang/de/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 18:13:08 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=119</guid>
		<description><![CDATA[Man kann &#252;ber Lotus Notes sagen was man m&#246;chte, wenn man damit eine Weile gearbeitet hat und auf z.B. Outlook umgestiegen ist/wurde, dann fehlt einem in der Regel doch die eine oder andere liebgewonnene Funktion. Da ich nun bereits bei meinem zweiten Kunden &#8220;gezwungen&#8221; bin, mit MS Outlook 2003 zu arbeiten und mich scheinbar auch [...]]]></description>
			<content:encoded><![CDATA[<p>Man kann &uuml;ber Lotus Notes sagen was man m&ouml;chte, wenn man damit eine Weile gearbeitet hat und auf z.B. Outlook umgestiegen ist/wurde, dann fehlt einem in der Regel doch die eine oder andere liebgewonnene Funktion.</p>
<p>Da ich nun bereits bei meinem zweiten Kunden &#8220;gezwungen&#8221; bin, mit MS Outlook 2003 zu arbeiten und mich scheinbar auch in Zukunft nicht um dessen Verwendung dr&uuml;cken kann, habe ich zwei der vielen praktische Notes-Funktionen f&uuml;r Outlook 2003 implementiert:</p>
<ol>
<li>Die Schaltfl&auml;che <b>[Send only]</b>, bzw. <b>[Nur senden]</b> versendet eine E-Mail ohne eine Kopie davon in Outlook zu speichern.</li>
<li>Die Schaltfl&auml;che <b>[Send and File...]</b> bzw. <b>[Senden und ablegen...]</b> erfragt vor dem Versenden in welchem Ordner die gerade geschriebene E-Mail abgelegt werden soll.</li>
</ol>
<p>Installation:</p>
<ol>
<li>Download des Visual Basic Moduls in der gew&uuml;nschten Sprache.<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
<p>Note: There is a file embedded within this post, please visit this post to download the file.<br />

</li>
<li>In Outlook den Visual Basic Editor &ouml;ffnen.
<p><a href="http://sebthom.de/wp-content/uploads/2009/02/01_outlook_open_vbe.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/01_outlook_open_vbe-150x150.png" alt="open VBE from within outlook" title="open VBE from within outlook" class="alignnone size-thumbnail wp-image-121" height="150" width="150" /></a></li>
<li>Das Visual Basic Modul importieren
<p><a href="http://sebthom.de/wp-content/uploads/2009/02/02_vbe_import.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/02_vbe_import-150x150.png" alt="Modul importieren" title="Modul importieren" class="alignnone size-thumbnail wp-image-122" height="150" width="150" /></a> <a href="http://sebthom.de/wp-content/uploads/2009/02/03_vbe_select_file.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/03_vbe_select_file-150x150.png" alt="Das VBE Modul ausw&auml;hlen" title="Das VBE Modul ausw&auml;hlen" class="alignnone size-thumbnail wp-image-123" height="150" width="150" /></a> <a href="http://sebthom.de/wp-content/uploads/2009/02/04_vbe_module_imported.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/04_vbe_module_imported-150x150.png" alt="Das VBE Modul wurde importiert." title="Das VBE Modul wurde importiert." class="alignnone size-thumbnail wp-image-124" height="150" width="150" /></a>
</li>
<li>Das Projekt speichern.
<p><a href="http://sebthom.de/wp-content/uploads/2009/02/05_vbe_save_module.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/05_vbe_save_module-150x150.png" alt="Das VBE Projekt speichern" title="Das VBE Projekt speichern" class="alignnone size-thumbnail wp-image-125" height="150" width="150" /></a>
</li>
<li>Die Schaltfl&auml;chen in der Toolbar installieren.
<p><a href="http://sebthom.de/wp-content/uploads/2009/02/06_outlook_open_markos.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/06_outlook_open_markos-150x150.png" alt="Makros Dialog &ouml;ffnen" title="Makros Dialog &ouml;ffnen" class="alignnone size-thumbnail wp-image-126" height="150" width="150" /></a> <a href="http://sebthom.de/wp-content/uploads/2009/02/07_marco_select_install_sendandfile.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/07_marco_select_install_sendandfile-150x150.png" alt="Schaltfl&auml;che [Senden und ablegen...] installieren" title="Schaltfl&auml;che [Senden und ablegen...] installieren" class="alignnone size-thumbnail wp-image-127" height="150" width="150" /></a> <a href="http://sebthom.de/wp-content/uploads/2009/02/08_msg_sendandfile_installed.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/08_msg_sendandfile_installed-150x120.png" alt="Schaltfl&auml;che [Senden und ablegen...] installiert" title="Schaltfl&auml;che [Senden und ablegen...] installiert" class="alignnone size-thumbnail wp-image-128" height="120" width="150" /></a> <a href="http://sebthom.de/wp-content/uploads/2009/02/09_marco_select_install_sendonly.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/09_marco_select_install_sendonly-150x150.png" alt="Schaltfl&auml;che [Nur senden] installieren" title="Schaltfl&auml;che [Nur senden] installieren" class="alignnone size-thumbnail wp-image-129" height="150" width="150" /></a> <a href="http://sebthom.de/wp-content/uploads/2009/02/10_msg_sendonly_installed.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/10_msg_sendonly_installed-150x120.png" alt="Schaltfl&auml;che [Nur senden] installiert" title="Schaltfl&auml;che [Nur senden] installiert" class="alignnone size-thumbnail wp-image-130" height="120" width="150" /></a>
</li>
<li>Beim Erstellen einer neuen E-Mail sollten nun in der Toolbar die beiden zus&auml;tzlichen Schaltfl&auml;chen angezeigt werden.
<p><a href="http://sebthom.de/wp-content/uploads/2009/02/11_new_buttons_in_toolbar.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/11_new_buttons_in_toolbar-150x150.png" alt="Neue Schaltfl&auml;chen in der Toolbar" title="Neue Schaltfl&auml;chen in der Toolbar" class="alignnone size-thumbnail wp-image-131" height="150" width="150" /></a>
</li>
<li>Beim Klick auf &#8220;Senden und ablegen&#8230;&#8221; erscheint vor dem Versenden der Ordnerdialog.
<p><a href="http://sebthom.de/wp-content/uploads/2009/02/12_sendandfile_select_folder.png" rel="lightbox[119]"><img src="http://sebthom.de/wp-content/uploads/2009/02/12_sendandfile_select_folder-150x150.png" alt="Auswahl des Zielordners" title="Auswahl des Zielordners" class="alignnone size-thumbnail wp-image-120" height="150" width="150" /></a></li>
</ol>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=119" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2009. |
<a href="http://sebthom.de/119-lotus-notes-send-only-send-and-file-buttons-for-outlook-2003/lang/de/">Permalink</a> |
<a href="http://sebthom.de/119-lotus-notes-send-only-send-and-file-buttons-for-outlook-2003/lang/de/#comments">19 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/119-lotus-notes-send-only-send-and-file-buttons-for-outlook-2003/lang/de/&amp;title=Lotus Notes [Send only] und [Send and File] Schaltfl&auml;chen f&uuml;r Outlook 2003">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/outlook/" rel="nofollow tag">Outlook</a>, <a href="http://sebthom.de/tag/productivity/" rel="nofollow tag">Productivity</a>, <a href="http://sebthom.de/tag/vba/" rel="nofollow tag">VBA</a>, <a href="http://sebthom.de/tag/visual-basic/" rel="nofollow tag">Visual Basic</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/119-lotus-notes-send-only-send-and-file-buttons-for-outlook-2003/feed/lang/de/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>getpass f&#252;r Jython</title>
		<link>http://sebthom.de/70-getpass-jython/lang/de/</link>
		<comments>http://sebthom.de/70-getpass-jython/lang/de/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 00:02:15 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Jython]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=70</guid>
		<description><![CDATA[In meinem aktuellen Projekt entwickle ich u.a. verschiedene Jython basierte Kommandozeilenanwendungen. Einige davon erwarten die Eingabe von maskierten Passw&#246;rtern. Python stellt hierf&#252;r das getpass Modul bereit. Leider ist bisher keine entsprechende Implementierung f&#252;r Jython verf&#252;gbar. Im folgenden ein passendes Modul, welches diese Funktionalit&#228;t bereitstellt. Es verwendet einen Mechanismus um die Passworteingabe in der Kommandozeile zu [...]]]></description>
			<content:encoded><![CDATA[<p>In meinem aktuellen Projekt entwickle ich u.a. verschiedene Jython basierte Kommandozeilenanwendungen. Einige davon erwarten die Eingabe von maskierten Passw&ouml;rtern. Python stellt hierf&uuml;r das <a href="http://www.python.org/doc/lib/module-getpass.html" rel="nofollow" >getpass</a> Modul bereit. Leider ist bisher keine entsprechende Implementierung f&uuml;r Jython verf&uuml;gbar.</p>
<p>Im folgenden ein passendes Modul, welches diese Funktionalit&auml;t bereitstellt. Es verwendet einen Mechanismus um die Passworteingabe in der Kommandozeile zu maskieren, welcher hier beschrieben wurde <a href="http://java.sun.com/developer/technicalArticles/Security/pwordmask/" rel="nofollow" >http://java.sun.com/developer/technicalArticles/Security/pwordmask/</a>. Sollte Jython in Verbindung mit Java 6 oder h&ouml;her eingesetzt werden, so nutzt dieses Modul stattdessen die neue <a href="http://java.sun.com/javase/6/docs/api/java/io/Console.html#readPassword%28%29" rel="nofollow" >Console.readPassword()</a> Methode. Sollte das Modul in einer Umgebung laufen in welcher eine getpass Modulimplementierung verf&uuml;gbar ist, dann wird stattdessen an die entsprechende Methode im getpass Modul delegiert.</p>
<pre class="python" name="code"># ext_getpass.py
# @author Sebastian Thomschke, http://sebthom.de/
import thread, sys, time, os

# exposed methods:
__all__ = ["getpass","getuser"]

def __doMasking(stream):
    __doMasking.stop = 0
    while not __doMasking.stop:
        stream.write("b*")
        stream.flush()
        time.sleep(0.01)

def generic_getpass(prompt="Password: ", stream=None):
    if not stream:
        stream = sys.stderr
    prompt = str(prompt)
    if prompt:
        stream.write(prompt)
        stream.flush()
    thread.start_new_thread(__doMasking, (stream,))
    password = raw_input()
    __doMasking.stop = 1
    return password

def generic_getuser():
    for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
        usr = os.environ.get(name)
        if usr: return usr

def java6_getpass(prompt="Password: ", stream=None):
    if not stream:
        stream = sys.stderr
    prompt = str(prompt)
    if prompt:
        stream.write(prompt)
        stream.flush()

    from java.lang import System
    console = System.console()
    if console == None:
	    return generic_getpass(prompt, stream)
    else:
        return "".join(console.readPassword())

try:
    # trying to use Python's getpass implementation
    import getpass
    getpass = getpass.getpass
    getuser = getpass.getuser
except ImportError, e:
    getuser = generic_getuser

    # trying to use Java 6's Console.readPassword() implementation
    try:
        from java.io import Console
        getpass = java6_getpass
    except ImportError, e:
        # use the generic getpass implementation
        getpass = generic_getpass
</pre>
<p>Here is an usage example:</p>
<pre class="python" name="code">
import ext_getpass as getpass

pw = getpass.getpass("Please enter your password:")
print "The entered password was: " + pw
</pre>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=70" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/70-getpass-jython/lang/de/">Permalink</a> |
<a href="http://sebthom.de/70-getpass-jython/lang/de/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/70-getpass-jython/lang/de/&amp;title=getpass f&uuml;r Jython">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/jython/" rel="nofollow tag">Jython</a>, <a href="http://sebthom.de/tag/password/" rel="nofollow tag">password</a>, <a href="http://sebthom.de/tag/python/" rel="nofollow tag">python</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/70-getpass-jython/feed/lang/de/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebSphere Portal 6.1.0.0 does not support installation on a managed node</title>
		<link>http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/lang/de/</link>
		<comments>http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/lang/de/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 19:42:41 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[WebSphere Portal]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[limitation]]></category>
		<category><![CDATA[websphere portal]]></category>

		<guid isPermaLink="false">http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/</guid>
		<description><![CDATA[With WebSphere Portal 5.1 a new deployment option was introduced that allowed the installation of WP onto an existing node managed by a deployment manager. AFAIK the main reason for this new option was to simplify the cluster setup procedure. Both options, installing WP standalone and federating it into a cell afterwards as well as [...]]]></description>
			<content:encoded><![CDATA[<p>With WebSphere Portal 5.1 a new deployment option was introduced that allowed the installation of WP onto an existing node managed by a deployment manager. AFAIK the main reason for this new option was to simplify the cluster setup procedure.</p>
<p>Both options, installing WP standalone and federating it into a cell afterwards as well as installing it on an already managed node have different pros and cons each. In WP 6.0 the installation onto a managed node was even mandatory to enable WebSphere Process Server integration.</p>
<p>Surprisingly WP6.1.0.0 does not support the installation on a managed node anymore. All nodes of a cluster need to be installed as standalone systems first and then be federated into a WebSphere cell.</p>
<p>For WP 6.0 the installation procedure is described <a href="http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/topic/com.ibm.wp.ent.doc/wpf/clus_install_primary_fed.html" rel="nofollow"  target="_blank">here</a>. The 6.1 info center does not mention this procedure anymore and it no, it was not dropped accidentally.</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=67" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/lang/de/">Permalink</a> |
<a href="http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/lang/de/&amp;title=WebSphere Portal 6.1.0.0 does not support installation on a managed node">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/deployment/" rel="nofollow tag">deployment</a>, <a href="http://sebthom.de/tag/limitation/" rel="nofollow tag">limitation</a>, <a href="http://sebthom.de/tag/websphere-portal/" rel="nofollow tag">websphere portal</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/67-websphere-portal-6100-does-not-support-installation-on-a-managed-node/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Behoben] Leere Seiten mit WordPress 2.6.x</title>
		<link>http://sebthom.de/63-solved-blank-pages-with-wordpress-26x/lang/de/</link>
		<comments>http://sebthom.de/63-solved-blank-pages-with-wordpress-26x/lang/de/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 18:57:59 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=63&#038;langswitch_lang=de</guid>
		<description><![CDATA[Nach dem Upgrade auf WordPress 2.6 kam es immer wieder vor das im Browser leere Seiten angezeigt wurden. Eine Seitenaktualisierung mittels STRG+F5 behob in den meisten F&#228;llen das Problem. Heute habe ich meinen Blog auf WordPress 2.6.2 aktualisiert und danach war es nicht mehr m&#246;glich die Verwaltungsseite f&#252;r Plug-ins aufzurufen. Egal was ich probierte, die [...]]]></description>
			<content:encoded><![CDATA[<p>Nach dem Upgrade auf WordPress 2.6 kam es immer wieder vor das im Browser leere Seiten angezeigt wurden. Eine Seitenaktualisierung mittels STRG+F5 behob in den meisten F&auml;llen das Problem. Heute habe ich meinen Blog auf WordPress 2.6.2 aktualisiert und danach war es nicht mehr m&ouml;glich die Verwaltungsseite f&uuml;r Plug-ins aufzurufen. Egal was ich probierte, die Seite blieb im Browser leer.<br />
Auf der Suche nach einer m&ouml;glichen L&ouml;sung im Internet bin ich auf verschiedene Diskussionen &uuml;ber dieses scheinbar allgemein bekannte Ph&auml;nomen gestossen. Leider half keine der skizzierten L&ouml;sungsans&auml;tze in meinem Fall.<br />
Daher habe ich mich einmal mehr in die Untiefen des WordPress Codes gest&uuml;rzt und die &#8211; f&uuml;r meinen Fall &#8211; entscheidenden Programmzeilen lokalisieren k&ouml;nnen. Das Problem wird durch mehrere <b>(object)</b> Casts in der Datei strong>wp-includes/taxonomy.php</strong> verursacht, welche Arrays in Objekte transformieren:</p>
<pre class="php" name="code">$wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count');
$wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count');
$wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false);
</pre>
<p>Da weder Fehlermeldungen im Browser noch in den Log Dateien erscheinen habe ich leider keine Idee wieso diese Casts zum Abbruch der Skriptausf&uuml;hrung f&uuml;hren. Die installierte PHP Version entspricht der aktuellen stabilen 5.x Version und sollte daher eigentlich nicht die Ursache des Problems sein.<br />
Um das Problem zu umgehen habe ich eine Methode eingef&uuml;hrt die ebenfalls Arrays in Objekte transformieren kann, welche jedoch nicht auf der PHP Objekt Casting Funktion beruht.</p>
<pre class="php" name="code">function arr2obj($arr) {
	foreach ($arr as $k => $v) $obj -> {$k} = $v;
	return $obj;
}

$wp_taxonomies['category'] = arr2obj(array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count'));
$wp_taxonomies['post_tag'] = arr2obj(array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count'));
$wp_taxonomies['link_category'] = arr2obj(array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false));
</pre>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=63" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/63-solved-blank-pages-with-wordpress-26x/lang/de/">Permalink</a> |
<a href="http://sebthom.de/63-solved-blank-pages-with-wordpress-26x/lang/de/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/63-solved-blank-pages-with-wordpress-26x/lang/de/&amp;title=[Behoben] Leere Seiten mit WordPress 2.6.x">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/bug/" rel="nofollow tag">bug</a>, <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/wordpress/" rel="nofollow tag">Wordpress</a>, <a href="http://sebthom.de/tag/workaround/" rel="nofollow tag">workaround</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/63-solved-blank-pages-with-wordpress-26x/feed/lang/de/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments</title>
		<link>http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/lang/de/</link>
		<comments>http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/lang/de/#comments</comments>
		<pubDate>Thu, 15 May 2008 23:23:44 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[jdk]]></category>

		<guid isPermaLink="false">http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/</guid>
		<description><![CDATA[We are currently switching the build system of OVal from custom Ant scripts to Maven 2. During that process we accidentally compiled the project using the Java compiler of the Sun JDK 5 instead of the AspectJ compiler. Surprisingly javac did not complain about the missing aspect class files. Instead it already aborted while compiling [...]]]></description>
			<content:encoded><![CDATA[<p>We are currently switching the build system of <a href="http://oval.sourceforge.net/" rel="nofollow" title="OVal - the object validation framework for Java 5 or later"  target="_blank">OVal</a> from custom Ant scripts to Maven 2. During that process we accidentally compiled the project using the Java compiler of the Sun JDK 5 instead of the AspectJ compiler. Surprisingly javac did not complain about the missing aspect class files. Instead it already aborted while compiling an ordinary Java class which only referenced other non-AspectJ related classes. This is the original error message:</p>
<pre>[INFO] [compiler:compile]
[INFO] Compiling 180 source files to C:\projects\oval\src\trunk\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
C:\projects\oval\src\trunk\src\main\java\net\sf\oval\Validator.java:[373,58]
addMethodParameterChecks(java.lang.reflect.Method,int,java.lang.Object)
has private access in net.sf.oval.internal.ClassChecks </pre>
<p>There exist multiple methods named <strong>addMethodParameterChecks</strong> in the class <strong>ClassChecks</strong> with different signatures. The problem is that javac tries to link against the wrong method when compiling the class calling one of the methods. </p>
<p>(...)<br/>Read the rest of <a href="http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/lang/de/">Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments</a> (284 words)</p>
<hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/lang/de/">Permalink</a> |
<a href="http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/lang/de/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/lang/de/&amp;title=Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/bug/" rel="nofollow tag">bug</a>, <a href="http://sebthom.de/tag/compiler/" rel="nofollow tag">compiler</a>, <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/jdk/" rel="nofollow tag">jdk</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/feed/lang/de/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DD Sitemap Generator Plug-in und mehrsprachige Blogs</title>
		<link>http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/lang/de/</link>
		<comments>http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/lang/de/#comments</comments>
		<pubDate>Thu, 01 May 2008 21:47:38 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/</guid>
		<description><![CDATA[Um ein zweisprachiges Blog mit WordPress betreiben zu k&#246;nnen, verwende ich das Language Switcher Plug-in. Dieses erlaubt es, durch die Verwendung spezieller Tags in den &#252;blichen Titel und Inhaltsfeldern zu deklarieren, welche Teile in welcher Sprache geschrieben sind (z.B. &#8220;[ lang_en]Hello World[ /lang_en][ lang_de]Hallo Welt[ /lang_de]&#8220;). Wenn ein solcher Beitrag im Browser angezeigt wird entfernt [...]]]></description>
			<content:encoded><![CDATA[<p>Um ein zweisprachiges Blog mit <a href="http://wordpress.org/" rel="nofollow"  target="_blank">WordPress</a> betreiben zu k&ouml;nnen, verwende ich das <a href="http://www.poplarware.com/languageplugin.html" rel="nofollow"  target="_blank">Language Switcher Plug-in</a>. Dieses erlaubt es, durch die Verwendung spezieller Tags in den &uuml;blichen Titel und Inhaltsfeldern zu deklarieren, welche Teile in welcher Sprache geschrieben sind (z.B. <strong>&#8220;[ lang_en]Hello World[ /lang_en][ lang_de]Hallo Welt[ /lang_de]&#8220;</strong>). Wenn ein solcher Beitrag im Browser angezeigt wird entfernt das Plug-in diese Tags sowie die Inhalte in den nichtausgew&auml;hlten Sprachen.</p>
<p>Ich verwende das <a href="http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/" rel="nofollow"  target="_blank">DD Sitemap Generator Plug-in f&uuml;r WordPress</a> zur automatischen Erzeugung einer Sitemap basierend auf den Beitr&auml;ge und Kategorien meines Blogs. Auf dieser generierten Sitemap werden jedoch bei den Kategorienamen und Beitragstiteln die &Uuml;bersetzungen in allen Sprachen auf einmal angezeigt inklusive der speziellen Tags. </p>
<p>Um dies zu beheben habe ich mich etwas im Code von WordPress und dem Language Switcher Plug-in umgesehen. Das Language Switcher Plug-in entfernt die Tags und &uuml;berfl&uuml;ssigen &Uuml;bersetzungen indem es sich der <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference" rel="nofollow"  target="_blank">Filters API</a> bedient &#8211; eine Art ereignisbasierter R&uuml;ckrufmMechanismus. Plug-ins k&ouml;nnen Ihr Interesse in bestimmten Textfilterereignissen signalisieren indem sie die Funktion <a href="http://codex.wordpress.org/Function_Reference/add_filter" rel="nofollow"  target="_blank">add_filter(the_event_id, the_name_of_a_function_to_callback)</a> unter Angabe der ID eines Filterereignisses und des Namens der aufzurufenden Funktion im Falle des Auftretens des entsprechenden Ereignis. Neben dem Registrieren f&uuml;r Filterereignisse k&ouml;nnen Plug-ins auch selbst solche Textfilterereignisse ausl&ouml;sen indem sie Funktion <a href="http://codex.wordpress.org/Function_Reference/apply_filters" rel="nofollow"  target="_blank">apply_filters(the_event_id, the_text_to_be_filtered)</a> unter Angabe einer ID des Filterereignisses und des zu filternden Textes aufrufen. WordPress f&uuml;hrt dann alle f&uuml;r dieses Ereignis registrier Filtermethoden auf dem &uuml;bergebenen Text aus und die apply_filters Funktion gibt als Ergebnis den &#8220;gefilterten&#8221; text zur&uuml;ck. Wenn WordPress beispielsweise die Titel von Beitr&auml;gen oder Seiten darstellt l&ouml;st es ein Filterereignis mit der ID &#8220;the_title&#8221; aus. Dies erm&ouml;glicht Plug-ins den Titel zu prozessieren/modifizieren bevor er dargestellt wird. Das Language Switcher Plug-in registriert sich daher selbst f&uuml;r dieses und eine Reihe anderer Filterereignisse um mehrsprachig eingegebene Texte vor der Darstellung um die Sprachtags und die nicht relevanten &Uuml;bersetzungen zu entfernen.</p>
<p>Leider l&ouml;st das DD Sitemap Generator Plug-in die entsprechenden Filterereignisse bei der Erstellung der Sitemap nicht aus. Daher ist auch das Language Switcher Plug-in nicht in der Lage die Kategorienamen und Beitragstitel zu bearbeiten.</p>
<p>Um das Problem zu l&ouml;sen habe ich daher den Quellcode des DD Sitemap Generator Plug-in analysiert und die fehlenden <strong>apply_filters</strong> Aufrufe an den entsprechenden Stellen hinzugef&uuml;gt. Wer ebenfalls von diesem Problem betroffen ist kann sich wie folgt behelfen:</p>
<ol>
<li>Die Datei <strong>&lt;wordpress_root&gt;/wp-content/plugins/sitemap-generator/sitemap-generator.php</strong> (oder <strong>&lt;wordpress_root&gt;/wp-content/plugins/dd-sitemap-gen/dd-sitemap-gen.php</strong>) in einem Editor &ouml;ffnen
<li>Den folgenden Text lokalisieren<br />&nbsp;&nbsp; <font face="Courier New">$tmp_array['title'] = $pages[$k]-&gt;post_title;</font><br />und ersetzen durch<br />&nbsp;&nbsp; <font face="Courier New">$tmp_array['title'] = <strong>apply_filters(&#8216;the_title&#8217;, </strong>$pages[$k]-&gt;post_title<strong>)</strong>;</font>
<li>Den folgenden Text lokalisieren<br />&nbsp;&nbsp; <font face="Courier New">$tmp_array['title'] = $cat_data[$c]['cat_name'];</font><br />und ersetzen durch<br />&nbsp;&nbsp; <font face="Courier New">$tmp_array['title'] = <strong>apply_filters(&#8216;the_category&#8217;, </strong>$cat_data[$c]['cat_name']<strong>)</strong>;</font>
<li>Den folgenden Text lokalisieren<br />&nbsp;&nbsp; <font face="Courier New">$tmp_array['title'] = $posts[$k]-&gt;post_title;</font><br />und ersetzen durch<br />&nbsp;&nbsp; <font face="Courier New">$tmp_array['title'] = <strong>apply_filters(&#8216;the_title&#8217;, </strong>$posts[$k]-&gt;post_title<strong>)</strong>;</font>
<li>Die &Auml;nderungen speichern. Das sollte es gewesen sein.</li>
</ol>
<p>Mit diesem Verfahren kann man auch andere Plug-ins f&uuml;r ein gutes Zusammenspiel mit dem Language Switcher Plug-in korrigieren.</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=55" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/lang/de/">Permalink</a> |
<a href="http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/lang/de/#comments">3 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/lang/de/&amp;title=DD Sitemap Generator Plug-in und mehrsprachige Blogs">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/wordpress/" rel="nofollow tag">Wordpress</a>, <a href="http://sebthom.de/tag/workaround/" rel="nofollow tag">workaround</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/55-making_dd_sitemap_generator_plugin_work_with_multilingual_blogs/feed/lang/de/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Behoben] WordPress 2.5 One-Click Plug-in Upgrades &#8211; Could not create directory</title>
		<link>http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/lang/de/</link>
		<comments>http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/lang/de/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 23:44:06 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/</guid>
		<description><![CDATA[Vor einigen Tagen habe ich meine WordPress Installation auf das neue 2.5 Release aktualisiert. Aufgrund meiner Tr&#228;gheit im Hinblick auf administrative T&#228;tigkeiten wollte ich nat&#252;rlich auch die neue on-click plug-in upgrade Funktion nutzen um ein paar Plug-ins zu aktualisieren. Allerdings scheiterten alle meine Versuche die Funktion zu nutzen mit der ziemlich nutzlosen Fehlermeldung &#8220;Could not [...]]]></description>
			<content:encoded><![CDATA[<p>Vor einigen Tagen habe ich meine WordPress Installation auf das neue <a href="http://wordpress.org/development/2008/03/wordpress-25-brecker/" rel="nofollow"  target="_blank">2.5 Release</a> aktualisiert. Aufgrund meiner Tr&auml;gheit im Hinblick auf administrative T&auml;tigkeiten wollte ich nat&uuml;rlich auch die neue <a href="http://wordpress.org/development/2008/03/wordpress-25-brecker/" rel="nofollow"  target="_blank">on-click plug-in upgrade</a> Funktion nutzen um ein paar Plug-ins zu aktualisieren. Allerdings scheiterten alle meine Versuche die Funktion zu nutzen mit der ziemlich nutzlosen Fehlermeldung &#8220;Could not create directory&#8221;. Daher begab ich mich auf die &uuml;bliche Netzsuche und bin relativ schnell auf <a href="http://wordpress.org/support/topic/164174" rel="nofollow"  target="_blank">einige</a> <a href="http://blog.fabrice-pascal.de/item/1132/2008/04/06/" rel="nofollow"  target="_blank">Beitr&auml;ge</a> gestossen, welche die Ursache in unzureichenden Berechtigungen auf bestimmte Verzeichnisse ausmachten. Das manuelle Anlegen des Verzeichnisses /wp-content/upgrade und das &#8220;chmodden&#8221; auf 777 dieses selben sowie der Plug-in Verzeichnisse w&uuml;rden das Problem l&ouml;sen. Leider nicht bei mir. Daher blieb mir nichts weiter &uuml;brig als die &Auml;rmel hochzukrempeln und WordPress zu debuggen&#8230;</p>
<p>Lange Rede, kurzer Sinn, ich bin schlie&szlig;lich auf den PHP Bug Report <a href="http://bugs.php.net/bug.php?id=42739" rel="nofollow"  target="_blank">#42739 mkdir doesn&#8217;t like a trailing slash when safe_mode is enabled</a> gestossen und es zeigte sich, da&szlig; dies genau das Problem war, welches sich mir auf meinem Hosting Account entgegenstellte. Die PHP Option safe_mode ist dort aktiviert und WordPress versucht vergeblich mit Schr&auml;gstrich endende Verzeichnissepfade anzulegen (z.B. /htdocs/wp-content/upgrade/the-plugin<strong>/</strong>).</p>
<p>Nachdem mir der Grund also bekannt war, konnte ich einen Workaround entwickeln und endlich den on-click plug-in updater nutzen. F&uuml;r alle die das gleiche Problem haben, hier meine L&ouml;sung:</p>
<ol>
<li>Die Datei <strong>&lt;wp_root&gt;/wp_admin/includes/class-wp-filesystem-direct.php</strong> lokalisieren und in einem Editor &ouml;ffnen
<li>Nach &#8220;<strong>function mkdir</strong>&#8221; in der Datei suchen
<li>Die nachfolgenden Codezeilen in die Methode einf&uuml;gen.&nbsp;
<pre class="php" name="code">function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
	if( ! $chmod)
		$chmod = $this-&gt;permission;

	// workaround for http://bugs.php.net/bug.php?id=42739 starts here
	if(ini_get('safe_mode') &amp;&amp; substr($path, -1) == '/')
	{
		$path = substr($path, 0, -1);
	}
	// workaround for http://bugs.php.net/bug.php?id=42739 ends here

	if( !@mkdir($path,$chmod) )
		return false;
	if( $chown )
		$this-&gt;chown($path,$chown);
	if( $chgrp )
		$this-&gt;chgrp($path,$chgrp);
	return true;
}</pre>
<li>Mit der Ein-Klick-Aktualisierung beginnen! </li>
</ol>
<p><b>Nachtrag:</b></p>
<ol>
<li>Die &Auml;nderung funktioniert auch mit WordPress 2.5.1</li>
<li> Falls diese &Auml;nderung nicht zum gew&uuml;nschten Erfolg f&uuml;hren, kann der Fehler noch eine zweite Ursache haben. Daher sollten die Berechtigungen des Verzeichnis /wp-content/upgrade/ und dessen Unterverzeichnisse &uuml;berpr&uuml;ft und gegebenenfalls per chmod auf 777 gesetzt werden. Falls das upgrade Verzeichnis gar nicht existieren sollte, reicht es vielleicht schon dieses einfach manuell anzulegen.</li>
</ol>
<p><p><b>Nachtrag 2:</b>
<ol>
<li>Falls sich das Problem weiter besteht sollte gepr&uuml;ft werden ob das Plug-in <b>AskApache Password Protect</b> installiert ist.</li>
<li>Wenn ja, kann es helfen dieses vor dem Aktualisieren anderer Plug-ins zu deaktivieren.</li>
</ol></p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=54" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/lang/de/">Permalink</a> |
<a href="http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/lang/de/#comments">37 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/lang/de/&amp;title=[Behoben] WordPress 2.5 One-Click Plug-in Upgrades &#8211; Could not create directory">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/bug/" rel="nofollow tag">bug</a>, <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/wordpress/" rel="nofollow tag">Wordpress</a>, <a href="http://sebthom.de/tag/workaround/" rel="nofollow tag">workaround</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/54-solved-wordpress-25-one-click-plugin-update-problem-could-not-create-directory/feed/lang/de/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>myPodder  &#8211; ein mobiler Podcatcher</title>
		<link>http://sebthom.de/49-mypodder-mobile-podcatcher/lang/de/</link>
		<comments>http://sebthom.de/49-mypodder-mobile-podcatcher/lang/de/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 19:59:25 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Freeware Tipps]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcasts]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=49&#038;langswitch_lang=de</guid>
		<description><![CDATA[Vor zwei Wochen habe ich zum ersten Mal damit begonnen Podcasts ernsthaft auszuprobieren &#8211; bis jetzt haupts&#228;chlich Aufzeichnungen vom Deutschland Funk (http://www.dradio.de/podcast/). Ich habe mir die Audiodateien zu interessant klingenden Themen heruntergeladen und auf dem Weg zum/vom B&#252;ro in der U-Bahn angeh&#246;rt. Das hat wirklich Spa&#223; gemacht &#8211; insbesondere da ich mir nun die Berichte [...]]]></description>
			<content:encoded><![CDATA[<p>Vor zwei Wochen habe ich zum ersten Mal damit begonnen Podcasts ernsthaft auszuprobieren &#8211; bis jetzt haupts&auml;chlich Aufzeichnungen vom Deutschland Funk (<a href="http://www.dradio.de/podcast/" rel="nofollow" target="_blank" >http://www.dradio.de/podcast/</a>). Ich habe mir die Audiodateien zu interessant klingenden Themen heruntergeladen und auf dem Weg zum/vom B&uuml;ro in der U-Bahn angeh&ouml;rt. Das hat wirklich Spa&szlig; gemacht &#8211; insbesondere da ich mir nun die Berichte und Diskussionen anh&ouml;ren konnte die mich wirklich interessieren und ich nun nicht mehr an deren Sendezeiten gebunden war. Allerdings fand ich es ziemlich umst&auml;ndlich erst auf der Webseite nach den einzelnen Podcasts zu suchen, diese dann einzeln auszuw&auml;hlen, herunterzuladen und schliesslich auf meinen schicken <a href="http://www.amazon.de/dp/B000OAFHXQ/?tag=stde-post-21" rel="nofollow" >Samsung T9</a> zu &uuml;berspielen.
<p>Auf der Suche nach m&ouml;glichen Programmen die diesen Prozess vereinfachen k&ouml;nnten bin ich auf die Software <a href="http://www.podcastready.com/download.php" rel="nofollow" >myPodder</a> gestossen. Diese wird kostenlos von <a href="http://www.podcastready.com/" rel="nofollow" >Podcast Ready</a> bereitgestellt. Podcasts Ready stellt einen Onlinekatalog verf&uuml;gbarer Podcasts unterschiedlichster Quellen bereit und zu meiner &Uuml;berraschung waren auch die Podcasts des Deutschlandfunks aufgef&uuml;hrt. Das interessante an ihrer Software ist die Tatsache, da&szlig; sie sich direkt auf Audioplayern installieren l&auml;&szlig;t und man diese so konfigurieren kann, da&szlig; sie beim Anschliessen des Players an einen Computer automatisch startet. Somit kann man auf einfachste und sehr komfortable Weise &uuml;ber quasi jeden internetf&auml;higen Computer seinen Player mit neuen Podcasts best&uuml;cken.(...)<br/>Read the rest of <a href="http://sebthom.de/49-mypodder-mobile-podcatcher/lang/de/">myPodder  &#8211; ein mobiler Podcatcher</a> (0 words)</p>
<hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/49-mypodder-mobile-podcatcher/lang/de/">Permalink</a> |
<a href="http://sebthom.de/49-mypodder-mobile-podcatcher/lang/de/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/49-mypodder-mobile-podcatcher/lang/de/&amp;title=myPodder  &#8211; ein mobiler Podcatcher">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/audio/" rel="nofollow tag">audio</a>, <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/podcasts/" rel="nofollow tag">podcasts</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/49-mypodder-mobile-podcatcher/feed/lang/de/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Meine favorisierten WordPress Plugins &amp; Ressourcen</title>
		<link>http://sebthom.de/46-favorite-wordpress-resources/lang/de/</link>
		<comments>http://sebthom.de/46-favorite-wordpress-resources/lang/de/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 09:04:13 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[MP3]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://sebthom.de/46-lang_enmy-favorite-wordpress-resourceslang_enlang_demeine-favorisierten-wordpress-ressourcenlang_de/lang/de</guid>
		<description><![CDATA[Jetzt, da ich ein paar Erfahrungen mit WordPress sammeln konnte, habe ich eine Liste meiner favorisierten WordPress Plug-ins und Tutorials zusammengestellt: (...)Read the rest of Meine favorisierten WordPress Plugins &#38; Ressourcen (717 words) &#169; sebthom for sebthom.de, 2007. &#124; Permalink &#124; 3 comments &#124; Add to del.icio.us Post tags: audio, MP3, PHP, Wordpress Feed enhanced [...]]]></description>
			<content:encoded><![CDATA[<p>Jetzt, da ich ein paar Erfahrungen mit WordPress sammeln konnte, habe ich eine Liste meiner favorisierten WordPress Plug-ins und Tutorials zusammengestellt:</p>
<p>(...)<br/>Read the rest of <a href="http://sebthom.de/46-favorite-wordpress-resources/lang/de/">Meine favorisierten WordPress Plugins &amp; Ressourcen</a> (717 words)</p>
<hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2007. |
<a href="http://sebthom.de/46-favorite-wordpress-resources/lang/de/">Permalink</a> |
<a href="http://sebthom.de/46-favorite-wordpress-resources/lang/de/#comments">3 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/46-favorite-wordpress-resources/lang/de/&amp;title=Meine favorisierten WordPress Plugins &amp; Ressourcen">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/audio/" rel="nofollow tag">audio</a>, <a href="http://sebthom.de/tag/mp3/" rel="nofollow tag">MP3</a>, <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/wordpress/" rel="nofollow tag">Wordpress</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/46-favorite-wordpress-resources/feed/lang/de/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>OVal 1.0 ver&#246;ffentlicht!</title>
		<link>http://sebthom.de/42-oval-java-validation-framework-released/lang/de/</link>
		<comments>http://sebthom.de/42-oval-java-validation-framework-released/lang/de/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 12:10:22 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[oval]]></category>

		<guid isPermaLink="false">http://sebthom.de/2007/07/oval-java-validation-framework-released/</guid>
		<description><![CDATA[OVal ist ein pragmatisches und erweiterbares Validierungsframework f&#252;r jegliche Art von Javaobjekten (nicht nur JavaBeans). Bedingungen k&#246;nnen via Annotationen, POJOs oder XML konfiguriert werden. Zus&#228;zliche Bedingungen k&#246;nnen in Form von Java Klassen oder die Verwendung von Skriptsprachen wie JavaScript, Groovy, BeanShell, OGNL oder MVEL ausgedr&#252;ckt werden. Neben der einfachen Objektvalidierung kann OVal auch Funktionen f&#252;r [...]]]></description>
			<content:encoded><![CDATA[<p>OVal ist ein pragmatisches und erweiterbares Validierungsframework f&uuml;r jegliche Art von Javaobjekten (nicht nur JavaBeans). Bedingungen k&ouml;nnen via Annotationen, POJOs oder XML konfiguriert werden. Zus&auml;zliche Bedingungen k&ouml;nnen in Form von Java Klassen oder die Verwendung von Skriptsprachen wie JavaScript, Groovy, BeanShell, OGNL oder MVEL ausgedr&uuml;ckt werden. Neben der einfachen Objektvalidierung kann OVal auch Funktionen f&uuml;r Programming by Contract bereitstellen. Hierzu werden AspectJ basierte Aspekte verwendet.</p>
<p>Projektseite: <a href="http://sourceforge.net/projects/oval/" rel="nofollow" >http://sourceforge.net/projects/oval/</a></p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=42" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2007. |
<a href="http://sebthom.de/42-oval-java-validation-framework-released/lang/de/">Permalink</a> |
<a href="http://sebthom.de/42-oval-java-validation-framework-released/lang/de/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/42-oval-java-validation-framework-released/lang/de/&amp;title=OVal 1.0 ver&ouml;ffentlicht!">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/oval/" rel="nofollow tag">oval</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/42-oval-java-validation-framework-released/feed/lang/de/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

