Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package pt.webdetails.cda.connections.mondrian;
 
 import  org.dom4j.Element;
 import  org.pentaho.platform.api.engine.IConnectionUserRoleMapper;
 import  org.pentaho.platform.engine.core.system.PentahoSessionHolder;
 import  org.pentaho.platform.engine.core.system.PentahoSystem;
Created by IntelliJ IDEA. User: pedro Date: Feb 2, 2010 Time: 5:09:59 PM
public abstract class AbstractMondrianConnection extends AbstractConnection implements MondrianConnection
  {
  }
  {
    super(id);
  }
  public AbstractMondrianConnection(final Element connectionthrows InvalidConnectionException
  {
    super(connection);
  }
  {
    return .;
  }
  {
    final ArrayList<PropertyDescriptorproperties = new ArrayList<PropertyDescriptor>();
    return properties;
  }
  protected String assembleRole(String catalog)
  {
    try
    {
      final IConnectionUserRoleMapper mondrianUserRoleMapper =
              PentahoSystem.get(IConnectionUserRoleMapper.class"Mondrian-UserRoleMapper"null);
      final String[] validMondrianRolesForUser =
              mondrianUserRoleMapper.mapConnectionRoles(PentahoSessionHolder.getSession(), "solution:" + catalog.replaceAll("solution/",""));
      if ((validMondrianRolesForUser != null) && (validMondrianRolesForUser.length > 0))
      {
        final StringBuffer buff = new StringBuffer();
        for (int i = 0; i < validMondrianRolesForUser.lengthi++)
        {
          final String aRole = validMondrianRolesForUser[i];
          // According to http://mondrian.pentaho.org/documentation/configuration.php
          // double-comma escapes a comma
          if (i > 0)
          {
            buff.append(",");
          }
          buff.append(aRole.replaceAll(","",,"));
        }
        return buff.toString();
      }
      else
      {
        return "";
      }
    }
    catch (Exception e)
    {
      return "";
    }
  }
New to GrepCode? Check out our FAQ X