Ideas for free

Januari 24, 2007

Sharepoint 2003: Auto Open List Attachment

Diarsipkan di bawah: Microsoft Sharepoint, Tips and Tricks — cakriwut @ 7:54 am

English:

Actually this is a query from one of our client. They ask me how to make some list items automatically open its attachment. Although this can be done programatically, but I prefer Javascript approach.

Many task in web application can be accomplished using Javascript. Sharepoint using Javascript to create dynamic view for the users. For example you open DispForm.aspx of a list, it will dynamically hide/show Attachments information. Here you can see two item list, the first list has an attachment while the other hasn’t any.

ListItemView0

List item with attachment will show, Attachments row just like this picture,

ListItemView1

while list item without attachment will hide the Attachments row.

ListItemView4

It all provided by Sharepoint using simple Javascript that checks whether “idAttachmentsTable” object has rows defined. If that object has zero length rows, then it has no attachment. Hence, by checking “idAttachmentsTable” object and digging to url child nodes we can grab location of the attachment. Passing the location of the attachment to document location will then open list item attachment automatically.

So, start to open DispForm.aspx of the list, and insert custom javascript just above closing </BODY> tag.

ListItemView3

Save the modification, and if you click on list item with attachment, it will open the attachment automatically.

ListItemView2

Januari 23, 2007

MOSS 2007: Enable Search Visibility !

Diarsipkan di bawah: Microsoft Sharepoint, Office Server 2007, Tips and Tricks — cakriwut @ 4:35 am

English:

This morning I have disussion with Mark why we can’t search page content in our new MOSS 2007 server installation. I remembered that in Beta 2 and Beta 2 TR – there was no such problem (or may be I didn’t realize it before?)

We start to full crawl – because I remember that I never do full crawl before. And I have scheduled midnight crawling in purpose; to save my laptop power; which also mean never run – because I don’t run it at midnight.

After waiting for a while, there was no luck. Search always return empty results. Then we try to look for search setting in Administration Page, SSP and Site Setting. It was Mark who first figure out that there is “Search visibility” in site collection setting.

 

SearchVisible1

If you click on “Search visibility” link, then new search visibility setting page will appear. Choose the appropriate settings, for example just like bellow – to index page content.

SearchVisible2

Wait for crawling schedule before you start to search page content, based on that settings.

Januari 19, 2007

Sharepoint 2003: Infinite page request looping in CustomAuth

Diarsipkan di bawah: Microsoft Sharepoint, Tips and Tricks — cakriwut @ 3:17 am

English:

There have been several writings on SharePoint authentication model, such as

1. HOWTO: Sharepoint and Customauth, part 1 – soliciting questions
2. Working SharePoint Form Authentication
3. Implementing SSO

I did the implementation allmost a year ago. Yesterday, my friend Addino told me that he can’t implement it and furthermore he received infinite page load request. I said “really? Let me try tomorrow if I have spare time”.

Today, I implemented it on my laptop successfully at first attempt. (Please to the links for howto) So, now I user have a login form – instead of IE login pop-up box. Furthermore, the login form can be extended advance authentication process.

Let us see how I make it happen in my computer.

Sharepoint Folder

You can see I create Logon folder under my SharePoint virtual directory. There you can see default.aspx which act as login page.

When a request hit my SharePoint site, CustomAuth filter will check for unauthenticated request (anonymous users). If user has not been authenticated, then it will redirect to Logon/default.aspx.

So what makes infinite page load request?

Basically the reason behind that problem is when the users can not reach Logon/default.aspx - then by default it will return the request to CustomAuth. In this case the anonymous user will then reach CustomAuth again – and redirected to Logon/default.aspx page again and again. (see the red line).

 

AuthProcess

I assume you have done with the procedure to allow only anonymous access to Sharepoint as well as to /Logon directory.

Then why anonymous user can’t reach Logon/default.aspx?

Remember that when the user hits Logon/default.aspx for the first time – he is anonymous. This means that he can not access anything inside Sharepoint or other place which requires authenticated user.

It reflect to the code inside the page. Any code/component inside the page should not access to restricted location – unless you use impersonation or proxy web services.

Yeach – I hope it helps you to implement CustomAuth.

–o0o–

Indonesian:

Pembahasan tentang model autentifikasi SharePoint sudah banyak dilakukan – dan biasanya akan mulai dicari jika kita ingin mengimplementasikan form login di Sharepoint, seperti

1. HOWTO: Sharepoint and Customauth, part 1 – soliciting questions
2. Working SharePoint Form Authentication
3. Implementing SSO

Terus terang saya sudah mencoba sepintas lalu saja sejak tahun lalu – dan dibiarkan begitu saja karena belum terpakai. Sampai saat kemarin, teman saya Addino mengatakan bahwa dia tidak dapat menggunakan CustomAuth dan malah terjadi looping pada saat loading halaman. Waktu itu saya bilang “Tunggu, biar saya coba besok kalau lagi ada waktu.”

Siang ini, saya mencoba mengimplementasikan CustomAuth dan langsung jalan dengan baik. (Prosedurenya dapat dibaca sendiri di link diatas) Jadi, SharePoint saya sekarang menggunakan login form dan bukan pop-up prompt dari IE. Dan kalau kita mau mengeksplor lebih jauh, form login tersebut dapat melakukan proses autentifikasi yang lebih kompleks.

Berikut ini bagaimana struktur direktori di folder SharePoint saya.

Sharepoint Folder

Disitu terlihat ada folder Logon didalam virtual direktori SharePoint. Didalamnya dapat kita jumlah file default.aspx yang berfungsi sebagai halaman login.

Pada saat situs SharePoint menerima request, maka filter CustomAuth akan mengecek apakah request tersebut anonim atau tidak. Jika user belum melakukan login/autentifikasi, maka filter ini akan meneruskan request ke Logon/default.aspx.

Jadi mengapa terjadi looping?

Alasan paling mungkin terjadinya hal ini adalah jika user tidak dapat mengakses Logon/default.aspx - maka secara default request tersebut akan dikembalikan ke CustomAuth. Pada saat request dikembalikan ke CustomAuth, user masih dalam status anonim – dan kita bisa menduga bersama-sama proses di CustomAuth akan meneruskan request itu ke Logon/default.aspx kembali. Dan hal terjadi berulang-ulang karena ketidak-mampuan mengakses halaman login. (garis merah).

 

AuthProcess

Disini diasumsikan bahwa akses ke SharePoint dan direktory /Logon sudah dirubah sehingga hanya diperbolehkan akses secara anonim.

Jadi mengapa user anonim tidak dapat mengakses Logon/default.aspx?

Satu hal penting yang perlu diingatkan disini adalah, pada saat user mengakses Logon/default.aspx untuk pertama kalinya – statusnya masih anonim. Hal ini juga berarti bahwa dia tidak dapat mengakses lokasi-lokasi lainnya termasuk yang ada didalam SharePoint yang membutuhkan autentifikasi terlebih dahulu.

Kondisi ini juga mempengaruhi kode-kode apa saja yang dapat diletakkan didalam halaman tersebut. Semua kode/komponen yang diletakkan didalam halaman tersebut tidak boleh mengakses lokasi-lokasi terbatas – kecuali, akses dilakukan dengan teknik impersonasi atau dengan menggunakan proxy web service.

Ok, mudah-mudahan ini bisa membantu rekan-rekan yang lain yang ingin mengimplementasikan CustomAuth.

Blog pada WordPress.com.