Retrieve folder contents from Windchill API - ptc-windchill

We want to use the Windchill API for integrating Windchill into our application.
I know how to get the folder structure, but I don't know how to get folder contents.
I would like to get the list of documents by supplying the folder as parameter. I was looking at the documentation but I cannot seem to find anything useful.
This is the method for retrieving folders
get /v1/folders/{id}/folders
This is our Windchill structure and on the right I need the document list.
image
Any help is appreciated.

Related

What values to use for linkExternalObject action on project object?

I'm trying to link external folder using Workfront API (v12) using linkExternalObject action on a project.
According to Api Explorer it takes 5 arguments:
objID (string)
linkedObjectID (string)
integrationType (string)
URL(string)
params (string[])
This action is also described in Developer Documentation, but that doesn't help much.
I'm assuming that:
objID will be id of a folder (DOCFDR) that I can create using api.
integrationType should be WEBHOOKS, since I'm integrating with external storage via document webhooks.
Any idea if it's correct way to create a linked folder and where to take the remaining values from?
I tried creating Linked Folder (LNKFDR) directly, but it's not a top level object so I can't.
I tried looking up values for Linked Folder created via Workfront UI but that doesn't help much.
linkExternalObject action as documented in Api Explorer
Any help will be greatly appreciated.

how to create a new folder using alfresco api

I have uploaded sample.zip file in this directory CompanyHome/site/testsite/documentlibrary/test.
Now I want to create new folder called childfolder under above directory [CompanyHome/site/testsite/documentlibrary/test/childfolder] and move the sample.zip under it.using Alfresco API how do i create child folder and move the file under newly created childfolder?
This really depends upon what version of Alfresco you're using and what API you want to use to do it. For example, assuming that you want to do this via a REST API then you have the option of CMIS, the recent "Public API" or the internal WebScript based API.
Alternatively, you might want to do this by using the JavaScript API and WebScript develop your own WebScripts.
There are lots of ways to achieve this - perhaps you can provide some more information on the overall picture of what you're trying to do and where you're trying to do this (e.g. as an extension of Share maybe?).
It's possible to create a folder within Share and if you do so whilst you have browser developer tools open you'll be able to see the exact REST API calls that are used.

Where do I properly put my constants in Meteor

I usually follow the unofficial Meteor FAQ on how to structure my codebase, but I can't figure out where I should put my global constants.
To give an example: I have some database entries with a constant GUID that I need to reference in many points of my app. So far I just attached the constants to the relevant collection, such that in collections/myCollectionWithGuids.coffee it would say:
#MyCollectionWithGuids = new Meteor.Collection "myCollectionWithGuids"
#MyCollectionWithGuids.CONSTANT_ID = "8e7c2fe3-6644-42ea-b114-df8c5211b842"
This approach worked fine, until I need to use it in the following snippet, located in client/views/myCollectionWithGuidsView.coffee, where it says:
Session.setDefault "selectedOption", MyCollectionWithGuids.CONSTANT_ID
...which is unavailable because the file is being loaded before the Collections are created.
So where should I put my constants then, such that they are always loaded first without hacking in a bunch of subdirectories?
You could rely on the fact that a directory names lib is always treated first when it comes to load order.
So I would probably advise you to organize your code as follow :
lib/collections/collection.js
client/views/view.js
In your particular use case this is going to be okay, but you might find cases when you have to use lib in your client directory as well and as the load order rules stack (subdirectories being loaded first), it will be loaded BEFORE the lib folder residing in your project root.
For the moment, the only way to have full control over the load order is to rely on the package API, so you would have to make your piece of code a local package of your app (living in the packages directory of your project root).
It makes sense because you seem to have a collection and a view somehow related, plus splicing your project into a bunch of collaborative local packages tends to be an elegant design pattern after all.
Creating a local package is really easy now that Meteor 0.9 provide documentation for the package.js API.
http://docs.meteor.com/#packagejs
I would put your collection definitions in a lib directory. File structure documentation explains that all files under the lib directory get loaded before any other files, which means your variable would be defined when you attempt to access it in your client-side code.
Generally speaking, you always want your collections to be defined before anything else in your application is loaded or executed, since your application will most likely heavily depend upon the use of the collection's cursor.

asp.net Web API retrieve file(s) without saving them

I want to retrieve file(s) with ASP.NET Web Api, XML file(s) or zip file(s).
There are many examples how to do this, like this:
http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2
But the problem is, I don't want to save them on HDD!
I just want to validate the XML with some functions and generate a report on the fly and want to return this report.
But every tutorial use the "MultipartFormDataStreamProvider" witch save the files on HDD.
How can I get the file(s) and file name(s) in memory?
Kind regards
I think you can use the MultipartMemoryStreamProvider?
See a way to implement file upload without writing to the file system.

How to write a webscript in Alfresco that returns a zip file

I need to write a webscript in alfresco that returns to the user a single zip file that contains several files, some of them created on the fly by the script and some of them stored on the server.
How can i do it?I know how to create different files on the server, i don't know how to zip them and how to include files that are stored on the server.
Well, you can develop a Java action that would do the zipping part.
Last time I was looking into this, I didn't find an out-of-the-box solution.
As for returning, you can specify that by specifying webscript format, ie:
<format default="html">any</format>
Only, there is a problem, you can't set a zip format, but alfresco wiki says how you can add more:
http://wiki.alfresco.com/wiki/3.0_Web_Scripts_Framework#HTTP_Response_Formats
Edit: I just found this thread (while looking for a solution for another problem). In the thread a custom "unzip" action is described, maybe you can use that to add a zip/unzip action in your alfresco installation and use it.

Resources