0

how to import a theme in liferay 7 workspace?

I added the theme under workspace/themes and I tried to deploy it but did not work. The build type of my Theme is Ant.

The following picture shows the details:

enter image description here

I put the Theme under *sdk\com.liferay.portal.plugins.sdk-1.0.11\themes* and I tried to test it as in Liferay 6. Import-> Liferay Projects from plugins SDK then when adding the SDK I got an error :

app.server.dir is invalid. Please reconfigure Plugins SDK setting: app.server.dir=path to liferay portal/tomcat-8.0.32

Then I tried to migrate the theme from the plugins sdk liferay workspace. I puted the sdk under: liferay-workspace\plugins-sdk\sdk\com.liferay.portal.plugins.sdk-1.0.11

Then I tried this commande C:\Users\User1\workspace2\liferay-workspace>blade convert --themebuilder name_theme she does not return anything.

The structure of the original theme:

enter image description here

The css directory:

enter image description here

I fixed the problem app.server.dir is invalid. by switching the java jdk from 8 to 7 in eclipse.ini file:

-vm
D:/Program Files/Java/jdk1.7.79/bin/javaw.exe

When I did Import-> Liferay Projects from plugins SDK and I puted the SDK path, I got this error:

No available projects can be imported.

Do I need to upgrade it?

Update:

Sorry, I checked the compatibility of Theme. The theme is already compatible with Liferay 7 and no need to upgrade it.

<look-and-feel>
    <compatibility>
        <version>7.0.2+</version>
    </compatibility>
    ...
</look-and-feel>

I am trying to import the Theme on Liferay 7.0.0 GA1.

1- I am using jdk 1.8 for eclipse Neon.3 Release (4.6.3).

Image description:

enter image description here

2- I updated sdk /build.{ username}.properties

Image description:

enter image description here

3- I putted the Theme under sdk\liferay-plugins-sdk-7.0\themes and I did Import-> Liferay Projects from plugins SDK and I putted the SDK path D:\FormationJEE\Liferay\Liferay7_g1\sdk\liferay-plugins-sdk-7.0. I do not find the theme. I did Refresh and it does not appear.

Image description:

enter image description here

I followed @OlafKock 's instructions:

I declared the compatibility with 7.0.0+ and when I did Import-> Liferay Projects from plugins SDK I did not have the right to put the path of sdk. It is set by default to this: D:\FormationJEE\Liferay\Liferay7_g1\sdk\liferay-plugins-sdk-‌​7.0. I do not find the theme. I did Refresh and it does not appear.

Now, I can not change the path of sdk anymore. It is stuck at D:\FormationJEE\Liferay\Liferay7_g1\sdk\liferay-plugins-sdk-‌​‌​7.0. I can not test the theme on Liferay 7.0 GA5.

I fixed that by creating another workspace but still can not import the theme project.

4- Hello, I tried to migrate the theme from the plugins sdk to workspace using this command:

blade convert --themebuilder [THEME_PROJECT_NAME]

I typed the command and nothing happens. I followed this link: MIGRATING A THEME FROM THE PLUGINS SDK TO WORKSPACE

Dark Magic
  • 149
  • 3
  • 20

2 Answers2

0

To upgrade existing liferay 6 theme refer following url

https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/upgrading-themes

use following command to upgrade your existing liferay 6 theme.

gulp upgrade

You can build liferay 7 theme using following url, and copy your existing liferay theme css, js and portal files to new theme directory.

https://web.liferay.com/web/smgulnaaz/blog/-/blogs/theme-creation-in-liferay-7
Rajesh
  • 400
  • 3
  • 7
  • I got an error: Local gulp not found in liferay-workspace\plugins-sdk\sdk\com.liferay.portal.plugins.sdk-1.0.11\myTheme – Dark Magic Nov 08 '17 at 14:55
  • Install Node.js (v4.2.2), npm and then from command prompt install gulp using following "npm install gulp - g" – Rajesh Nov 08 '17 at 15:07
  • refer - https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/themes-generator – Rajesh Nov 08 '17 at 15:08
  • pls I need more help. I already have Node.js installed and npm. I taped the command in Node.js command prompt and I got an error. where should I write the commande? – Dark Magic Nov 08 '17 at 16:24
  • Use "npm install -g gulp" to install local gulp tool. You can type it from your workflow/themes directory. Send me your theme src. Let me know. – Rajesh Nov 08 '17 at 16:33
  • I typed `C:\Users\User1\workspace2\liferay-workspace\themes>npm install -g gulp`. there are warnings, but I think it works. Now, where to type `gulp upgrade` commande? – Dark Magic Nov 08 '17 at 16:45
  • In your theme’s root directory modules\inspinia7, run "gulp upgrade". It will upgrade existing liferay 6.2 theme to liferay 7. – Rajesh Nov 08 '17 at 16:54
  • pls a lite help I am confused. I already have my theme under `liferay-workspace/themes` and when I typed `npm install -g gulp` it was changed. how to do it properly? – Dark Magic Nov 08 '17 at 17:00
  • if its already upgraded, try running gulp deploy, if it generate war, your theme is upgraded to workspace if not then attached your theme code. – Rajesh Nov 08 '17 at 17:02
  • I can't give you the code. I tried **gulp upgrade** and **gulp deploy** `C:\Users\User1\workspace2\liferay-workspace\themes\inspinia7>gulp upgrade [17:54:09] No gulpfile found` – Dark Magic Nov 08 '17 at 17:08
  • create new theme under liferay-workspace/themes/ and manually copy css js and template files – Rajesh Nov 08 '17 at 17:22
  • the theme has been modified. from 28 mo to 7 mo? and I do not understand what I'm doing? – Dark Magic Nov 08 '17 at 17:31
  • see the update. pls I need to know if you've done that before. and is it possible to repeat the steps properly? stay with me. – Dark Magic Nov 08 '17 at 19:41
  • recently i've upgrade liferay 6 theme to liferay 7. please expand css directory? Also let me know if you using vm template or ftl file. – Rajesh Nov 08 '17 at 19:44
  • pls see the update. I don't think there is a vm template or a ftl file. – Dark Magic Nov 08 '17 at 20:01
  • I really need a help. – Dark Magic Nov 08 '17 at 20:14
  • vm or freemaker files are in templates directory. Ok you can do one thing, create new theme following instruction from this link https://web.liferay.com/web/smgulnaaz/blog/-/blogs/theme-creation-in-liferay-7. Once you create theme, copy your existing css/js/templates/fonts from your existing theme/_diff folder to new workspace theme/directory. It would be much easier. – Rajesh Nov 08 '17 at 20:15
  • can I test the theme as in Liferay 6. **Import-> Liferay Projects from plugins SDK** I got an error: **app.server.dir is invalid. Please reconfigure Plugins SDK setting: app.server.dir=path to liferay portal/tomcat-8.0.32** when adding the SDK. – Dark Magic Nov 08 '17 at 20:20
  • you could check this one "app.server.tomcat.dir=${app.server.parent.dir}/tomcat-*** " in build.properties file of plugin sdk, if it is different with your tomcat version, you could config "app.server.tomcat.dir" in your build.${username}.properties file or change tomcat version in build.properties file. – Rajesh Nov 08 '17 at 20:23
  • The "app.server.tomcat.dir" is the same as the tomcat version. I created a build.username.properties file and I added **app.server.type** , **app.server.parent.dir** , **app.server.tomcat.dir** still the same problem. – Dark Magic Nov 08 '17 at 20:31
  • you mean `app.server.parent.dir= D:\\FormationJEE\\Liferay\\Liferay7_ga4\\tomcat\\liferay-ce-portal-7.0-ga4` – Dark Magic Nov 08 '17 at 20:36
  • I followed the blog and I created a Theme and I copied the files css / js / templates / fonts from my existing **theme/_diff** folder to **liferay-7-theme/src**. Now, what do I have to do? – Dark Magic Nov 08 '17 at 22:09
  • great do that gulp build and gulp deploy on your new created theme root folder. – Rajesh Nov 08 '17 at 22:13
  • ok, done , there some warnings: `[23:17:40] D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.0/lib/sass/util.rb:1074: warning: constant ::Fixnum is deprecated` – Dark Magic Nov 08 '17 at 22:19
  • you can resolve warning. try deploy and test on liferay server if everything works fine – Rajesh Nov 08 '17 at 22:23
  • I am using Liferay 7.0.3 GA4. I am in **Control Panel -> site Templates** there is no theme, there is only "Community Site" and "Intranet Site" How to deploy it on the Liferay server? – Dark Magic Nov 08 '17 at 22:31
  • it should be in look and feel not site templates. – Rajesh Nov 08 '17 at 22:33
  • where do I find it? – Dark Magic Nov 08 '17 at 22:36
  • site - navigation - configure – Rajesh Nov 08 '17 at 22:43
  • It works. this is the new theme that I created and for the other one? – Dark Magic Nov 08 '17 at 22:57
  • Now, what do I have to do? – Dark Magic Nov 08 '17 at 23:27
  • Sorry, I checked the compatibility of Theme. The theme is already compatible with Liferay 7 and no need to upgrade it. I putted the Theme under /themes and I did Import-> Liferay Projects from plugins SDK and I putted the SDK path. I do not find the theme. I did Refresh and it does not appear. please check the Update3. – Dark Magic Nov 13 '17 at 13:25
  • Hello, I tried to migrate the theme from the plugins sdk to workspace using this command "blade convert --themebuilder nameThemeProject". I typed the command and nothing happens. – Dark Magic Nov 22 '17 at 09:55
0

Not sure if this helps, but: Try 7.0 GA5. It might have fixed an issue that you're running into. Also, it might help the mismatch of your stated version and the declared compatibility

<look-and-feel>
    <compatibility>
        <version>7.0.2+</version>
    </compatibility>
    ...
</look-and-feel>

7.0.2+ refers to "7.0 GA3 and later", but you state that you're using GA1. Many issues have been fixed since then. Do a quick try declaring compatibility with 7.0.0+, but, by all means, use the most current version as a long term fix.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • I declared the compatibility with 7.0.0+ and when I did **Import-> Liferay Projects from plugins SDK** I did not have the right to put the path of sdk. It is set by default to this: **D:\FormationJEE\Liferay\Liferay7_g1\sdk\liferay-plugins-sdk-7.0**. I do not find the theme. I did Refresh and it does not appear. – Dark Magic Nov 14 '17 at 11:36
  • Now, I can not change the path of sdk anymore. It is stuck at **D:\FormationJEE\Liferay\Liferay7_g1\sdk\liferay-plugins-sdk-‌​7.0**. I can not test the theme on Liferay 7.0 GA5. – Dark Magic Nov 14 '17 at 12:00
  • I fixed that by creating another workspace but still can not import the theme project. – Dark Magic Nov 20 '17 at 10:13