Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/tagbangers/wallride
Browse files Browse the repository at this point in the history
  • Loading branch information
ogawa-takeshi committed Feb 22, 2017
2 parents d4eaa36 + 30bb634 commit 2220291
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 92 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>
<groupId>org.wallride</groupId>
<artifactId>wallride</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
<packaging>pom</packaging>
<name>WallRide</name>
<description>CMS for developers of principles</description>
Expand Down Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>org.wallride</groupId>
<artifactId>wallride-core</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
</dependency>

<!-- Spring -->
Expand Down
2 changes: 1 addition & 1 deletion wallride-bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.wallride</groupId>
<artifactId>wallride-parent</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
<relativePath>../wallride-parent/pom.xml</relativePath>
</parent>
<artifactId>wallride-bootstrap</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion wallride-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.wallride</groupId>
<artifactId>wallride</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wallride-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,23 @@ public TagUtils tagUtils() {

@Bean
@ConditionalOnMissingBean
public WallRideThymeleafDialect wallRideThymeleafDialect() {
WallRideThymeleafDialect dialect = new WallRideThymeleafDialect();
public WallRideThymeleafDialect wallRideThymeleafDialect(WallRideExpressionObjectFactory expressionObjectFactory) {
return new WallRideThymeleafDialect(expressionObjectFactory);
}

@Bean
@ConditionalOnMissingBean
public WallRideExpressionObjectFactory wallRideExpressionObjectFactory() {
WallRideExpressionObjectFactory expressionObjectFactory = new WallRideExpressionObjectFactory();
ArticleUtils articleUtils = articleUtils();
PageUtils pageUtils = pageUtils();
dialect.setPostUtils(postUtils(pageUtils));
dialect.setArticleUtils(articleUtils);
dialect.setPageUtils(pageUtils);
dialect.setCategoryUtils(categoryUtils());
dialect.setTagUtils(tagUtils());
dialect.setWallRideProperties(wallRideProperties);
return dialect;
expressionObjectFactory.setPostUtils(postUtils(pageUtils));
expressionObjectFactory.setArticleUtils(articleUtils);
expressionObjectFactory.setPageUtils(pageUtils);
expressionObjectFactory.setCategoryUtils(categoryUtils());
expressionObjectFactory.setTagUtils(tagUtils());
expressionObjectFactory.setWallRideProperties(wallRideProperties);
return expressionObjectFactory;
}

@Bean(name = {"defaultTemplateResolver", "homePathTemplateResolver"})
Expand Down Expand Up @@ -141,7 +147,7 @@ public ITemplateResolver classPathTemplateResolver() {
}

@Bean
public SpringTemplateEngine templateEngine() {
public SpringTemplateEngine templateEngine(WallRideThymeleafDialect wallRideThymeleafDialect) {
SpringTemplateEngine engine = new SpringTemplateEngine();
// engine.setTemplateResolver(templateResolver());
Set<ITemplateResolver> templateResolvers = new LinkedHashSet<>();
Expand All @@ -152,15 +158,15 @@ public SpringTemplateEngine templateEngine() {
Set<IDialect> dialects = new HashSet<>();
dialects.add(new SpringSecurityDialect());
dialects.add(new Java8TimeDialect());
dialects.add(wallRideThymeleafDialect());
dialects.add(wallRideThymeleafDialect);
engine.setAdditionalDialects(dialects);
return engine;
}

@Bean
public ThymeleafViewResolver thymeleafViewResolver() {
public ThymeleafViewResolver thymeleafViewResolver(SpringTemplateEngine templateEngine) {
ThymeleafViewResolver viewResolver = new ExtendedThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine());
viewResolver.setTemplateEngine(templateEngine);
viewResolver.setViewNames(this.thymeleafProperties.getViewNames());
viewResolver.setCharacterEncoding(this.thymeleafProperties.getEncoding().name());
viewResolver.setContentType(this.thymeleafProperties.getContentType() + ";charset=" + this.thymeleafProperties.getEncoding());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,85 +19,20 @@
import org.thymeleaf.dialect.AbstractDialect;
import org.thymeleaf.dialect.IExpressionObjectDialect;
import org.thymeleaf.expression.IExpressionObjectFactory;
import org.wallride.support.*;

public class WallRideThymeleafDialect extends AbstractDialect implements IExpressionObjectDialect {

public static final String NAME = "WallRide";

private PostUtils postUtils;
private WallRideExpressionObjectFactory wallRideExpressionObjectFactory;

private ArticleUtils articleUtils;

private PageUtils pageUtils;

private CategoryUtils categoryUtils;

private TagUtils tagUtils;

private WallRideProperties wallRideProperties;

protected WallRideThymeleafDialect() {
protected WallRideThymeleafDialect(WallRideExpressionObjectFactory wallRideExpressionObjectFactory) {
super(NAME);
}

public PostUtils getPostUtils() {
return postUtils;
}

public void setPostUtils(PostUtils postUtils) {
this.postUtils = postUtils;
}

public ArticleUtils getArticleUtils() {
return articleUtils;
}

public void setArticleUtils(ArticleUtils articleUtils) {
this.articleUtils = articleUtils;
}

public PageUtils getPageUtils() {
return pageUtils;
}

public void setPageUtils(PageUtils pageUtils) {
this.pageUtils = pageUtils;
}

public CategoryUtils getCategoryUtils() {
return categoryUtils;
}

public void setCategoryUtils(CategoryUtils categoryUtils) {
this.categoryUtils = categoryUtils;
}

public TagUtils getTagUtils() {
return tagUtils;
}

public void setTagUtils(TagUtils tagUtils) {
this.tagUtils = tagUtils;
}

public WallRideProperties getWallRideProperties() {
return wallRideProperties;
}

public void setWallRideProperties(WallRideProperties wallRideProperties) {
this.wallRideProperties = wallRideProperties;
this.wallRideExpressionObjectFactory = wallRideExpressionObjectFactory;
}

@Override
public IExpressionObjectFactory getExpressionObjectFactory() {
WallRideExpressionObjectFactory expressionObjectFactory = new WallRideExpressionObjectFactory();
expressionObjectFactory.setPostUtils(postUtils);
expressionObjectFactory.setArticleUtils(articleUtils);
expressionObjectFactory.setPageUtils(pageUtils);
expressionObjectFactory.setCategoryUtils(categoryUtils);
expressionObjectFactory.setTagUtils(tagUtils);
expressionObjectFactory.setWallRideProperties(wallRideProperties);
return expressionObjectFactory;
return wallRideExpressionObjectFactory;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class Tags {

private IExpressionContext context;

private TagUtils TagUtils;
private TagUtils tagUtils;

public Tags(IExpressionContext context, TagUtils TagUtils) {
this.context = context;
this.TagUtils = TagUtils;
this.tagUtils = TagUtils;
}

public List<Tag> getAllTags() {
return TagUtils.getAllTags();
return tagUtils.getAllTags();
}
}
4 changes: 2 additions & 2 deletions wallride-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>org.wallride</groupId>
<artifactId>wallride-parent</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
<packaging>pom</packaging>
<name>WallRide Parent</name>
<description>CMS for developers of principles</description>
Expand Down Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>org.wallride</groupId>
<artifactId>wallride-core</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion wallride-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.wallride</groupId>
<artifactId>wallride</artifactId>
<version>1.0.0.M10</version>
<version>1.0.0.M11</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wallride-tools</artifactId>
Expand Down

0 comments on commit 2220291

Please sign in to comment.