Alfresco webdav show only User Homes folder - alfresco

I inherited two legasy project of Alfresco (CE 5.2.e and 5.0.0) and have struggle with webdav. Connect is succesfull but as root dir is set "User Homes" for admin and "Home folder" for other users.I cant navigate enythere else. I need connect "Company Home" as root dir. I thing i miss some configuration but have no idea where to search.
I find only this blog https://hub.alfresco.com/t5/alfresco-content-services-hub/file-server-configuration/ba-p/291570 So I checked config <alf_install_dir>/tomcat/webapps/alfresco/WEB-INF/web.xml and it have all default values from installer set properly.
<context-param>
<param-name>store</param-name>
<param-value>workspace://SpacesStore</param-value>
</context-param>
<context-param>
<param-name>rootPath</param-name>
<param-value>/app:company_home</param-value>
</context-param>
<filter>
<filter-name>WebDAV Authentication Filter</filter-name>
<filter-class>org.alfresco.repo.web.filter.beans.BeanProxyFilter</filter-class>
<init-param>
<param-name>beanName</param-name>
<param-value>WebDavAuthenticationFilter</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>WebDAV Authentication Filter</filter-name>
<url-pattern>/webdav/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>WebDAV Authentication Filter</filter-name>
<url-pattern>/cmisatom/*</url-pattern>
</filter-mapping>
<!-- WebDAV session listener - ensures that no locked resources is left after session expires -->
<listener>
<listener-class>org.alfresco.repo.webdav.WebDAVSessionListener</listener-class>
</listener>
<servlet>
<servlet-name>WebDAV</servlet-name>
<servlet-class>org.alfresco.repo.webdav.WebDAVServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>WebDAV</servlet-name>
<url-pattern>/webdav/*</url-pattern>
</servlet-mapping>

Related

HDIV parameter do not exist

I am trying to integrate HDIV with my web application using HDIV struts 1.jar
I encounter the below error when trying to load the login page.
(self-tuning)'][][](org.hdiv.logs.Logger) - HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/index.do;_HDIV_STATE_;;;127.0.0.1;127.0.0.1;anonymous;
Possible checks I did:
tried with addition of struts--el tag lib with HDIV--el tag lib
tried with filter mapping pattern to all url
Not sure where I am going wrong. Many searches do not provide me a proper solution. Any guidance is highly appreciated. Thank you
Here are my config files.
hdiv-config.xml. I named it as struts-config-hdiv.xml
<hdiv:config excludedExtensions="css,png,gif,jpg,html,js" protectedExtensions=".*.do">
</hdiv:config>
<hdiv:config>
<hdiv:startPages>/index.html</hdiv:startPages>
<hdiv:startPages>/fsm/efsm/index.do</hdiv:startPages>
</hdiv:config>
<hdiv:config errorPage="/fsm/jsp/tiles/common/ErrorPage.jsp">
<hdiv:startPages>/index.html</hdiv:startPages>
<hdiv:startPages>/fsm/efsm/index.do</hdiv:startPages>
</hdiv:config>
<hdiv:editableValidations registerDefaults="true">
<hdiv:validationRule url=".*"></hdiv:validationRule>
</hdiv:editableValidations>
<hdiv:config showErrorPageOnEditableValidation="true">
</hdiv:config>
<hdiv:config maxPagesPerSession="5">
</hdiv:config>
<hdiv:config avoidValidationInUrlsWithoutParams="true">
</hdiv:config>
`
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/struts-config/struts-config-hdiv.xml</param-value>
</context-param>
<filter>
<filter-name>ValidatorFilter</filter-name>
<filter-class>org.hdiv.filter.ValidatorFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ValidatorFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.hdiv.listener.InitListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config/struts-config-default.xml
</param-value>
</init-param>
<init-param>
<param-name>config/hdiv</param-name>
<param-value>
/WEB-INF/struts-config/struts-config-hdiv.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>validating</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/hdiv-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/hdiv-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/hdiv-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-html-el.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/hdiv-html-el.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-logic-el.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/hdiv-logic-el.tld</taglib-location>
</taglib>
`
pom.xml
<dependency>
<groupId>org.hdiv</groupId>
<artifactId>hdiv-config</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.hdiv</groupId>
<artifactId>hdiv-struts-1</artifactId>
<version>3.3.0</version>
</dependency>
According to your post I see two possible solutions:
You must process the reported URL at server side using the custom tags offered by Struts 1 to render linksr. In that way Hdiv will include the additional hdiv parameter.
If the URL is a start page (the entry point to the application) where the user starts the browsing (in that case you are not rendering the link) you must define a start page within Hdiv configuration.
<hdiv:config>
<hdiv:startPages>XXX the URL XX</hdiv:startPages>
Regards,
Roberto Velasco (Hdiv Security)

Alfresco CAS webservice call not working form webapp

I am trying to authenticate a ticket against CAS. I have a working CAS server, and 2 services. Service A is an alfresco server, service B is my own Spring Web App.
I log into B and am redirecdted to CAS login, I login, and I am in Web App B just fine. All Happy.
I can SSO into Alfresco explorer just fine. (ie, I click on a link, and I am already loged in) All Happy.
In my web app B, I call a RESTful api in alfresco(A) and I am all sad.
I can put the REST url call into my browser and I get the expected result, and I am all confused.
How do I call this URL from my web app B? I add the ticket to the end of the URL like this:
https://example.org:8443/alfresco/service/workflow/getTaskList?userId=me&ticket=ST-6-ayiC6vVX3yEBQcFB12sj-xxx.org
My Web.xml is set up like this:
<filter>
<filter-name>Authentication Filter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>https://example.org:7443/cas/login</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>https://example.org:8443</param-value>
</init-param>
</filter>
<filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>https://example.org:7443/cas</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>https://example.org:8443</param-value>
</init-param>
</filter>
<filter>
<filter-name>Alfresco CAS Authentication Filter</filter-name>
<filter-class>org.xxx.alfresco.repository.extension.web.app.servlet.CASAuthenticationFilter</filter-class>
</filter>
with my filter mappings for the webservices like this:
<filter-mapping>
<filter-name>Authentication Filter</filter-name>
<url-pattern>/service/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CAS Validation Filter</filter-name>
<url-pattern>/service/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Alfresco CAS Authentication Filter</filter-name>
<url-pattern>/service/*</url-pattern>
</filter-mapping>
But as I have debugging going on, I can see that I am not even getting to my CASAuthenticationFilter. The error is begin picked up by Cas20ProxyReceivingTicketValidationFilter. Here is the exception:
Feb 10, 2014 1:56:17 AM org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter doFilter
WARNING: org.jasig.cas.client.validation.TicketValidationException:
ticket 'ST-6-ayiC6vVX3yEBQcFB12sj-xxx.org' not recognized
Any Ideas?

Getting error: The content of element type "web-app" must match,

When I build my project in Eclipse Helios Service Release 2, I get an error in my web.xml. Please suggest what I have to do for this. In my project I am using DTD 2.2. The error is below.
The content of element type "web-app" must match "(icon?,display-
name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-
mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-
role*,env-entry*,ejb-ref*)".
The error message tells you in detail in what order the elements are supposed to be placed and how many of them are allowed. In other words, the ordering or amount of the elements inside the <web-app> of your web.xml is incorrect. For example, as per the error message, <servlet> needs to go before <servlet-mapping>. The ? suffix means that there may be zero or one of them. The * suffix means that there may be zero or many of them.
So, the example below is invalid:
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
While the example below is valid:
<servlet>...</servlet>
<servlet>...</servlet>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet-mapping>...</servlet-mapping>
<servlet-mapping>...</servlet-mapping>
If anyone's interested I received the same exception for error-page. This node needs to go after servlet, but before servlet-mapping.
I have the same issue when I integrate spring to struts2 in Eclipse. After some testing, I found it's the problem of tag's order in web.xml file. The following file has the error
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
If I changed the order to
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
The error will be eliminated.
Hope this will be helpful to the people who encounter the same problem.

WebOrb / Spring integration not working

I've tried copying the weborb config files across to an existing Spring app, and for some reason my spring services aren't being exposed to WebOrb.
I don't see the spring services shown in the WebOrb console, and when I hit the server methods, I get instances of the service that aren't spring wired.
Although this app uses spring annotations heavily, I've tried hitting my services declared in the following ways (always trying to hit "servicesFacade" as my destination):
#Service
public class ServicesFacade ...
#Service("servicesFacade")
public class ServicesFacade ...
<bean id="servicesFacade" class="com.mangofactory.grapevine.service.ServicesFacade" />
I must have missed a config step, but I've compared everything with the example, and can't think what it is.
** Note - I haven't copied any other jars from the web-orb folder (notably, I've exlcuded the spring jars), as I already have a working Spring 3.0 install running on my web app. Could this be the cause?
Steps taken:
Copied from %WEBORB_INSTALL%:
/webapp/WEB-INF/classes -> WEB-INF/classes
/webapp/WEB-INF/flex -> WEB-INF/flex
/webapp/WEB-INF/lib/weborb.jar & jdom-1.1.jar -> WEB-INF/lib
Updated web.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Grapevine</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>weborb.ORBServletContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>grapevine</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>weborb</servlet-name>
<servlet-class>weborb.ORBServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>rds</servlet-name>
<servlet-class>weborb.rds.handler.FrontEndHttpServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>grapevine</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>weborb</servlet-name>
<url-pattern>*.wo</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rds</servlet-name>
<url-pattern>/rds.wo</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
I have the following spring-related classes in my lib folder:
org.springframework.aop-3.0.4.RELEASE.jar
org.springframework.asm-3.0.4.RELEASE.jar
org.springframework.beans-3.0.4.RELEASE.jar
org.springframework.context-3.0.4.RELEASE.jar
org.springframework.context.support-3.0.4.RELEASE.jar
org.springframework.core-3.0.4.RELEASE.jar
org.springframework.expression-3.0.4.RELEASE.jar
org.springframework.jdbc-3.0.4.RELEASE.jar
org.springframework.jms-3.0.4.RELEASE.jar
org.springframework.orm-3.0.4.RELEASE.jar
org.springframework.oxm-3.0.4.RELEASE.jar
org.springframework.security.config-3.0.3.RELEASE.jar
org.springframework.security.core-3.0.3.RELEASE.jar
org.springframework.security.web-3.0.3.RELEASE.jar
org.springframework.transaction-3.0.4.RELEASE.jar
org.springframework.web-3.0.4.RELEASE.jar
org.springframework.web.portlet-3.0.4.RELEASE.jar
org.springframework.web.servlet-3.0.4.RELEASE.jar
spring-flex-1.0.3.RELEASE.jar
Any help would be greatly appreciated
Marty
Please check if your weborb-config.xml (it is in WEB-INF/classes) contains the following line:
<serviceInvoker>weborb.handler.SpringBeanHandler</serviceInvoker>
Mark

Filtering static content Jersey

I'm trying to serve static content (a HTML form that calls a Jersey REST resource) from the same webapp as the servlet that handles the requests to the resource. As I understand I can filter requests to static content away from the Jersey servlet. My web.xml is as follows, but at the moment I am unable to access the static content nor the resource...both were working separately.
<filter>
<filter-name>my-filter</filter-name>
<filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/*.html</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>my-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>my-service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.mydomain.ws.myservice</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>my-service</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
FWIW your original problem was probably because the param-value for the WebContentRegex was not a regular expression. Ok techincally it was, but it is not matching what you probably want. You should try something like /.*.html instead.
I setup my services such that the rest service are under their own subpath separate from the static content:
<servlet-mapping>
<servlet-name>ServletAdaptor</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>

Resources