Update SharePoint custom list Displayform on existing site collection? - sharepoint

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?

Related

Create own customized Web Content List

I'm looking to create my own Web Content List portlet. I exactly want to display the web content of my portal applying some filters.
I'm a little bit lost...
I tried to create a hook but I dont know how to find the possible actions of this portlet.
I don't want to get all the content. I want to use a rules mechanism for filtering the contents(drools portlet), depending on the user information.
Thank you in advance,
Oriol
You can get the list of web contents by using following method:
List<JournalArticle> result = JournalArticleLocalServiceUtil.getArticles(groupId, -1, -1);
You can display the list using liferay search container as:
<liferay-ui:search-container delta="30" emptyResultsMessage="no-users-were-found">`
<liferay-ui:search-container-results>`
results="<%= result%>"
total="<%=result.size() %>" />
<liferay-ui:search-container-row
className="com.liferay.portlet.journal.model.JournalArticle"
keyProperty="articleId"
modelVar="content" >
<liferay-ui:search-container-column-text
name="ID" value="<%= content.getArticleId()%>" /> // You can add multiple columns
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />
</liferay-ui:search-container>
Hope this will help you.

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.

How to programmatically customize editform.aspx/newform.aspx with SP2007?

I have been looking for a solution for hours but I can't manage to customize my list forms. Although it is very easy to modify the form under SPDesigner, I can't find a way to do the same in VS2008.
Does anyone know the way to customize a form programmatically ?
Thank you very much
The best way to customize newform.asxp and editform.aspx (in my opinion) could be :
On a new visual studio solution :
Define your content type for the list
Define a list shema based on the CT
In the section "forms" in the schema.xml define your own aspx for editform.aspx and newform.aspx like
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\YourListDefinitionPathInSolution\YourEditForm.aspx" UseLegacyForm="True" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\YourListDefinitionPathInSolution\YourEditForm.aspx" UseLegacyForm="True" WebPartZoneID="Main" />
</Forms>
In this blog post you will find the good recipe : Create custom SharePoint 2010 list form for deployment in a Visual Studio 2010 project
Regards
EDIT : sorry, recipe for 2010 version :-(
What you are suggesting does not sound like best practice, the newform.aspx, editform.aspx, etc. are the SharePoint out-of-the-box forms for the list and should probably be left alone.
What changes are you making? Simple changes like increasing the size of text boxes or substantial changes?
You can create your own forms if the changes are substantial

Clone entry in expressionengine with safecracker

I have an expressionengine template for frontend users using safecracker to create entries. ex: http://domain.com/index.php/create. After user creates an entry, the entry can be edited by going to http://domain.com/index.php/create/my_entry where my_entry is the entry user created. My question is can i provide the user an option to clone an entry. What is the best way to clone. I can't think of an easy way to do this.
I haven't tried this, but you could try creating a new template - say, /index.php/clone/ - that you'd link to with the url_title of the entry to be cloned after it (e.g., /index.php/clone/my_entry). Then use a channel:entries tag with url_title="{segment_2}" to get the values of all the existing entry's fields, and nest an {exp:safecracker} tag inside of it?
{exp:channel:entries channel="my_channel" url_title="{segment_2}"}
{exp:safecracker channel="my_channel"}
<input name="title" type="text" value="{title} />
<input name="my_custom_field" type="text" value="{my_custom_field}" />
... etc ...
<input type="submit" value="Submit" />
{/exp:safecracker}
{/exp:channel:entries}
Worth a shot anyway.

Add a form with POST method on a SharePoint 2010 page?

The HTML I got asked to add to a page is:
<div>
<div> Click below to enter</div>
<form id="formID" method=POST action="http://www.someWebsite.com">
<input type="submit" name="do_login" value="Log in" />
<input type="hidden" name="username" value="someUsername" />
<input type="hidden" name="password" value="somePassword" />
</form>
</div>
I know I can't add a form like that because there is already on that SharePoint created, I had a look at http://www.sharepointboris.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/ but when I follow the example and save SharePoint still strips out most of the code so how can I achieve what I want in another way?
Thanks in advance.
For our SharePoint 2007 installation, I created a quiz web part. Basically, it pulls questions and answers from a list, but the actual questions are presented and submitted using a form with POST variables. It's probably much more complex and in-depth than you're looking to go, but I made a custom web part to present the form, read the post variables, and execute associated functions. The big plus to using a custom web part is that you're able to put in nearly any content you want, since you're coding it in ASP.NET.
What I did was to create a custom .aspx page (not through the sharepoint gui) with the code I posted in my question, uploaded the page to a library and then linked to it via a page viewer web part
You can get the form to work as normal if you remove the tags and place the form control inside a div like so:
<div>
<div> Click below to enter</div>
<div id="formID" method=POST action="http://www.someWebsite.com">
<input type="submit" name="do_login" value="Log in" />
<input type="hidden" name="username" value="someUsername" />
<input type="hidden" name="password" value="somePassword" />
</div>
</div>
This way sharepoint will accept everything inside the div tags. In a asp.net when you create a page in sharepoint, the whole page is containied withing a form that why sharepoint does not allow you to use another form within it.
Hope this helps

Resources