diff -r 000000000000 -r bde4ae8d615e os/security/contentmgmt/contentaccessfwfordrm/engineering/dox/CafRecognizer.dox --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/security/contentmgmt/contentaccessfwfordrm/engineering/dox/CafRecognizer.dox Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,117 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +//
"KMinInt=Not Recognized"
to "KMaxInt=Certain"
).
+// The implementation of DRM presents a problem when determinining the MIME type. Usually, a DRM
+// file stores one or more content objects. For example, an OMA file with
+// MIME type application/vnd.oma.drm.content
might store an image file with
+// MIME type image/jpeg
. Apparc expects only one MIME type to be returned, not two.
+// The CAF recognizer RECCAF.DLL
uses the
+// to determine whether or not a file is recognized by the content access framework and
+// if so retrieves these two MIME types.
+// The mapping of these two MIME types returned by CAF to a single MIME type follows these rules:
+// File MIME Type | Content MIME Type | Apparc MIME Type |
---|---|---|
Present | Present | x-caf-ContentMimeType |
Present | Not Present | FileMimeType |
Present | application/x-caf | application/x-caf |
CApaDataRecognizerType::DoRecognizeL()
+// implementations. These two parameters can be passed to the ContentAccess::CAgentResolver::DoRecognize()
+// function to determine whether one of the Content Access Agents recognizes the file.
+// CApaDataRecognizer::DoRecognize(TDesC& aFilename, TDesC8& aBuffer)
+// TBool recognized;
+// CAgentResolver *resolver = CAgentResolver::NewL();
+// recognized = resolver->DoRecognize(filename, buffer, fileMimeType, contentMimeType);
+// ContentAccess::CAgentResolver::DoRecognize()
passes the filename and buffer to each of the
+// agents in turn. The agents perform the recognition, and the result is returned
+// as either \c ETrue if the file was recognized, or \c EFalse if it was not. If the file
+// is recognized, the \c fileMimeType and \c contentMimeType parameters are populated
+// with the correct MIME types.
+// The recognition is distributed to the agents because they are able to recognize
+// a file belonging to their agent. They are also able to examine the contents to
+// work out the content MIME type. This allows one generic CAF recognizer to be used
+// for all the agents implemented with the content access framework.
+// CApaCafRecognizer::SupportedDataTypeL()
fuction.
+// image/jpeg
+// image/gif
+// text/plain
+// text/html
+// ... etc
+// If this file is replaced (to support new content types), the recognizer
+// will only implement the changes during the next power on. Similarly if a new agent
+// is added, the recognizer will only rebuild its list of agents after the next power on.
+// AppName_reg.rss
) to include the new CAF MIME types. For example, in the past an image
+// viewer may have only included image/jpeg
in the list of MIME types it could open.
+// If the application is updated to use the Content Access Framework, it should support
+// image/jpeg
and x-caf-image/jpeg
in order to support
+// unprotected and protected content respectively. See the registration file examples below.
+// All file operations should be conducted through the CAF framework, so that the
+// application will not need to know anything about a specific DRM scheme.
+// Registration file that doesn't use CAF
+// datatype_list =
+// DATATYPE { priority= EDataTypePriorityHigh ; type="image/jpeg"; },
+// Registration file that does use CAF
+// datatype_list =
+// DATATYPE { priority= EDataTypePriorityHigh ; type="image/jpeg"; },
+// DATATYPE { priority= EDataTypePriorityHigh ; type="x-caf-image/jpeg"; },
+// ContentAccess::CAgentResolver::DoRecognize()
function @ref DoRecognize "(see below)"
+ @li Users and applications will be interested in the MIME type of the content within a file not the packaging. CAF abstracts the packaging.
+ @li If the content is recognized with only the MIME type of the content within the file, it would confuse legacy applications who thought the entire file was that MIME type
+ @li Prefixing the content type with "x-caf-"
shows it is a file that can be opened by CAF to read that content type without confusing legacy applications
+ @li A file that needs to be passed through the supplier interface before it can be used will just be recognized as the file MIME type, the content type is irrelevant before the supply operation.
+ @li A file containing many content objects should just be recognized as application/x-caf
since the packaging of the archive is irrelevant. CAF abstracts the packaging.
+ @note The concept of "confidence" has also been eliminated for the files within the Content
+ @section DoRecognize How to determine the file and content MIME types of a DRM file
+ @code
+ @endcode
+ @image html recognizer.gif
+ @section ConfigFile CAF Recognizer Configuration File
+ @code
+ @endcode
+ @section AppRegFiles Application Registration files
+ @code
+ @endcode
+ @code
+ @endcode
+*/