Changeset 2575
- Timestamp:
- 04/30/05 02:56:17 (4 years ago)
- Files:
-
- trunk/Colloquy.xcode/project.pbxproj (modified) (5 diffs)
- trunk/Importer/English.lproj/InfoPlist.strings (modified) (1 diff)
- trunk/Importer/English.lproj/schema.strings (modified) (1 diff)
- trunk/Importer/GetMetadataForFile.c (modified) (1 diff)
- trunk/Importer/Info.plist (modified) (2 diffs)
- trunk/Importer/main.c (modified) (3 diffs)
- trunk/Importer/schema.xml (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Colloquy.xcode/project.pbxproj
r2572 r2575 2450 2450 1CF4D76607E6AD4400DB421A, 2451 2451 0A5B683F0810EC9700398D5A, 2452 CBF685370820190D00F498FB,2453 CBF685380820190D00F498FB,2454 CBF6853A0820190D00F498FB,2455 CBF6853C0820190D00F498FB,2456 2452 ); 2457 2453 isa = PBXResourcesBuildPhase; … … 2937 2933 1CE3C4F807E13F4C004931E6, 2938 2934 1C70377F07E49F25005CEA40, 2939 CBF685390820190D00F498FB,2940 CBF6853B0820190D00F498FB,2941 2935 ); 2942 2936 isa = PBXSourcesBuildPhase; … … 5157 5151 CBF684F00820174000F498FB = { 5158 5152 children = ( 5153 CBF685320820190D00F498FB, 5154 CBF685340820190D00F498FB, 5159 5155 CBF6852C0820190D00F498FB, 5156 CBF685330820190D00F498FB, 5160 5157 CBF685310820190D00F498FB, 5161 CBF685320820190D00F498FB,5162 CBF685330820190D00F498FB,5163 CBF685340820190D00F498FB,5164 5158 ); 5165 5159 isa = PBXGroup; 5166 name = Importer;5160 name = "Metadata Importer"; 5167 5161 refType = 4; 5168 5162 sourceTree = "<group>"; … … 5225 5219 ); 5226 5220 isa = PBXNativeTarget; 5227 name = Colloquy;5221 name = "Colloquy (Metadata Importer)"; 5228 5222 productName = Importer; 5229 5223 productReference = CBF685150820186F00F498FB; … … 5343 5337 refType = 4; 5344 5338 sourceTree = "<group>"; 5345 };5346 CBF685370820190D00F498FB = {5347 fileRef = CBF6852D0820190D00F498FB;5348 isa = PBXBuildFile;5349 settings = {5350 };5351 };5352 CBF685380820190D00F498FB = {5353 fileRef = CBF6852F0820190D00F498FB;5354 isa = PBXBuildFile;5355 settings = {5356 };5357 };5358 CBF685390820190D00F498FB = {5359 fileRef = CBF685310820190D00F498FB;5360 isa = PBXBuildFile;5361 settings = {5362 };5363 };5364 CBF6853A0820190D00F498FB = {5365 fileRef = CBF685320820190D00F498FB;5366 isa = PBXBuildFile;5367 settings = {5368 };5369 };5370 CBF6853B0820190D00F498FB = {5371 fileRef = CBF685330820190D00F498FB;5372 isa = PBXBuildFile;5373 settings = {5374 };5375 };5376 CBF6853C0820190D00F498FB = {5377 fileRef = CBF685340820190D00F498FB;5378 isa = PBXBuildFile;5379 settings = {5380 };5381 5339 }; 5382 5340 CBF6855D08201B7300F498FB = { trunk/Importer/English.lproj/InfoPlist.strings
r2574 r2575 1 1 /* Localized versions of Info.plist keys */ 2 2 3 CFBundleName = "Colloquy"; 4 CFBundleShortVersionString = "1.0"; 5 CFBundleGetInfoString = "ColloquyImporter version 1.0, Copyright (c) 2005 Karl Adam."; 6 NSHumanReadableCopyright = "Copyright (c) 2005 Karl Adam."; 3 CFBundleGetInfoString = "Colloquy Metadata Importer 1.0; Copyright � 2005, Karl Adam"; 4 NSHumanReadableCopyright = "Copyright � 2005, Karl Adam"; trunk/Importer/English.lproj/schema.strings
r2572 r2575 1 /* Localized DisplayNames for your custom metadata attributes */2 /* The form is: "myMetadataKey" = "My Metadata Key"; */3 /* The name on the left is the name defined in schema.xml */4 /* The name on the right is what the user will see */5 1 com_internet_messaging_Service = "Service"; 6 7 /* Localized Description of you custom metadata attributes */8 /* The form is: "myMetadataKey.Description" = "stuff";9 /* com_Foo_YourAttrName should be definded in the schema.xml file */10 /* The value on the right will be displayed by the Finder etc.. */11 2 com_internet_messaging_Service.Description = "The network protocol over which this transcript was recorded"; trunk/Importer/GetMetadataForFile.c
r2573 r2575 3 3 #include <Foundation/Foundation.h> 4 4 5 /* ----------------------------------------------------------------------------- 6 Step 1 7 Set the UTI types the importer supports 8 9 Modify the CFBundleDocumentTypes entry in Info.plist to contain 10 an array of Uniform Type Identifiers (UTI) for the LSItemContentTypes 11 that your importer can handle 12 13 ----------------------------------------------------------------------------- */ 5 Boolean GetMetadataForFile( void *thisInterface, CFMutableDictionaryRef attributes, CFStringRef contentTypeUTI, CFStringRef pathToFile ) { 6 NSMutableDictionary *returnDict = (NSMutableDictionary *) attributes; 7 NSURL *file = [NSURL fileURLWithPath:(NSString *) pathToFile]; 14 8 15 /* ----------------------------------------------------------------------------- 16 Step 2 17 Implement the GetMetadataForFile function 18 19 Implement the GetMetadataForFile function below to scrape the relevant 20 metadata from your document and return it as a CFDictionary using standard keys 21 (defined in MDItem.h) whenever possible. 22 ----------------------------------------------------------------------------- */ 9 NSError *error = nil; 10 NSXMLDocument *transcript = [[[NSXMLDocument alloc] initWithContentsOfURL:file options:NSXMLDocumentTidyXML error:&error] autorelease]; 23 11 24 /* ----------------------------------------------------------------------------- 25 Step 3 (optional) 26 If you have defined new attributes, update the schema.xml file 27 28 Edit the schema.xml file to include the metadata keys that your importer returns. 29 Add them to the <allattrs> and <displayattrs> elements. 30 31 Add any custom types that your importer requires to the <attributes> element 32 33 <attribute name="com_mycompany_metadatakey" type="CFString" multivalued="true"/> 34 35 ----------------------------------------------------------------------------- */ 12 // Get date started 13 NSArray *dateArray = [transcript nodesForXPath:@"/log[1]/@began" error:&error]; 14 NSDate *dateStarted = [NSDate dateWithString:[[dateArray objectAtIndex:0] stringValue]]; 15 [returnDict setObject:dateStarted forKey:(NSString *) kMDItemContentCreationDate]; 36 16 37 38 39 /* -----------------------------------------------------------------------------40 Get metadata attributes from file41 42 This function's job is to extract useful information your file format supports43 and return it as a dictionary44 ----------------------------------------------------------------------------- */45 46 Boolean GetMetadataForFile(void* thisInterface,47 CFMutableDictionaryRef attributes,48 CFStringRef contentTypeUTI,49 CFStringRef pathToFile) {50 /* Pull any available metadata from the file at the specified path */51 /* Return the attribute keys and attribute values in the dict */52 /* Return TRUE if successful, FALSE if there was no data provided */53 NSMutableDictionary *returnDict = (NSMutableDictionary *)attributes;54 NSError *error;55 NSMutableArray *participants = [[NSMutableArray alloc] init];56 NSXMLDocument *transcriptDOM = [[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:(NSString *)pathToFile]57 options:NSXMLDocumentTidyXML58 error:&error];59 60 // Get date started61 NSArray *dateArray = [transcriptDOM nodesForXPath:@"/log[1]/@began" error:&error];62 NSDate *dateStarted = [NSDate dateWithString:[[dateArray objectAtIndex:0] stringValue]];63 [returnDict setObject:dateStarted forKey:(NSString *)kMDItemContentCreationDate];64 65 17 // Get date of last message 66 NSArray *xpathResult = [transcript DOMnodesForXPath:@"/log[1]/envelope[last()]/message[last()]/@received" error:&error];18 NSArray *xpathResult = [transcript nodesForXPath:@"/log[1]/envelope[last()]/message[last()]/@received" error:&error]; 67 19 NSDate *lastMessageDate = [NSDate dateWithString:[[xpathResult objectAtIndex:0] stringValue]]; 68 20 NSTimeInterval logDuration = [lastMessageDate timeIntervalSinceDate:dateStarted]; 69 21 70 22 // Set Duration 71 [returnDict setObject:[NSNumber numberWithInt:logDuration] forKey:(NSString *) kMDItemDurationSeconds];72 23 [returnDict setObject:[NSNumber numberWithInt:logDuration] forKey:(NSString *) kMDItemDurationSeconds]; 24 73 25 // Get WhereFroms 74 xpathResult = [transcript DOMnodesForXPath:@"/log[1]@source" error:&error];26 xpathResult = [transcript nodesForXPath:@"/log[1]@source" error:&error]; 75 27 NSString *fromURL = nil; 76 if ( [xpathResult count] ) {28 if( [xpathResult count] ) { 77 29 fromURL = [[xpathResult objectAtIndex:0] stringValue]; 78 [returnDict setObject:fromURL forKey:(NSString *) kMDItemWhereFroms];30 [returnDict setObject:fromURL forKey:(NSString *) kMDItemWhereFroms]; 79 31 } 80 32 81 33 // Set Title and Coverage 82 34 NSDateFormatter *formatter = [[NSDateFormatter alloc] initWithDateFormat:@"%A, the %d of %B at %I:%M" allowNaturalLanguage:NO]; 83 35 NSString *coverageWording = nil; 84 36 85 37 // Set Coverage 86 if ( fromURL ) {38 if( fromURL ) { 87 39 coverageWording = [NSString stringWithFormat:@"Conversation from %@ to %@ in %@", [formatter stringFromDate:dateStarted], 88 40 [formatter stringFromDate:lastMessageDate], 89 fromURL];41 fromURL]; 90 42 } else { 91 43 coverageWording = [NSString stringWithFormat:@"Conversation from %@ to %@", [formatter stringFromDate:dateStarted], 92 44 [formatter stringFromDate:lastMessageDate]]; 93 45 } 94 [returnDict setObject:coverageWording forKey:(NSString *)kMDItemCoverage]; 95 [returnDict setObject:coverageWording forKey:(NSString *)kMDItemTitle]; 96 46 47 [returnDict setObject:coverageWording forKey:(NSString *) kMDItemCoverage]; 48 [returnDict setObject:coverageWording forKey:(NSString *) kMDItemTitle]; 49 97 50 // Get Participants 98 NS Array *participantsArray = [transcriptDOM nodesForXPath:@"/log[1]/envelope/sender" error:&error];99 NS Enumerator *pEnum = [participantsArray objectEnumerator];100 NS XMLNode *participantName = nil;101 102 while ( participantName = [pEnum nextObject] ) { 103 NSString *userNick = [participantName stringValue];104 105 if ( ! [participants containsObject:userNick] )106 [participants addObject: [participantName stringValue]];51 NSMutableArray *participants = [NSMutableArray array]; 52 NSArray *participantNodes = [transcript nodesForXPath:@"/log[1]/envelope/sender" error:&error]; 53 NSEnumerator *enumerator = [participantNodes objectEnumerator]; 54 NSXMLNode *participantNode = nil; 55 56 while( ( participantNode = [enumerator nextObject] ) ) { 57 NSString *nickname = [participantNode stringValue]; 58 if( ! [participants containsObject:nickname] ) 59 [participants addObject:nickname]; 107 60 } 108 [returnDict setObject:participants forKey:(NSString *)kMDItemContributors]; 109 61 62 [returnDict setObject:participants forKey:(NSString *) kMDItemContributors]; 63 110 64 // Now the stuff that doesn't change 111 [returnDict setObject:[NSArray arrayWithObject:@"Colloquy"] forKey:(NSString *)kMDItemEncodingApplications]; 112 65 [returnDict setObject:[NSArray arrayWithObject:@"Colloquy"] forKey:(NSString *) kMDItemCreator]; 113 66 114 67 return TRUE; trunk/Importer/Info.plist
r2572 r2575 3 3 <plist version="1.0"> 4 4 <dict> 5 6 <!--7 If your application does not already define a UTI, you may want to declare it8 here, so that your documents are recognized by systems which do not have your9 application installed.10 11 To export this declaration, fill in the fields with your application's12 information, and uncomment the block of XML.13 -->14 15 <!--16 <key>UTExportedTypeDeclarations</key>17 <array>18 <dict>19 <key>UTTypeIdentifier</key>20 <string>cc.javelin.colloquy.colloquytranscript</string>21 <key>UTTypeReferenceURL</key>22 <string>http://www.colloquy.info/</string>23 <key>UTTypeDescription</key>24 <string>Your Document Kind String</string>25 <key>UTTypeConformsTo</key>26 <array>27 <string>public.data</string>28 <string>public.content</string>29 </array>30 <key>UTTypeTagSpecification</key>31 <dict>32 <key>public.filename-extension</key>33 <array>34 <string>colloquyTranscript</string>35 </array>36 </dict>37 </dict>38 </array>39 -->40 41 5 <key>CFBundleDevelopmentRegion</key> 42 6 <string>English</string> … … 52 16 </dict> 53 17 </array> 18 <key>CFBundleName</key> 19 <string>Colloquy Metadata Importer</string> 54 20 <key>CFBundleExecutable</key> 55 21 <string>Colloquy</string> trunk/Importer/main.c
r2572 r2575 1 //2 // main.c3 // ColloquyImporter4 //5 // Created by Karl Adam on 4/27/05.6 // Copyright (c) 2005 __MyCompanyName__. All rights reserved.7 //8 9 10 11 12 13 //==============================================================================14 //15 // DO NO MODIFY THE CONTENT OF THIS FILE16 //17 // This file contains the generic CFPlug-in code necessary for your importer18 // To complete your importer implement the function in GetMetadataForFile.c19 //20 //==============================================================================21 22 23 24 25 26 27 1 #include <CoreFoundation/CoreFoundation.h> 28 2 #include <CoreFoundation/CFPlugInCOM.h> 29 3 #include <CoreServices/CoreServices.h> 30 4 31 // -----------------------------------------------------------------------------32 // constants33 // -----------------------------------------------------------------------------34 35 36 5 #define PLUGIN_ID "04A856E0-880E-41BA-ABFA-35F147710AFC" 37 38 //39 // Below is the generic glue code for all plug-ins.40 //41 // You should not have to modify this code aside from changing42 // names if you decide to change the names defined in the Info.plist43 //44 45 46 // -----------------------------------------------------------------------------47 // typedefs48 // -----------------------------------------------------------------------------49 6 50 7 // The import function to be implemented in GetMetadataForFile.c … … 57 14 typedef struct __MetadataImporterPluginType 58 15 { 59 MDImporterInterfaceStruct *conduitInterface;60 CFUUIDRef factoryID;61 UInt32 refCount;16 MDImporterInterfaceStruct *conduitInterface; 17 CFUUIDRef factoryID; 18 UInt32 refCount; 62 19 } MetadataImporterPluginType; 63 20 64 // -----------------------------------------------------------------------------65 // prototypes66 // -----------------------------------------------------------------------------67 // Forward declaration for the IUnknown implementation.68 //69 21 70 22 MetadataImporterPluginType *AllocMetadataImporterPluginType(CFUUIDRef inFactoryID); … … 74 26 ULONG MetadataImporterPluginAddRef(void *thisInstance); 75 27 ULONG MetadataImporterPluginRelease(void *thisInstance); 76 // -----------------------------------------------------------------------------77 // testInterfaceFtbl definition78 // -----------------------------------------------------------------------------79 // The TestInterface function table.80 //81 28 82 29 static MDImporterInterfaceStruct testInterfaceFtbl = { 83 NULL,84 MetadataImporterQueryInterface,85 MetadataImporterPluginAddRef,86 MetadataImporterPluginRelease,87 GetMetadataForFile30 NULL, 31 MetadataImporterQueryInterface, 32 MetadataImporterPluginAddRef, 33 MetadataImporterPluginRelease, 34 GetMetadataForFile 88 35 }; 89 36 90 91 // -----------------------------------------------------------------------------92 // AllocMetadataImporterPluginType93 // -----------------------------------------------------------------------------94 // Utility function that allocates a new instance.95 // You can do some initial setup for the importer here if you wish96 // like allocating globals etc...97 //98 37 MetadataImporterPluginType *AllocMetadataImporterPluginType(CFUUIDRef inFactoryID) 99 38 { 100 MetadataImporterPluginType *theNewInstance;39 MetadataImporterPluginType *theNewInstance; 101 40 102 theNewInstance = (MetadataImporterPluginType *)malloc(sizeof(MetadataImporterPluginType));103 memset(theNewInstance,0,sizeof(MetadataImporterPluginType));41 theNewInstance = (MetadataImporterPluginType *)malloc(sizeof(MetadataImporterPluginType)); 42 memset(theNewInstance,0,sizeof(MetadataImporterPluginType)); 104 43 105 /* Point to the function table */106 theNewInstance->conduitInterface = &testInterfaceFtbl;44 /* Point to the function table */ 45 theNewInstance->conduitInterface = &testInterfaceFtbl; 107 46 108 /* Retain and keep an open instance refcount for each factory. */109 theNewInstance->factoryID = CFRetain(inFactoryID);110 CFPlugInAddInstanceForFactory(inFactoryID);47 /* Retain and keep an open instance refcount for each factory. */ 48 theNewInstance->factoryID = CFRetain(inFactoryID); 49 CFPlugInAddInstanceForFactory(inFactoryID); 111 50 112 /* This function returns the IUnknown interface so set the refCount to one. */113 theNewInstance->refCount = 1;114 return theNewInstance;51 /* This function returns the IUnknown interface so set the refCount to one. */ 52 theNewInstance->refCount = 1; 53 return theNewInstance; 115 54 } 116 55 117 // -----------------------------------------------------------------------------118 // DeallocColloquyImporterMDImporterPluginType119 // -----------------------------------------------------------------------------120 // Utility function that deallocates the instance when121 // the refCount goes to zero.122 // In the current implementation importer interfaces are never deallocated123 // but implement this as this might change in the future124 //125 56 void DeallocMetadataImporterPluginType(MetadataImporterPluginType *thisInstance) 126 57 { 127 CFUUIDRef theFactoryID;58 CFUUIDRef theFactoryID; 128 59 129 theFactoryID = thisInstance->factoryID;130 free(thisInstance);131 if (theFactoryID){132 CFPlugInRemoveInstanceForFactory(theFactoryID);133 CFRelease(theFactoryID);134 }60 theFactoryID = thisInstance->factoryID; 61 free(thisInstance); 62 if (theFactoryID){ 63 CFPlugInRemoveInstanceForFactory(theFactoryID); 64 CFRelease(theFactoryID); 65 } 135 66 } 136 67 137 // -----------------------------------------------------------------------------138 // MetadataImporterQueryInterface139 // -----------------------------------------------------------------------------140 // Implementation of the IUnknown QueryInterface function.141 //142 68 HRESULT MetadataImporterQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv) 143 69 { 144 CFUUIDRef interfaceID;70 CFUUIDRef interfaceID; 145 71 146 interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault,iid);72 interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault,iid); 147 73 148 if (CFEqual(interfaceID,kMDImporterInterfaceID)){149 /* If the Right interface was requested, bump the ref count,150 * set the ppv parameter equal to the instance, and151 * return good status.152 */153 ((MetadataImporterPluginType*)thisInstance)->conduitInterface->AddRef(thisInstance);154 *ppv = thisInstance;155 CFRelease(interfaceID);156 return S_OK;157 }else{158 if (CFEqual(interfaceID,IUnknownUUID)){159 /* If the IUnknown interface was requested, same as above. */160 ((MetadataImporterPluginType*)thisInstance )->conduitInterface->AddRef(thisInstance);161 *ppv = thisInstance;162 CFRelease(interfaceID);163 return S_OK;164 }else{165 /* Requested interface unknown, bail with error. */166 *ppv = NULL;167 CFRelease(interfaceID);168 return E_NOINTERFACE;169 }170 }74 if (CFEqual(interfaceID,kMDImporterInterfaceID)){ 75 /* If the Right interface was requested, bump the ref count, 76 * set the ppv parameter equal to the instance, and 77 * return good status. 78 */ 79 ((MetadataImporterPluginType*)thisInstance)->conduitInterface->AddRef(thisInstance); 80 *ppv = thisInstance; 81 CFRelease(interfaceID); 82 return S_OK; 83 }else{ 84 if (CFEqual(interfaceID,IUnknownUUID)){ 85 /* If the IUnknown interface was requested, same as above. */ 86 ((MetadataImporterPluginType*)thisInstance )->conduitInterface->AddRef(thisInstance); 87 *ppv = thisInstance; 88 CFRelease(interfaceID); 89 return S_OK; 90 }else{ 91 /* Requested interface unknown, bail with error. */ 92 *ppv = NULL; 93 CFRelease(interfaceID); 94 return E_NOINTERFACE; 95 } 96 } 171 97 } 172 98 173 // -----------------------------------------------------------------------------174 // MetadataImporterPluginAddRef175 // -----------------------------------------------------------------------------176 // Implementation of reference counting for this type. Whenever an interface177 // is requested, bump the refCount for the instance. NOTE: returning the178 // refcount is a convention but is not required so don't rely on it.179 //180 99 ULONG MetadataImporterPluginAddRef(void *thisInstance) 181 100 { 182 ((MetadataImporterPluginType *)thisInstance )->refCount += 1;183 return ((MetadataImporterPluginType*) thisInstance)->refCount;101 ((MetadataImporterPluginType *)thisInstance )->refCount += 1; 102 return ((MetadataImporterPluginType*) thisInstance)->refCount; 184 103 } 185 104 186 // -----------------------------------------------------------------------------187 // SampleCMPluginRelease188 // -----------------------------------------------------------------------------189 // When an interface is released, decrement the refCount.190 // If the refCount goes to zero, deallocate the instance.191 //192 105 ULONG MetadataImporterPluginRelease(void *thisInstance) 193 106 { 194 ((MetadataImporterPluginType*)thisInstance)->refCount -= 1;195 if (((MetadataImporterPluginType*)thisInstance)->refCount == 0){196 DeallocMetadataImporterPluginType((MetadataImporterPluginType*)thisInstance );197 return 0;198 }else{199 return ((MetadataImporterPluginType*) thisInstance )->refCount;200 }107 ((MetadataImporterPluginType*)thisInstance)->refCount -= 1; 108 if (((MetadataImporterPluginType*)thisInstance)->refCount == 0){ 109 DeallocMetadataImporterPluginType((MetadataImporterPluginType*)thisInstance ); 110 return 0; 111 }else{ 112 return ((MetadataImporterPluginType*) thisInstance )->refCount; 113 } 201 114 } 202 115 203 // -----------------------------------------------------------------------------204 // ColloquyImporterMDImporterPluginFactory205 // -----------------------------------------------------------------------------206 // Implementation of the factory function for this type.207 //208 116 void *MetadataImporterPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID) 209 117 { 210 MetadataImporterPluginType *result;211 CFUUIDRef uuid;118 MetadataImporterPluginType *result; 119 CFUUIDRef uuid; 212 120 213 /* If correct type is being requested, allocate an214 * instance of TestType and return the IUnknown interface.215 */216 if (CFEqual(typeID,kMDImporterTypeID)){217 uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID));218 result = AllocMetadataImporterPluginType(uuid);219 CFRelease(uuid);220 return result;221 }222 /* If the requested type is incorrect, return NULL. */223 return NULL;121 /* If correct type is being requested, allocate an 122 * instance of TestType and return the IUnknown interface. 123 */ 124 if (CFEqual(typeID,kMDImporterTypeID)){ 125 uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID)); 126 result = AllocMetadataImporterPluginType(uuid); 127 CFRelease(uuid); 128 return result; 129 } 130 /* If the requested type is incorrect, return NULL. */ 131 return NULL; 224 132 } 225 trunk/Importer/schema.xml
r2572 r2575 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 3 <schema version="1.0" xmlns="http://www.apple.com/metadata" 4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 5 xsi:schemaLocation="http://www.apple.com/metadata file:///System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Resources/MetadataSchema.xsd"> 6 <note> 7 Custom attributes that this metadata importer supports. Below 2 <schema version="1.0" xmlns="http://www.apple.com/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.apple.com/metadata file:///System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Resources/MetadataSchema.xsd"> 3 <note> 4 Custom attributes that this metadata importer supports. Below 8 5 is an example of a multivalued string attribute. Other types 9 6 are CFNumber, CFDate, CFBoolean and CFData. 10 </note> 11 <attributes> 12 <attribute name="com_internet_messaging_Service" multivalued="true" type="CFString"/> 13 </attributes> 7 </note> 14 8 15 <types> 16 <type name="cc.javelin.colloquy.colloquytranscript"> 17 <note> 18 The keys that this metadata importer handles. 19 </note> 20 <allattrs> 9 <attributes> 10 <attribute name="com_internet_messaging_Service" multivalued="true" type="CFString"/> 11 </attributes> 12 13 <types> 14 <type name="cc.javelin.colloquy.colloquytranscript"> 15 <note>The keys that this metadata importer handles.</note> 16 <allattrs> 21 17 kMDItemTitle 22 18 kMDItemContributors … … 24 20 kMDItemDurationSeconds 25 21 kMDItemWhereFroms 26 kMDItem EncodingApplications22 kMDItemCreator 27 23 com_internet_messaging_Service 28 </allattrs>29 <displayattrs>24 </allattrs> 25 <displayattrs> 30 26 kMDItemTitle 31 27 kMDItemContributors … … 33 29 kMDItemDurationSeconds 34 30 kMDItemWhereFroms 35 kMDItem EncodingApplications31 kMDItemCreator 36 32 com_internet_messaging_Service 37 </displayattrs>38 </type>39 </types>33 </displayattrs> 34 </type> 35 </types> 40 36 </schema> 41
