Announcement Announcement Module
Collapse
No announcement yet.
Spring surf with Alfresco WCM Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring surf with Alfresco WCM

    Hi evereyone,

    i'm testing with a spring surf webapp and Alfresco WCM, i create a web project in alfresco wcm, and i did a bulk import of the war, but when i try the preview, i get an error, that the servlet cant find a specific view, when i run the webapp in a tomcat there is no problem, i think this is a problem of libraries, has anyone have the same problem? if so what do you do?

    i also want to know if in future realeses of alfresco or spring surf, this will be supported out of the box

    thanks

  • #2
    Hi i have another question, how can i include a static html in surf component

    i'm using this code from alfresco surf

    <?xml version='1.0' encoding='UTF-8'?>
    <component>
    <scope>page</scope>
    <region-id>main</region-id>
    <source-id>index</source-id>
    <component-type-id>/component/common/include</component-type-id>
    <properties>
    <container>div</container>
    </properties>
    <resources>
    <resource id="source" type="webapp">/content/news/latestNews.html</resource>
    </resources>
    </component>

    i also have to import the scripts for /component/common/include

    when i debug the javascript code view.get.js, from the /component/common/include webscript i notice that the properties container and resources are not visible to the instance object

    is there another way to use this funtionality with spring surf? i hope you can help me

    Thanks in advance

    Comment


    • #3
      Hi i make a solution to include a static html into a component

      first i create a component type in /WEB-INF/classess/surf/site/components-type

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <component-type>
      	<id>include</id>
      	<title>Include Component Type</title>
      	<description>Includes static html into a compoent</description>
      	<processor mode="view">
      		<id>jsp</id>
      		<jsp-path>/WEB-INF/jsp/include.jsp</jsp-path>
      	</processor>
      </component-type>
      then i create the jsp for my component type

      Code:
      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
      <%@ page import="org.springframework.extensions.surf.*" %>
      <%@ page import="org.springframework.extensions.surf.types.*"%>
      <%@ page import="org.springframework.extensions.surf.render.*" %>
      <%
      RenderContext context = (RenderContext) request.getAttribute("renderContext");
      String componentId = (String) context.getValue(WebFrameworkConstants.RENDER_DATA_COMPONENT_ID);
      Component component = context.getObjectService().getComponent(componentId);
      String includeurl = component.getModelProperty("url");
      %>
      <jsp:include page="<%= includeurl%>"/>
      this is a simple jsp:include, and i'm passing the url property with the location of the static content i want to show, i try to use a custom property but spring surf just parse the model properties, this could be a bug but i'm not sure

      here is how i configure my page to use this component

      Code:
      <?xml version='1.0' encoding='UTF-8'?>
      <page>
          <id>pageid</id>
          <title>Page title</title>
          <template-instance>templateinstanceid</template-instance>
          <authentication>none</authentication>
          <components>
              <component>
                  <region-id>include-region</region-id>
                  <component-type-id>include</component-type-id>
                  <url>/WEB-INF/staticcontent.html</url>
              </component>
          </components>
      </page>
      this solution solves my second question that is how to include static content in a component, i hope this can help

      The first question is still pending :-(

      how can i configure my spring-surf application in Alfresco WCM to be able to see the preview of a sandbox?, actually when i do this the virtual server fails, i think this a library problem

      i also want to know if in future realeses of alfresco or spring surf, this will be supported out of the box

      thanks

      Comment


      • #4
        Alfresco WCM comes with a virtualization server that does have some problems with Spring itself. The virtualization server is a "tweaked" version of Tomcat that lets the container virtualize access to classpath and servlet context resources. It works well for some cases but not for all cases. It will give you some trouble with Spring and Spring Surf.

        In terms of Alfresco's strategy going forward, we're very much not aiming to utilize the virtualization server. Rather, Spring Surf servers can sit on their own and you can publish out to them. The receiver can either write files to disk or it can write them into an Alfresco CMIS runtime. Surf can talk to either of these. It will pick up your changes and begin to present them.

        We're still building out this connectivity. At the moment, you can configure Surf's search paths to look to local disk quite easily using the surf.xml file. By adjusting surf.xml to use a "local" runtime, Surf will add in local disk locations to look for files. These locations can be receiver points from Alfresco's deployment engine which includes Alfresco WCM's test server deployment facility.

        This capability to load Surf objects from a diversity of locations is not specific to Alfresco. In fact, you can author the Surf objects anywhere you like and deploy them in whatever fashion you wish. However, if you do use Alfresco, you'll get a lot of these capabilities given to you and preconfigured.

        Alfresco 3.3, which is Alfresco's latest release, also features use of the Spring Web Editor which was recently added. The Spring Web Editor provides a front-end facility for manipulating content on a page. Alfresco 3.3 provides a plugin for this editor for in-context editing that can be used to edit content live on your Surf and non-Surf web sites.

        More on that coming!

        Michael

        Comment

        Working...
        X