I wonder how to create a PDF or Word document automatically from the repository when I create a new folder in the document library.
Thanks in advance.
I don't really understand what you exactly mean. Buy I guess it can be done by a rule or behaviour.
Create a rule on the root folder where your folders will be created. Set the incoming type to be folder.
As the action execute a JavaScript.
If you look at the JavaScript API Cookbook, there are samples on how to create a file. Creating PDF's or Word from scratch is a bit difficult hence the binary content isn't plain text.
Related
I would like to know if is it possible to create a symbolic link which points to the last created file of a specific directory.
I have a folder which contains several HTML reports and I need a symlink for get the last generated report.
Because of I don't know when a new report has been generated I must use a script on the crontab, so I'd like to know if a better way to do could exist.
I want to assign a small code string to each document after it is uploaded in alfresco. Something like: '2012/314-39414'.
The code will be generated by a rule that depends on the user that uploaded the document, the time the document is uploaded and a unique number which will be incremented after each document upload.
Can I have help to implement this in Alfresco?
Use OnCreateNodePolicy (java code) to do this the cleanest way.
Search the net or Alfresco forums to look for examples or you could download the SDK and lookup current code which uses it.
I'am doing upload functionality in ASP.NET 1.1.
I want to create one empty zip folder on given path.
So, how to create an empty zip folder?
Later on I will save files in that folder. I do not want to use any third party component.
There are a couple of third-party components that do this. Writing one from scratch would be a big effort, I do not recommend it. Why the requirement not to use an existing library? There are some suggested in the answers for Open-source zip library for .NET?.
If all you really want is an empty zip file, simply add one to your solution and copy it into place as necessary.
I have requirement where I need to allow users to upload a Word document with place holders for certain fields which can be found in the database. This will be their template. For example the place holders might be prepended with ## or something. For example
Dear ##Title ##Lastname
They then can grab a record and hit export to Word document. This will then let them choose the template. They can select the template and then click continue. I will then get the template and replace the ##Title with the title field in the database for the selected record. I am not sure where to start or what components I need to do this.
From my initial investigation it seems that I can do this with the new open XML standard for Office 2007. So perhaps I should read in the template and save all the contents to a db table somewhere. Then when the use wants to export I get the contents again and then do a search and replace for the ## placeholders and link them properly. Then save the document to the output stream again which will then bring up the save dialog on their browser.
I am using ASP.Net MVC and am in a hosted environment. I was also maybe contemplating dynamically creating a new View type and dynamically creating new views when the user uploads a template. Not sure that this approach will work though.
Is this a good approach?
What tools should I be looking at?
Any other suggestions?
This is similar to an approach we took for inserting data into word documents and then returning them to the user. We opened the .docx file (it's a zip file so easy to extract) extracted the document (in the word folder called document.xml), did the replace and then put the document back into the .docx file and returned it to the user.
An issue we hit were that word inserted tags at strange places, especially things like spell/grammar errors, so we needed to be careful when we did the search/replace.
We decided not to store the fields from the document in a database to allow the documents to be easily updated.
We used dotnetzip component for opening the .docx files
Something we also did was to combine several documents into a single large document to save on the number of downloads. If I remember we used the open xml toolkit to do this merging. The website has also got loads of other information that may be of use.
Check out Scott Guthries blog post about the new view engine code named "Razor" coming out real shortly from Microsoft. In the comments there is talk about it being able to be used in mail merge scenarios like you talk about with ASP.NET MVC views.
Is there any method to extract zip files and maintain the same folder structure in the output folder.I am able to extract the zip file and its inner files but not able to extract folder from a zip file and thus fail to maintain folder structure also.
Yes.
There is an AS3 component that allows you to read and write data from zip files, and the demo also shows that it is possible to see the folder structure.
http://www.nochump.com/blog/?p=15
I have not used this component myself, but if I am correct in assuming that you are making an AIR application then this component may automatically generate folders, otherwise you can use the file system api to create the correct folders yourself.
Good Luck!
You may also want to check out fzip:
http://codeazur.com.br/lab/fzip/