留言板

Resources Importer:How to avoid version number with the imported resources?

thumbnail
Irina Russkaya,修改在6 年前。

Resources Importer:How to avoid version number with the imported resources?

Junior Member 帖子: 44 加入日期: 16-12-2 最近的帖子
Hi,

I use resources importer to import resources with the theme. My problem is that all the imported resources (journal articles, journal structures, journal templates and ADTs) have a version number in the name of my imported resources like Tab - 1.0.0. In the resources importer is only Tab. If I deploy the theme with the changed resource in the importer the number in the name stays the same. So I have the same Tab - 1.0.0, but content is changed.

Is there any option to import resources with their real names without - 1.0.0?
thumbnail
David H Nebinger,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
How are the version numbers getting in there in the first place?

I mean, Liferay doesn't by default monkey with the title/name especially since they support localization.

Is this something your content authors are doing?









Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Irina Russkaya,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Junior Member 帖子: 44 加入日期: 16-12-2 最近的帖子
I have an empty site without any contents. Then I deploy my theme with the integrated resources then the resources appear on the site with the names with numbers.
thumbnail
David H Nebinger,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Okay, so maybe you don't realize, but the imported assets are being pulled in as they are defined for RI, it is not Liferay manufacturing these during import.

You need to go to the theme and the exported contents, that's where you'll find the version numbers in the names/titles.










Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
I have the same behaviour.

My imported Structures, Templates and ADTs have all 1.0.10 at the end:

For example if I have one ADT file "Carousel ADT.ftl" inside "resources-importer" folder when it is imported it become: "Carousel ADT - 1.0.10"

My articles don't have this number at the end, the name is the same of the file inside "resources-importer" folder.
thumbnail
David H Nebinger,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
What version of Liferay are you guys using?










Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
Liferay 7 GA 4

EDIT: the number at the end of the file in a new liferay instance is 1.0.0 (not 1.0.10)
thumbnail
Irina Russkaya,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Junior Member 帖子: 44 加入日期: 16-12-2 最近的帖子
I use Liferay 7 GA 4 and Liferay 7 DXP with the actual FP. On both the same problem
thumbnail
Irina Russkaya,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Junior Member 帖子: 44 加入日期: 16-12-2 最近的帖子
I've solved my problem.
In liferay-plugin-package.properties
resources-importer-append-version=false

Then all the imported resources (templates, structures) don't have the version number in the name.
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
Thanks for sharing your solution

Can I ask where did you find it? in the documentation it is not present:

liferay-plugin-package_7_0_0.properties
thumbnail
Irina Russkaya,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Junior Member 帖子: 44 加入日期: 16-12-2 最近的帖子
Massimo Bevilacqua:


Can I ask where did you find it? in the documentation it is not present:

liferay-plugin-package_7_0_0.properties


In the source code of Resources Importer (PluginPackageProperties). We should oftener investigate the source code directly. Is always helpful.
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
Thank you!
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
I have one question...I am messing with import resource too and I have this problem...

If in my sitemap.json file I add an asset publisher with an ADT I am not able to set tags or priority just to display only certain contents.
Usually I manage the contents to display with tags or priority.
I can set tags for web content in assset.json, but I am not able to set the filter for this tags in the asset publisher.
I can set order by priority in asset publisher but not priority number in web content

Can you help me?
thumbnail
Irina Russkaya,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Junior Member 帖子: 44 加入日期: 16-12-2 最近的帖子
Could you please provide your sitemap.json or only part with the asset publisher? I will test it on my liferay machine. I think it is something with freeMarkerPortletPreferences. It will be also useful for me.
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Resources Importer:How to avoid version number with the imported resour

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
Sure, thank you
inside sitemap.json:

                 {
                    "portletId": "com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_${groupId}",
                    "portletPreferences": {
                        "groupId": "${groupId}",
                        "portletSetupShowBorders": "false",
                        "portletSetupUseCustomTitle": "false",
                        "displayStyle": "full-content", 
                        "orderByColumn1":"priority",
                        "orderByType1":"DESC",
                        "showAssetTitle":"false", 
                        "delta":"5",
                        "portletSetupPortletDecoratorId":"barebone",
                        "displayStyleGroupId": "${groupId}"
                    }
                },


In this way I can set "Ordering and grouping" In Asset publisher Configuration
"orderByColumn1":"priority",
"orderByType1":"DESC",


If you want to use your custom ADT replacing full-content with ""ddmTemplate_YOUR_ADT_TEMPLATE_KEY","
  "displayStyle": "full-content", 


I have unziped a Lar file and find that the field name for Displayed assets filter is :
<preference>
<name>queryValues0</name>
<value>testTag</value>
<value>home</value>
</preference>


But it doesn't work

In my assets.json I have something like this:

  {
            "name": "lorem ipsum.xml",
            "priority":"3.0",
            "tags": [
                "testTag",
                "home"
            ]
        },


The tags are correctly insert in my content but priority is not