adobe-consulting-services / acs-aem-commons Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://adobe-consulting-services.github.io/acs-aem-commons/
License: Apache License 2.0
Home Page: http://adobe-consulting-services.github.io/acs-aem-commons/
License: Apache License 2.0
Kinda of like the AEM Adaptive Image Servlet, except on bovine growth hormones.
https://github.com/davidjgonzalez/acs-aem-commons/tree/feature/named-transform-image-servlet
Inspired by previous discussions in Issue #24, with @ykisen and @justinedelson around non-destructive renditioning of Images. Note, this approach does NOT support authorability of renditions.
Allows developers to create transform rule sets (resize/crop/rotate - in whichever order) and apply the named transforms against (almost?) any image in AEM.
Works against:
Requesting URIs require a "transform" extension, the first suffix segment is the named transform and the last suffix segment is "image." or "img." (to promote cacheability).
Current all transforms are maintained in a single OSGi Config; debating trying to break it out to allow "sets" of named transforms via configFactory configs.
Something like:
<dhlm:includeClientLibraries region="head" js="true" css="true"/>
As components become more dynamic the need for multi-rendition of pages (our favorite sort of authorable resource!) becomes more necessary. Sling's resource-centric worldview positions us exceedingly well (ex. page based selectors) however defining various images (or more typically, image transformations) based on page renditions is still problematic.
Ex. I maybe want a 4x3 (200px x 150x) cropped image for search results, but a 16 x 9 (160px x 90px) image for a featured box in the sidebar, etc. We have no good, concise way for Authors to define an image to represent a page and provide transformations w previews for the various renditions.
Not 100% sure .. early POC is creating a new component with multiple dialog tabs, each tab featuring a html5smartimage widget with preset crop ratios. Crop rations are store on discrete nodes but image binary is pulled for the "usual" image node under a page's jcr:content. A special "image-preview" selector is added to the page to display all images at their various transformations.
I am not convinced this is the best solution, however my gut reaction is allowing renditions of Pages to be managed centrally (at said Page) is key.
Page content pushes width past view port making for awkward scroll experience on small devices, esp on feature pages
A Component that allows a fixed # of components to be added; something like a Parsys that only accepts N components; where N is configurable by Design.
CQ Author Tools UI for forcing dispatcher flush of any paths in Dispatcher (permission-able by admin)
Remove the procedural bottleneck of requesting Ops team to flush (delete) dispatcher caches post deployments or content activations across environment. This tends to be an impediment to new development as there is often a gap between dev and ops (and ops owns dispatcher config/stat files/etc.)
This comes up with regularity that some elements need to be rewritten to make them absolute URLs to some secondary domain which is "cookie-less".
Everyone wants to be able to increment clientlibs/designs based on released to allow long TTLs for these typically long-lived assets.
Currently the only way I know how to do this is to have maven builds adjust the name of the clientlibs folder to contains a build no. (assuming all FW assets reside under a CL, which IMO they should; Designs are an odd abstraction -- see DesignHtmlLibraryManager.
Design Dialogs are a powerful tool for storing cross-site component configurations. The way the cell lookup works prevents the very common use case of allowing certain components from sharing a design-global configuration vs a template-specific configuration. Ex. Logo on Geometrixx; requires editing on each type of page (Homepage and a Content page). page impl cellNames can be setup, but this prevents other components from being configured on a per-template basis which can be desirable.
Create a Sling Filter that looks at the to-be-included Component and set the cellName based on a property on the cq:Component node. Im not sure if IncludeOptions will allow a full reset of the cell stack -- may require another approach.
JaCoCo is a more current coverage tool than cobertura.
Cloud Services configuration for Dynamic Tag Management
The robots.txt I added is (of course) in a sub-dir of the site, so its ignored.
Can add files to the GH pages domain root (everything on google points to no)?
If not, we can add meta tags to the apidocs pages themselves like so
find . -name '*.html' -exec sed -i '' 's/<\/HEAD>/<meta name=\"robots\" content=\"noindex\"><\/HEAD>/' "{}" \;
To the copy-javadoc.sh
(unless the javadoc mvn plugin has support for this; didnt see it though)
Update Sling Filter to require a configuration policy so it only include in the filter stack if explicitly desired.
Re-usable AEM Component rarely contain the markup or sum of features required for various customer use cases. This results in a copy-down overlay approach of the original JSP. This causes grief when upgrading source materials as enhancements are not recognized without re-integration.
This problem is very common when using the Foundation AEM Components.
(Re-usable) ACS AEM Components will:
<audio>
tag)<audio ...>...</audio>
tag/apps/acs-commons/components/content/audio/partials/audio.jsp
/apps/acs-commons/components/content/audio/audio.jsp
will simply include the partials:<cq:include script="partials/audio.jsp"/>
For a developer to augment the component markup, they simply have to superResourceType (i guess it would be sub-ResourceType) the ACS AEM Commons audio component and selectively include whatever partials they want intermixed with whatever markup or other facets they need (as long as the superType is set)
/apps/myapp/components/content/audio/audio.jsp
<div class="myclass-for-audio">
<cq:include script="partials/audio.jsp"/>
<p><%= properties.get('instructions', "Press play") %></p>
</div>
partials/audio.jsp
with both facets, or one for each facet; partials/audio.jsp
(audio tag) and partials/instructions.jsp
(print instruction text).One of our design principals is to not have required 3rd party dependencies. Which implies that we can have optional 3rd party dependencies.
The policy I suggest is:
For each 3rd party dependency, I'd also like to see a separate project which makes that dependency available in a content package. For libraries which are already OSGi-ified, this would just be a content package project embedding the bundle. For libraries which are not OSGi-ified, we will need a content package project and an embedded bundle project.
An example (for the Twitter4J API) can be found here: https://github.com/justinedelson/com.adobe.acs.bundles.twitter4j
The idea is that this content package would be released and deployed and then could be incorporated into a project just like ACS AEM Commons. We'd have to add instructions for how to do this to the site as well as identify which features depend on which libraries.
WDYT?
This is a pretty popular service.
CRX 2 does not scale wrt to writes/content-distribution in a way that makes it a reasonable solution for storing user-based highly volatile data. Personalized data tends to get pushed and persisted in the ClientContext via cookies.
Sometimes maintaining the state in Cookies does not make sense. (Business would like more control over stored data, does not want to expose the data directly to the user, privacy concerns, performance concerns (sending large cookies across all requests), etc.)
Use redis to create a highly scalable "session-like" store for user data. Users would posses a cookie key (ala JSESSIONID) which would be associated with a data set in redis. redis can be access from all Publish servers so the data is not tied to a single publish server thus highly scalable. redis also has native data expiration to automatically expire content. redis is hugely scalable wrt to reads and writes as it is an in-memory datastore.
Currently, you get no feedback
From https://travis-ci.org/Adobe-Consulting-Services/acs-aem-commons/builds/12147278:
Could not find artifact com.adobe.granite:com.adobe.granite.ui.commons:jar:5.5.8
It would be a better user experience if the edit dialog on the design page used drop down lists to select the client library category
OOTB AEM configpage [1] loads the dialogs using in-page JS written out by Java code.
String dialogPath = (!resource.getResourceType().startsWith("/libs") ? "/libs/" : "") + resource.getResourceType() + "/dialog";
In our case, resource.getResourceType
is acs-commons/components/utilities/dtmpage
so the dialogPath turns into /libs/acs-commons/components/utilities/dtmpage
which is incorrect.
[1] /libs/cq/cloudserviceconfigs/components/configpage/body.jsp
Currently exported as 1.2.0. Needs to be locked down by next release.
@davidjgonzalez can I ask you to take a crack at this?
http://activecq.com/system/assets/46/original/quick-reference.html
Thoughts on moving my quick reference as a gh-pages page?
I'm a little hesitant because:
Im happy to move it over, or not; I maintain it for me, but am happy to share.
That being said, i'd welcome feedback/corrections/suggestions.
Would be nice to add a blacklist of resourceTypes/resourceType patterns that would be ignored which would generate "normal" behavior when an exception is thrown in them.
Create a maven archetype that extends the Adobe multi-module maven archetype but includes core organization and place holders.
Intermediary solution: a zip of the augmenting files to unzipped over a new multi-mod project.
Key elements:
A clean wrapper for exposing common "Page" data, such as contents of <head>
's meta-tags, etc.
In the ACS-AEM-Commons utility pages I find myself using "ugly" code to display simple data points like Page Title
final String title = TextUtil.getFirstNonEmpty(
currentPage.getPageTitle(),
currentPage.getTitle(),
currentPage.getName());
No to mention escaping and localizing values.
IME we (cq implementors) tend to have very similar lookup patterns/uses for all the various Page attrs (title, keywords, description, nav titles, etc.). My hesitation is this list of common usages may not warrant a full "wrapper" implementation. I think we'd want to define the interface before adding to the project.
How about as another striation:
Who are you?
Unfortunately, we have 1100+ checkstyle warnings at this point. Until that number is reduced, we can't really be failing the analysis build for them. Once that number has been reduced to a managable number, we can reenable it.
CQ
is included in the list of predefined variables for jslint verification. This is potentially problematic as it can allow edit-time JS to seep into user-side JS. Since it only impacts one file, I'm going to remove it from this list.
Not necessarily a bug, but marking it as such.
Disptacher Flush UI Template shows up in, if not "buggy", then atleast odd places.
Example:
Shows up as viable Template for Cloud Services.
Im sure itll show up in a variety of other places as well.
Unless other have suggestions i move to restricting to to:
/etc/acs-commons/dispatcher-flush
/etc/dispatcher-flush
/etc/replication
IMO those are the most logical places (options) for these pages to live.
The contract of writeIncludes() says that it includes CSS and JS, but in fact that is not the case - only JS libraries are output.
WDYT?
There's a slight inefficiency in DispatcherFlushRulesImpl where it creates new filter objects inside a loop. Since the filter object is stateless, this isn't necessary.
Similar to the New flag, we should have a way of flagging pages as being updated. I see this as a manual process, i.e. we'd flag the Forms page as updated to draw attention to the fact that it has changed. Or when new widgets are added to the custom widgets page.
Would be best not to reproduce these all over the place.
I've noticed we use (at least) two different styles for representing JCR nodes in documentation:
Although the latter is more accurate, it seems noisier to me and I generally prefer JSON.
Creating a Web UI for defining Dispatcher Flush rules would be great. This would allow for a base set of rules to be strictly defined as part of the application (OSGi Config) and another set to be defined in an ad hoc manner to support flexible content build out.
This UI might be able to be built out using ACS AEM Commons Generic Lists.
There's no way to specify externalStyleSheets for an RTE produced by Dynamic RTE configuration. There should be.
There are two queries running inside ErrorPageHandlerImpl and I believe both can be eliminated.
The first query is to find all the cases where the errorPages property is defined. This can be done without a query by using an InheritanceValueMap to walk up the resource tree from the parent resource.
The second query is to find a page with the appropriate name within the errors path. This can be done by direct node access.
Does it help to write a utils method to get check the sling runmode and return an isAuthor boolean? I can do it, but, need to know from you guys if I should create a new SlingUtils class or add this to an existing class.
Let me know what you thinks.
Thanjs
Images can only be easily transformed (resized, cropped, rotated) via the Image component which requires associating a binary image with a resource.
Often requiring an Author to define an Image resource w the proper transformations is unwieldy.
Adaptive Image Servlet begins to solve this problem however still requires the "proxy resource" AFIAK
A Servlet that intercepts requests for nt:file resource types with a specific signature (selector) that uses parameterized instructions which are part of the suffix to transform the resource.
<img src="/content/dam//path/to/picture.png.transform.img.png/width/20/rotate/180/image.png"/>
This could/would reduce the need for multiple renditions of DAM assets as media-based WF tends to be heavy computationally and wrt to storage.
As AEM moves from WCM to WebApp, the need to move around User profile information becomes more common. Current "OOTB" implementation for this requires various Launchers and dev-based "touch" of resource for replication.
RR has many nuances and pitfalls. We would need to be very careful we dont create a faulty/broken abstraction.
Replication Handler that, on content replication, issues Dispatcher Flush requests for other content trees, independent of stat level. Ex.
Replication of resources matching: /content/dam/mysite/.* ~> Flush /content/mysite
or
Replication of resources matching: /etc/packages/.* ~> Flush / (everything! who knows what a new package could affect!)
Similar to the new 4.1.4+ Dispatcher Handler functionality, but does not require bash scripting, and can be achieved via simple OSGi Configuration mappings (future versions may include an UI-based component). The Ops maintained dispatcher handlers are brittle in that they live outside the natural realm of the application, maintained by a team that should not require intimate knowledge of the inter-content dependencies.
(Needs a better name)
The dispatching of error pages should always be done using a GET request so as to ensure that they get properly delivered.
For example, a request like
curl -u admin:admin http://localhost:4502/content/page/which/doesnt/exist.html -F./jcr:content/foo=bar
should not actually set jcr:content/foo to bar on the error page.
and since Markdown doesn't support definition lists properly, textile will have to be used instead
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.