Skip to content

Instantly share code, notes, and snippets.

<aggregated-group-config>
<aggregator-type>org.jasig.portal.events.aggr.IPortalEventAggregator</aggregator-type>
<include>
<groupService>pags</groupService>
<groupName>Everyone</groupName>
</include>
</aggregated-group-config>
private boolean layoutExistsForUser(IPerson person) {
// Assertions.
if (person == null) {
return false;
}
final List<Integer> ignoredNodeIds = new LinkedList<Integer>();
final List<Integer> newNodeIds = new LinkedList<Integer>();
//Get header/footer child/next nodes
@edalquist
edalquist / README
Created March 28, 2012 16:26
Eclipse XML Detail Formatter
When dealing with XML variables (Document, Node, Element) in the debug view of Eclipse
it can be handy to see the actual XML instead of the object model. Eclipse's Detail
Formatter feature makes this possible.
* Right click on the xml object in question
* Select "New Detail Formatter"
* Paste the code below into the Detail Formatter Code Snippet
* Enjoy!
@edalquist
edalquist / transform.java
Created April 3, 2012 16:22
guava examples
public Iterable<? extends IPortalData> getPortalData() {
final List<String> userList = this.jdbcOperations.queryForList("SELECT USER_NAME FROM UP_USER", String.class);
return Lists.transform(userList, new Function<String, IPortalData>() {
@Override
public IPortalData apply(final String userName) {
return new SimpleStringPortalData(userName, null, null);
}
});
}
private static final LoadingCache<String, Name> NAME_PARSE_CACHE = CacheBuilder.newBuilder().maximumSize(1000).build(new CacheLoader<String, Name>() {
@Override
public Name load(String s) throws Exception {
int start = 0;
int separatorLength = separator.length();
int end = s.indexOf(separator, start);
List<String> list = new ArrayList<String>(4);
while (end != -1)
{
list.add(s.substring(start,end));
public <T extends BaseAggregation> List<T> fillInBlanks(AggregationInterval interval, DateTime start, DateTime end, List<T> data, Function<AggregationIntervalInfo, T> missingDataCreator) {
final List<T> fullData = new LinkedList<T>();
AggregationIntervalInfo nextInterval = this.getIntervalInfo(interval, start);
for (final T entry : data) {
final DateDimension dateDimension = entry.getDateDimension();
final TimeDimension timeDimension = entry.getTimeDimension();
//Convert the date/time dimensions into a concrete DateTime
private static TimeZone defaultTimeZone;
private static DateTimeZone defaultDateTimeZone;
private static String defaultUserTimezone;
@BeforeClass
public static void setupTZ() {
defaultTimeZone = TimeZone.getDefault();
defaultDateTimeZone = DateTimeZone.getDefault();
defaultUserTimezone = System.getProperty("user.timezone");
<bean id="requestAttributeSourceFilter"
class="org.jasig.services.persondir.support.web.RequestAttributeSourceFilter">
<property name="additionalDescriptors" ref="requestAdditionalDescriptors" />
<property name="usernameAttribute" value="remoteUser" />
<property name="remoteUserAttribute" value="remoteUser" />
<property name="serverNameAttribute" value="serverName" />
<property name="processingPosition" value="BOTH" />
<property name="headerAttributeMapping">
<map>
#
# Licensed to Jasig under one or more contributor license
# agreements. See the NOTICE file distributed with this work
# for additional information regarding copyright ownership.
# Jasig licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a
# copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
<filter-mapping>
<filter-name>requestAttributeSourceFilter</filter-name>
<url-pattern>/Login</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>requireValidSessionFilter</filter-name>
<servlet-name>RenderingDispatcherServlet</servlet-name>
<servlet-name>JsonRenderingDispatcherServlet</servlet-name>
</filter-mapping>