如何在Liferay中创建自定义主题,默认主题为父级?

时间:2015-09-29 08:27:46

标签: java liferay liferay-6 portlet liferay-theme

我想弄清楚有关创建和更改Liferay主题的一些事情。现在我想对默认主题进行一些更改。我从maven archetype为liferay主题创建了项目。将默认主题设置为父级,将所有文件复制到我的/ webapp文件夹。这是我的pom.xml

<?xml version="1.0"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
    <artifactId>theme</artifactId>
    <groupId>by.velcom</groupId>
    <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sample-theme</artifactId>
<packaging>war</packaging>
<name>sample-theme Theme</name>
<build>
    <plugins>
        <plugin>
            <groupId>com.liferay.maven.plugins</groupId>
            <artifactId>liferay-maven-plugin</artifactId>
            <version>${liferay.maven.plugin.version}</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>theme-merge</goal>
                        <goal>build-css</goal>
                        <goal>build-thumbnail</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
                <appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
                <appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
                <appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
                <liferayVersion>${liferay.version}</liferayVersion>
                <parentTheme>${liferay.theme.parent}</parentTheme>
                <pluginType>theme</pluginType>
                <themeType>${liferay.theme.type}</themeType>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>portal-service</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-bridges</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-taglib</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-java</artifactId>
        <version>${liferay.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.portlet</groupId>
        <artifactId>portlet-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
<properties>
    <liferay.theme.parent>_unstyled</liferay.theme.parent>
    <liferay.theme.type>vm</liferay.theme.type>
</properties>

然后我在样式和模板中更改了一些内容,部署了sample-theme.war。 Configuration-&gt;显示设置(样本主题)中添加了新主题。但是当我选择并申请时,我看不到我做出的任何改变。有人能说我做错了吗?

1 个答案:

答案 0 :(得分:0)

如果默认情况下你的意思是经典那么你必须改变

<liferay.theme.parent>_unstyled</liferay.theme.parent>

这个

<liferay.theme.parent>_classic</liferay.theme.parent>

运行maven任务以便它应用它,记住你只需要复制你想要修改的文件。