Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch '1.2' of github.com:hlship/tapx into 1.2
  • Loading branch information
hlship committed Jul 5, 2011
2 parents 6dea8b1 + 1ecc354 commit cad5d3a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 23 deletions.
10 changes: 7 additions & 3 deletions build.gradle
@@ -1,6 +1,6 @@
description = "Collection of add-ons for Tapestry 5"

tapestryVersion = "5.2.5"
tapestryVersion = "5.3.0-SNAPSHOT"

if (!project.hasProperty('deployUserName')) deployUserName = '*UNSET-USERNAME*'
if (!project.hasProperty('deployPassword')) deployPassword = '*UNSET-PASSWORD*'
Expand All @@ -16,7 +16,7 @@ subprojects {
sourceCompatibility = '1.5'
targetCompatibility = '1.5'

version = '1.1-SNAPSHOT'
version = '1.2-SNAPSHOT'

group = 'com.howardlewisship'

Expand All @@ -27,7 +27,11 @@ subprojects {
mavenRepo urls: "https://repository.jboss.org/nexus/content/repositories/releases/"

// For the Kaptcha library
mavenRepo urls: "http://howardlewisship.com/repository/"
mavenRepo urls: "http://howardlewisship.com/repository/"

// Latest snapshots

mavenRepo urls: "https://repository.apache.org/content/repositories/snapshots"
}

configurations {
Expand Down
Expand Up @@ -196,7 +196,6 @@ public int compareTo(Pair o)

private final Mapper<Object, Pair> toPair = new Mapper<Object, Pair>()
{
@Override
public Pair map(Object value)
{
return new Pair(model.toLabel(value), model.toClient(value));
Expand Down
Expand Up @@ -223,7 +223,6 @@ public void render(MarkupWriter writer, final RenderQueue queue)

nodes.rest().each(new Worker<TreeNode>()
{
@Override
public void work(TreeNode element)
{
queue.push(toRenderCommand(element, false));
Expand Down
@@ -1,4 +1,4 @@
// Copyright 2010 Howard M. Lewis Ship
// Copyright 2010, 2011 Howard M. Lewis Ship
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,6 @@

import java.util.Map;

import org.apache.tapestry5.internal.services.PagePool;
import org.apache.tapestry5.ioc.Resource;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.URLChangeTracker;
Expand All @@ -31,15 +30,12 @@ public class DynamicTemplateParserImpl implements DynamicTemplateParser, UpdateL
{
private final Map<Resource, DynamicTemplate> cache = CollectionFactory.newConcurrentMap();

private final PagePool pagePool;

private final BindingSource bindingSource;

private final URLChangeTracker tracker;

public DynamicTemplateParserImpl(ClasspathURLConverter converter, PagePool pagePool, BindingSource bindingSource)
public DynamicTemplateParserImpl(ClasspathURLConverter converter, BindingSource bindingSource)
{
this.pagePool = pagePool;
this.bindingSource = bindingSource;

tracker = new URLChangeTracker(converter);
Expand Down Expand Up @@ -79,7 +75,9 @@ public void checkForUpdates()
// rebuilt, which is a crude way of clearing out that data. Other alternatives exist, such as
// yielding up a proxy to the DynamicTemplate that is more change-aware.

pagePool.clear();
// But PagePool no longer exists in 5.3 ... need to expose an explicit way to clear the PageSource's cache

// pagePool.clear();
}
}

Expand Down
Expand Up @@ -44,7 +44,6 @@ private final Predicate<StackExtension> by(final StackExtensionType type)
{
return new Predicate<StackExtension>()
{
@Override
public boolean accept(StackExtension element)
{
return element.type == type;
Expand Down
Expand Up @@ -50,7 +50,6 @@ public Person findById(final long id)
{
return F.flow(db).filter(new Predicate<Person>()
{
@Override
public boolean accept(Person object)
{
return object.getId() == id;
Expand Down
Expand Up @@ -281,7 +281,6 @@ public void beginRender(MarkupWriter writer)

private static Mapper<String, TimeZone> ID_TO_TIME_ZONE = new Mapper<String, TimeZone>()
{
@Override
public TimeZone map(String value)
{
return TimeZone.getTimeZone(value);
Expand Down
Expand Up @@ -34,7 +34,6 @@ public Flow<TimeZone> getTimeZones()
{
return F.flow(TimeZone.getAvailableIDs()).map(new Mapper<String, TimeZone>()
{
@Override
public TimeZone map(String id)
{
return TimeZone.getTimeZone(id);
Expand Down
@@ -1,10 +1,10 @@
// Copyright 2009, 2010 Howard M. Lewis Ship
// Copyright 2009, 2010, 2011 Howard M. Lewis Ship
//
// Licensed 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
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -22,19 +22,19 @@
import java.util.List;
import java.util.Map;

import org.apache.tapestry5.internal.services.ResourceStreamer;
import org.apache.tapestry5.ioc.Resource;
import org.apache.tapestry5.ioc.annotations.Scope;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.services.assets.ContentTypeAnalyzer;

import com.howardlewisship.tapx.templating.RenderedStream;
import com.howardlewisship.tapx.templating.RenderedStreamEnclosure;

@Scope(PERTHREAD)
public class MultipartResourceTrackerImpl implements MultipartResourceTracker
{
private final ResourceStreamer resourceStreamer;
private final ContentTypeAnalyzer contentTypeAnalyzer;

private long uid = System.nanoTime();

Expand All @@ -56,9 +56,9 @@ private StoredResource(String contentId, Resource resource)

}

public MultipartResourceTrackerImpl(ResourceStreamer resourceStreamer)
public MultipartResourceTrackerImpl(ContentTypeAnalyzer contentTypeAnalyzer)
{
this.resourceStreamer = resourceStreamer;
this.contentTypeAnalyzer = contentTypeAnalyzer;
}

/**
Expand Down Expand Up @@ -173,6 +173,6 @@ public String toString()

private String getContentType(Resource resource) throws IOException
{
return resourceStreamer.getContentType(resource);
return contentTypeAnalyzer.getContentType(resource);
}
}

0 comments on commit cad5d3a

Please sign in to comment.