Sharepoint 2007 AddList and AddListFromFeature are missing template columns and data content - web-services

What I've Done
Inside SharePoint I created a List based on the Project Tasks template
I deleted most default columns, and added new custom columns
I added data using the new format
Then I did a "Save as template" and chose to save the template with the content
What IS Working
Now, when I use that template to create a new List inside of SharePoint it works perfectly. The custom columns are present, and the data is all pre-filled as expected.
What ISN'T Working
However, when I use the AddList or AddListFromFeature methods made available by SharePoint web services the new list is created, but it is simply based off of the original Project Tasks template with the default columns and no data!
What I've Tried
I tried following the suggestion in the article from Phase 2 to setup a custom template ID, but that only prevented me from using the template at all (was no longer listed when I do a "Create").
I'm still trying to figure out if this article applies - it seems to be a similar issue, but applied to Sites instead of Lists.
I found that another person was having the same problem about a year ago.
System Setup
Working with SharePoint 2007 (I think?), using PHP with NuSOAP to connect. The connection is definitely working as I've added items to lists, created lists, and read data.
Code Samples
Request - against Phase 2 Method template above
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2034="http://tempuri.org"><SOAP-ENV:Body>
<AddListFromFeature xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>2Test Milestone Release</listName>
<description>Testing this out</description>
<featureID>{00BFEA71-513D-4CA0-96C2-6A47775C0119}</featureID>
<templateID>151</templateID>
</AddListFromFeature></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response - fails due to templateID not being recognized
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Cannot complete this action.
Please try again.</errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x81072101</errorcode></detail></soap:Fault></soap:Body></soap:Envelope>
I'm stumped! So if you can help - I'd be a very happy person! Thanks, in advance!

I would chase why you can't create the list via the interface in the first place, these two web service calls don't seem to include the important parameter when creating from custom templates, lets analyse the querystrings:
New Project Tasks (out of the box)
http://site/_layouts/new.aspx?FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=150
New Project Tasks Custom (saved in the list template gallery)
http://site/_layouts/new.aspx?CustomTemplate=PT6.stp&FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=150
New Project Tasks Custom (manifest.xml edited to 151)
http://site/_layouts/new.aspx?CustomTemplate=PT6.stp&FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=151
They all work, so my take here is that the Web Service is a no no for custom templates, or it has some secret magic (common in list definitions) since specifying only the ListTemplate without being explicitly CUSTOM won't work even in the UI.
If you can't get around with this apparent limitation, my suggestions are:
.NET, note that this post has some voodoo in the first comment if you happen to get the same error
Make an IFRAME with http://site/_layouts/new.aspx?CustomTemplate=PT6.stp&FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=150 as source and fill the fields using javascript, and then trigger the OK button click, make some full page loading transition and it will even look good.
Method 2 needs to be done from the same domain, if you are not running your PHP from the same domain (unlikely) you need to create a page inside the SharePoint site to contain this hack, it can be as simple as a Web Part Page with a Content Editor Web Part in it, you read some querystring parameters, place them on the fields, trigger the OK and wait for the page to change so you can redirect to a "success" page.
Edit: I got curious and looked at the source of New.aspx, it has this little snippet (bIsCustomTemplate = strCustomTemplate != null, strCustomTemplate = querystring "CustomTemplate"):
<% if (bIsCustomTemplate) { %>
<input id="onetidCustomTemplate" type="Hidden" name="CustomTemplate" value=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(strCustomTemplate),Response.Output);%> />
<% } %>
I looked at the disassembled code but I don't think we can post it here, but it only proves that the UI builds it from a post (Request.Form) and looks for the CustomTemplate parameter, and the Web Service has only those methods were you can't specify a custom template.

Related

Recover hybrid page Alfresco Share

I've created a new page Aikau, but I changed the XML file and the rendered page content between the standard Share header and footer disappeared.
In this page, I want the arguments of the query string, so I write this code:
page.get.desc.xml:
<webscript>
<shortname>My New Page</shortname>
<url>/hdp/ws/my-new-page</url>
<authentication>user</authentication>
</webscript>
page.get.js:
function main ()
{
// Get the args
var fileProp = args["test"];
model.temp = fileProp;
}
main();
page.get.html.ftl:
Test arg: ${temp}
I have to put /hdp/ws/my-new-page in the XML file to write the content of FTL file in this page... But why did the header and footer of the Alfresco template disappeared ? hdp serves for this purpose. And if I don't put the URL like that on the XML, the page appears with the template.
What is wrong in my code? Or how can I recover the template? Or add header and footer?
EDIT: I already try to put only /my-new-page without /hdp/ws/ but the args are null when I put /hdp/ws/. Give me a hint.
EDIT2: I already try to import alfresco-template.ftl but I can't. Any idea?
You don't actually need to include the the "hdp/ws" part in your WebScript descriptor. Only the "/my-new-page" is required. Aikau attempts to simplify the Surf page creation by providing a number of pages out-of-the-box (and the "hdp" page is just one of them).
Aikau uses URI-template mapping to match a single WebScript to a page, so for example in the URL:
/share/page/hdp/ws/my-new-page
share = application context
page = Spring MVC request dispatcher
hdp/ws/my-new-page is then mapped to the URI template:
<uri-template id="share-page">/{pageid}/ws/{webscript}</uri-template>
Where "hdp" is the id of the page to render and "my-new-page" is the WebScript URL. The HDP page uses the "webscript" token from the template to automatically create a new Surf Component and bind it to the WebScript.
But in short - don't include "hdp/ws" in your WebScript URLs for Aikau pages.
You need to make the things that you have on javascript server in this javascript mandatorily? If not, you can create a javascript client that receive the same arguments (location.search give to you the query string, so, you can make parse of that query string and get only the value of the "test" that you want) and call them on FTL file (the client-side javascript). So, when the page loading, it does not lose the arguments. It isn't the best solution but you can try this...

Use UpdateListItems webbservice on Sharepoint using Infopath form without managed code

I need to create a Infopath form that users can use to create posts and update a Sharepoint list.
I have located the list GUID and the Lists.asmx webbservice. I have made sure that I am admin with full rights on the List in question. The list is a basic 2 column (1 line of text).
I have created the CAML template:
<?xml version="1.0" encoding="UTF-8"?>
<Batch OnError="Continue">
<Method ID="1" Cmd="New">
<Field Name="Field1"></Field>
<Field Name="Field2"></Field>
</Method>
</Batch>
Two data connections using the CAML:
XML-file - loading the CAML.
Send data using Lists.asmx-service - "UpdateListItems"-method.
The parameters for the UpdateListItems : tns:listName connected to a variable containing the GUID. tns:updates connected to /Batch in loaded CAML, XML-subtree included.
I have added a Repeating Table using the XMLfile-connection (CAML) where I can fill the column values for the new Listitem.
I have added a button that triggers action rules that use the dataconnection and "UpdateListItems"-method. The button also is tested trigger other rule actions, so the button itself works.
As I try post a new item to the sharepoint-list I receive no error message, everything seems to work fine, but no items is created.
If I change anything, like the GUID or other things, I recieve different error messages, so it appears as Infopath thinks everything works fine, but Sharepoint isn't doing anything with my list. No items is created.
Anyone has any idea of what could it be that goes wrong?
Edit: I have used other webservices from the same Sharepoint-server without any problems.
This suggestion may be a bit dated, but...
I just had a similar problem. By using ULSViewer on the SharePoint server and reading the MSDN documentation I figured out that the Name attribute in the CAML Field tag should be the internal name Sharepoint assigns to your list column when you create it. In my case I had to change the CAML from:
<Field Name="pub1">
to
<Field Name="_x0066_ub1">
I had the same problem - you have to point the Web service submit to site /_vti_bin/lists.asmx not to server /_vti_bin/lists.asmx. For example your site is on address server/site, you should use server/site/_vti_bin/lists.asmx, not server/_vti_bin/lists.asmx. My problem was with some subsites, so you could check it if it's the same to you.
When creating new items using UpdateListItem, you need to include a Field tag for the list's ID column. It should be formatted as such:
<Field Name='ID'>New</Field>
Is Title still a required column in your list (it is by default). If so, try adding that to your XML:
<Field Name='Title'></Field>
and I dont think that
<Field Name='ID'></Field>
is required when doing a NEW command (inserting a new list item), but it is required for an UPDATE command (updating an existing list item) - I certainly didnt need it when I tested this.

How can I develop a list template for a dynamic list in Liferay with action buttons?

List template in dynamic data list in Liferay
I have already read this post and also another webapplicationdeveloper blogpost but not find any idea to get action button in customly applied template to dynamic data list.
I have also tried including that default record_action.jsp of dynamicdatalist portlet in vm template but its not working and also set the property below
journal.template.velocity.restricted.variables =
in portal-ext property but still I am not getting the action button in my custom template
I have already tried this :
#
set (
$categoriesService = $portal.getClass().forName("com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil").getMethod("getService", null).invoke(null, null))
My answer is: Yessss, it works. But I want use a jstl lib (e.g. <aui> or <ui>) as well. In my opinion the simpliest way to do it is include jsp file to themeServletContext. Put your file.jsp into your theme:
your-theme/docroot/path/to/your/jsp/file.jsp
and paste this piece of code into your vm (for example portal_normal.vm):
$theme.include($themeServletContext, "/path/to/your/jsp/file.jsp")
In this case it unable to find the $theme variable my page displaying the $theme as it is...:(
Please help:
Leave velocity, it's too poor to use taglib, and switch to freemaker language: more powerfull and full support of taglib.
Here there is an example to use freemaker for theme develment, but it's good starting point also to template in dynamic data list.
https://www.liferay.com/it/web/mika.koivisto/blog/-/blogs/using-freemarker-in-your-theme-templates
Look also freemaker guide: http://freemarker.org/docs/index.html

Umbraco error in Document Types

A long time ago I first setup a website in Umbraco. This seemed to be working fine.
I have now come back to it about a year later, and was initially getting the following error when selecting a Document Type (any document type in the Settings tab):
A bit weird, because earlier I didn't have this issue, but fine. I do what it says, and add <identity impersonate="true"/> to the <system.web> node in web.config.
While it does fix the initial issue, I now have the following on all document types:
When trying to create a new Document Type, I get the same kind of error, but then the ReturnUrl part is ReturnUrl=/umbraco/create.aspx?nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2&nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2' - but only if I tick the box 'Create template for this item'. The same happens when I try and create a Template.
After Googleing I came up with this: our.umbraco post with similar issue. One (unconfirmed) solution is that there's an illegal name in a document type/ template - but I haven't changed anything, and might be fixed by going into the database.
I did check the /masterpages folder, the only 'strange' characters in there are - and _.
In my Document Types I have on named 'Textpage (Two col)' and another named 'News & Events list'. I'm a bit hesitant to just delete them, since I don't have enough Umbraco knoledge to be sure this will fix my issue...
Is there any known solution for this, or will I also have to go into the database (and if so, whereabouts?)
I'm running Umbraco 4.7.2, assembly version 1.0.4500.21031.
I've hosted this site with GoDaddy.com - I don't know if that would be relevant.
[Update 1]
As per Tom Maton's comment:
The requirepermissions should be set to false, and have been.
in Appsettings I've set this:
<add key="umbracoUseMediumTrust" value="true" />
And I've added Trusted_Connection=yes to the connectionstring.
the problem remains.
[Update 2]
Tried the solution amelvin provided, but no dice. Doctypes and templates still give the error. I'm getting more certain it's some security issues. Which folder would correspond to the Templates? Would that be the masterpages folder? If so, what kind of permissions does that one need?
It could be that you don't have full trust on your Go Daddy environment?
Check this post out http://our.umbraco.org/forum/getting-started/installing-umbraco/17856-Umbraco-on-GoDaddy-Shared-Hosting
Could help resolve your issue.
The error could be a knock on from permissions errors as yet unsolved.
But the error is thrown if the content page does not have a template assigned or if Umbraco thinks it doesn't have a template. If absolutely nothing has changed to the site then it could be that the umbraco.config file has somehow got corrupted (it will contain all the doctype/template cross reference info). This can be fixed by right clicking on the top 'content' node and choose 'republish entire website'.
Secondly navigate to the settings | document types (if you can now) and check the templates dropdown on the first tab of the appropriate document type. If its set to 'please select' then this error will get thrown when any page tries to render without a valid template assigned. If a default template is assigned - then go to that template and re-publish it - Umbraco may have lost it.
If this does not work then check if the template is assigned properly. Go to the same place in the content tree as the problem page and try to add a node with the desired doctype. If no choices are offered then it could be that the parent tab no longer allows the correct doctypes as children nodes, so go back to the doctypes and check the allowed children (second tab) of the parent node.
If none of this works without odd errors being thrown then its a mystery!
Here are a list of Permissions required for Umbraco http://our.umbraco.org/wiki/reference/files-and-folders/permissions
Or you could use one of the steps below to check all the folder permissions.
http://our.umbraco.org/wiki/reference/files-and-folders/permissions/perform-permissions-check
Or install this package. http://our.umbraco.org/projects/backoffice-extensions/ugolive this will allow you to check the permissions are correctly setup.

Translate xml content using web service API from Ektron CMS400.Net

First of all: I'm on Ektron CMS v8.1
I'm having a problem with dynamicly adding translated content to the cms via the Webservice API. I can perfectly add xml content by using the following object and method:
ContentSoapClient csc = new ContentSoapClient("ContentSoap");
csc.AddContent3(...);
I specify a language and the xml content gets inserted. But now I want to add a translated version of the xml to the cms. So I want it to have the same contentId!
Anyone has an idea on this? The only method in the csc object that recieves a contentId is 'csc.AddContent2(..)' But that doesn't import anything and just gives me an error saying my xml is incorrect. While my xml is correct..I checked it!
Thanks!
Found the answer..
Ektron apparantly uses alot of asmx files and I only checked the "/workarea/webservices/WebServiceAPI/Content/Content.asmx" webservice. I found the method 'AddTranslatedXMLContent()' I need in the "/Workarea/webservices/ContentWS.asmx" webservice.
I wish they just cleaned up their API... Would save us a lot of trouble.
Firstly, I haven't used the ContentSoapClient class and can't find any documentation on it.
Ektron often takes a language id when you create the API object. See if the ContentSoapClient contructor can take a Language Id.