forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LPS-115484 Token definition registry #91176
Closed
liferay-continuous-integration
wants to merge
6
commits into
brianchandotcom:master
from
liferay-continuous-integration:ci-forward-LPS-115484-new-pr-101-sender-izaera-ts-1594372872738
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note that themes are WAR files, not OSGi bundles, so people need to add the Token-Definition-Path header to the liferay-plugin-package.properties file to make it appear in the MANIFEST.MF file of the generated OSGi bundle.
It is possible that in the future we have another method returning structured data, so we suffix this one with "String" to leave room for the other method. See liferay-frontend#87 (comment) .
…ry to avoid ambiguity We cannot call the service ThemeTokenDefinition because if we model the String in the future with a more complex object we may collide.
To conserve resources, the PR Tester does not automatically run for forwarded pull requests. |
liferay-continuous-integration
deleted the
ci-forward-LPS-115484-new-pr-101-sender-izaera-ts-1594372872738
branch
July 17, 2020 10:23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Forwarded from: liferay-frontend#101 (Took 1
ci:forward
attempt in 1 hour 28 minutes)@izaera
@liferay-frontend
Original pull request comment:
Resend of #91149
This is the -hopefully- final PR for the first version of token definitions API.
It simply provides a singleton OSGi service that retrieves the content of a specific file inside theme bundles. In the future we may evolve the API, but for now this is a good starting point.
See originating PR with the whole discussion on this here.
I have tested this API by manually deploying a modified version of the classic-theme project.
How to use the API
To obtain the token definition of a given theme you just need to inject a
ThemeTokenDefinitions
instance in your component:and call its only method passing the theme id:
How to attach a token definition to a theme:
In your theme's project you just need to add a header to
liferay-plugin-package.properties
to specify where the JSON file is located inside the WAR:Token-Definition-Path=WEB-INF/your-wonderful-token-definition.json
You can also omit it and
WEB-INF/token-definition.json
will be used.Then just fill your
token-definition.json
with whatever is needed (the format is out of the scope of this PR for now, as it hasn't been defined yet).✔️ ci:test:stable - 20 out of 20 jobs passed
✔️ ci:test:relevant - 46 out of 46 jobs passed in 1 hour 11 minutes
Click here for more details.
Base Branch:
Branch Name: master
Branch GIT ID: 416a2473fe7d0ecbf40a2ed07d1aba6e290aeda5
Copied in Private Modules Branch:
Branch Name: master-private
Branch GIT ID: 2d61577aa6a76425e17132e68f5aa901f720a686
ci:test:stable - 20 out of 20 jobs PASSED
20 Successful Jobs:
ci:test:relevant - 46 out of 46 jobs PASSED
46 Successful Jobs:
For more details click here.
✔️ ci:test:sf - 1 out of 1 jobs passed in 5 minutes
Click here for more details.
Base Branch:
Branch Name: master
Branch GIT ID: 416a2473fe7d0ecbf40a2ed07d1aba6e290aeda5
Sender Branch:
Branch Name: LPS-115484-new
1 out of 1jobs PASSEDBranch GIT ID: 7b4fdb596c5866f0a8db97c5138b07b7abf50304
1 Successful Jobs:
For more details click here.