IdentityServer3 - CustomViewService Vs DefaultViewService - css

I would like to change the look and feel of the login page that is served up by IdentityServer3.
Effectively i would like to add a selection of stylesheets (as its used across multiple sites) that can be added. I am also looking to include an additional "Register" button that will take you too another page along with a forgot password link.
I know i can add the forgot password link in the LoginPageLinks list on startup, but the modification for registration i dont think will work this way. (Please correct if im wrong)
I have read the ID3 documentation on modification and it appears i can get most of what i want by modifying the DefaultViewService, however a custom View service (implementing the IViewService) seems to give me everything, but you have to have all of the assets in place explicitly in my solution (js/css/html/less/fonts).
What i want to know is am i missing something here? is the DefaultViewService the answer? and how modifiable is it really? as i dont really want to go down the root of the implementing a custom view.

A 100% custom IViewService is rarely the way to go, as it's a lot of work. You can always implement custom HTML templates to add your CSS and whatever custom markup you want. If you need it to be dynamic, then you can look into deriving from the DefaultViewService and overriding the appropriate methods to add what you need at runtime.

Related

cq:include default components in CQ form with server validation

I would like to customize start/end of OOTB CQ5 user form component to start with certain custom components pre-populated when the 'form' component is drag/dropped on to the page.
I currently have an over-laid /apps/foundation/components/form elements with start/end/actions customized. But I am to figure out way to add a component belonging to the FORM group, to the form start.......end to the page whenever a form is added to the page.
I have tried using a <cq:include path= "customComp" resourceType="/pathto/customComponent" /> to the jsp of the form-end component, this adds / shows the custom-component on display but does not perform the server-validations as it is not a separate node between the start and end nodes on the page, but a dynamically added one.
This is basically to enforce/mandate the use of my custom captcha component whenever a form is placed on a page.
thanks in Advance !
If you want to leave the form creation entirely to the author (as intended with OOTB components) there is no easy way to "sneak in" a mandatory captcha component. Even if you managed to put in the captcha component, the author can just delete it or move it out of your paragraph system.
Mingling the captcha with form-end might be possible, but not without reinventing the form-end component pretty much from scratch. I wouldn't want to do that.
I see three options that might be helpful to you:
Implement a jcr EventListener that will fire whenever a form is created or changed. Check the form data structure in jcr and when the mandatory captcha component is missing, add it and commit. This type of behaviour is of course a little shady and may suprise authors - but it's gonna work.
Build a wrapper form component that contains a paragraph system with a fully pre-configured form, including form-start, captcha and form-end. This approach my even save authors a bit of work and nobody will "forget" about the chaptcha easily. Nothing will stop an evil author from explicitly deleting the catpcha component however.
Build an entirely custom form component that does not utilizy any of the OOTB components. In this scenario you have full control over what the author can and cannot do. Most likely you will give up on a lot of flexibility in order to save development time and end up with a mostly static form where the author can edit a few cruicial parts.

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

Alfresco ajax advanced search

With alfresco advanced search form I would like to perform search by ajax and display the list of search results in the same page (without reloading the page).
Is it possible?
Is there a recommended way to do it?
Thank you in advance
So if I understand you clearly you don't want the page to reload.
Sure that's possible!
Do you start by hacking into the advanced search form or do you create a new page just for this is maybe the first question.
You can do it either way. Probably the latter is easier to maintain and less hacking and you can use a client-site Library of your preference.
If you want to keep the default form you just need to change the following files
advsearch.js, the client-side YUI file which gets run on the form and does the submit
/alfresco/site-webscripts/org/alfresco/components/search/advsearch.get.html.ftl, the html file which has all the div's etc. defined.
So change the client-side library to do the search directly to the repo, take a look at search.js and use the method.
Then define in your template the search results area from search.get.html.ftl.
So basically you're merging these 2 components into 1 big one.

Edit the Html.BeginForm helper method in asp.net

I have a specific theme which I apply to my html and now instead of editing it everything I create view. I want to edit the html helper methods and all all my necessary classes and id information can be put in one place.
How do i do this?
Do I just create a new custom one or is it easier to edit one that is already there? I do plan to add some ones that are not there.
I have googled abit but all the answerers I found give specific code to their problem. I dont even know which folder to put my classes in? In a book im reading about mvc it explains custom model template, but i dont think that is exactly what im looking for?
Even a basic example will be great.
Do I just create a new custom one or is it easier to edit one that is
already there? I do plan to add some ones that are not there.
I would say creating a custom one would be fast and simple. But if you still want to give a try by enhancing existing one, than you can get the source code of System.Web.Mvc for CodePlex, and make your necessary modifications and build it, reference it and use it in your project.

Customization of hook function

I Am new to drupal I need to customize core functionality like register module and event module.please share you thought / sample code / sample website for get the clarification over my issue
Thanks in advance
Balaji
From what you posted in the comment to creejayoz answer, it seems like what you are after is not using hook_form_alter, but something in the line of what the profile module does. It's part of drupal core, and with it you can add extra fields to the user like first and last name. There are also more advanced modules that you can use instead, but it seems like you wont need it. Using the profile module will also be a lot quicker and easier than using hook_form_alter as you wont need to create a db table make SQL and such to the save the data.
You can use hook_form_alter to heavily modify the way Drupal's registration works, by modifying the form's fields, adding extra validation/submit functions, etc. It's difficult to give more detail without knowing what you're wanting to do.

Resources