Coder Social home page Coder Social logo

Comments (4)

davidjgonzalez avatar davidjgonzalez commented on May 23, 2024

I think just a isAuthor(..) method would be overkill since we have slingSettingsService.getRunModes().contains("author")

If it was part of a broader Util full of handy tolls for out-of-HTTPRequest context, then it would be a different story.

(If im in the context of a HTTP Request I (almost) always want to use WCMMode rather than runmodes.)

from acs-aem-commons.

justinedelson avatar justinedelson commented on May 23, 2024

I could see this being useful if it was a static. That requires jumping through some hoops to get this value set in a static context. Probably an immediate component which sets the values on startup. Runmodes can't be changed at runtime, so this is OK to do once.

If so, I'd like to see

isAuthor()
isPublish()
isRunmode(String)

from acs-aem-commons.

kaushalmall avatar kaushalmall commented on May 23, 2024

@davidjgonzalez I thought WCMMode was never a good way to differentiate between being on author or publish. IIRC @justinedelson is a proponent of this.

@justinedelson are you talking about creating a OSGi component that sets the values on startup? I would love to do this, but, might (read will) need direction to get me started.

from acs-aem-commons.

davidjgonzalez avatar davidjgonzalez commented on May 23, 2024

@kaushalmall WCMModes don't differentiate between author and publish instances; but can differentiate between intended publish and author behaviors. Within HTTP Request scoped-behaviors (Components/Servlets/etc.) the idea of the author/publish runmode is (normally) just an abstraction around WCMMode types.

Creating hard in-code deps on Author or Publish make it more difficult to experience the behavior on Author as it would on Publish.

Runmodes typically play a role in changing backend behaviors (WF, Listeners, Jobs, etc.) that need to behave differently based on the tier.

Of course, as with anything there are exceptions.

IIRC @jayk is a proponent of WCMModes :P

from acs-aem-commons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.