How to add post method in to a link in ofbiz? - security

I'm using ofbiz framework to develop. But I'm confused with method of a link tag. Because security reasons, I don't want to display value of parameter in address of addressbar. In fact, I'm usually use method="post" for a a tag, but in ofbiz I don't know what attribute can do it. How can I do in this case ?

My resolution is:
I use a form element instead of using a link element because forms use post as the default method:
If my link element is:
<link target="myTarget">
<parameter param-name="myParameter" from-field="myField"/>
</link>
My form element will be:
<form name="myForms" type="single" target="myTarget">
<field name="myField" parameter-name="myParameter">
<hidden></hidden>
</field>
<field name="mySubmitButton" title="${uiLabelMap.myButtonTitle}">
<submit button-type="button"/>
</field>
</form>

Related

How to get document datasource in another Custom Control?

I have an xPage with this content:
<div class="lotusFrame">
<xc:layoutCommonBanner />
<xp:callback facetName="facetTitleBar" id="callbackTitleBar" />
<xc:layoutDiscrepancyPlaceBar />
<div class="lotusMain">
<div class="lotusColLeft">
<xp:callback facetName="facetColLeft" id="callbackColLeft" />
</div>
<div class="lotusColRight">
<xp:callback facetName="facetColRight" id="callbackColRight" />
</div>
<div class="lotusContent">
<xp:callback facetName="facetContent" id="callbackContent" />
</div>
</div>
<xc:layoutCommonFooter />
<xc:layoutCommonLegal />
</div>
As you can see, there are several custom controls in it composing layout. In the facetContent, there is a document with document datasource. It's the only document in the page. I need to get this document somehow in the layoutDiscrepancyPlaceBar custom control.
I found some old articles on the web with undocumented feature called currentDocument. It should be on every page with document datasource. But it doesn's work. I have Domino 8.5.2 and currentDocument seems to be no longer supported.
Can you help me out? How can I get document datasource from one custom control in another custom control. Is it even possible?
Thanks in advance, Jiří
EDIT: OK, it is still supported, but it only works in custom control, that is included inside the one with document datasource. In the case scenario above it doesn't work.
Your best option is to hand over the binding name in a custom property. (lets call it bindto. Then you bind your field to
"${#{"+compositeData.bindto+"}}"
See details here (inside the prezi)
P.S. currentDocument is documented somewhere.
You can also pass a handle on the data source directly to the custom control, as well as the name of the item to bind to on the data source. Because EL supports array syntax as well as dot syntax, this allows you to define expressions like this:
#{compositeData.dsn[compositeData.fieldName]}
(where "dsn" is the property being passed the handle on the data source, and "fieldName" is the property being passed the name of the item to bind to on that data source.)
More details on this approach can be found here.

Content rating control is always hidden

I've added the following code to the selected transformation of a News List webpart:
<%# Register Src="~/CMSAdminControls/ContentRating/RatingControl.ascx" TagName="RatingControl" TagPrefix="cms" %>
<cms:RatingControl ID="elemRating" runat="server" Enabled="true" RatingType="Stars" ExternalValue='
<%# Convert.ToString(CMS.GlobalHelper.ValidationHelper.GetDouble(Eval("DocumentRatingValue"), 0)/((CMS.GlobalHelper.ValidationHelper.GetDouble(Eval("DocumentRatings"), 0) == 0?1:CMS.GlobalHelper.ValidationHelper.GetDouble(Eval("DocumentRatings"), 1)))) %>' />
The rest of the selected transformation is the same as the default.
According to the Kentico documentation this should add the webpart to the details page of a news item.
For some reason the input tag is getting rendered as follows:
<input type="hidden" name="p$lt$zoneContent$pageplaceholder$pageplaceholder$lt$News$NewsList$repItems$ctl00$ctl00$elemRating$RatingControl$elemRating_RatingExtender_ClientState" id="p_lt_zoneContent_pageplaceholder_pageplaceholder_lt_News_NewsList_repItems_ctl00_ctl00_elemRating_RatingControl_elemRating_RatingExtender_ClientState" value="0">
note the type="hidden" attribute. This causes the control not to render and I'm not sure where to fix this.
As mentioned in my comment. The is actually just used to store the value. Below that, it renders some extra content that will not display unless some CSS classes are carried over from the CMSDesk.css.
You can either copy the necessary CSS classes into your own CSS, or just import the CMSDesk.css file where necessary to make sure the rating elements are displaying.

Can I use Microdata with JSF 2.0?

I found this page:
http://www.kiwi-community.eu/pages/viewpage.action?pageId=7733331
But it is rather discouraging.
Do I simply add the namespace and use the tags ?
I also seem to have a hard time finding the correct namespace...
When adding microdata to a JSF composite component in a webapp I'm working on I found that it worked fine as long as itemscope was not left with an empty value. See: how-can-i-manage-microdata-with-xslt
So something like the following is fine:
<section itemscope="itemscope" itemtype="http://schema.org/Person">
<div class="profile">
<h4 itemprop="name" ><h:outputText value="#{cc.attrs.name}"/></h4>
<h5 itemprop="title"><h:outputText value="#{cc.attrs.jobTitle}"/></h5>
<p itemprop="telephone" class="phone"><h:outputText value="#{cc.attrs.phoneNumber}"/></p>
</div>
</section>
idk what jsf is but you can use microdata in any html5 markup. check out schema.org for the namespace and linkage dude.

Update SharePoint custom list Displayform on existing site collection?

I have an existing site collection with a bug that I need to fix where a custom document list has been created along with an override file for the displayform:
<Form Type="DisplayForm" ToolbarTemplate="BLPDocLibDisplayFormToolBar" SetupPath="pages\kmform.aspx" Url="DispForm.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" SetupPath="pages\form.aspx" Url="EditForm.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="Forms/Upload.aspx" WebPartZoneID="Main" />
<Form Type="NewFormDialog" Path="EditDlg.htm">
Being a novice at SharePoint I have no clue or can find anything useful out there on how I can update the deployed override file Dispform.aspx as it appears that every list has it's own copy of the file.
Anyone know how this can be done?
Thanks in advance.
Dan
Please clarify your question. Do you mean that you have created many lists of this custom type and now need to change the display page to the default one instead of custom?

CAML cannot reference Custom Properties in custom fields

I am trying to create a custom field type in SharePoint.
My custom field type has a custom property called CustomProperty.
<FieldTypes>
<FieldType>
<Field Name="TypeName">CustomField</Field>
<Field Name="InternalType">CustomField</Field>
..............................
..............................
<PropertySchema>
<Fields>
<Field Name="CustomProperty" DisplayName="CustomProperty" Type="Text" Hidden="TRUE" />
</Fields>
<RenderPattern Name="DisplayPattern">
<Property Select="CustomProperty" />
</RenderPattern>
</FieldType>
</FieldTypes>
I am trying to render the value of this custom property in the DisplayPattern.
But it looks like the CAML is not able to reference the custom properties.
I am not getting any value for the CustomValue property even though it is set correctly.
Any idea how to refer custom properties in CAML?
Unfortunately there is no straightforward way of achieving this, from what I've seen.
Your best option is to look at using this.GetCustomProperty("CustomProperty") within the overrided GetFieldValue function (or GetFieldValueAsHtml for a Note field).
The value string passed into the GetFieldValue function is the output from your CAML, so you can append to it and pass it on out.
Here is a sample:
http://blogs.msdn.com/toddca/archive/2009/01/23/customizing-the-rendering-of-a-custom-spfield.aspx
I haven’t tried it myself, and I have no idea if changing the SchemaXml could cause any unexpected problems.

Resources