Drupal, a custom searchable user profile should be based on Node or Custom db? - drupal-6

I have to work on a Drupal project to create user profile for some specific users on the website with some special fields. They can be a different role. Main idea is to search. User profile must be searchable with provided criteria.
I have two options,
1- Using node with (content_profile)
2. Create my own form and tables.
One my question is, is it possible to create a separate search machanism for custom created database? and is there a way to cache search result? or should I use node based? please advice some one with idea on this..
Thanks.

Yes it is possible to create a search mechanism using views and exposing the custom table to views via the api (there is a blog post here: http://blog.menhir.be/2008/10/22/expose-database-fields-to-views-in-a-custom-drupal-module/ and there is more info using the advanced help module (http://drupal.org/project/advanced_help) (install and look through the views documetation), then you could also use the Views caching.
A custom table and fields would be my preferred method if you have a lot of users as the profile tables can get pretty big (this may not be an issue for you), or you could use the content profile module http://drupal.org/project/content_profile and possibly save yourself some work!
If you wanted to perform a complete custom search not using views you'd probably need to implement that and the caching yourself if you went the custom field/table route, but you'd gain a lot of flexibility.

Related

What is the preferred strategy/workaround for introducing legacy database entities in Jhipster

Is there a good practice to introduce existing legacy database tables/entities into a JHipster project?
The idea I had was to create the JPA entities that look exactly like the existing entities and then use the generated artifacts as per normal. Will this possibly work?
In the end, I opted for just creating a view of all the underlying tables I needed in my query. The steps I followed were:
create the view on the DB,
Generate the entity using JHipster, with exactly the same fields.
Strip out the Update ad Create and Delete functions and we have a read-only view page with all the data you need and all the fields displaying, done.
Now I can add my own routers and buttons, to allow other specific operations/flow. This page was my inspiration: https://www.javabullets.com/calling-database-views-from-spring-data-jpa/

How to save an orchard form to a database

I'm creating a fairly complex orchard form and need the results saved to a sql server database. From what I understand, I should be creating a workflow activity and then on form submit, connecting to the database and saving the data through C#. Is this the correct approach?
I could also just create a module which is my custom form, and build the form myself, but would like to take advantage of orchards forms.
My question is
1. Am I approaching this correctly? or is there an easier way to do this.
2. I haven't been able to find any documentation on creating custom workflow activities. Is this even possible to do? Can someone point me in the right direction.
No, the custom forms module already saves the results, you don't have to do anything more.
Yes, you can create custom activities. Look at the code for the existing activities for examples.

How can I programmatically determine the creator of a Domino database?

I'm using the built-in Domain Catalog database to list all the databases on a particular Domino server. I'm creating a custom view to show certain information about each database. What I'd like to have is a column that displays the creator of each database. However, if the Domain Catalog is keeping track of this information, I can't find it.
Is there a field in the Domain Catalog that provides this information that I just haven't been able to find? Is there some other way I might find this information and get it into this view? #DBlookup and related functions don't work in column formulas.
That information is not stored in the catalog, and is probably not stored in the database either (It's not shown on any of the property tabs).
You would probably need to get/write a server add-in to monitor database creation and store that data somewhere. Then you'd need to account for databases created by adminp/replication - your add-in might pick them up as having been created by a server.
This question was also asked in the R4/R5 forums in 1998 and received no answer.
Interesting question. There is no such attribute for database, but you can dig for some clues.
New databases: use NotesNoteCollection and look for some specific design element (icon, for example) and look for first element in $UpdatedBy field.
New copies/from templates: above mentioned method won't work. It will return info from original/template, not current database. In this case, try using Created property of DB and check user footprints after that date - in ACL log (he probably altered ACL immediately after copy), new design elements (probably made new view, folder, agent...) or profile documents.
What Frantisek said. Looking in the log archive (ugh!) may tell you who deployed it, but in a well run environment that won't be who developed it. A list of $UpdatedBy(0) for all design notes should give you a good idea. The catch will be that it mayl be people who left the company years ago. : )

Sharepoint custom personalization

I am creating sharepoint custom solution that will show number of drop down in page. The drop down data is shared in may pages.
I want to persist selected values of the user such that when ever he visit that page or any other page that have same drop down, he should be able to see is saved value pre selected in drop down.
To implement this I have a number of options. Please suggest the best for SharePoint
1)Sharepoint User profiles
2)Sharepoint list
3) Cookie
4) Isolated storage?
Options 3 and 4 here are clientside. But I am looking for any other way that SharePoint provides to save user preferences/personalization information.
Which one is the correct way of doing that in SharePoint?
Thanks
One issue you should be aware of with user profiles is that they are only available for MOSS (as opposed to WSS). In WSS each site has their own User information list. If the solution you are building will need to run in both MOSS and WSS environments, you should plan accordingly.
jt
My instinct tells me to use cookies for this, if it's a fairly simple state you need to persist. This seems to be a part of the UI logic, and I wouldn't bind that to the profile storage.
Pages and web parts have personalization stores as well, but they are generally not shared between instances.
I would go with profile storage, because that's the sort of thing it's there for, although generally when you are writing custom code in SharePoint the idea of best practices kind of gets thrown out the window.

Sharepoint: Best way to display lists of non-Sharepoint content with "compatible" UI?

I've built a web part for Sharepoint that retrieves data from an external service. I'd like to display the items in a way that's UI-compatible with Sharepoint (fits in with its surroundings.)
I'm aware of the "DataFormWebPart" but was unable to get one working properly. It requires a valid DataSource and I was unable to build one from the results of a web service call... Part of the problem is that my web service wrappers don't expose the XML return info, rather I have a bunch of deserialized objects. There doesn't seem to be an easy way to turn actual objects into a datasource, or populate a "generic" datasource from object data.
I could use an SPGridView to get the same UI, but the grid control doesn't have much in the way of smarts -and- it forces every field into its own column. I'd prefer to render each list item as a single cell with complex rendering (for instance the way that StackOverflow shows its lists of questions.) I'd also like to get as much of the Sharepoint-standard UI as possible, such as the sorting, filtering, and paging controls.
So, first: Has anyone here written a Sharepoint control that does this, and if so do you have sample code to share? If not: am I overlooking some useful control, whether MS-supplied or available in an external library?
Thanks!
Steve
Sharepoint: Best way to display lists
of non-Sharepoint content with
“compatible” UI?
Take a look at the built in sharepoint web controls:
Microsoft.SharePoint.WebControls Namespace
It contains all the controls used in sharepoint. I'd tell you more, but the documentation is very thorough.
Problem with SharePoint is that there are a bunch of different ways to do this. If your data is not changing too often and is not overly large it may be worth considering entering it into a list for display.
If you have the Enterprise licence it may be worth getting your data into the BDC and using it there.
you may have to convert the objects into xml or use the serialised objects with the XML webpart for display. This still has the issue of custom rendering using XSLT.
Here's a great article that explains how to configure BDC connections to web services using the BDC Definition Editor:
Creating a Web Service Connection by Using the Business Data Catalog Definition Editor
http://msdn.microsoft.com/en-us/library/bb737887.aspx
The best way to do this IMO is to make a Web Part. As a Web Part the UI will be automatically rendered to be the same as the theme the site is using (unless you override it) and it will be able to be placed anywhere by anyone with admin privileges.
Tutorial on making a Web Part
Tutorial on packaging and deploying a Web Part
Example Web Part Source Code
You could create a custom web part and use an SPGridView. You say you don't like it, because it forces every field into its own column, but that's not true. You can create a template (ITemplate) for every column and fully customize what's shown inside it, just like you would using a normal ASP.Net GridView. Using this approach I've added the little "New" images right next to a list item's Title, just like SharePoint does itself.

Resources