Well, I formuled this cuestion before but seems like I didnt do correctly, so I will try again explaining myself better.
Im working on a event handler in openbravo that creates a structure of folders via rest api, I have been able to make a single folder so I could make the structure via java but i need to add alot of stuff to all the folders idividually so my work will be x100 harder, so Im searching on internet a way of creating from a space template but cant find nothing, would be nice if u could lend me a hand, its my first time using Rest apis too so Im not that good on this, thx for ur time.
Something cool about Alfresco is that if you look at the Alfresco public REST API and you don't see what you are looking for you can simply write your own RESTful end point.
To do that, you use the Web Script Framework (tutorial). With the web script framework you can implement controllers using either server-side JavaScript or Java.
That gives you access to the entire foundational API of Alfresco, which includes the ability to create folders from space templates.
For example, when using Java to create a folder from a space template, you can use the fileFolderService to copy the template folder to a parent folder, like this:
fileFolderService.copy(template, parentFolder, folderName).getNodeRef();
That template variable is a nodeRef. How you get that nodeRef is up to you. One way would be to do a search for it.
So, to re-cap, write a web script. The web script can use the foundational API to create a folder from a template. Your web script can accept arguments for things like where to put the new folder, what space template to use, etc. That's up to you.
Related
I am newbie in Alfresco. I was just going through the Alfresco documents here. I have gone through it, but didn't get the answer of my question as described below.
Is it possible to start workflow(/task) on the content outside of the Alfresco Content (i.e. Our Local System File/Folder)? If yes, how can I achieve the same?
I agree with Younes that you can configure a rule to launch a workflow. In order to do that, you'll want to take a look at the JavaScript workflow API.
Using a rule on a folder will require something to trigger the rule, such as a document being added to the folder. But your question asks if a workflow can be triggered external to Alfresco. To do that, you might consider using a Web Script.
A Web Script is simply a way to extend Alfresco's RESTful API with your own logic. So you could create a web script called "startMyWorkflow" that includes a JavaScript controller leveraging the same API I referenced earlier to kick off the workflow. With that in place, you'd be able to launch the workflow externally using anything that can speak REST over HTTP.
You can setup a rule action to start a workflow if certain conditions are met (files added to some folder, file metadata changed, a new revision has been uploaded ...).
To learn how to create new rules in alfresco follow this tutorial
Update : I may have forgotten to mention that -as the op suggested- he could then setup a cifs/ftp/webdav folder locally to point to some location in the repo having that rule action I was talking about.... So for example adding files to that folder would automatically start a workflow....
Hopefully someone can help me, I'm new to EPiServer and have been given a data migration task. We are using the latest version 8.5. I need to migrate content from a clients home grown CMS (that luckily is in a tree like structure) to EPiServer. There doesn't seem to be a whole lot of information about this on the web - perhaps I just don't know the right thing to search for.
It looks like using the EPiServer.ServiceApi might be the route to go but again locating useful documentation is proving difficult.
I was thinking of setting up the client CMS in SQL Server and writing a simple console application to call the EPiServer.ServiceApi inserting the content. If anyone has any information on this or better still and example i would be very grateful.
Thanks,
Dan
If you are just importing content from another CMS I would write a scheduled job in EPiServer:
http://world.episerver.com/code/dannymurphy/Stoppable-Scheduled-Job-with-feedback/
That job then uses the standard IContentRepository to create content:
http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/8/Content/Persisting-IContent-instances/
That way you can run it whenever you want and have access to EPiServers complete API. Also you can see progress of the import through the job status.
In the job you can read the content as a file in any format you like or directly from the source CMS database or some xml or RSS feed perhaps.
I have moved content from PHP, Java and .NET CMS this way. In .NET you could even access the source CMS via WCF or SOAP if available.
The ServiceApi is relatively new and more focused on Commerce products and media assets rather than CMS page and block content so I wouldn't use that.
There is complete documentation below for the ServiceApi by the way, did you not find it?
http://world.episerver.com/documentation/Items/EPiServer-Service-API/
Regarding language management you can read more in the below links:
http://cjsharp.com/blog/2013/04/11/working-with-localization-and-language-branches-in-episerver-7-mvc/
http://tedgustaf.com/blog/2010/5/create-a-new-page-language-branch-programmatically-in-episerver/
Basically you have two options for multiple languages. If the content is just straight translations you should create nine different language versions (branches) of the same page. You can also have multiple sites in an EPiServer installation but that requires 9 separate licenses (and the associated costs).
I've done a lot of EpiServer content migration projects. The easiest way if it's possible is to export your current sites tree in Json and then import that into EpiServer. I've had to do it on a recent project and mixed with Json.net it's pretty easy.
If you want to go that route you can find all the code to do it here: EpiServer Content Migration With Json.Net/
I am a sort-of newbie with MVC and Zend in particular. I have taken over a project from another team, site is built in Zend framework. There is an admin dashboard to add content, assets like images and media, a blog and a portal into Zen Cart for the store.
What is the easiest method of adding a new web page that has as its contents several things that are dynamic - items for sale, music to listen to, blog entries, news items from the database and a featured artist. All of this is stored in the MySQL db. I just do not know enough about MVC to make it work correctly.
I can create a page in the admin dashboard and use as the URL another "module" that already exists, but if I attempt to copy a module folder (for instance the folder called musiclive is almost exactly what I need except I need to add another column of elements...) the admin dashboard does not render. I know that I need to create some sort of "view" and fiddle with or create a controller, but not sure of the easiest method of doing this. I probably have to tell the admin dashboard I have added another "module" but it really is just the main or home page of the site - the other guys never built it because it was rich with details and I guess they put it off. I also probably have to change the files inside the module folder to reflect a different page.
Would love some help or pointers. Ask if you need more details on what the heck I am describing here...
Create a new controller in that same module instead of copying the whole module if the module is so similar to your requirements. And then extend already built resources like forms, models. I strongly recommend you to read about zend framework documentation, especially skeleton application tutorial. That will increase your knowledge as well as make you understand MVC and your current project.
http://framework.zend.com/learn/
One more thing there are 2 versions of zend framework and both are entirely different. You need to know the version in which the project is built. Zend framework 2 has following generic directory structure:
config/
autoload/
application.config.php
module
Application/
config/
src/
view
Module.php
SomeOtherModule/
...
public/
vendor/
In Community 4.0.a, I'm posting my custom activities in the repo following this: http://wiki.alfresco.com/wiki/3.0_Activities_Developer_Guide
I have defined my own activity type, with custom bundles and pagelink to display custom needs in the activity dashlet.
But I face an issue, I need to specialize the output based on the activity-type in a similar way of what is done already in activity-list.get.js in the specialize() function.
I can't hack the js cause I'm packaging things in my own amp for Share.
What is the best way to do it? Is there some kind of extension point or do I need to override completely the dashlet?
The old way (3.x) to change the behaviour of a webscript controller is to copy the code and overwrite the Javascript by placing it under web-extension: alfresco/web-extension/site-webscripts/org/alfresco/components/dashlets/activity-list.get.js. There you can modify the specialize() function or whatever you need to do.
All files you place in the alfresco/web-extension/site-webscripts folder will replace original files in the share.war WEB-INF/classes/alfresco/site-webscripts classpath. Best practice is to place your customizations in the tomcat/shared/classes/alfresco/web-extension folder so you don't need to modify the WAR file.
Alfresco 4.0 provides a new way to change the javascript controllers of a webscript. You can add additional Javascript code that will run after the original code. This is preferable because you don't need to change original code and you can upgrade more easily later. To use it you need to get familiar with the new Share extension modules concept. See David Draper's Blog for more info on that.
I know I've seen this in the past, but I can't seem to find it now.
Basically I want to create a page that I can host on a dasBlog instance that contains the layout from my theme, but the content of the page I control.
Ideally the content is a user control or ASPX that I write. Anybody know how I can accomplish this?
The easist way to do this is to "hijack" the FormatPage functionality.
First add the following to your web.config in the newtelligence.DasBlog.UrlMapper section:
<add matchExpression="(?<basedir>.*?)/Static\.aspx\?=(?<value>.+)" mapTo="{basedir}/FormatPage.aspx?path=content/static/{value}.format.html" />
Now you can create a directory in your content directory called static. From there, you can create html files and the file name will map to the url like this:
http://BASEURL/Static.aspx?=FILENAME
will map to a file called:
/content/static/FILENAME.format.html
You can place anything in that file that you would normally place in itemTemplate.blogtemplate, except it obviously won't have any post data. But you can essentially use this to put other macros, and still have it use the hometemplate.blogtemplate to keep the rest of your theme wrapped around the page.
I did something similar setting up a handler to stream video files from the blog on my home server. I ended up ditching it because it killed my bandwidth whenever someone would view a video, but I did have it up and working for a while.
To get it to work I had to check dasBlog out from source control and open it in visual studio. I had VS2008 and it was built using VS2005, so it took some work to get everything to build. Once I could get the unaltered solution to build I added a new class library project to hold my code. This is to make sure my code stays separate across dasBlog updates.
I don't have access to the code here at work so I can't tell you exact names right now, but if you want your pages to be able to use the themes then they need to inherit from a class in the newtelligence.dasBlog.Web namespace, and I believe also implement an interface. A good place to look is in FormatPage and FormatControl.