[HST] "preview only" modules

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[HST] "preview only" modules

Niels van Kampenhout
Hi,

I created a bunch of modules that together add inline editing
functionality to a website. The user can login using a small login form.
If a user is logged in, some extra CSS and JS files are loaded that
enable inline editing when double cliking on some areas.

It's a proof of concept, and as such it works quite well. However the
inline editing functionality should only be available in the preview
site. Is there a (preferably easy ;-) ) way to have a different HST
configuration in preview and live? I just want to leave out some modules
in the preview.

Thanks,
Niels

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

Re: [HST] "preview only" modules

Jeroen Reijn
Administrator
This post has NOT been accepted by the mailing list yet.
Hi Niels,

I guess you could just duplicate the hst:configuration in your CMS console and create a version that is in unpublished mode. Now the state of the hst:configuration is probably set to published?

Regards,

Jeroen


Niels van Kampenhout wrote
Hi,

I created a bunch of modules that together add inline editing
functionality to a website. The user can login using a small login form.
If a user is logged in, some extra CSS and JS files are loaded that
enable inline editing when double cliking on some areas.

It's a proof of concept, and as such it works quite well. However the
inline editing functionality should only be available in the preview
site. Is there a (preferably easy ;-) ) way to have a different HST
configuration in preview and live? I just want to leave out some modules
in the preview.

Thanks,
Niels

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Ard
Reply | Threaded
Open this post in threaded view
|

RE: [HST] "preview only" modules

Ard
Hello

>
> Hi Niels,
>
> I guess you could just duplicate the hst:configuration in
> your CMS console and create a version that is in unpublished
> mode. Now the state of the hst:configuration is probably set
> to published?

As the published version is typically a result of publishing the
unpublished (:-)) version, it might be confusing to rely on different
configurations for both.

As I would prefer to have a different session user (different userid, so
for example a preview user and a live user ) for live & preview (not
sure if you can easily build this in the hst2 trunk), I think the
cleanest solution is as follows:

1) define a (marker only) mixin nodetype, for example:

[myproject:previewonly] mixin

2) create two users, a live and preview user. The live user has no read
rights on nodes of type 'myproject:previewonly'

3) add the mixin 'myproject:previewonly' via the console on those nodes
that are not allowed for the live user.

That should do the trick

Regards Ard

>
> Regards,
>
> Jeroen
>
>
>
> Niels van Kampenhout wrote:
> >
> > Hi,
> >
> > I created a bunch of modules that together add inline editing
> > functionality to a website. The user can login using a
> small login form.
> > If a user is logged in, some extra CSS and JS files are loaded that
> > enable inline editing when double cliking on some areas.
> >
> > It's a proof of concept, and as such it works quite well.
> However the
> > inline editing functionality should only be available in
> the preview
> > site. Is there a (preferably easy ;-) ) way to have a different HST
> > configuration in preview and live? I just want to leave out some
> > modules in the preview.
> >
> > Thanks,
> > Niels
> >
> > _______________________________________________
> > Hippo-cms7-user mailing list and forums
> > http://www.onehippo.org/cms7/support/community.html
> >
> >
>
>
> -----
> http://blogs.hippo.nl/reijn/
> --
> View this message in context:
> http://n2.nabble.com/-HST--%22preview-only%22-modules-tp230044
> 0p2302971.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

Re: [HST] "preview only" modules

Niels van Kampenhout
Ard Schrijvers wrote:

> As I would prefer to have a different session user (different userid, so
> for example a preview user and a live user ) for live & preview (not
> sure if you can easily build this in the hst2 trunk), I think the
> cleanest solution is as follows:
>
> 1) define a (marker only) mixin nodetype, for example:
>
> [myproject:previewonly] mixin
>
> 2) create two users, a live and preview user. The live user has no read
> rights on nodes of type 'myproject:previewonly'
>
> 3) add the mixin 'myproject:previewonly' via the console on those nodes
> that are not allowed for the live user.
>
> That should do the trick

How do I configure different users for preview and live in the site
toolkit? Right now I have a file hst.properties inside WEB-INF that contains

repository.address=rmi://127.0.0.1:1099/hipporepository
repository.user.name=username
repository.password=password

Also, for the inline editing, CMS users can login with their own
account. Would I need to set read permission on the previewonly mixin
for each user? I guess I could put them in a group and set the
permission there.

Perhaps an easier solution would be to have the complete preview
shielded behind a login. Would that be possible? Users would still login
with their own CMS account.

Thanks,
Niels

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

Re: [HST] "preview only" modules

Niels van Kampenhout
Niels van Kampenhout wrote:
> Perhaps an easier solution would be to have the complete preview
> shielded behind a login. Would that be possible? Users would still login
> with their own CMS account.

I did a rather naive implementation of the above, and it works well (at
least well enough for a proof of concept).

I created a servlet filter that checks if a user is logged in (by
checking a session attribute). If not it forwards to a dedicated login
page. This uses the login module I used earlier embedded in a webpage.
The login module checks the username and password and sets the session
attribute. The filter also sets a "preview" attribute on the current
request.

Any module or JSP can now check for a logged in session, and the preview
request attribute. If both conditions are true, the javascript that
enables inline editing is loaded.

Niels

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Ard
Reply | Threaded
Open this post in threaded view
|

RE: [HST] "preview only" modules

Ard
In reply to this post by Niels van Kampenhout

>
> How do I configure different users for preview and live in
> the site toolkit? Right now I have a file hst.properties
> inside WEB-INF that contains

Yes, this feature didn't make it to the hst2 tag/trunk anymore before
the major rebuild started...guess you could build it :-))

>
> repository.address=rmi://127.0.0.1:1099/hipporepository
> repository.user.name=username
> repository.password=password
>
> Also, for the inline editing, CMS users can login with their
> own account. Would I need to set read permission on the
> previewonly mixin for each user? I guess I could put them in
> a group and set the permission there.

I am not to familiar with the domains/groups permissions, but I guess
configuring this ones should be enough (Bart?)

>
> Perhaps an easier solution would be to have the complete
> preview shielded behind a login. Would that be possible?
> Users would still login with their own CMS account.

And then still use the readonly mixin, right? Should be possible, but as
indicated, the hst2 did not make it to deliver these options, so you
need to build something for it I am afraid

Ard


>
> Thanks,
> Niels
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

RE: [HST] "preview only" modules

Frank van Lankvelt
In reply to this post by Niels van Kampenhout
Hi Niels,

> Also, for the inline editing, CMS users can login with their
> own account. Would I need to set read permission on the
> previewonly mixin for each user? I guess I could put them in
> a group and set the permission there.
>
It may be easiest to create a separate domain with
- a facetrule that matches the mixin
- an authrole that gives users from an existing group (author?) the
jcrread role

Create your own group if you want to have more control over who can see
the inline editing features and who can't.

Cheers, Frank

> Perhaps an easier solution would be to have the complete
> preview shielded behind a login. Would that be possible?
> Users would still login with their own CMS account.
>
> Thanks,
> Niels
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>

[hidden email]          www.onehippo.com
Amsterdam Hippo B.V. Oosteinde 11   1017 WT   Amsterdam
+31(0)20-5224466
San Francisco Hippo USA Inc. 101 H Street, suite Q   Petaluma   CA
94952-5100   +1-877-41-HIPPO

 
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html