cancel
Showing results for 
Search instead for 
Did you mean: 

How to add content to the repository ?

steuni
Champ in-the-making
Champ in-the-making
Hello,

I'm not sure how to do this… When I create content with a Web form in WCM, the resulting HTML is created in the Website at the location specified by the output path pattern. But how do I add it to the Alfresco repository ? Can I map a folder to an Alfresco space ? Do I need to write a JSP and use an Alfresco Web Service or API ?

The other way around, if I wanted to have a dynamic drop down box in a Web form with all the users and groups defined in Alfresco, what's the easiest way to do that ?

Thanks,

– Jerome
3 REPLIES 3

kvc
Champ in-the-making
Champ in-the-making
Jerome:


Hmmm … not sure I understand the question.

The content you create (and generate) are already in the Alfresco repository, albeit in a different store type that provides Subversion-style
versioning behavior (file and dir versioning, branching, snapshotting, etc.).

To have web pages that dynamically query the repo to source web
content, you can use either our native Java API for the AVM (the
Subversion-style repo implementation) or, with 2.1, simply use the
Javascript / Templating API (in conjunction with web scripts).

For a dynamic form element, you can use an inline callout by referencing
a JSP that fetches a list of current users and puts that back into the
form.  To do this, your JSP actually generates part of your XSD, which,
when done, we in turn generate into the browser-based XForm your
users use to create or mod content.

You can find an example of the JSP in-line callout in our sample website
(which is a bit long-in-the-tooth and getting updated, but is still useful
to demonstrate this).

Let us know if you've further questions.

Kevin

steuni
Champ in-the-making
Champ in-the-making
Thanks for your reply Kevin!

For the dynamic form part, I'll try that out as soon as I find out why I get an http 401 on calling http://localhost:8080/alfresco/service/search/keyword?q=alfresco from WSF's documents.jsp (this error prevents me from previewing the website. It is referenced twice in the forums but no solution is given…)

For the first question, let me rephrase that. What I would like is for the content generated by a form to go into the repository at some other place where it can have rules applied, such as workflow and transformation). Plus the content that is created from the forms and that stays under the Web Projects space is not found by the search engine.  How would I go about doing that ?

Thanks,

Jerome

steuni
Champ in-the-making
Champ in-the-making
I'll just reply to my own question regarding the 401 error:

You have to replace in documents.jsp the call to http://localhost:8080/alfresco/service/search/keyword?q=${keyword} with a call to http://localhost:8080/alfresco/api/service/search/keyword?q=${keyword}

– Jerome