Writing a Custom Property Renderer
Hello all,
I am new to KMC development. I want to know how to go about writing a custom property renderer. Detail step by step instructions as to where to start and what are the configurations, etc. would be a great help for me.
Thanks in advance.
Vicky R.
Hello Vicky,
Step by Step guide to creating Property renderer is:
1. Program an implementation of AbstractPropertyRenderer.
2. Implement a RFServerWrapper service to register your property renderer with CrtClassLoaderRegistry.
CrtClassLoaderRegistry.addClassLoader(this.getClass().getClassLoader());
3. Technical mapping to your coding in the Property Metadata service.
4.Restart your server for the changes to take effect.
Check this link for more infos:
https://forums.sdn.sap.com/thread.jspa?threadID=41619
Also check the implementations of RFServerWrapper service in examples at this link:
http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c739e546-0701-0010-53a9-a370e39a5a20
Greetings,
Praveen Gudapati
Similar Messages
-
Custom Property Renderer - class not found error?
Hi,
I am trying to create a custom property renderer in KM - just a basic Hello World for now, as in some of the other threads on SDN.
When I use the renderer for a property in my layout set, nothing is displayed.
My code is as follows:
public class SBPCPropertyRenderer extends AbstractPropertyRenderer
public Component renderProperty(IProperty property, IResource res, int maxLength)
throws WcmException
TextView t = new TextView();
t.setText("Hello World");
return t;// renders a property
public interface IRFServiceWrapper extends IService
public static final String KEY = "com.company.project.km.SBPCPropertyRenderer";
public class RFServiceWrapper implements IRFServiceWrapper
private IServiceContext mm_serviceContext;
* Generic init method of the service. Will be called by the portal runtime.
* @param serviceContext
public void init(IServiceContext serviceContext)
mm_serviceContext = serviceContext;
CrtClassLoaderRegistry.addClassLoader(this.getKey(), this.getClass().getClassLoader());
* This method is called after all services in the portal runtime have already been initialized.
public void afterInit()
* configure the service : @param configuration
public void configure(IServiceConfiguration configuration)
* This method is called by the portal runtime when the service is destroyed.
public void destroy()
* This method is called by the portal runtime when the service is released.
public void release()
* @return the context of the service, which was previously set by the portal runtime
public IServiceContext getContext()
return mm_serviceContext;
* This method should return a string that is unique to this service amongst all
* other services deployed in the portal runtime.
* @return a unique key of the service
public String getKey()
return KEY;
However, when I try to render using this bespoke renderer, I get the following error in the Default Trace:
#1.5#000BCDEE0DD8005600000082000006C00004497AFED42BF7
#1206692517085
#com.sapportals.wcm.rendering.property.PropertyRendererUtil
#sap.com/irj
#com.sapportals.wcm.rendering.property.PropertyRendererUtil
#username
#6737
#ITNSAPNT06_J2E_4316950
#username
#9cf6bb00fc9e11dcbc54000bcdee0dd8
#SAPEngine_Application_Thread[impl:3]_34
#0
#0
#Error
#Plain
#Either the class com.company.project.km.SBPCPropertyRenderer could not be found oder the following error occurs while rendering: java.lang.ClassNotFoundException: com.company.project.km.SBPCPropertyRenderer
at com.sapportals.wcm.crt.CrtClassLoaderRegistry.findClass(CrtClassLoaderRegistry.java:176)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sapportals.wcm.rendering.property.PropertyRendererUtil.renderProperty(PropertyRendererUtil.java:122)
at
My PortalApp.xml is as follows:
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
</application-config>
<components/>
<services>
<service name="default">
<service-config>
<property name="className" value="com.company.project.km.SBPCPropertyRenderer"/>
<property name="startup" value="true"/>
</service-config>
</service>
<service name="RFServiceWrapper">
<service-config>
<property name="className" value="com.company.project.km.RFServiceWrapper"/>
<property name="startup" value="true"/>
</service-config>
</service>
</services>
</application>
Can anyone spot what I am doing wrong?
Thanks,
TomHi Tom,
I've implemented similar behaviour but with the state of resource. The code is following:
private static final class URLs {
private static final String BEFORE_APPROVAL = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledr.gif";
private static final String APPROVAL = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledy.gif";
private static final String PUBLISHED = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledg.gif";
private static final String ARCHIVED = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledi.gif";
public Component renderProperty(IProperty property, IResource res, int maxLength){
Image image = null;
try {
IRepositoryServiceFactory factory = ResourceFactory.getInstance().getServiceFactory();
IURLGeneratorService ug = (IURLGeneratorService)factory.getService(IServiceTypesConst.URLGENERATOR_SERVICE);
IStatemanagementManager stateManager = (IStatemanagementManager) factory.getRepositoryService(res,IWcmConst.STATEMANAGEMENT_SERVICE);
IStatemanagementUtilsResource sResource = stateManager.getStatemangementResource(res).getUtils();
Locale locale = res.getContext().getLocale();
IState state = sResource.readState();
if (state.getID().equalsIgnoreCase(States.BEFORE_APPROVAL))
image = new Image(ug.createAbsoluteUri(new UriReference(URLs.BEFORE_APPROVAL,null,null)).getPath(), state.getDescription(locale));
if (state.getID().equalsIgnoreCase(States.ARCHIVED))
image = new Image(ug.createAbsoluteUri(new UriReference(URLs.ARCHIVED,null,null)).getPath(), state.getDescription(locale));
if (state.getID().equalsIgnoreCase(States.APPROVAL))
image = new Image(ug.createAbsoluteUri(new UriReference(URLs.APPROVAL,null,null)).getPath(), state.getDescription(locale));
if (state.getID().equalsIgnoreCase(States.PUBLISHED))
image = new Image(ug.createAbsoluteUri(new UriReference(URLs.PUBLISHED,null,null)).getPath(), state.getDescription(locale));
return image;
} catch (Exception e) {
StatePropertyRenderer.log.fatalT(e.getMessage());
return image;
But you can simply take one of the properties of your resource with the method res.getProperty(<IPropertyName>) instead of state and check the value of this IProperty. I took images from KM but you can also add necessary images to your project and use them.
Regards
Pavel -
Custom property renderer for multiple value selections of property metadata
Hi,
We have created custom predefined metadata properties and fetching data from SAP to display values while uploading a document from KM.Everything is working fine and values are being displayed in a dropdown.
The standard property multi-valued displays values in checkboxex but the requirement is to allow for multiple selections in dropdown using shift ot ctrl key.
We started creating our own property renderer by decompiling classes like allowedvalues_multivalued
but we could not see the property on the upload screen.
Any help is greatly appericiated.
Thanks,
Vasu.Vasu,
Try changing the property renderer setting in your custom property. There might be one which allows a multiple select box. If not, you can always create your own. The following links are helpful:
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/5800
https://www.sdn.sap.com/irj/sdn/nw-cm?rid=/library/uuid/f7b176eb-0701-0010-2b84-8edb1f76771d
Andrew -
Hi all,
My situation is that I need to be able to, when uploading a document to KM and according to the value that takes a custom property, show only a specific group of properties on the screen.
I'm trying to solve this by developing a custom group renderer. Within the renderer I can get the value of a property, then according to this value I would want to load the specific structured group using its name and render it inside my current structured group renderer.
The problem is that I've haven't been able to create/load the structured group, how is this done?
Also I could try to do it with a custom property renderer that modifies the contents of its containing structured group. Is this possible?/how could I do this?
From what I've seen the KM creates all the Structured Groups when CM loads and pass only the minimal parameters to the group/property renderers limiting what can be done from a dynamic loading of properties point of view. What should I do to be able to extend the logic, not only the way that static properties are painted/rendered?
I'd like to know what you think.
Thanks in advanced,
Andrés
This topic is derived from this one because nodoby could help me there. Custom Group RendererHi Patricio,
Thanks for your answer. Could you please help me with some doubts that I have?
1. In the ResourceType creation it asks for a Resource Type ID, I don't know what to put in there, at help.sap.com it shows it in a URLish form. What should I put here?
2. Also, in Custom Properties is it a comma separated values of the Ids of the properties?
3. How do I pass the ResourceType to the new command that I will create? What is the format of the "parameters" parameter.
If you could provide some references/procedures that I can look into I'd appreciate it.
Thanks in advanced,
André -
Custom property not displaying at folder creation or Details screen
Hello everyone
I have created a custom boolean property that I need to have displayed both at folder creation and in the Details screen of a folder after it's created. The property is in the default namespace, and is in the Custom group. I have created a properties file for the label and created the necessary meta data extension. The folder validity pattern is " / " and the Resource Type listed is "normalct" so that it's active for folders only.
Then I went to Property Groups and listed my new property in the Group Items field of the Custom group. The Custom group is a part of "all_groups" so that group is displayed both when a new folder is created in KM and when the Details screen of a folder is displayed.
<i>However,</i> my custom property isn't displaying under the Custom tab when I go to create a new KM folder, nor when I view the Details screen of an existing folder. What configuration am I missing? Do I have to develop a custom property renderer for each new property I need to create? I was hoping I could achieve this result with configuration changes only, but I must be missing something.
Any help would be greatly appreciated and rewarded.
Thanks in advance,
FallonHi Fallon,
actualy, if you want this property to be displayed only for folders and not for documents, you don't need to specify the resource type for folders. Setting "/" or "/**" for "Folder Validity Patterns" and "" (empty) for "Document Validity Patterns" should be enough.
If you sill experience problems, you have to check all settings, for example with the settings suggested in this <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2654">weblog</a>. If you use the "default" Property Group in the property settings, you don't have to enter the <b>Property ID</b> in a special Property Structure Group that in turn is integrated in the all_groups Property Structure Group.
Hope this helps,
Robert -
Data provider problem in custom item renderer
I have a complex, custom item renderer for a list. I add
items that I extracted from an xml to the data provider using the
IList interface. But when displaying the list, the items are all
screwed up. Each rendered item has some parts which are initialized
as different components depending on the values from the xml. This
initialization is called in the item renderer for the
creationComplete event.
The weird thing is that when I output the dataProvider to
check its values, some of the items have internal uids sometimes
and sometimes they don't. If I output the dataProvider right after
I add the items to it, none of them get internal uids. But from the
initialize method, some of them do and some don't.
To make things weirder, sometimes, as I scroll up and down
the list, the dynamic components get all switched up. I'm either
having a problem with internal uids or with the creation policies
for lists. Or it's probably some simpler mistake I have yet to see.
Anyone have any idea where the problem could lie? Any help is
greatly appreciated.Any successful render must:
1) override the set data property of the component
Further, best practice is to store any data you need in the
override set data(), and call invalidateProperties(). Then do the
actual work in an override commitProperties() function.
The framework is smart about when to call commitProperties
efficiently. set data() gets called much more often.
Tracy -
How to implement custom field renderer?
I'm trying to create a custom field renderer that will render certain database fields as checkboxes in HTML. I'm using the Data Web Beans/JSP approach. In my view object I have added a "Boolean" property to the attributes that represent boolean type fields (e.g., field Warranty to indicate if an asset is under warranty). I have created a CheckBoxField() class similar to the TextField() class, and call it if the attribute is a boolean, but I can't figure out how to set the custom field renderer. When the program runs, it still uses the TextField renderer. The JDeveloper online documentation doesn't say anything about it. Is there a sample program or some other documentation that implements a custom field renderer?
Hi,
this document in addition
http://www.oracle.com/technology/products/jdev/howtos/10g/jaassec/index.htm
has a list of LoginModules, one that authenticates against physical database users
Frank -
Inconsistent behavior with Custom Cell Renderer
I have two questions:
Questions # 1.
I have created a custom cell renderer for my JTable that changes color if the text property changes and the text contains the letter 'S'. Like
so:
class SchedRenderer extends DefaultTableCellRenderer{
public SchedRenderer(){
super();
final Color c = scSelfCont.panelbg;
this.setForeground(c);
this.addPropertyChangeListener("text",new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent e){
boolean foundS=false;
String text=e.getNewValue().toString();
for(int i=0;i<text.length();i++)
if(text.charAt(i)=='S'){
foundS=true;
break;
if(foundS){
SchedRenderer.this.setBackground(Color.red);
SchedRenderer.this.setForeground(Color.red);
else{
SchedRenderer.this.setBackground(c);
SchedRenderer.this.setForeground(c);
99% of the time it works just fine. But occasionally the cell will revert back to its original color, and then back to the correct color after clicking somewhere entirely different. I set some breakpoints in the property change handler and it gets called quite frquently even if no change has been made. At first I thought this was a JDK bug, but I am now convinced that there simply must be a better way to do this, any ideas?
Question # 2:
Is there a simple way to change the color of an entire row without selecting it? Currently I am using Custom Cell Renderers to change
colors of cells, but it seems like such an obtuse method. Is there a better way?
Thanks in advance.
Adrian CalvinI have two questions:
Questions # 1.
I have created a custom cell renderer for my JTable that changes color if the text property changes and the text contains the letter 'S'. Like
so:
class SchedRenderer extends DefaultTableCellRenderer{
public SchedRenderer(){
super();
final Color c = scSelfCont.panelbg;
this.setForeground(c);
this.addPropertyChangeListener("text",new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent e){
boolean foundS=false;
String text=e.getNewValue().toString();
for(int i=0;i<text.length();i++)
if(text.charAt(i)=='S'){
foundS=true;
break;
if(foundS){
SchedRenderer.this.setBackground(Color.red);
SchedRenderer.this.setForeground(Color.red);
else{
SchedRenderer.this.setBackground(c);
SchedRenderer.this.setForeground(c);
[\code]
99% of the time it works just fine. But occasionally the cell will revert back to its original color, and then back to the correct color after clicking somewhere entirely different. I set some breakpoints in the property change handler and it gets called quite frquently even if no change has been made. At first I thought this was a JDK bug, but I am now convinced that there simply must be a better way to do this, any ideas?
Question # 2:
Is there a simple way to change the color of an entire row without selecting it? Currently I am using Custom Cell Renderers to change
colors of cells, but it seems like such an obtuse method. Is there a better way?
Thanks in advance.
Adrian Calvin -
How can I get the value of a custom property from a resource object?
I am trying to get the value(s) of a custom property, called "status" within a method. The method has an object of type IResource available to it.
I have tried the following:
PropertyName propName = new PropertyName("","status");
value = res.getProperty(propName).toString();
However, I am getting a NullPointerException when I try to create the PropertyName instance.
Is there a better way to get the value of a specific property from a resource object?
Thanks,
TomThanks Praveen.
I was missing the default namespace of "http://sapportals.com/xmlns/cm" - I thought I could just pass an empty string for the namespace, but it looks like I must always specifiy, even if it is default.
Tom -
How do I map custom property from portal api ptsearchresponse?
I want to map the search results to my datatable.
I can execute the search fine. But how do I map the property value? My property id is 101.
In other words which ptSearchResponse method do I use?
IPTSession ptSession;
IPTSearchRequest ptSearchRequest;
IPTSearchResponse ptSearchResponse;
IPTSearchQuery ptSearchQuery;
string serverConfigDir = ConfigPathResolver.GetOpenConfigPath();
IOKContext configContext = OKConfigFactory.createInstance(serverConfigDir, "portal");
PortalObjectsFactory.Init(configContext);
ptSession = PortalObjectsFactory.CreateSession();
ptSession.Connect(1, "", null);
// Create a SearchRequest object
ptSearchRequest = ptSession.GetSearchRequest();
// Set search settings (constraints)
// Set maximum results desired (100)
ptSearchRequest.SetSettings(
PT_SEARCH_SETTING.PT_SEARCHSETTING_MAXRESULTS, 100);
// Set the folder in which to search (array to support multiple folders)
ptSearchRequest.SetSettings(
PT_SEARCH_SETTING.PT_SEARCHSETTING_DDFOLDERS,
new int[] { Convert.ToInt32(ConfigurationManager.AppSettings["DocumentFolderId"]) });
// Include subfolders of the folder
ptSearchRequest.SetSettings(
PT_SEARCH_SETTING.PT_SEARCHSETTING_INCLUDE_SUBFOLDERS, true);
// Restrict search to just portal documents
// (not ALI Collaboration or ALI Publisher)
ptSearchRequest.SetSettings(
PT_SEARCH_SETTING.PT_SEARCHSETTING_APPS, PT_SEARCH_APPS.PT_SEARCH_APPS_PORTAL);
// get documents only
ptSearchRequest.SetSettings(
PT_SEARCH_SETTING.PT_SEARCHSETTING_OBJTYPES, new int[] { PT_CLASSIDS.PT_CATALOGCARD_ID });
// Request the intrinsic PT_PROPERTY_PROVIDERCLSID and custom property 101
ptSearchRequest.SetSettings(
PT_SEARCH_SETTING.PT_SEARCHSETTING_RET_PROPS,
new int[] { PT_INTRINSICS.PT_PROPERTY_PROVIDERCLSID, 101 });
//Use IPTFilter to create search filter with clause with two statements
IPTFilter ptFilter;
IPTPropertyFilterClauses ptFilterClause;
IPTPropertyFilterStatement ptFilterStmt1;
IPTPropertyFilterStatement ptFilterStmt2;
// Create the filter itself
ptFilter = PortalObjectsFactory.CreateSearchFilter();
// Create the filter clause
ptFilterClause = (IPTPropertyFilterClauses)ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_CLAUSES);
ptFilterClause.SetOperator(PT_BOOLOPS.PT_BOOLOP_OR);
// Attach it to the filter itself
ptFilter.SetPropertyFilter(ptFilterClause);
// Put two statements into the clause
ptFilterStmt1 = (IPTPropertyFilterStatement)
ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_STATEMENT);
ptFilterStmt1.SetOperand(101);
ptFilterStmt1.SetOperator(PT_FILTEROPS.PT_FILTEROP_CONTAINS);
ptFilterStmt1.SetValue(tbSearch.Text.Trim());
ptFilterClause.AddItem(ptFilterStmt1, ptFilterClause.GetCount());
ptFilterStmt2 = (IPTPropertyFilterStatement)
ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_STATEMENT);
ptFilterStmt2.SetOperand(1);
ptFilterStmt2.SetOperator(PT_FILTEROPS.PT_FILTEROP_CONTAINS);
ptFilterStmt2.SetValue(tbSearch.Text.Trim());
ptFilterClause.AddItem(ptFilterStmt2, ptFilterClause.GetCount());
// Make the filter into an actual search query
ptSearchQuery = ptSearchRequest.CreateAdvancedQuery(ptFilter);
// Run the search and return results
ptSearchResponse = ptSearchRequest.Search(ptSearchQuery);
// How many things matched the search?
int totalMatches = ptSearchResponse.GetTotalMatches();
// How many items were returned? (Not necessarily all)
int returnedMatches = ptSearchResponse.GetResultsReturned();
// create DataTable and map results to
// datatable fields
DataTable dtSearchResults = new DataTable("Documents");
dtSearchResults.Columns.Add("Name");
dtSearchResults.Columns.Add("Excerpt");
dtSearchResults.Columns.Add("DocSubject");
dtSearchResults.Columns.Add("DocTopic");
dtSearchResults.Columns.Add("DocType");
dtSearchResults.Columns.Add("DocKeywords");
dtSearchResults.Columns.Add("Url");
dtSearchResults.Columns.Add("ImageURL");
DataRow dr;
// Print the name of each result
for (int i = 0; i < returnedMatches; i++)
dr = dtSearchResults.NewRow();
String strName = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTNAME);
String strText = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTSUMMARY);
String strURL = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_DOCUMENTURL);
String strImageURL = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTIMAGEUUID);
dr["Name"] = strName;
dr["Excerpt"] = strText;
dr["Url"] = strURL;
dr["ImageURL"] = "pt://images/plumtree/portal/public/img/sml" + strImageURL + ".gif";
dtSearchResults.Rows.Add(dr);
Edited by [email protected] at 04/11/2008 7:26 PM
Edited by [email protected] at 04/11/2008 7:27 PMProblem solved. I should use JsonObject instead of JSONObject :D
-
How can I add a custom property to an object, like a paragraph?
Hi,
We have a merge process that combine multiple document into one and I need to store the filename of the imported file at the beginning of each merge point. Each document that we merge contains a Title paragraph and I was wrongly assuming that I could set the label property of this paragraph with my value for future references, but only to find out that the paragraph object doesn't have a label property.
I also tried setting a custom property by doing this
paragraph.properties["myCustomProperty"] = "value";
It doesn't crash, but if I try reading the value it is always undefined.
I'm looking for alternative, or on how would you approach this, can you please advice?
Your help is much appreciated.
ThanksPeter Kahrel wrote:
You could label the paragraph's parent story. Is that any good?
Peter.
Well I tought about it, but then I have to find a way to keep track of which paragraph this value belongs to and so far I havent found a way to uniquely identify a paragraph and I can't assume that the merged document won't be edited so I can't use the index.
Peter Kahrel wrote:
Otherwise use a paragraph property that you never use and that doesn't affect composition, such as .bulletsTextAfter
P.
It may be an alternative, but that may cause problem in the furture if they ever decide to use or change that properties. Plus, I'm not sure if can put anything I want in there, but that would be worth the try. -
How to reference a custom property in a vo transient attribute expr + bug
Hi all
I have created a transient attribute with an expression that evaluate null content to replace it by a appropriate text.
<ViewAttribute
Name="DescriptionUI"
IsUpdateable="false"
IsSelected="false"
IsPersistent="false"
PrecisionRule="true"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="VIEW_ATTR"
SQLType="VARCHAR">
<TransientExpression><![CDATA[((Description == null) ? 'Pas de description' : Description)]]></TransientExpression>
</ViewAttribute>I have defined a custom property for that attribute that contains the message text. I was surprised to see that the custom property was not associate with the attribute in the source file. Don't understand where the association is done
<Properties>
<CustomProperties>
<Property
Name="flex.tree.noLabel"
ResId="flex.noDescription"/>
</CustomProperties>
</Properties>I had some difficulties to use the custom property editor. When creating a new related one by using an existing resource the property column value is not changed and the content 'Property' is generated. Because no relationships exists between attribute and the property, the entry is lost in the table referring custom property list for the attribute when your come back into the view object or if you save an another entry in an another attribute.
So my first question ? Is the attribute editing part the right part to define custom property pairs if they are not related to attributes ? is it a bug ?
My second question is : is it possible to evaluate the bundle in the expression (replacing the literal 'Pas de description' by an expression) ? What is the expression to use ? Where it is described to do such things in the help or in the documentation ?
Thank youThis is wrong
((Label == null) ? {FlexParameterModelBundle['flex.tree.noLabel']} : Label)
What is the correct syntax to refer to the project model standard bundle in the groovy expression ?
Thank for the help ! -
How to create Image as Custom Property Type used in Configurable Web Part?
I wanted to create custom configurable web part property for Image.
Example - the screenshot of Image property used in Image web part is shown below:
My goal is to create as many images as possible in custom configurable web part.
I tried to write the code:
[WebBrowsable(true),
WebDisplayName("Example Photo"),
WebDescription("Example Photo of the user"),
Category("Custom User Profile"),
Personalizable(PersonalizationScope.Shared)]
public Image ExampleUserPhoto { get; set; }
However, the result does not display Image configurable web part property.
I wonder why the data type Image does not cause the custom web part to have Image configurable web part property.
Other data types such as Boolean, Enum, Integer, String and DateTime can be used.
How can I create Image as Custom Property Type used in Configurable Web Part?I have examined that context node __00 has been enhanced,and has a class name z___00. But when I created a new attirubute by right click " Attributes" with wizard under context node __00.There is still a error message "view is not enhaced or copied with wizard".
But when I created a method "getvaliation " in the class of context node zcl__00, the attribute 'valiation' automatically created(at the same time the method "getvaliation' automatically created for the attribute 'valiation') and I need not to create attibute 'validation' by wizard . It seemed as if the problem is resloved. But when I make test for it in web ui .There is a runtime erro message.
Do I need to make some configurations in the business object layer for the checkbox? but the checkbox is only used as a flag to decide whether a backgoud job is needed to be executed.
Edited by: samhuman on Jun 22, 2010 10:31 AM -
Event Handling in JTable Custom Cell Renderer
I have a JLabel as a custom cell Renderer for a column. I want to handle mouse click event for the JLabel rendered in the cell.
I tried adding the listener for the label in the custom cell renderer but it is not working. Any ideas how to handle this problem??
Thanks
S.AnandIf you want to handle the selection of a tree node
1) write a class like:
public class TreePaneListener implements TreeSelectionListener {
// TREE SELECTION LISTENER
public void valueChanged(TreeSelectionEvent e) {
JTree tree = (JTree)e.getSource();
DefaultMutableTreeNode node = null;
int count = 0;
boolean doSomething = false;
if(tree.getSelectionCount() > 1) {
TreePath[] selection = tree.getSelectionPaths();
int[] temp = new int[selection.length];
for(int i =0; i < selection.length; i++) {
// Check each node for selection
node = (DefaultMutableTreeNode)selection.getLastPathComponent();
if(node.getLevel()==2) {
// Change this code to take the action desired
doSomething = true;
2) After creating the tree register the listener
TreePaneListener handler = new TreePaneListener();
tree.addTreeSelectionListener(handler); -
People Search and a Custom Property
I am trying to surface a custom property in the people search query results. For example,
http://<servername:port>/_api/search/query?querytext='*'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'
I get XML results but when I look at the properties returned for each of the people result, there are no custom properties from user profile properties. How can I modify the custom properties so that they start showing in the XML results for people search?
Rank, DocId, AboutMe, AccountName, BaseOfficeLocation, Department etc.
Please let me know.
Thanks!
Update: I am using SearchExecutor class and its ExecuteQuery API.Hi,
Thank you for your sharing! It will be beneficial to others in this forum who meet the same issue in the future.
Best Regards,
Wendy
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]
Maybe you are looking for
-
Hello! I'd like to use a CMYK PDF/Illustrator file thats coming from another designer as a label on a 3D object that I imported as a 3D Layer. The Photoshop document is in 16bit RGB mode and has the sRGB color Profile. Are these the right requirement
-
i have xml structure. <?xml version="1.0" encoding="utf-8"?> <ul> <li><a href="http://www.google.com">Google</a></li> <li><a href="http://www.hotmail.com">Hotmail</a></li> <li><a href="http://www.nepalNews.com">Nepal News</a></li> </ul> I
-
Hi ppl, My requirement is to call a WD iView from a VC iView. I tried to follow this blog and few other materials: Combining ABAP and Visual Composer The blogs speaks on eventing in VC, i've tried to implement the same with a sample flight applicatio
-
C6's Photo Gallery and Swipe to Unlock on X6 ?
Will X6 get C6's Photo Gallery and Swipe to Unlock ?C6's Photo Gallery is really very useful and faster then X6's gallery. Thanks in advance...Sorry if i'm in wrong section...
-
Hide buttons from Adobe on Interactive Forms
When the PDF is displayed, I get all the buttons from Adobe on my toolbar. I can only find one option in NWDS where i can hide toolbar, but that hides the whole bar. I want to keep the fileoptions like save, print, search.can anyone help me.