Skip to content

Commit

Permalink
release 1.0.4-b1
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrzewski committed Jan 22, 2010
1 parent dfdae20 commit 7313515
Show file tree
Hide file tree
Showing 95 changed files with 4,918 additions and 0 deletions.
6 changes: 6 additions & 0 deletions coral-browser/.checkstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><fileset-config file-format-version="1.1.0" simple-config="false">
<fileset name="main sources" check-config-name="Ledge checks" enabled="false"><file-match-pattern match-pattern="main.*java$" include-pattern="true"/>
</fileset>
<fileset name="test sources" check-config-name="Ledge test checks" enabled="false"><file-match-pattern match-pattern="test.*java$" include-pattern="true"/>
</fileset>
</fileset-config>
5 changes: 5 additions & 0 deletions coral-browser/.cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bin
target
.clover
*.log*
build.properties
28 changes: 28 additions & 0 deletions coral-browser/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Copyright (c) 2003, Caltha - Gajda, Krzewski, Mach, Potempski Sp.J.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Caltha - Gajda, Krzewski, Mach, Potempski Sp.J.
// nor the names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

3 changes: 3 additions & 0 deletions coral-browser/findbugsExclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<FindBugsFilter>
</FindBugsFilter>
35 changes: 35 additions & 0 deletions coral-browser/maven.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
Copyright (c) 2003, Caltha - Gajda, Krzewski, Mach, Potempski Sp.J.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Caltha - Gajda, Krzewski, Mach, Potempski Sp.J.
nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->

<!-- $Id: maven.xml,v 1.4 2004-05-13 14:09:54 fil Exp $ -->
<project xmlns:j="jelly:core"
xmlns:ant="jelly:ant">

</project>
56 changes: 56 additions & 0 deletions coral-browser/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.objectledge.coral</groupId>
<artifactId>coral-common</artifactId>
<relativePath>../coral-common/pom.xml</relativePath>
<version>1.0.4-b1</version>
</parent>
<artifactId>coral-browser</artifactId>
<packaging>jar</packaging>
<name>Coral Browser Web Module</name>
<dependencies>
<dependency>
<groupId>org.objectledge.coral</groupId>
<artifactId>coral-web</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>content/**</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.objectledge</groupId>
<artifactId>ledge-maven-assemblies</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>content-war.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
35 changes: 35 additions & 0 deletions coral-browser/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2003, Caltha - Gajda, Krzewski, Mach, Potempski Sp.J.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the Caltha - Gajda, Krzewski, Mach, Potempski Sp.J.
# nor the names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# project.properties for coral-api
#
# $Id: project.properties,v 1.1 2004-10-14 04:44:01 rafal Exp $

# multiproject
maven.multiproject.type=jar

# parent project
coralCommon=../coral-common
62 changes: 62 additions & 0 deletions coral-browser/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="ISO-8859-2"?>
<project>
<pomVersion>3</pomVersion>
<extend>${coralCommon}/project.xml</extend>

<name>Coral browser</name>
<id>coral-browser</id>
<groupId>coral</groupId>
<currentVersion>${versions.coral}</currentVersion>
<shortDescription>
Coral Browser is a simple web application that allows viewing and modifying Coral
data schema, security settings, and resources.
</shortDescription>

<dependencies>
<dependency>
<groupId>coral</groupId>
<artifactId>coral-api</artifactId>
<version>${versions.coral}</version>
<url>http://coral.objectledge.org/modules/coral-api/</url>
</dependency>
<dependency>
<groupId>coral</groupId>
<artifactId>coral-web</artifactId>
<version>${versions.coral}</version>
<url>http://coral.objectledge.org/modules/coral-web/</url>
</dependency>
<dependency>
<groupId>coral</groupId>
<artifactId>coral-datatypes</artifactId>
<version>${versions.coral}</version>
<url>http://coral.objectledge.org/modules/coral-datatypes/</url>
</dependency>
<dependency>
<groupId>dna</groupId>
<artifactId>dna-api</artifactId>
<version>1.1-rc2</version>
<url>http://dna.codehaus.org</url>
</dependency>
<dependency>
<groupId>objectledge</groupId>
<artifactId>ledge-components</artifactId>
<version>${versions.ledge}</version>
</dependency>
<dependency>
<groupId>objectledge</groupId>
<artifactId>ledge-web</artifactId>
<version>${versions.ledge}</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package org.objectledge.coral.modules.actions.browser;

import org.jcontainer.dna.Logger;
import org.objectledge.context.Context;
import org.objectledge.coral.schema.AttributeClass;
import org.objectledge.coral.schema.AttributeDefinition;
import org.objectledge.coral.schema.AttributeFlags;
import org.objectledge.coral.schema.ResourceClass;
import org.objectledge.coral.session.CoralSession;
import org.objectledge.parameters.Parameters;
import org.objectledge.pipeline.ProcessingException;
import org.objectledge.templating.TemplatingContext;
import org.objectledge.web.mvc.MVCContext;
import org.objectledge.web.mvc.security.PolicySystem;

/**
* Add attribute action.
*
* @author <a href="mailo:pablo@caltha.pl">Pawel Potempski</a>
* @version $Id: AddAttribute.java,v 1.3 2005-05-24 05:40:28 pablo Exp $
*/
public class AddAttribute extends BaseBrowserAction
{
public AddAttribute(PolicySystem policySystemArg, Logger logger)
{
super(policySystemArg, logger);
}

/**
* Runns the valve.
*
* @param context the context.
*/
public void execute(Context context, Parameters parameters, MVCContext mvcContext, TemplatingContext templatingContext, CoralSession coralSession)
throws ProcessingException
{
try
{
String attrName = parameters.get("attr_name", "");
if (attrName.length() == 0)
{
throw new ProcessingException("Attribute name not found");
}
long resClassId = parameters.getLong("res_class_id", -1L);
if (resClassId == -1L)
{
throw new ProcessingException("Resource class id not found");
}
long attrClassId = parameters.getLong("attr_class_id", -1L);
if (attrClassId == -1L)
{
throw new ProcessingException("Attribute class id not found");
}
boolean setDomain = parameters.getBoolean("set_domain", false);
String domain = null;
if (setDomain)
{
domain = parameters.get("domain", "");
}
boolean setValue = parameters.getBoolean("set_value", false);
String value = parameters.get("value", "");
String[] keys = parameters.getParameterNames();
int flags = 0;
for (int i = 0; i < keys.length; i++)
{
if (keys[i].startsWith("flag_"))
{
String flagName = keys[i].substring(5, keys[i].length());
flags = flags + AttributeFlags.flagValue(flagName);
}
}
AttributeClass attrClass = coralSession.getSchema().getAttributeClass(attrClassId);
AttributeDefinition attrDefinition = coralSession.getSchema().createAttribute(attrName, attrClass, domain, flags);
ResourceClass resourceClass = coralSession.getSchema().getResourceClass(resClassId);
Object defaultValue = null;
if (setValue)
{
defaultValue = attrClass.getHandler().toAttributeValue(value);
}
coralSession.getSchema().addAttribute(resourceClass, attrDefinition, defaultValue);
}
catch (Exception e)
{
logger.error("ARLException: ", e);
templatingContext.put("result", "exception");
return;
}
templatingContext.put("result", "added_successfully");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.objectledge.coral.modules.actions.browser;

import org.jcontainer.dna.Logger;
import org.objectledge.context.Context;
import org.objectledge.coral.session.CoralSession;
import org.objectledge.parameters.Parameters;
import org.objectledge.pipeline.ProcessingException;
import org.objectledge.templating.TemplatingContext;
import org.objectledge.web.mvc.MVCContext;
import org.objectledge.web.mvc.security.PolicySystem;

/**
* Add role action.
*
* @author <a href="mailo:pablo@caltha.pl">Pawel Potempski</a>
* @version $Id: AddPermission.java,v 1.3 2005-05-24 05:40:28 pablo Exp $
*/
public class AddPermission extends BaseBrowserAction
{
public AddPermission(PolicySystem policySystemArg, Logger logger)
{
super(policySystemArg, logger);
}

/**
* Performs the action.
*/
public void execute(Context context, Parameters parameters, MVCContext mvcContext, TemplatingContext templatingContext, CoralSession coralSession)
throws ProcessingException
{
try
{
String permissionName = parameters.get("permission_name", "");
if (permissionName.length() == 0)
{
templatingContext.put("result", "invalid_name");
return;
}
coralSession.getSecurity().createPermission(permissionName);
}
catch (Exception e)
{
logger.error("ARLException: ", e);
//templatingContext.put("trace",StringUtils.stackTrace(e));
templatingContext.put("result", "exception");
return;
}
templatingContext.put("result", "added_successfully");
}
}
Loading

0 comments on commit 7313515

Please sign in to comment.