You are here

How do we put Customized icons in luminis IV?

Submitted by phillies40 on Fri, 09/10/2010 - 09:31

Hi all

Has any school successfully put customized icons in their luminis 4.2.2.34 system? if so, please provide me the tips or experiences? Thanks!

Alan
PCOM

Luminis Version:

Channels:

Hack Type:

How-To:

Modification:

Comments

We have altered our Luminis icon bar by adding a Blackboard icon that takes users to the Blackboard login page. Have not succeeded in getting SSO to Blackboard through the icon, although we do have SSO with Blackboard in the My Courses channel and the Course Studio.

Also, we have created a conditional icon for email that offers a Gmail icon to students which takes them to the Gmail login or offers the OWA icon to staff and faculty and does have SSO. Administrators get both Gmail and OWA icons on their icon bar.

All this was relatively straight-forward, but our icon evaluator for email has been "flakey" in that it occasionally offers people the wrong icon. We are still working on debugging that...it seems like the problem has something to do with the order that roles are assigned to a user in the LDAP.

The biggest issue we had was with the fact that we are PD and were trying to change the behavior of the icons from the relevent files on the resource tier. Actually, its the files on each of the web servers in portal tier that matter.

You may contact me directly, if you'd like to discuss this further.
kc.allen@sfcc.edu

Hi KC

I am writing you an email now, thanks!

Alan

Note: We just took our springbreak vacations in New Mexico, we visited SantaFe, Alberquque and Taos, it was a nice one! :)

Hi all

I got the following errors trying to compile a Java file to create customized icons:

$ javac NewIconEvaluator.java
NewIconEvaluator.java:3: package org.apache.commons.logging does not exist
import org.apache.commons.logging.Log;
^
NewIconEvaluator.java:4: package org.apache.commons.logging does not exist
import org.apache.commons.logging.LogFactory;
^
NewIconEvaluator.java:6: package org.jasig.portal.channels.cpicons does not exist
import org.jasig.portal.channels.cpicons.IconEvaluator;
^
NewIconEvaluator.java:7: package campuspipeline.uportal.dlm.provider does not exist
import campuspipeline.uportal.dlm.provider.ExtensionClass;
^
NewIconEvaluator.java:8: cannot find symbol
symbol: class IconEvaluator
public class NewIconEvaluator extends IconEvaluator
^
NewIconEvaluator.java:12: cannot find symbol
symbol : class Log
location: class com.sungardhe.cpicons.NewIconEvaluator
private static final Log cLog = LogFactory.getLog( NewIconEvaluator.class );
^
NewIconEvaluator.java:12: cannot find symbol
symbol : variable LogFactory
location: class com.sungardhe.cpicons.NewIconEvaluator
private static final Log cLog = LogFactory.getLog( NewIconEvaluator.class );
^
NewIconEvaluator.java:18: cannot find symbol
symbol : variable super
location: class com.sungardhe.cpicons.NewIconEvaluator
Map icons = super.evaluate( cpInfo );
^
Note: NewIconEvaluator.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors

Anyone can give me idea how to get rid of the errors??? Thanks!

Alan

package com.sungardhe.cpicons;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Element;
import org.jasig.portal.channels.cpicons.IconEvaluator;
import campuspipeline.uportal.dlm.provider.ExtensionClass;
public class GMailEvaluator extends IconEvaluator
{
public static final String RCS_ID = "@(#) $Header: //depot/main/luminis-sdk/ui-sdk/samples/com/sungardhe/cpicons/GMailEvaluator.java#1 $";
/** Class logging object. */
private static final Log cLog = LogFactory.getLog( GMailEvaluator.class );
private static final String BLACKBOARD_ICON = "blackboard";
private static final String GMAIL_ICON = "gmail";

public Map evaluate( Element cpInfo )
{
Map icons = super.evaluate( cpInfo );
try
{
// Hardcoded "TRUE" for Blackboard and GMail icons, Alan Yang 09/13/2010
icons.put( BLACKBOARD_ICON, "true" );
icons.put( GMAIL_ICON, "true" );
}

catch( Exception ex )
{
cLog.error( "failed to evaluate cp icons", ex );
}
return icons;
}
}

Please note: We hard coded "Blackboard" and "Gamil" because all users will see the icons, thanks!

Hi Alan,
Here is the code that works for us. Be sure to run .cpclasspath before you compile.

package com.sungardhe.cpicons;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Element;
import org.jasig.portal.channels.cpicons.IconEvaluator;
import campuspipeline.uportal.dlm.provider.ExtensionClass;

public class MultipleIconEvaluator extends IconEvaluator
{
public static final String RCS_ID = "@(#) $Header: //depot/main/luminis-sdk/ui-sdk/samples/com/sungardhe/cpicons/MultipleIconEvaluator.java#1 $";

/** Class logging object. */
private static final Log cLog = LogFactory.getLog(MultipleIconEvaluator.class);

private static final String EXCHANGELABS_ICON = "exchangelabs";
private static final String MSEXCHANGE_ICON = "msexchange";
private static final String BLACKBOARD_ICON = "blackboard";

public Map evaluate( Element cpInfo )
{
Map icons = super.evaluate( cpInfo );
boolean blackboardEnabled = false;

try
{
// Test to see if blackboard.enabled is set to true
if (getDirectoryProperty(cpInfo,"blackboard.enabled").equalsIgnoreCase("true") )
{
blackboardEnabled = true;
}

// Update the icon map
icons.put(BLACKBOARD_ICON, "" + blackboardEnabled );

////////////////////////////////////////////////////////////////////////////

// Override MS Exchange icon display to only display for employees or faculty. First, check to see if the property is enabled
boolean msexchangeEnabled = false;

if (getDirectoryProperty(cpInfo,"msexchange.enabled").equalsIgnoreCase("true") )
{
// Now check to see if this user is an employee or faculty member
String[] userRoles = (String[])getLDAPAttributes(cpInfo,"pdsRole").toArray(new String[0]);

for (int i = 0; i {
if (userRoles[i].equalsIgnoreCase("employee") || userRoles[i].equalsIgnoreCase("faculty"))
{
msexchangeEnabled = true;
break;
}
}
}

// Update the icon map with information for the msexchange icon
icons.put(MSEXCHANGE_ICON, "" + msexchangeEnabled );

//////////////////////////////////////////////////////////////////////////////

// Override Exchange Labs icon display to only display for students. First, check to see if the property is enabled
boolean exchangelabsEnabled = false;

if (getDirectoryProperty(cpInfo,"exchangelabs.enabled").equalsIgnoreCase("true") )
{
// Now check to see if this user is a student
String[] userRoles = (String[])getLDAPAttributes(cpInfo,"pdsRole").toArray(new String[0]);

for (int i = 0; i {
if (userRoles[i].equalsIgnoreCase("student"))
{
exchangelabsEnabled = true;
break;
}
}
}

// Update the icon map with information for the exchangelabs icon
icons.put(EXCHANGELABS_ICON, "" + exchangelabsEnabled );

/////////////////////////////////////////////////////////////////////////////

}

catch( Exception ex )
{
cLog.error( "failed to evaluate system property", ex );
}
return icons;
}
}

Hi Bill

Thanks for reply.
cpclasspath is now fixed. but I kept getting the following warnings:

NewIconEvaluator.java:25: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Map
icons.put(BLACKBOARD_ICON, "" + BlackboardEnabled);
^
NewIconEvaluator.java:26: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Map
icons.put(GMAIL_ICON, "" + GmailEnabled);
^
Please help? Thanks!

Alan

Being a community college, we have lots of people who have more than one role. A large number of employees are also students.

Our "rule" is if you are an employee, no matter what else you might be, you get the OWA icon. If you are a student and/or a student employee, you get the Gmail icon.

Sometimes (not often) the evaluator gets it wrong. Do you ever have that issue?

Hi KC

We show all Icons for all our luminis users and we got no complains so far.

Blackboard, Gmail and Groupwise are our customized icons.

Alan

That would be "Ms. KC Allen".
Glad it worked out for you.