📄 contentreference.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2) on Wed Jul 19 18:22:41 EDT 2006 --><TITLE>ContentReference (IBM WebSphere Portal Version 6.0.0.0 API Docs)</TITLE><META NAME="keywords" CONTENT="com.ibm.content.binder.model.ContentReference interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="ContentReference (IBM WebSphere Portal Version 6.0.0.0 API Docs)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <A HREF="#main"><FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/ibm/content/binder/model/ContentItem.html" title="interface in com.ibm.content.binder.model"><B>PREV CLASS</B></A> <A HREF="../../../../../com/ibm/content/binder/model/Metadata.html" title="interface in com.ibm.content.binder.model"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="ContentReference.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><A NAME="main"></A><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.ibm.content.binder.model</FONT><BR>Interface ContentReference</H2><DL><DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../../com/ibm/content/binder/model/ContentItem.html" title="interface in com.ibm.content.binder.model">ContentItem</A></DD></DL><HR><DL><DT>public interface <B>ContentReference</B></DL><P>A reference to a document stored by a content provider. The document is referenced using a URI, that is interpreted by the <a href="#cp">content provider</a> storing the document. <br><br> The <code>ContentReference</code> is identified in the <A HREF="../../../../../com/ibm/content/binder/model/Binder.html" title="interface in com.ibm.content.binder.model"><CODE>Binder</CODE></A> it is attached to by its name (see <A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#getName()"><CODE>getName()</CODE></A>), that must be unique in this <A HREF="../../../../../com/ibm/content/binder/model/Binder.html" title="interface in com.ibm.content.binder.model"><CODE>Binder</CODE></A> instance.<br>The other important properties of this class are the contentProvider and uri ones. The contentProvider property sets in which <a href="#cp">content provider</a> is the referenced content stored, and the uri identifies that content in this <a href="#cp">content provider</a>. The uri form depends on the <a href="#cp">content provider</a> used. See below for code samples. <br><br><a name="creation" /> A <code>ContentReference</code> instance can be created using a <A HREF="../../../../../com/ibm/content/binder/model/BinderFactory.html" title="interface in com.ibm.content.binder.model"><CODE>BinderFactory</CODE></A>, by passing to its <A HREF="../../../../../com/ibm/content/binder/model/BinderFactory.html#createContentReference(java.lang.String)"><CODE>BinderFactory.createContentReference(String)</CODE></A> method, the name of the <code>ContentReference</code> to create:<br><br> <code> BinderFactory binderFactory = ...;<br> ContentReference reference = binderFactory.createContentReference("Finance Report");<br> </code> <br><br> <a name="cp" /> The Binder API currently supports 2 contents providers:<br> <ul> <li><a name="cp_pdm" /><b>The Portal Document Manager (PDM) content provider</b> that allows the referencing of document stored in the PDM library. <br><br> The name to use for this content provider is set in the <A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#CONTENT_PROVIDER_PDM"><CODE>CONTENT_PROVIDER_PDM</CODE></A> constant. The URI to provide to reference those documents is their path in the PDM library. For example, the following code creates a <code>ContentReference</code> that references a document named FinanceReport.xls located in the PDM library in the /reports/2006 folder: <br><br><code> ContentReference reference = BinderFactory.createContentReference("Finance Report");<br> reference.setContentProvider(CONTENT_PROVIDER_PDM);<br> reference.setUri("/reports/2006/FinanceReport.xls");<br> </code><br> </li> <li><a name="cp_sv" /><b>The Simple Value content provider</b> that allows the storage of simple String name-value pairs.<br><br> This provider is not used to reference documents but simple String values, the URI of the <code>ContentReference</code> being in that case, the value. It provides a basic form handling mechanism.<br><br> The name to use for this content provider is set in the <A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#CONTENT_PROVIDER_SIMPLE_VALUE"><CODE>CONTENT_PROVIDER_SIMPLE_VALUE</CODE></A> constant, and the URI is the value to be stored. For example, the following code shows how to use a <A HREF="../../../../../com/ibm/content/binder/model/Binder.html" title="interface in com.ibm.content.binder.model"><CODE>Binder</CODE></A> to represent a simple registration form: <br><br><code> ContentReference reference = BinderFactory.createContentReference("FirstName");<br> reference.setDisplayName("First name");<br> reference.setContentProvider(CONTENT_PROVIDER_SIMPLE_VALUE);<br> reference.setUri("Joe");<br> <br> ContentReference reference = BinderFactory.createContentReference("LastName");<br> reference.setDisplayName("Last name");<br> reference.setContentProvider(CONTENT_PROVIDER_SIMPLE_VALUE);<br> reference.setUri("Bloggs");<br> <br> ContentReference reference = BinderFactory.createContentReference("Email");<br> reference.setDisplayName("Email");<br> reference.setContentProvider(CONTENT_PROVIDER_SIMPLE_VALUE);<br> reference.setUri("jbloggs@acme.com");<br> <br> ContentReference reference = BinderFactory.createContentReference("Password");<br> reference.setVisible(false);<br> reference.setContentProvider(CONTENT_PROVIDER_SIMPLE_VALUE);<br> reference.setUri("pwd4jbloggs");<br> </code><br> In that context, the type property of the <code>ContentReference</code> could be used to store the type of the value (i.e. String, Date, Integer, etc ...). </li> </ul><P><P><DL><DT><B>Since:</B></DT> <DD>6.0</DD></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#CONTENT_PROVIDER_PDM">CONTENT_PROVIDER_PDM</A></B></CODE><BR> A String constant to represent the <a href="#cp_pdm">Portal Document Manager (PDM)</a> content provider.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#CONTENT_PROVIDER_SIMPLE_VALUE">CONTENT_PROVIDER_SIMPLE_VALUE</A></B></CODE><BR> A String constant to represent the <a href="#cp_sv">Simple Value</a> content provider.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#getContentProvider()">getContentProvider</A></B>()</CODE><BR> A String identifying the <a href="#cp">content provider</a> that hosts the content referenced by this <code>ContentReference</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#getDescription()">getDescription</A></B>()</CODE><BR> The description of this <code>ContentReference</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/content/binder/model/ContentReference.html#getDisplayName()">getDisplayName</A></B>()</CODE><BR> The display name of this <code>ContentReference</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Object</CODE></FONT></TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -