Beagle,Querying extended properties



Hello,
(sorry by my bad english, I try to explain this as the best as I can...)
This is my first time posting on a list and I don't know the procedures to post a question....if I make a mistake....sorry....

After this I try to explain my question.
I'm trying to make beagle can search by extended properties...by example: I set a custom extended property to a file "setfattr -n user.CustomProperty -v CustomValue <File>" and I want that beagle can search CustomProperty:CustomValue.

I was reading about, and I think that the Filters can do that. But the "problem" is that I want that every file with extended attributes have its attributes as searchable properties...

this is my try to add properties:

Changes made on Filter.cs (inside beagled foder)

               // I added a new function that  add extended properties
               protected void GetXtendedProperties(FileInfo info){
                        string[] PropertyName;
                        string[] XProperties;
                        string XValue;
                        //512 char is fine for extended values of property???
                        byte[] XValueBuffer=new byte[512];
                        Mono.Unix.Native.Syscall.listxattr(info.FullName,out XProperties);
                        for(int i=0 ; i<XProperties.Length ; i++)
                        {
                                Mono.Unix.Native.Syscall.getxattr(info.FullName,XProperties[i],XValueBuffer);
                                XValue=System.Text.ASCIIEncoding.ASCII.GetString(XValueBuffer);
                                PropertyName=XProperties[i].Split('.');
                                // We only need the last string after '.'??? may be is wrong...
                                AddProperty(Beagle.Property.NewKeyword("dc:"+PropertyName[PropertyName.Length-1 ] , XValue.Trim('\0')));
                                XValueBuffer=new byte[512];
                        }

                }
                protected virtual void DoOpen (FileSystemInfo info) {
                        if (info is FileInfo){
                                //Put the extended properties of the file
                                GetXtendedProperties(info as FileInfo);
                                //
                                DoOpen (info as FileInfo);
                        }
                        else if (info is DirectoryInfo)
                                DoOpen (info as DirectoryInfo);
                }

With this I can see the extended properties with beagle-extract-content, but I can't search by property:value...

Can you give me a hand???, please???


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]