Alfresco ajax advanced search - alfresco

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.

Related

Drupal know from where things are showed

I have a strange question but I don't find any hint about that (if it's possible), for a drupal 7 website I have to modify some content of a page in the backoffice, but I really don't know from where some content of this page is created (a table, similar to a view table but not a view table).
I just want to know if there is any way to show which php function the page use to finally be showed. I know there is something like that for the theme (drupal theme debug) but I don't find something for my case.
Any idea ?
You need PHP profiler to check all functions called on page, there's a module for Drupal7 for XHProf integration. But I would suggest you to use your browsers inspector as mentioned by 2pha before. For example if there's a form on the page just use the form ID to find it. Custom classes are very useful in these cases, parts of the html codes etc. In your case search for table headers...
The code you are looking for is most probably in custom modules and the
general suggestion is to keep you custom modules in separated folder from contributed ones.

IdentityServer3 - CustomViewService Vs DefaultViewService

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.

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.

how to config SlickUpload 6 AJAX to NOT require a file

I've been trying to figure out how to make the current SlickUpload 6.1.7 play nice in a form that does not require someone to include files. We want it to be optional. This form is for people to contact us, and we want to give them the option to include attachments, just not require it. It works if you upload a file, however the form will not submit, if you do not upload any file.
We are trying to use the Ajax version with Memory stream, but the 'AspNetAjaxCs-VS2010' sample code is not helping much... the documentation is sparse, and the samples have little constancy between them, making it hard to understand how exactly it all works. (at least for me) The fact that they got bought out, and the new owner company pretty much ignores people unless they are paying for it, is not cool.
Any ideas?
You could use a div to detect a drop inside your page. That way you could only activate it when the user really need it, or whenever the using actually select something for uploading, like a trigger.
I'm not sure I understand your question, but if so, it sounds like you already have a form that you want to use SlickUpload with to upload files IF there are files to be uploaded. Are you using the CustomUploadStreamProvider form?

Custom search form in Drupal 6: Views/Panels or custom sql?

I use CCK in Drupal 6 and I need to build a search form in Drupal with 8-10 fields used as a filter. When the user submits the form I need to make a query on the DB applying filters and presenting the result on a table.
I know how to do this programmatically by building dynamically the SQL-where condition (joining node and content_type_xyz tables) but I would be interested in learning how to do it in the "Drupal way". I think I would have to use Views and Panels but I don't know if they can be easily implemented in situations like this. I've tried to build some sample views but I think to be faster in creating code by hand.
If you want custom searches you need IMO to do 2 things:
Hook yourself into _search so you can use Drupal's display for the results. Inside this form, you can create your queries for the database or load other content as you wish, just be sure to use pager_query.
Extend the search form that already exists or built your own. I suggest buliding your own. use what is already existing from Drupals search form. This way, you have a clean way of how to do this.
There is actually no need to use any fancy modules (that doesn't mean you should rule them out, but a search is something so esential that it is quite well handled with the basics).
Using the above, you'll get a native search form with all it's power and can make use of global paging options.
If you do it using views you will only be limited to the filtering you can do using SQL. Views is an SQL builder, and does not contain any 'proper' search functions. That said, it sounds like Views will do what you want; if you create filters under views and then click 'Expose this filter', you will suddenly see fields that allow the user to enter something to filter by appear.

Resources