[jboss-svn-commits] JBoss PortletSwap SVN: r210 - in server/trunk: server-service/server-lib/src/main/java/org/jboss/portletswap and 13 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Jan 21 15:04:55 EST 2008
Author: thomas.heute at jboss.com
Date: 2008-01-21 15:04:55 -0500 (Mon, 21 Jan 2008)
New Revision: 210
Added:
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRFileArtifactImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRLicenseImpl.java
Removed:
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/ArtifactType.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/Type.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/metadata/
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Artifact.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Category.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/FileArtifact.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Module.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/ReferencedArtifact.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/AbstractArtifactImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/CategoryImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/FileArtifactImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/LicenseImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ModuleImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ReferencedArtifact.java
Modified:
server/trunk/server-service/server-lib/pom.xml
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/DirectoryService.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/RepositoryService.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/memory/DirectoryServiceImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/filter/TypeFilter.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRModuleImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/ArtifactFactory.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceImpl.java
server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceImpl.java
server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceTestCase.java
server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceTestCase.java
server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceTestCase.java
server/trunk/server-webapp/pom.xml
server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/ContentServlet.java
server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/DirectoryServlet.java
Log:
Clean
Modified: server/trunk/server-service/server-lib/pom.xml
===================================================================
--- server/trunk/server-service/server-lib/pom.xml 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/pom.xml 2008-01-21 20:04:55 UTC (rev 210)
@@ -39,6 +39,12 @@
<version>1.1.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.portletswap</groupId>
+ <artifactId>server-model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
<!--TEST SCOPE-->
<dependency>
<groupId>org.jboss.unit</groupId>
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/ArtifactType.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/ArtifactType.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/ArtifactType.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,34 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public enum ArtifactType {
-
- FILE_ARTIFACT_TYPE
-
-}
-
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/DirectoryService.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/DirectoryService.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/DirectoryService.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -27,6 +27,7 @@
import org.jboss.portletswap.filter.Filter;
import org.jboss.portletswap.model.Category;
import org.jboss.portletswap.model.Module;
+import org.jboss.portletswap.model.Type;
/**
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/RepositoryService.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/RepositoryService.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/RepositoryService.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portletswap;
-import org.jboss.portletswap.metadata.License;
import org.jboss.portletswap.model.Artifact;
import org.jboss.portletswap.model.Category;
+import org.jboss.portletswap.model.License;
import org.jboss.portletswap.model.Module;
import org.jboss.portletswap.repository.NotFoundException;
import org.jboss.portletswap.repository.RepositoryException;
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/Type.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/Type.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/Type.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,34 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public enum Type {
-
- JSR168PORTLET, JSR286PORTLET, THEME, MIXED, OTHER
-
-}
-
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -37,7 +37,7 @@
import org.jboss.portletswap.DirectoryService;
import org.jboss.portletswap.Ordering;
-import org.jboss.portletswap.Type;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.filter.Filter;
import org.jboss.portletswap.jcr.JCRService;
import org.jboss.portletswap.model.Category;
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/memory/DirectoryServiceImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/memory/DirectoryServiceImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/directory/impl/memory/DirectoryServiceImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -34,7 +34,7 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portletswap.DirectoryService;
import org.jboss.portletswap.Ordering;
-import org.jboss.portletswap.Type;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.filter.CategoryFilter;
import org.jboss.portletswap.filter.Filter;
import org.jboss.portletswap.filter.TypeFilter;
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/filter/TypeFilter.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/filter/TypeFilter.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/filter/TypeFilter.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portletswap.filter;
-import org.jboss.portletswap.Type;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.model.Module;
/**
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Artifact.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Artifact.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Artifact.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portletswap.ArtifactType;
-import org.jboss.portletswap.Type;
-import org.jboss.portletswap.metadata.CompatibilityList;
-import org.jboss.portletswap.metadata.License;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface Artifact
-{
-
- public Object getId();
-
- public String getName();
-
- public ArtifactType getArtifactType();
-
- public Type getType();
-
- public LocalizedString getDescription();
-
- public void setDescription(LocalizedString description);
-
- public LocalizedString getDisplayName();
-
- public void setDisplayName(LocalizedString displayName);
-
- public CompatibilityList getCompatibilityList();
-
- public void setCompatibilityList(CompatibilityList compatibilityList);
-
- public License getLicense();
-
- public void setLicense(License license);
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Category.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Category.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Category.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,54 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model;
-
-import java.util.List;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface Category
-{
-
- public static final String ROOT_CATEGORY_NAME = "org.jboss.portletswap.RootCategoryNode";
-
- public Category getParent();
-
- public void addChild(Category category);
-
- public List<Category> getChildren();
-
- public Object getId();
-
- public String getName();
-
- public LocalizedString getDisplayName();
-
- public void setDisplayName(LocalizedString displayName);
-
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/FileArtifact.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/FileArtifact.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/FileArtifact.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,40 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model;
-
-import java.io.File;
-import java.io.InputStream;
-
-import org.jboss.portletswap.model.Artifact;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface FileArtifact extends Artifact
-{
- public InputStream getInputStream();
-
- public File getFile();
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Module.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Module.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/Module.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,65 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model;
-
-import java.util.List;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.common.util.Version;
-import org.jboss.portletswap.Type;
-import org.jboss.portletswap.metadata.Author;
-import org.jboss.portletswap.model.Artifact;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface Module
-{
-
- public void setId(Object id);
-
- public Object getId();
-
- public String getName();
-
- public Type getType();
-
- public Version getVersion();
-
- public LocalizedString getDescription();
-
- public List<Author> getAuthors();
-
- public void setDescription(LocalizedString localizedString);
-
- public List<Artifact> getArtifacts();
-
- public void addArtifact(Artifact artifact);
-
- public List<Category> getCategories();
-
- public void addCategory(Category category);
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/ReferencedArtifact.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/ReferencedArtifact.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/ReferencedArtifact.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,37 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model;
-
-import java.net.URL;
-
-import org.jboss.portletswap.model.Artifact;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface ReferencedArtifact extends Artifact
-{
- public URL getUrl();
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/AbstractArtifactImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/AbstractArtifactImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/AbstractArtifactImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,136 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model.impl;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portletswap.ArtifactType;
-import org.jboss.portletswap.Type;
-import org.jboss.portletswap.metadata.CompatibilityList;
-import org.jboss.portletswap.metadata.License;
-import org.jboss.portletswap.model.Artifact;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public abstract class AbstractArtifactImpl implements Artifact
-{
- private Object id;
-
- private String name;
-
- private ArtifactType artifactType;
-
- private Type type;
-
- private LocalizedString description;
-
- private LocalizedString displayName;
-
- private CompatibilityList compatibilityList;
-
- private License license;
-
- public ArtifactType getArtifactType()
- {
- return artifactType;
- }
-
- public void setArtifactType(ArtifactType artifactType)
- {
- this.artifactType = artifactType;
- }
-
- public Type getType()
- {
- return type;
- }
-
- public void setType(Type type)
- {
- this.type = type;
- }
-
- public LocalizedString getDescription()
- {
- return description;
- }
-
- public void setDescription(LocalizedString description)
- {
- this.description = description;
- }
-
- public LocalizedString getDisplayName()
- {
- return displayName;
- }
-
- public void setDisplayName(LocalizedString displayName)
- {
- this.displayName = displayName;
- }
-
- public CompatibilityList getCompatibilityList()
- {
- return compatibilityList;
- }
-
- public void setCompatibilityList(CompatibilityList compatibilityList)
- {
- this.compatibilityList = compatibilityList;
- }
-
- public License getLicense()
- {
- return license;
- }
-
- public void setLicense(License license)
- {
- this.license = license;
- }
-
- public Object getId()
- {
- return id;
- }
-
- public void setId(Object id)
- {
- this.id = id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/CategoryImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/CategoryImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/CategoryImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,122 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model.impl;
-
-import java.util.List;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portletswap.model.Category;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class CategoryImpl implements Category
-{
-
- private Object id;
-
- private LocalizedString displayName;
-
- private String name;
-
- private List<Category> children;
-
- private Category parent;
-
- protected CategoryImpl(String name)
- {
-
- }
-
- public CategoryImpl(String name, Category parent)
- {
- this.name = name;
- this.parent = parent;
- }
-
- public Category getParent()
- {
- return parent;
- }
-
- protected void getParent(Category parent)
- {
- this.parent = parent;
- }
-
- public void addChild(Category category)
- {
- children.add(category);
- }
-
- public List<Category> getChildren()
- {
- return children;
- }
-
- public Object getId()
- {
- return id;
- }
-
- public void setId(Object id)
- {
- if (this.id == null)
- {
- this.id = id;
- }
- else
- {
- throw new IllegalStateException("Not allowed to change the id");
- }
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- if (this.name == null)
- {
- this.name = name;
- }
- else
- {
- throw new IllegalStateException("Not allowed to change the name");
- }
- }
-
- public LocalizedString getDisplayName()
- {
- return displayName;
- }
-
- public void setDisplayName(LocalizedString displayName)
- {
- this.displayName = displayName;
- }
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/FileArtifactImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/FileArtifactImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/FileArtifactImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,127 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model.impl;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.Property;
-import javax.jcr.RepositoryException;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portletswap.ArtifactType;
-import org.jboss.portletswap.Type;
-import org.jboss.portletswap.jcr.JCRService;
-import org.jboss.portletswap.model.FileArtifact;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class FileArtifactImpl extends AbstractArtifactImpl implements FileArtifact
-{
-
- private InputStream inputStream;
-
- private File file;
-
- public FileArtifactImpl(Type type, File file, InputStream inputStream)
- {
- setType(type);
- this.inputStream = inputStream;
- this.file = file;
- }
-
- public FileArtifactImpl(JCRService jcrService, Node node) throws RepositoryException
- {
- setName(node.getName());
- setId(node.getUUID());
-
- Property typeProperty = node.getProperty("ps:type");
- setType(Type.valueOf(typeProperty.getString()));
-
- // Description
- NodeIterator it = node.getNodes("ps:description");
- Map<Locale, String> values = new HashMap<Locale, String>();
- while (it.hasNext())
- {
- Node tmpNode = it.nextNode();
- Locale locale = new Locale(tmpNode.getProperty("jcr:language").getString());
- String value = tmpNode.getProperty("ps:value").getString();
- values.put(locale, value);
- }
- setDescription(new LocalizedString(values, Locale.ENGLISH));
-
- // DisplayName
- it = node.getNodes("ps:displayName");
- values = new HashMap<Locale, String>();
- while (it.hasNext())
- {
- Node tmpNode = it.nextNode();
- Locale locale = new Locale(tmpNode.getProperty("jcr:language").getString());
- String value = tmpNode.getProperty("ps:value").getString();
- values.put(locale, value);
- }
- setDisplayName(new LocalizedString(values, Locale.ENGLISH));
-
- // Compatibility List
- // TODO
-
- // License
- try
- {
- Property property = node.getProperty("ps:license");
- Node licenseNode = node.getSession().getNodeByUUID(property.getString());
- setLicense(new LicenseImpl(jcrService, licenseNode));
- }
- catch (PathNotFoundException e)
- {
- // ignore
- }
-
- this.inputStream = node.getProperty("ps:file").getStream();
- }
-
- public InputStream getInputStream()
- {
- return inputStream;
- }
-
- public File getFile()
- {
- return file;
- }
-
- public ArtifactType getArtifactType()
- {
- return ArtifactType.FILE_ARTIFACT_TYPE;
- }
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/LicenseImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/LicenseImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/LicenseImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,78 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model.impl;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.jboss.portletswap.jcr.JCRService;
-import org.jboss.portletswap.metadata.License;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class LicenseImpl implements License
-{
- private String id;
-
- private String name;
-
- private String text;
-
- public LicenseImpl(String name, String text)
- {
- this.name = name;
- this.text = text;
- }
-
- public LicenseImpl(JCRService jcrService, Node licenseNode) throws RepositoryException
- {
- id = licenseNode.getUUID();
- name = licenseNode.getProperty("ps:name").getString();
- text = licenseNode.getProperty("ps:text").getString();
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getText()
- {
- return text;
- }
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
-
- }
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ModuleImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ModuleImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ModuleImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,181 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.common.util.Version;
-import org.jboss.portletswap.Type;
-import org.jboss.portletswap.metadata.Author;
-import org.jboss.portletswap.model.Artifact;
-import org.jboss.portletswap.model.Category;
-import org.jboss.portletswap.model.Module;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class ModuleImpl implements Module
-{
- private List<Artifact> artifacts;
-
- private Object id;
-
- private String name;
-
- private Version version;
-
- private LocalizedString description;
-
- private List<Author> authors;
-
- private List<Category> categories = new ArrayList<Category>();
-
- public ModuleImpl(String name, Version version)
- {
- this.version = version;
- this.name = name;
- this.artifacts = new ArrayList<Artifact>();
- }
-
- public ModuleImpl(String name)
- {
- this.name = name;
- this.artifacts = new ArrayList<Artifact>();
- }
-
- public ModuleImpl()
- {
- this.artifacts = new ArrayList<Artifact>();
- }
-
- public Object getId()
- {
- return id;
- }
-
- public Version getVersion()
- {
- return version;
- }
-
- public Type getType()
- {
- Type type = null;
- for (Artifact artifact: artifacts)
- {
- if (type == null)
- {
- type = artifact.getType();
- }
- else if (type != artifact.getType())
- {
- type = Type.MIXED;
- }
- }
- return type;
- }
-
- public List<Artifact> getArtifacts()
- {
- return artifacts;
- }
-
- public void setId(Object id)
- {
- if (this.id == null)
- {
- this.id = id;
- }
- else
- {
- throw new IllegalStateException("Not allowed to change the id");
- }
- }
-
- public void setName(String name)
- {
- if (this.name == null)
- {
- this.name = name;
- }
- else
- {
- throw new IllegalStateException("Not allowed to change the name");
- }
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setVersion(Version version)
- {
- this.version = version;
- }
-
- public LocalizedString getDescription()
- {
- return description;
- }
-
- public void setDescription(LocalizedString description)
- {
- this.description = description;
- }
-
- public List<Author> getAuthors()
- {
- return authors;
- }
-
- public void setAuthors(List<Author> authors)
- {
- this.authors = authors;
- }
-
- public List<Category> getCategories()
- {
- return categories;
- }
-
- public void setCategories(List<Category> categories)
- {
- this.categories = categories;
- }
-
- public void addCategory(Category category)
- {
- categories.add(category);
- }
-
- public void addArtifact(Artifact artifact)
- {
- artifacts.add(artifact);
- }
-
-}
-
Deleted: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ReferencedArtifact.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ReferencedArtifact.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/ReferencedArtifact.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -1,37 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portletswap.model.impl;
-
-import java.net.URL;
-
-import org.jboss.portletswap.model.Artifact;
-
-/**
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface ReferencedArtifact extends Artifact
-{
- public URL getUrl();
-}
-
Added: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRFileArtifactImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRFileArtifactImpl.java (rev 0)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRFileArtifactImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portletswap.model.impl.jcr;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portletswap.model.ArtifactType;
+import org.jboss.portletswap.model.Type;
+import org.jboss.portletswap.jcr.JCRService;
+import org.jboss.portletswap.model.FileArtifact;
+import org.jboss.portletswap.model.impl.FileArtifactImpl;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class JCRFileArtifactImpl extends FileArtifactImpl implements FileArtifact
+{
+
+ private InputStream inputStream;
+
+ private File file;
+
+ public JCRFileArtifactImpl(JCRService jcrService, Node node) throws RepositoryException
+ {
+ setName(node.getName());
+ setId(node.getUUID());
+
+ Property typeProperty = node.getProperty("ps:type");
+ setType(Type.valueOf(typeProperty.getString()));
+
+ // Description
+ NodeIterator it = node.getNodes("ps:description");
+ Map<Locale, String> values = new HashMap<Locale, String>();
+ while (it.hasNext())
+ {
+ Node tmpNode = it.nextNode();
+ Locale locale = new Locale(tmpNode.getProperty("jcr:language").getString());
+ String value = tmpNode.getProperty("ps:value").getString();
+ values.put(locale, value);
+ }
+ setDescription(new LocalizedString(values, Locale.ENGLISH));
+
+ // DisplayName
+ it = node.getNodes("ps:displayName");
+ values = new HashMap<Locale, String>();
+ while (it.hasNext())
+ {
+ Node tmpNode = it.nextNode();
+ Locale locale = new Locale(tmpNode.getProperty("jcr:language").getString());
+ String value = tmpNode.getProperty("ps:value").getString();
+ values.put(locale, value);
+ }
+ setDisplayName(new LocalizedString(values, Locale.ENGLISH));
+
+ // Compatibility List
+ // TODO
+
+ // License
+ try
+ {
+ Property property = node.getProperty("ps:license");
+ Node licenseNode = node.getSession().getNodeByUUID(property.getString());
+ setLicense(new JCRLicenseImpl(jcrService, licenseNode));
+ }
+ catch (PathNotFoundException e)
+ {
+ // ignore
+ }
+
+ this.inputStream = node.getProperty("ps:file").getStream();
+ }
+
+ public InputStream getInputStream()
+ {
+ return inputStream;
+ }
+
+ public File getFile()
+ {
+ return file;
+ }
+
+ public ArtifactType getArtifactType()
+ {
+ return ArtifactType.FILE_ARTIFACT_TYPE;
+ }
+
+}
+
Added: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRLicenseImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRLicenseImpl.java (rev 0)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRLicenseImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portletswap.model.impl.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.jboss.portletswap.jcr.JCRService;
+import org.jboss.portletswap.model.impl.LicenseImpl;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class JCRLicenseImpl extends LicenseImpl
+{
+ private String id;
+
+ private String name;
+
+ private String text;
+
+ public JCRLicenseImpl(JCRService jcrService, Node licenseNode) throws RepositoryException
+ {
+ id = licenseNode.getUUID();
+ name = licenseNode.getProperty("ps:name").getString();
+ text = licenseNode.getProperty("ps:text").getString();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+
+ }
+
+}
+
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRModuleImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRModuleImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/model/impl/jcr/JCRModuleImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -40,12 +40,11 @@
import org.apache.jackrabbit.value.ReferenceValue;
import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.Version;
-import org.jboss.portletswap.Type;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.jcr.JCRService;
-import org.jboss.portletswap.metadata.Author;
import org.jboss.portletswap.model.Artifact;
+import org.jboss.portletswap.model.Author;
import org.jboss.portletswap.model.Category;
-import org.jboss.portletswap.model.impl.FileArtifactImpl;
import org.jboss.portletswap.model.impl.ModuleImpl;
/**
@@ -144,7 +143,7 @@
Node tmpNode = it.nextNode();
if (tmpNode.isNodeType("ps:fileArtifact"))
{
- result.add(new FileArtifactImpl(jcrService, tmpNode));
+ result.add(new JCRFileArtifactImpl(jcrService, tmpNode));
}
}
return result;
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/ArtifactFactory.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/ArtifactFactory.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/ArtifactFactory.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -27,7 +27,7 @@
import org.jboss.portletswap.jcr.JCRService;
import org.jboss.portletswap.model.Artifact;
-import org.jboss.portletswap.model.impl.FileArtifactImpl;
+import org.jboss.portletswap.model.impl.jcr.JCRFileArtifactImpl;
/**
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
@@ -43,7 +43,7 @@
NodeType nodeType = node.getPrimaryNodeType();
if (nodeType.isNodeType("ps:fileArtifact"))
{
- return new FileArtifactImpl(jcrService, node);
+ return new JCRFileArtifactImpl(jcrService, node);
}
}
catch (Exception e)
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -37,15 +37,15 @@
import org.apache.jackrabbit.value.DateValue;
import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.Version;
-import org.jboss.portletswap.ArtifactType;
+import org.jboss.portletswap.model.ArtifactType;
import org.jboss.portletswap.PortletswapException;
import org.jboss.portletswap.RepositoryService;
import org.jboss.portletswap.jcr.JCRService;
-import org.jboss.portletswap.metadata.Author;
-import org.jboss.portletswap.metadata.License;
import org.jboss.portletswap.model.Artifact;
+import org.jboss.portletswap.model.Author;
import org.jboss.portletswap.model.Category;
import org.jboss.portletswap.model.FileArtifact;
+import org.jboss.portletswap.model.License;
import org.jboss.portletswap.model.Module;
import org.jboss.portletswap.model.impl.FileArtifactImpl;
import org.jboss.portletswap.model.impl.LicenseImpl;
Modified: server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceImpl.java
===================================================================
--- server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceImpl.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/main/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceImpl.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -28,9 +28,9 @@
import org.jboss.portletswap.RepositoryService;
import org.jboss.portletswap.jcr.JCRServiceImpl;
-import org.jboss.portletswap.metadata.License;
import org.jboss.portletswap.model.Artifact;
import org.jboss.portletswap.model.Category;
+import org.jboss.portletswap.model.License;
import org.jboss.portletswap.model.Module;
import org.jboss.portletswap.model.impl.CategoryImpl;
import org.jboss.portletswap.model.impl.ModuleImpl;
Modified: server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceTestCase.java
===================================================================
--- server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceTestCase.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/directory/impl/jcr/DirectoryServiceTestCase.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -41,7 +41,6 @@
import org.jboss.portletswap.model.Module;
import org.jboss.portletswap.model.impl.CategoryImpl;
import org.jboss.portletswap.model.impl.ModuleImpl;
-import org.jboss.portletswap.model.impl.jcr.JCRModuleImpl;
import org.jboss.portletswap.repository.impl.jcr.RepositoryServiceImpl;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Destroy;
Modified: server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceTestCase.java
===================================================================
--- server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceTestCase.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/jcr/RepositoryServiceTestCase.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -40,19 +40,18 @@
import org.jboss.portal.common.util.Version;
import org.jboss.portal.common.util.Version.Qualifier;
import org.jboss.portletswap.PortletswapException;
-import org.jboss.portletswap.Type;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.jcr.JCRService;
import org.jboss.portletswap.jcr.JCRServiceImpl;
-import org.jboss.portletswap.metadata.License;
import org.jboss.portletswap.model.Artifact;
import org.jboss.portletswap.model.Category;
import org.jboss.portletswap.model.FileArtifact;
+import org.jboss.portletswap.model.License;
import org.jboss.portletswap.model.Module;
import org.jboss.portletswap.model.impl.CategoryImpl;
import org.jboss.portletswap.model.impl.FileArtifactImpl;
import org.jboss.portletswap.model.impl.LicenseImpl;
import org.jboss.portletswap.model.impl.ModuleImpl;
-import org.jboss.portletswap.model.impl.jcr.JCRModuleImpl;
import org.jboss.portletswap.repository.NotFoundException;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Destroy;
Modified: server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceTestCase.java
===================================================================
--- server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceTestCase.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-service/server-lib/src/test/java/org/jboss/portletswap/repository/impl/memory/RepositoryServiceTestCase.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -22,17 +22,15 @@
******************************************************************************/
package org.jboss.portletswap.repository.impl.memory;
-import static org.jboss.unit.api.Assert.*;
+import static org.jboss.unit.api.Assert.assertNotNull;
import org.jboss.portal.common.util.Version;
import org.jboss.portal.common.util.Version.Qualifier;
import org.jboss.portletswap.PortletswapException;
import org.jboss.portletswap.RepositoryService;
-import org.jboss.portletswap.Type;
import org.jboss.portletswap.model.Artifact;
-import org.jboss.portletswap.model.Category;
import org.jboss.portletswap.model.Module;
-import org.jboss.portletswap.model.impl.CategoryImpl;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.model.impl.FileArtifactImpl;
import org.jboss.portletswap.model.impl.ModuleImpl;
import org.jboss.unit.api.pojo.annotations.Test;
Modified: server/trunk/server-webapp/pom.xml
===================================================================
--- server/trunk/server-webapp/pom.xml 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-webapp/pom.xml 2008-01-21 20:04:55 UTC (rev 210)
@@ -33,6 +33,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.portletswap</groupId>
+ <artifactId>server-model</artifactId>
+ <scope>provided</scope>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.4.3</version>
Modified: server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/ContentServlet.java
===================================================================
--- server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/ContentServlet.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/ContentServlet.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -33,11 +33,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.logging.Logger;
+import org.jboss.portletswap.PortletswapException;
import org.jboss.portletswap.RepositoryService;
import org.jboss.portletswap.model.FileArtifact;
-import org.jboss.portletswap.repository.NotFoundException;
-import org.jboss.portletswap.repository.RepositoryException;
/**
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
@@ -46,8 +44,6 @@
@SuppressWarnings("serial")
public class ContentServlet extends HttpServlet
{
- private Logger log = Logger.getLogger(ContentServlet.class);
-
public static final String ARTIFACT_ID = "artifactId";
private RepositoryService repositoryService;
@@ -85,14 +81,9 @@
outputStream.write(bytes, 0, bytesRead);
}
}
- catch (NotFoundException e)
+ catch (PortletswapException e)
{
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
}
- catch (RepositoryException e)
- {
- log.error(e.getMessage());
- response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
- }
}
}
\ No newline at end of file
Modified: server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/DirectoryServlet.java
===================================================================
--- server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/DirectoryServlet.java 2008-01-21 20:03:25 UTC (rev 209)
+++ server/trunk/server-webapp/src/main/java/org/jboss/portletswap/servlet/DirectoryServlet.java 2008-01-21 20:04:55 UTC (rev 210)
@@ -28,13 +28,13 @@
import org.jboss.portal.common.util.Version;
import org.jboss.portletswap.PortletswapException;
import org.jboss.portletswap.RepositoryService;
-import org.jboss.portletswap.Type;
import org.jboss.portletswap.metadata.DisplayNameModel;
import org.jboss.portletswap.metadata.ResultModel;
import org.jboss.portletswap.metadata.ResultModelProvider;
import org.jboss.portletswap.model.Artifact;
import org.jboss.portletswap.model.Category;
import org.jboss.portletswap.model.Module;
+import org.jboss.portletswap.model.Type;
import org.jboss.portletswap.model.impl.CategoryImpl;
import org.jboss.portletswap.model.impl.FileArtifactImpl;
import org.jboss.portletswap.model.impl.ModuleImpl;
More information about the jboss-svn-commits
mailing list