How to change eZPlatform Backoffice SiteAccess? - ezplatform

I'm new to ezplatform and I have been just thrown in a project involving migration from ez legacy to ez platform.
One problem I've just bumped into is about siteaccess and images.
Example: users have custom images defined in a var directory, let's say var/news.
Unfortunately backoffice uses default siteaccess and I don't find a way to modify it without trigger a redirect from /ez#login to /login page.
I noticed that I can't change backoffice siteaccess in demo platform too.
So I was wondering either if there's a way to achieve this purpose or there's documentation that could help to address such subject?

Just to be clear, you have one var directory per site access, that is the issue right? As /ez will use the default one, you have a problem.
I think there is no simple way to manage this use case right now, I think it will be possible to do it with 2.x (ask in Slack)
One complex solution would be to put everything in one var directory and replace in the DB the different paths... :(
(or wait 2.x)

Related

Silverstripe URL Mapping

I'm trying to understand how URL Mapping works. I've gone through numerous pages, but I can't seem to wrap my head around what I'm trying to do.
Its really simple, I use DataObjects as pages approach and I have a member extension written to the member class. And I have the typical actions, show, edit, add.
So if I go to www.mywebsite.com/members/show/1 I can see the first user. If I change show to edit, I can edit the first user. Now if I go to www.mywebsite.com/members/add I can create a new user. This is working all as expected due to the functionality I created in the add method.
My problem is in the fact that when you go any website, you don't register to the website by going to members/add, you register by going to website.com/Register or something similar. From code management perspective, it is a lot easier for me to leave the code the way it is now. I don't want to have to create a Register page and move the code there, instead I am trying to figure out if it is possible to go to www.mywebsite.com/Register and have it load www.mywebsite.com/members/add. I am not talking about a redirect link that would update the url, I want users to still see Register in the url and not see /members/add.
Vice versa, if users were to go to www.mywebsite.com/members/add I want the link to update to Register or say page not found.
Is this possible with Silverstripe Framework?
I am not 100% sure, but I believe this is called URL Masking.
This is very possible, firstly I'd advise that you look over...
silverstripe-memberprofiles
...because even if you dont' want to use an existing module I'm sure there would be useful information. There is a great example of "pure" routing (i.e. silverstripe no cms) that leads on to "nested" routes - which is what I think you are asking for, so I highly recommend reading the slides below and then the created todo app
silverstripe-framework-building-without-the-cms
todo app source

Best practices approach to multiple views in meteor?

Every tutorial/example i can find for meteor shows a single view application. I would like to build something a little more complex. I'm unclear how to approach multiple views...preferably in a way that's somewhat scalable?
The iron-router package lets you access different views (layouts) by nice, REST-ful human-friendly clean URLs. It supports parameters in the URL, "loading" templates, waiting for subscriptions to finish loading, before and after hooks etc.
At this point you can only create Single Page applications with Meteor. Note that Single Page, doesn't mean you can't have several views - use iron-router for that.
But by design, Meteor serves a big fat unique JavaScript/HTML/CSS application down to the browser, though there's a feature request to allow incremental loading. It is then up to the application (or more precisely, the JavaScript framework), to dynamically render its views in order to display different "pages".
I was wondering the same thing and it took me way too much time getting something started. I finally got a paged app working solidly by using Backbone views and routes, so I created a simple boilerplate project to make setting up an app like this easier in the future.
Live demo here: backbone-boilerplate.meteor.com
Source code here: github.com/justinmc/meteor-backbone-boilerplate
Have you looked at madewith.meteor.com?
A bunch of apps there have multiple views using Backbone also Jonathan Kingston who created britto has started simple meteor framework called Stellar
At this stage of the game not sure if there really are best practices. But these two seem to be the current flow.
You can also make a tabbed interface for multiple views. There is a package project "Smart package for generating a tabbed interface with pushState" github project here: https://github.com/possibilities/meteor-tabs
The best solution right now is using a routing package (router is basic but works). The workflow is something like this:
declare routes; return a template name for each route
place the reactive helper provided by the package in your body tag
the reactive helper will return the template associated to that route
you create a template for each route and optionally set custom publish functions
Router will give you browser history (client side).
Note that at this time there are some limitation on the way Meteor handles html/js. They are load all at the same time. The bright side is that once the app is loaded, page transitions will be instant.

What's the difference between IPloneSiteRoot and ISiteRoot in Plone?

I'm Working in Plone 4.1 and I'm just curious to know the difference between Products.CMFPlone.interfaces.IPloneSiteRoot and Products.CMFCore.interfaces.ISiteRoot. If I want to register a zope-3 style view, to which one should I register it?
Whenever I want to use a site root, I usually end up using the INavigationRoot from plone.app.layout.navigation.interfaces.INavigationRoot instead.
The INavigationRoot is provided by the Plone site object, but it will also be provided by the navigation root of any subsite or the top level folders in a multi-lingual site. Especially in multi lingual sites, users will never navigate or see the actual site root itself, so any functionality attached to it won't be available to them.
The ISiteRoot only makes sense for things like export import handlers or other internal logic, but not for any enduser visible functionality.
An IPloneSiteRoot is a specific kind of ISiteRoot. IPloneSiteRoot is provided by the root of a Plone site, whereas ISiteRoot is provided by any CMF portal. If your product is only intended to work in Plone, then it doesn't really matter which interface you use. If you want it to be usable with other CMF-based applications, then use ISiteRoot.
Frankly, I usually go with ISiteRoot just because it's shorter to type. :)

Migating from CakePHP to Drupal, functionality question

(I've posted this on the drupal forum too btw)
I'm converting the company websites to use Drupal, or at least trying to check that its going to be the best way forward. I have a background in PHP development, and I'm currently using the CakePHP framwork. I've built this site (not my design) and I can see how to replicate most of the functionality using Drupal, most likely using the CCK module.
http://preview.tinyurl.com/yk6u8mt
As you can see from the homepage:
A user chooses a country.
The country is passed using an ajax call to a script that decides which phone is best based on 'in country' network coverage.
A div is shown recommending the visitor the best phone for that country.
I'm wondering how to go about this in Drupal, I'm definitely not after a step by step guide, I just want to know if this kind of thing is possible with Drupal, and what approach to use.
If someone can help that would be superb. Thanks.
Okay, so you've got a path you're defining in hook_menu, which is where your form is being presented - or else you've got it set up as a webform in a node, that could work too.
Either way, in your form you're going to be using AHAH - check out http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#ahah and http://drupal.org/node/348475 .
Basically, you're going to define another path in hook_menu that's of type MENU_CALLBACK, and which will receive the country as input, and then will return the div that you'll display on the screen.
One core example of AHAH that may be useful to you is where you're entering a password and it lets you know if the password is secure enough - check that out.
Edit: There's also some good examples at http://drupal.org/project/examples.
I would look into using CCK and views. you can set up filters for the views. If filters don't work, you have the ability to include php code. I have also successfully added jquery code in the header of a view through which I was then able to have my view filtered by what is typed in a text box.
Coming from CakePHP using Drupal is a pain in the a** - even more for developers.
It's application structure might be designed to ease extensibility but this only means you have a system to enable your own plugins and themes.
While modules are basically the M+C-part the themes are the V-part of an MVC-application. The problem is that this seperation is not very strict in Drupal - in fact you have to break it sometimes in order to make things work (e.g. you have to include a theme_mymodule_myfunction() into your module as default output which you then can override with your theme using mytheme_mymodule_myfunction() ) And don't even bother looking for classes ( see http://drupal.org/node/547518 ).
Also there is no real link from a module to a theme. On many occations this is a good thing as you can switch modules and themes seperatly without creating a problem. For application builders coming from CakePHP (or any other framework) you often feel a lack of "wholesomeness" - you create parts for a base software and have to live with it's drawbacks.
IMHO I wouldn't recommend this step. Drupal is fine if you have to manage a website and might add a few modules to add neccessary value (image gallery etc.) but I definetly don't recommend it as a base for a customized web-app.

Export Drupal Content?

I want to know what is the easiest way to export ALL content of a specific user in Drupal, by only making use of the database. Is this even possible?
Reason being, I moved a site, and now clients created content on the old server, unknowingly, and I need to move it to the new server. Unfortunately, the site can't be accessed anymore (due to the move) so I only have access to the database.
Should I perhaps look at finding a way to maket the isntallation accessible and then using an export mdoule, or is there an easy way to export using PHPMyAdmin?
Ouch
You could take the db and set it up on a sandbox somewhere, which would give you access to see what changed. Genrally if you have access to a DB (and know which version of drupal and modules you had), you can run a drupal site from it.
In an earlier question I suggested the migrate module for getting content from one drupal db to another, I think that appies here. If you can't get another code base to look at the old DB.
Instead of trying to pinpoint the content that a specific user has created, it will probably be a lot easier to get the stuff you need based on the datetime. But it really depends what kind of content that have been created. If it's just nodes, it should be fairly simple to load the nodes from the one database and save it to the other.
Another thing worth mentioning is that Drupal support having more than one database in your settings. You can relatively change the db connection if they are of the same type (e.g. MYSQL). See the db_set_active function.
You can also try to make use of the migrate modules like Jeremy suggested, which way to go depends a bit on how well your Drupal/PHP/SQL skills are and how tricky it is to get the data you need.
I think this module will help you
data_export_import
I know you already fixed this, but what about the backup_migrate module?

Resources