-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap;
import java.security.PrivilegedAction;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap;
import org.argeo.cms.auth.CurrentUser;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap;
import org.eclipse.swt.SWT;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap;
import org.eclipse.ui.IPerspectiveDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap;
import org.osgi.framework.BundleActivator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap.commands;
import org.argeo.cms.ui.workbench.UserHomePerspective;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.rap.commands;
import org.eclipse.core.commands.AbstractHandler;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.spring;
import javax.security.auth.Subject;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.spring;
import java.security.AccessController;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench;
import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench;
import org.argeo.cms.ui.workbench.useradmin.AdminLogView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench;
import org.eclipse.ui.IPageLayout;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench;
import org.argeo.cms.ui.workbench.internal.useradmin.parts.GroupsView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench;
import org.argeo.cms.ui.workbench.jcr.NodeFsBrowserView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.commands;
import static org.argeo.cms.CmsMsg.changePassword;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.commands;
import org.argeo.cms.ui.workbench.UserHomePerspective;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal;
/** Constants used across the application. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.net.URI;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.util.Arrays;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.util.Iterator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import static org.argeo.eclipse.ui.util.SingleSourcingConstants.FILE_SCHEME;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.util.HashMap;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.util.Iterator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.security.Principal;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import org.argeo.cms.ui.jcr.model.RemoteRepositoryElem;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.util.Iterator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.commands;
import java.io.InputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import java.util.Collections;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import org.eclipse.jface.dialogs.IMessageProvider;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import javax.jcr.query.Query;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import org.eclipse.jface.resource.ImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.jcr.parts;
import org.eclipse.jface.resource.ImageDescriptor;
-/*
- * Argeo Connect - Data management and communications
- * Copyright (C) 2012 Argeo GmbH
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- * Additional permission under GNU GPL version 3 section 7
- *
- * If you modify this Program, or any covered work, by linking or combining it
- * with software covered by the terms of the Eclipse Public License, the
- * licensors of this Program grant you additional permission to convey the
- * resulting work. Corresponding Source for a non-source form of such a
- * combination shall include the source code for the parts of such software
- * which are used as well as that of the covered work.
- */
package org.argeo.cms.ui.workbench.internal.useradmin;
import static org.argeo.cms.ui.workbench.WorkbenchUiPlugin.getImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import org.argeo.cms.ui.workbench.internal.useradmin.parts.GroupsView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import java.util.Dictionary;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import java.util.Dictionary;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import org.argeo.cms.ui.workbench.internal.useradmin.UserAdminWrapper;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.commands;
import javax.transaction.Status;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import org.eclipse.jface.resource.ImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import static org.argeo.api.NodeInstance.WORKGROUP;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import org.eclipse.jface.resource.ImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import static org.argeo.cms.auth.UserAdminUtils.getProperty;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.internal.useradmin.parts;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.jcr;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.jcr;
import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.jcr;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.jcr;
import java.net.URI;
//package org.argeo.eclipse.ui.workbench.osgi;
//public class BundlesView {}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.osgi;
import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
//package org.argeo.eclipse.ui.workbench.osgi;
//public class BundlesView {}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.osgi;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.osgi;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.osgi;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.osgi;
import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.useradmin;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.useradmin;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.useradmin;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.useradmin;
import java.util.TreeSet;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.util;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.cms.ui.workbench.util;
import java.util.HashMap;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.eclipse.spring;\r
\r
import static java.text.MessageFormat.format;\r
import org.osgi.util.tracker.ServiceTracker;\r
import org.springframework.context.ApplicationContext;\r
\r
-/**\r
- * Tracks Spring application context published as services.\r
- * \r
- * @author Heiko Seeberger\r
- * @author Mathieu Baudier\r
- */\r
+/** Tracks Spring application context published as services. */\r
class ApplicationContextTracker {\r
private final static Log log = LogFactory\r
.getLog(ApplicationContextTracker.class);\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.eclipse.spring;
import org.apache.commons.logging.Log;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.eclipse.spring;\r
\r
import org.argeo.eclipse.ui.EclipseUiException;\r
* original code from: <a href=\r
* "http://martinlippert.blogspot.com/2008/10/new-version-of-spring-extension-factory.html"\r
* >Blog entry</a>\r
- * \r
- * @author Martin Lippert\r
- * @author mbaudier\r
*/\r
public class SpringExtensionFactory implements IExecutableExtensionFactory,\r
IExecutableExtension {\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
/** Binary check on an arbitrary object. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
/**
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc;\r
-\r
-/** Basis for all SLC exceptions. This is an unchecked exception. */\r
-public class SlcException extends RuntimeException {\r
- private static final long serialVersionUID = 6373738619304106445L;\r
-\r
- /** Constructor. */\r
- public SlcException(String message) {\r
- super(message);\r
- }\r
-\r
- /** Constructor. */\r
- public SlcException(String message, Throwable e) {\r
- super(message, e);\r
- }\r
-\r
-}\r
+package org.argeo.slc;
+
+/** Basis for all SLC exceptions. This is an unchecked exception. */
+public class SlcException extends RuntimeException {
+ private static final long serialVersionUID = 6373738619304106445L;
+
+ /** Constructor. */
+ public SlcException(String message) {
+ super(message);
+ }
+
+ /** Constructor. */
+ public SlcException(String message, Throwable e) {
+ super(message, e);
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
/** JCR names used by SLC */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
/** JCR node types used by SLC */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc;
import java.io.InputStream;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc;\r
-\r
-/** Exception for unsupported features or actions. */\r
-public class UnsupportedException extends SlcException {\r
- static final long serialVersionUID = 1l;\r
-\r
- /** Action not supported. */\r
- public UnsupportedException() {\r
- this("Action not supported");\r
- }\r
-\r
- /** Constructor with a message. */\r
- public UnsupportedException(String message) {\r
- super(message);\r
- }\r
-\r
- /**\r
- * Constructor generating a message.\r
- * \r
- * @param nature\r
- * the nature of the unsupported object\r
- * @param obj\r
- * the object itself (its class name will be used in message)\r
- */\r
- public UnsupportedException(String nature, Object obj) {\r
- super("Unsupported " + nature + ": "\r
- + (obj != null ? obj.getClass() : "[object is null]"));\r
- }\r
-\r
- /**\r
- * Constructor generating a message.\r
- * \r
- * @param nature\r
- * the nature of the unsupported object\r
- * @param clss\r
- * the class itself (will be used in message)\r
- */\r
- public UnsupportedException(String nature, Class<?> clss) {\r
- super("Unsupported " + nature + ": " + clss);\r
- }\r
-\r
- /**\r
- * Constructor generating a message.\r
- * \r
- * @param nature\r
- * the nature of the unsupported object\r
- * @param value\r
- * the problematic value itself\r
- */\r
- public UnsupportedException(String nature, String value) {\r
- super("Unsupported " + nature + ": " + value);\r
- }\r
-\r
-}\r
+package org.argeo.slc;
+
+/** Exception for unsupported features or actions. */
+public class UnsupportedException extends SlcException {
+ static final long serialVersionUID = 1l;
+
+ /** Action not supported. */
+ public UnsupportedException() {
+ this("Action not supported");
+ }
+
+ /** Constructor with a message. */
+ public UnsupportedException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor generating a message.
+ *
+ * @param nature
+ * the nature of the unsupported object
+ * @param obj
+ * the object itself (its class name will be used in message)
+ */
+ public UnsupportedException(String nature, Object obj) {
+ super("Unsupported " + nature + ": "
+ + (obj != null ? obj.getClass() : "[object is null]"));
+ }
+
+ /**
+ * Constructor generating a message.
+ *
+ * @param nature
+ * the nature of the unsupported object
+ * @param clss
+ * the class itself (will be used in message)
+ */
+ public UnsupportedException(String nature, Class<?> clss) {
+ super("Unsupported " + nature + ": " + clss);
+ }
+
+ /**
+ * Constructor generating a message.
+ *
+ * @param nature
+ * the nature of the unsupported object
+ * @param value
+ * the problematic value itself
+ */
+ public UnsupportedException(String nature, String value) {
+ super("Unsupported " + nature + ": " + value);
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.attachment;
public interface Attachment {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.attachment;
public interface AttachmentsEnabled {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.attachment;
import java.io.InputStream;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.build;\r
\r
/** A packaged software component */\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.build;
import org.argeo.slc.ModuleSet;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
import java.io.File;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.deploy;\r
\r
import org.argeo.slc.build.Distribution;\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
public interface DeployedSystemManager<T extends DeployedSystem> {
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.deploy;\r
\r
import org.argeo.slc.build.Distribution;\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.deploy;\r
\r
public interface DeploymentData {\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
import org.argeo.slc.NameVersion;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
public interface InstalledExecutables extends DeployedSystem {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
import org.argeo.slc.NameVersion;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.deploy;
import java.util.List;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.deploy;\r
\r
public interface TargetData {\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.deploy;\r
\r
import java.io.File;\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.io.Serializable;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.execution;\r
\r
/** Variables or references attached to an execution (typically thread bounded).*/\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.Iterator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.Map;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
@Deprecated
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import org.argeo.slc.deploy.ModuleDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.Map;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
/**
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
/** Deal with nested level of executions using different variables. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.Map;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.execution;\r
\r
import java.io.Serializable;\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
/** Reference value to be used by an execution */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.execution;
import java.net.URI;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.primitive;
/** Abstraction of access to primitive values */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.primitive;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.primitive;
/** Converts to and from primitive types. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.primitive;
import org.argeo.slc.execution.AbstractExecutionValue;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test;\r
\r
\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test;\r
\r
import org.argeo.slc.SlcException;\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test;\r
\r
/**\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test;\r
\r
public interface TestDataProvider {\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test;\r
\r
/**\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import java.util.Date;\r
-import java.util.Map;\r
-\r
-/** The result of a test */\r
-public interface TestResult extends TestStatus, TestRunAware {\r
- public String getUuid();\r
-\r
- /** Adds a part of the result. */\r
- public void addResultPart(TestResultPart part);\r
-\r
- /**\r
- * Marks that the collection of test results is completed and free the\r
- * related resources (also closing listeners).\r
- */\r
- public void close();\r
-\r
- /**\r
- * The date when this test result was closed. Can be null, which means the\r
- * result is not closed.\r
- */\r
- public Date getCloseDate();\r
-\r
- /** Additional arbitrary meta data */\r
- public Map<String, String> getAttributes();\r
-}\r
+package org.argeo.slc.test;
+
+import java.util.Date;
+import java.util.Map;
+
+/** The result of a test */
+public interface TestResult extends TestStatus, TestRunAware {
+ public String getUuid();
+
+ /** Adds a part of the result. */
+ public void addResultPart(TestResultPart part);
+
+ /**
+ * Marks that the collection of test results is completed and free the
+ * related resources (also closing listeners).
+ */
+ public void close();
+
+ /**
+ * The date when this test result was closed. Can be null, which means the
+ * result is not closed.
+ */
+ public Date getCloseDate();
+
+ /** Additional arbitrary meta data */
+ public Map<String, String> getAttributes();
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/** Listener to the operations on a test result. */\r
-public interface TestResultListener<T extends TestResult> {\r
- /** Notified when a part was added to a test result. */\r
- public void resultPartAdded(T testResult, TestResultPart testResultPart);\r
-\r
- /** Stops listening and release the related resources. */\r
- public void close(T testResult);\r
-}\r
+package org.argeo.slc.test;
+
+/** Listener to the operations on a test result. */
+public interface TestResultListener<T extends TestResult> {
+ /** Notified when a part was added to a test result. */
+ public void resultPartAdded(T testResult, TestResultPart testResultPart);
+
+ /** Stops listening and release the related resources. */
+ public void close(T testResult);
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/**\r
- * Part of a test result.\r
- * \r
- * @see TestResult\r
- */\r
-public interface TestResultPart {\r
- /** The status, as defined in {@link TestStatus}. */\r
- public Integer getStatus();\r
-\r
- /** The related message. */\r
- public String getMessage();\r
-\r
- /** The underlying <code>Exception</code>. Can be null. */\r
- public String getExceptionMessage();\r
-}\r
+package org.argeo.slc.test;
+
+/**
+ * Part of a test result.
+ *
+ * @see TestResult
+ */
+public interface TestResultPart {
+ /** The status, as defined in {@link TestStatus}. */
+ public Integer getStatus();
+
+ /** The related message. */
+ public String getMessage();
+
+ /** The underlying <code>Exception</code>. Can be null. */
+ public String getExceptionMessage();
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-\r
-/** The actual run of a test */\r
-public interface TestRun {\r
- /** Gets UUID */\r
- public String getUuid();\r
-\r
- /** Gets the related test definition. */\r
- public <T extends TestDefinition> T getTestDefinition();\r
-\r
- /** Gets the related test data */\r
- public <T extends TestData> T getTestData();\r
-\r
- /** Gets the related deployed system. */\r
- public <T extends DeployedSystem> T getDeployedSystem();\r
-\r
- /** Gets the related result where to record results. */\r
- public <T extends TestResult> T getTestResult();\r
-}\r
+package org.argeo.slc.test;
+
+import org.argeo.slc.deploy.DeployedSystem;
+
+/** The actual run of a test */
+public interface TestRun {
+ /** Gets UUID */
+ public String getUuid();
+
+ /** Gets the related test definition. */
+ public <T extends TestDefinition> T getTestDefinition();
+
+ /** Gets the related test data */
+ public <T extends TestData> T getTestData();
+
+ /** Gets the related deployed system. */
+ public <T extends DeployedSystem> T getDeployedSystem();
+
+ /** Gets the related result where to record results. */
+ public <T extends TestResult> T getTestResult();
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/** Allows a test run to notify other objects. */\r
-public interface TestRunAware {\r
- /** Notifies the current test run. */\r
- public void notifyTestRun(TestRun testRun);\r
-\r
-}\r
+package org.argeo.slc.test;
+
+/** Allows a test run to notify other objects. */
+public interface TestRunAware {
+ /** Notifies the current test run. */
+ public void notifyTestRun(TestRun testRun);
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/**\r
- * Simple statuses. Ordering of the flags can be relied upon in aggregation: if\r
- * one element is failed, the aggregation is failed. Is one element is in ERROR,\r
- * the aggregation is in ERROR.\r
- * <p>\r
- * <ul>\r
- * <li>{@link #PASSED}: the test succeeded</li>\r
- * <li>{@link #FAILED}: the test could run, but did not reach the expected\r
- * result</li>\r
- * <li>{@link #ERROR}: an error during the test run prevented to get a\r
- * significant information on the tested system.</li>\r
- * </ul>\r
- * </p>\r
- */\r
-public interface TestStatus {\r
- /** The flag for a passed test: 0 */\r
- public final static Integer PASSED = 0;\r
- /** The flag for a failed test: 1 */\r
- public final static Integer FAILED = 1;\r
- /**\r
- * The flag for a test which could not properly run because of an error\r
- * (there is no feedback on the behavior of the tested component): 2\r
- */\r
- public final static Integer ERROR = 2;\r
- public final static String STATUSSTR_PASSED = "PASSED";\r
- public final static String STATUSSTR_FAILED = "FAILED";\r
- public final static String STATUSSTR_ERROR = "ERROR";\r
-\r
-}\r
+package org.argeo.slc.test;
+
+/**
+ * Simple statuses. Ordering of the flags can be relied upon in aggregation: if
+ * one element is failed, the aggregation is failed. Is one element is in ERROR,
+ * the aggregation is in ERROR.
+ * <p>
+ * <ul>
+ * <li>{@link #PASSED}: the test succeeded</li>
+ * <li>{@link #FAILED}: the test could run, but did not reach the expected
+ * result</li>
+ * <li>{@link #ERROR}: an error during the test run prevented to get a
+ * significant information on the tested system.</li>
+ * </ul>
+ * </p>
+ */
+public interface TestStatus {
+ /** The flag for a passed test: 0 */
+ public final static Integer PASSED = 0;
+ /** The flag for a failed test: 1 */
+ public final static Integer FAILED = 1;
+ /**
+ * The flag for a test which could not properly run because of an error
+ * (there is no feedback on the behavior of the tested component): 2
+ */
+ public final static Integer ERROR = 2;
+ public final static String STATUSSTR_PASSED = "PASSED";
+ public final static String STATUSSTR_FAILED = "FAILED";
+ public final static String STATUSSTR_ERROR = "ERROR";
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-\r
-/** Test run whose various components can be externally set. */\r
-public interface WritableTestRun extends ExecutableTestRun {\r
- public void setDeployedSystem(DeployedSystem deployedSystem);\r
-\r
- public void setTestData(TestData testData);\r
-\r
- public void setTestDefinition(TestDefinition testDefinition);\r
-\r
- public void setTestResult(TestResult testResult);\r
-}\r
+package org.argeo.slc.test;
+
+import org.argeo.slc.deploy.DeployedSystem;
+
+/** Test run whose various components can be externally set. */
+public interface WritableTestRun extends ExecutableTestRun {
+ public void setDeployedSystem(DeployedSystem deployedSystem);
+
+ public void setTestData(TestData testData);
+
+ public void setTestDefinition(TestDefinition testDefinition);
+
+ public void setTestResult(TestResult testResult);
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test.context;\r
\r
import java.util.Map;\r
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
package org.argeo.slc.test.context;\r
\r
import java.util.Collection;\r
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.rap;
import org.argeo.cms.ui.workbench.rap.RapWindowAdvisor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.specific;
import java.net.URL;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.rcp;
import org.eclipse.jface.resource.ImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.rcp;
import org.argeo.cms.ui.workbench.rcp.SecureRcp;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.rcp;
import org.argeo.cms.ui.workbench.rcp.SecureWorkbenchAdvisor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.rcp;
import org.argeo.cms.ui.workbench.rcp.SecureWorkbenchWindowAdvisor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.specific;
import java.awt.Desktop;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist;
import org.argeo.slc.client.ui.dist.views.AnonymousDistributionsView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist;
import org.argeo.slc.SlcNames;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist;
import org.eclipse.swt.graphics.Image;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist;
import org.eclipse.jface.resource.ImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist;
import org.argeo.slc.client.ui.dist.views.DistributionsView;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Credentials;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Credentials;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import java.util.Iterator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Credentials;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Repository;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Repository;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Credentials;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Binary;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Credentials;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import org.argeo.slc.client.ui.dist.DistPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Credentials;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import org.argeo.slc.client.ui.dist.views.ArtifactsBrowser;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import org.argeo.slc.client.ui.dist.DistPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Repository;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import org.argeo.slc.client.ui.dist.DistPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.controllers;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.controllers;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.net.URL;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import javax.jcr.RepositoryException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.net.URL;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import org.argeo.jcr.JcrUtils;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.editors;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.utils;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.utils;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.utils;
import java.math.BigDecimal;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.utils;
import java.text.DateFormat;
-/*
- * Argeo Connect - Data management and communications
- * Copyright (C) 2012 Argeo GmbH
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- * Additional permission under GNU GPL version 3 section 7
- *
- * If you modify this Program, or any covered work, by linking or combining it
- * with software covered by the terms of the Eclipse Public License, the
- * licensors of this Program grant you additional permission to convey the
- * resulting work. Corresponding Source for a non-source form of such a
- * combination shall include the source code for the parts of such software
- * which are used as well as that of the covered work.
- */
package org.argeo.slc.client.ui.dist.utils;
import org.eclipse.ui.forms.events.HyperlinkEvent;
/** Must be overriden **/
public abstract void linkActivated(HyperlinkEvent e);
-}
\ No newline at end of file
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import org.argeo.cms.ArgeoNames;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import java.util.HashMap;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import org.argeo.slc.client.ui.dist.DistPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import org.argeo.slc.SlcNames;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.views;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.wizards;
import javax.jcr.RepositoryException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.wizards;
import javax.jcr.security.Privilege;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.wizards;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.wizards;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.dist.wizards;
import java.net.URI;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui;
import org.eclipse.ui.IFolderLayout;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui;
import static org.argeo.slc.client.ui.ClientUiPlugin.getImageDescriptor;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui;
/** SLC UI common constants */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.commands;
import javax.jcr.Node;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.client.ui.commands;\r
-\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.Map;\r
-\r
-import javax.jcr.Node;\r
-import javax.jcr.RepositoryException;\r
-import javax.jcr.Session;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.client.ui.ClientUiPlugin;\r
-import org.argeo.slc.client.ui.model.ResultFolder;\r
-import org.argeo.slc.client.ui.model.ResultParent;\r
-import org.argeo.slc.client.ui.model.ResultParentUtils;\r
-import org.argeo.slc.client.ui.model.SingleResultNode;\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.core.runtime.IProgressMonitor;\r
-import org.eclipse.core.runtime.IStatus;\r
-import org.eclipse.core.runtime.Status;\r
-import org.eclipse.core.runtime.jobs.Job;\r
-import org.eclipse.jface.dialogs.MessageDialog;\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-\r
-/** Deletes one or many results */\r
-public class DeleteItems extends AbstractHandler {\r
- public final static String ID = ClientUiPlugin.ID + ".deleteItems";\r
- public final static ImageDescriptor DEFAULT_IMG_DESCRIPTOR = ClientUiPlugin\r
- .getImageDescriptor("icons/removeAll.png");\r
- public final static String DEFAULT_LABEL = "Delete selected item(s)";\r
-\r
- public Object execute(final ExecutionEvent event) throws ExecutionException {\r
- final ISelection selection = HandlerUtil\r
- .getActiveWorkbenchWindow(event).getActivePage().getSelection();\r
-\r
- // confirmation\r
- StringBuilder buf = new StringBuilder("");\r
- Iterator<?> lst = ((IStructuredSelection) selection).iterator();\r
- while (lst.hasNext()) {\r
- Object obj = lst.next();\r
- if (obj instanceof ResultParent) {\r
- ResultParent rp = ((ResultParent) obj);\r
- buf.append(rp.getName()).append(", ");\r
- }\r
- }\r
-\r
- String msg = "Nothing to delete";\r
- // remove last separator\r
- if (buf.lastIndexOf(", ") > -1) {\r
- msg = "Do you want to delete following objects (and their children): "\r
- + buf.substring(0, buf.lastIndexOf(", ")) + "?";\r
- }\r
- Boolean ok = MessageDialog.openConfirm(\r
- HandlerUtil.getActiveShell(event), "Confirm deletion", msg);\r
-\r
- if (!ok)\r
- return null;\r
-\r
- Job job = new Job("Delete results") {\r
- @Override\r
- protected IStatus run(IProgressMonitor monitor) {\r
- if (selection != null\r
- && selection instanceof IStructuredSelection) {\r
- Map<String, Node> nodes = new HashMap<String, Node>();\r
- Iterator<?> it = ((IStructuredSelection) selection)\r
- .iterator();\r
- Object obj = null;\r
- try {\r
-\r
- while (it.hasNext()) {\r
- obj = it.next();\r
- if (obj instanceof ResultFolder) {\r
- Node node = ((ResultFolder) obj).getNode();\r
- nodes.put(node.getPath(), node);\r
- } else if (obj instanceof SingleResultNode) {\r
- Node node = ((SingleResultNode) obj).getNode();\r
- nodes.put(node.getPath(), node);\r
- }\r
- }\r
- if (!nodes.isEmpty()) {\r
- Session session = null;\r
- monitor.beginTask("Delete results", nodes.size());\r
- for (String path : nodes.keySet()) {\r
- if (session == null)\r
- session = nodes.get(path).getSession();\r
-\r
- // check if the item has not already been\r
- // deleted while deleting one of its ancestor\r
- if (session.itemExists(path)) {\r
- Node parent = nodes.get(path).getParent();\r
- nodes.get(path).remove();\r
- ResultParentUtils.updatePassedStatus(\r
- parent, true);\r
- }\r
- monitor.worked(1);\r
- }\r
- session.save();\r
- }\r
-\r
- } catch (RepositoryException e) {\r
- throw new SlcException(\r
- "Unexpected error while deleteting node(s)", e);\r
- }\r
- monitor.done();\r
- }\r
- return Status.OK_STATUS;\r
- }\r
-\r
- };\r
- job.setUser(true);\r
- job.schedule();\r
- return null;\r
- }\r
-}
\ No newline at end of file
+package org.argeo.slc.client.ui.commands;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.client.ui.ClientUiPlugin;
+import org.argeo.slc.client.ui.model.ResultFolder;
+import org.argeo.slc.client.ui.model.ResultParent;
+import org.argeo.slc.client.ui.model.ResultParentUtils;
+import org.argeo.slc.client.ui.model.SingleResultNode;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Deletes one or many results */
+public class DeleteItems extends AbstractHandler {
+ public final static String ID = ClientUiPlugin.ID + ".deleteItems";
+ public final static ImageDescriptor DEFAULT_IMG_DESCRIPTOR = ClientUiPlugin
+ .getImageDescriptor("icons/removeAll.png");
+ public final static String DEFAULT_LABEL = "Delete selected item(s)";
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final ISelection selection = HandlerUtil
+ .getActiveWorkbenchWindow(event).getActivePage().getSelection();
+
+ // confirmation
+ StringBuilder buf = new StringBuilder("");
+ Iterator<?> lst = ((IStructuredSelection) selection).iterator();
+ while (lst.hasNext()) {
+ Object obj = lst.next();
+ if (obj instanceof ResultParent) {
+ ResultParent rp = ((ResultParent) obj);
+ buf.append(rp.getName()).append(", ");
+ }
+ }
+
+ String msg = "Nothing to delete";
+ // remove last separator
+ if (buf.lastIndexOf(", ") > -1) {
+ msg = "Do you want to delete following objects (and their children): "
+ + buf.substring(0, buf.lastIndexOf(", ")) + "?";
+ }
+ Boolean ok = MessageDialog.openConfirm(
+ HandlerUtil.getActiveShell(event), "Confirm deletion", msg);
+
+ if (!ok)
+ return null;
+
+ Job job = new Job("Delete results") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (selection != null
+ && selection instanceof IStructuredSelection) {
+ Map<String, Node> nodes = new HashMap<String, Node>();
+ Iterator<?> it = ((IStructuredSelection) selection)
+ .iterator();
+ Object obj = null;
+ try {
+
+ while (it.hasNext()) {
+ obj = it.next();
+ if (obj instanceof ResultFolder) {
+ Node node = ((ResultFolder) obj).getNode();
+ nodes.put(node.getPath(), node);
+ } else if (obj instanceof SingleResultNode) {
+ Node node = ((SingleResultNode) obj).getNode();
+ nodes.put(node.getPath(), node);
+ }
+ }
+ if (!nodes.isEmpty()) {
+ Session session = null;
+ monitor.beginTask("Delete results", nodes.size());
+ for (String path : nodes.keySet()) {
+ if (session == null)
+ session = nodes.get(path).getSession();
+
+ // check if the item has not already been
+ // deleted while deleting one of its ancestor
+ if (session.itemExists(path)) {
+ Node parent = nodes.get(path).getParent();
+ nodes.get(path).remove();
+ ResultParentUtils.updatePassedStatus(
+ parent, true);
+ }
+ monitor.worked(1);
+ }
+ session.save();
+ }
+
+ } catch (RepositoryException e) {
+ throw new SlcException(
+ "Unexpected error while deleteting node(s)", e);
+ }
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.setUser(true);
+ job.schedule();
+ return null;
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.client.ui.commands;\r
-\r
-import java.util.Iterator;\r
-\r
-import org.argeo.slc.client.ui.ClientUiPlugin;\r
-import org.argeo.slc.client.ui.model.ResultParent;\r
-import org.argeo.slc.client.ui.views.JcrResultTreeView;\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-\r
-/**\r
- * Force refresh the ResultTreeView. This command is only intended to be called\r
- * by either the toolbar menu of the view or by the popup menu. Refresh due to\r
- * data changes must be triggered by Observers\r
- */\r
-public class RefreshJcrResultTreeView extends AbstractHandler {\r
- public final static String ID = ClientUiPlugin.ID\r
- + ".refreshJcrResultTreeView";\r
- public final static String PARAM_REFRESH_TYPE = ClientUiPlugin.ID\r
- + ".param.refreshType";\r
- public final static String PARAM_REFRESH_TYPE_FULL = "fullRefresh";\r
- public final static ImageDescriptor DEFAULT_IMG_DESCRIPTOR = ClientUiPlugin\r
- .getImageDescriptor("icons/refresh.png");\r
- public final static String DEFAULT_LABEL = "Refresh selected";\r
-\r
- public Object execute(final ExecutionEvent event) throws ExecutionException {\r
- String refreshType = event.getParameter(PARAM_REFRESH_TYPE);\r
- JcrResultTreeView view = (JcrResultTreeView) HandlerUtil\r
- .getActiveWorkbenchWindow(event).getActivePage()\r
- .getActivePart();\r
-\r
- // force full refresh without preserving selection from the tool bar\r
- if (PARAM_REFRESH_TYPE_FULL.equals(refreshType))\r
- view.refresh(null);\r
- else {\r
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
- .getActiveWorkbenchWindow(event).getActivePage()\r
- .getSelection();\r
- @SuppressWarnings("rawtypes")\r
- Iterator it = selection.iterator();\r
- while (it.hasNext()) {\r
- Object obj = it.next();\r
- if (obj instanceof ResultParent) {\r
- view.refresh((ResultParent) obj);\r
- }\r
- }\r
- }\r
- return null;\r
- }\r
-}\r
+package org.argeo.slc.client.ui.commands;
+
+import java.util.Iterator;
+
+import org.argeo.slc.client.ui.ClientUiPlugin;
+import org.argeo.slc.client.ui.model.ResultParent;
+import org.argeo.slc.client.ui.views.JcrResultTreeView;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Force refresh the ResultTreeView. This command is only intended to be called
+ * by either the toolbar menu of the view or by the popup menu. Refresh due to
+ * data changes must be triggered by Observers
+ */
+public class RefreshJcrResultTreeView extends AbstractHandler {
+ public final static String ID = ClientUiPlugin.ID
+ + ".refreshJcrResultTreeView";
+ public final static String PARAM_REFRESH_TYPE = ClientUiPlugin.ID
+ + ".param.refreshType";
+ public final static String PARAM_REFRESH_TYPE_FULL = "fullRefresh";
+ public final static ImageDescriptor DEFAULT_IMG_DESCRIPTOR = ClientUiPlugin
+ .getImageDescriptor("icons/refresh.png");
+ public final static String DEFAULT_LABEL = "Refresh selected";
+
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ String refreshType = event.getParameter(PARAM_REFRESH_TYPE);
+ JcrResultTreeView view = (JcrResultTreeView) HandlerUtil
+ .getActiveWorkbenchWindow(event).getActivePage()
+ .getActivePart();
+
+ // force full refresh without preserving selection from the tool bar
+ if (PARAM_REFRESH_TYPE_FULL.equals(refreshType))
+ view.refresh(null);
+ else {
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil
+ .getActiveWorkbenchWindow(event).getActivePage()
+ .getSelection();
+ @SuppressWarnings("rawtypes")
+ Iterator it = selection.iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof ResultParent) {
+ view.refresh((ResultParent) obj);
+ }
+ }
+ }
+ return null;
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.commands;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.commands;
import java.util.HashMap;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.client.ui.commands;\r
-\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.Map;\r
-\r
-import javax.jcr.Node;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.BasicNameVersion;\r
-import org.argeo.slc.NameVersion;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.SlcNames;\r
-import org.argeo.slc.SlcTypes;\r
-import org.argeo.slc.deploy.ModulesManager;\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.core.runtime.IProgressMonitor;\r
-import org.eclipse.core.runtime.IStatus;\r
-import org.eclipse.core.runtime.Status;\r
-import org.eclipse.core.runtime.jobs.Job;\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-\r
-/** Deletes one or many results */\r
-public class UpdateModule extends AbstractHandler {\r
- private final static Log log = LogFactory.getLog(UpdateModule.class);\r
-\r
- private ModulesManager modulesManager;\r
-\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- final ISelection selection = HandlerUtil\r
- .getActiveWorkbenchWindow(event).getActivePage().getSelection();\r
- if (selection != null && selection instanceof IStructuredSelection) {\r
- UpdateJob job = new UpdateJob(selection);\r
- job.setUser(true);\r
- job.schedule();\r
- }\r
- return null;\r
- }\r
-\r
- private class UpdateJob extends Job {\r
- private final IStructuredSelection selection;\r
-\r
- public UpdateJob(ISelection selection) {\r
- super("Update modules");\r
- this.selection = ((IStructuredSelection) selection);\r
- }\r
-\r
- @Override\r
- protected IStatus run(IProgressMonitor monitor) {\r
- Iterator<?> it = selection.iterator();\r
- Object obj = null;\r
- try {\r
- Map<String, Node> nodes = new HashMap<String, Node>();\r
- nodes: while (it.hasNext()) {\r
- obj = it.next();\r
- if (obj instanceof Node) {\r
- Node node = (Node) obj;\r
- Node executionModuleNode = null;\r
- while (executionModuleNode == null) {\r
- if (node.isNodeType(SlcTypes.SLC_EXECUTION_MODULE)) {\r
- executionModuleNode = node;\r
- }\r
- node = node.getParent();\r
- if (node.getPath().equals("/"))// root\r
- continue nodes;\r
- }\r
-\r
- if (!nodes.containsKey(executionModuleNode.getPath()))\r
- nodes.put(executionModuleNode.getPath(),\r
- executionModuleNode);\r
- }\r
- }\r
-\r
- monitor.beginTask("Update modules", nodes.size());\r
- for (Node executionModuleNode : nodes.values()) {\r
- monitor.subTask("Update " + executionModuleNode.getName());\r
- NameVersion nameVersion = new BasicNameVersion(\r
- executionModuleNode.getProperty(SlcNames.SLC_NAME)\r
- .getString(), executionModuleNode\r
- .getProperty(SlcNames.SLC_VERSION)\r
- .getString());\r
- modulesManager.upgrade(nameVersion);\r
- monitor.worked(1);\r
- log.info("Module " + nameVersion + " updated");\r
- if (monitor.isCanceled())\r
- return Status.CANCEL_STATUS;\r
- }\r
- return Status.OK_STATUS;\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot update module " + obj, e);\r
- // return Status.CANCEL_STATUS;\r
- }\r
- }\r
-\r
- @Override\r
- protected void canceling() {\r
- getThread().interrupt();\r
- super.canceling();\r
- }\r
-\r
- }\r
-\r
- public void setModulesManager(ModulesManager modulesManager) {\r
- this.modulesManager = modulesManager;\r
- }\r
-\r
-}\r
+package org.argeo.slc.client.ui.commands;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.jcr.Node;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.NameVersion;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.SlcNames;
+import org.argeo.slc.SlcTypes;
+import org.argeo.slc.deploy.ModulesManager;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Deletes one or many results */
+public class UpdateModule extends AbstractHandler {
+ private final static Log log = LogFactory.getLog(UpdateModule.class);
+
+ private ModulesManager modulesManager;
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final ISelection selection = HandlerUtil
+ .getActiveWorkbenchWindow(event).getActivePage().getSelection();
+ if (selection != null && selection instanceof IStructuredSelection) {
+ UpdateJob job = new UpdateJob(selection);
+ job.setUser(true);
+ job.schedule();
+ }
+ return null;
+ }
+
+ private class UpdateJob extends Job {
+ private final IStructuredSelection selection;
+
+ public UpdateJob(ISelection selection) {
+ super("Update modules");
+ this.selection = ((IStructuredSelection) selection);
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ Iterator<?> it = selection.iterator();
+ Object obj = null;
+ try {
+ Map<String, Node> nodes = new HashMap<String, Node>();
+ nodes: while (it.hasNext()) {
+ obj = it.next();
+ if (obj instanceof Node) {
+ Node node = (Node) obj;
+ Node executionModuleNode = null;
+ while (executionModuleNode == null) {
+ if (node.isNodeType(SlcTypes.SLC_EXECUTION_MODULE)) {
+ executionModuleNode = node;
+ }
+ node = node.getParent();
+ if (node.getPath().equals("/"))// root
+ continue nodes;
+ }
+
+ if (!nodes.containsKey(executionModuleNode.getPath()))
+ nodes.put(executionModuleNode.getPath(),
+ executionModuleNode);
+ }
+ }
+
+ monitor.beginTask("Update modules", nodes.size());
+ for (Node executionModuleNode : nodes.values()) {
+ monitor.subTask("Update " + executionModuleNode.getName());
+ NameVersion nameVersion = new BasicNameVersion(
+ executionModuleNode.getProperty(SlcNames.SLC_NAME)
+ .getString(), executionModuleNode
+ .getProperty(SlcNames.SLC_VERSION)
+ .getString());
+ modulesManager.upgrade(nameVersion);
+ monitor.worked(1);
+ log.info("Module " + nameVersion + " updated");
+ if (monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ }
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ throw new SlcException("Cannot update module " + obj, e);
+ // return Status.CANCEL_STATUS;
+ }
+ }
+
+ @Override
+ protected void canceling() {
+ getThread().interrupt();
+ super.canceling();
+ }
+
+ }
+
+ public void setModulesManager(ModulesManager modulesManager) {
+ this.modulesManager = modulesManager;
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.controllers;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.decorators;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.editors;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.editors;
import java.util.HashMap;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.editors;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.editors;
import org.argeo.slc.client.ui.ClientUiPlugin;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.editors;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.model;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.model;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.model;
import org.argeo.eclipse.ui.TreeParent;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.model;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.model;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.model;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.providers;
import org.argeo.eclipse.ui.TreeParent;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.providers;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.views;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.views;
import java.text.DateFormat;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.views;
import java.text.DateFormat;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.client.ui.views;\r
-\r
-import java.text.DateFormat;\r
-import java.text.SimpleDateFormat;\r
-import java.util.ArrayList;\r
-import java.util.Calendar;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import javax.jcr.Node;\r
-import javax.jcr.NodeIterator;\r
-import javax.jcr.Property;\r
-import javax.jcr.Repository;\r
-import javax.jcr.RepositoryException;\r
-import javax.jcr.Session;\r
-import javax.jcr.nodetype.NodeType;\r
-import javax.jcr.observation.Event;\r
-import javax.jcr.observation.EventListener;\r
-import javax.jcr.observation.ObservationManager;\r
-\r
-import org.argeo.api.NodeConstants;\r
-import org.argeo.cms.ui.workbench.util.CommandUtils;\r
-import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;\r
-import org.argeo.jcr.JcrUtils;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.SlcNames;\r
-import org.argeo.slc.SlcTypes;\r
-import org.argeo.slc.client.ui.ClientUiPlugin;\r
-import org.argeo.slc.client.ui.SlcUiConstants;\r
-import org.argeo.slc.client.ui.commands.AddResultFolder;\r
-import org.argeo.slc.client.ui.commands.DeleteItems;\r
-import org.argeo.slc.client.ui.commands.RefreshJcrResultTreeView;\r
-import org.argeo.slc.client.ui.commands.RenameResultFolder;\r
-import org.argeo.slc.client.ui.commands.RenameResultNode;\r
-import org.argeo.slc.client.ui.editors.ProcessEditor;\r
-import org.argeo.slc.client.ui.editors.ProcessEditorInput;\r
-import org.argeo.slc.client.ui.model.ParentNodeFolder;\r
-import org.argeo.slc.client.ui.model.ResultFolder;\r
-import org.argeo.slc.client.ui.model.ResultItemsComparator;\r
-import org.argeo.slc.client.ui.model.ResultItemsComparer;\r
-import org.argeo.slc.client.ui.model.ResultParent;\r
-import org.argeo.slc.client.ui.model.ResultParentUtils;\r
-import org.argeo.slc.client.ui.model.SingleResultNode;\r
-import org.argeo.slc.client.ui.model.VirtualFolder;\r
-import org.argeo.slc.client.ui.providers.ResultTreeContentProvider;\r
-import org.argeo.slc.client.ui.providers.ResultTreeLabelProvider;\r
-import org.argeo.slc.jcr.SlcJcrResultUtils;\r
-import org.eclipse.jface.action.IMenuListener;\r
-import org.eclipse.jface.action.IMenuManager;\r
-import org.eclipse.jface.action.MenuManager;\r
-import org.eclipse.jface.dialogs.MessageDialog;\r
-import org.eclipse.jface.viewers.ColumnLabelProvider;\r
-import org.eclipse.jface.viewers.DecoratingLabelProvider;\r
-import org.eclipse.jface.viewers.DoubleClickEvent;\r
-import org.eclipse.jface.viewers.IDoubleClickListener;\r
-import org.eclipse.jface.viewers.ILabelDecorator;\r
-import org.eclipse.jface.viewers.ISelectionChangedListener;\r
-import org.eclipse.jface.viewers.IStructuredContentProvider;\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.jface.viewers.SelectionChangedEvent;\r
-import org.eclipse.jface.viewers.TableViewer;\r
-import org.eclipse.jface.viewers.TableViewerColumn;\r
-import org.eclipse.jface.viewers.TreePath;\r
-import org.eclipse.jface.viewers.TreeViewer;\r
-import org.eclipse.jface.viewers.Viewer;\r
-import org.eclipse.jface.viewers.ViewerDropAdapter;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.custom.SashForm;\r
-import org.eclipse.swt.dnd.DND;\r
-import org.eclipse.swt.dnd.DragSourceEvent;\r
-import org.eclipse.swt.dnd.DragSourceListener;\r
-import org.eclipse.swt.dnd.TextTransfer;\r
-import org.eclipse.swt.dnd.Transfer;\r
-import org.eclipse.swt.dnd.TransferData;\r
-import org.eclipse.swt.layout.FillLayout;\r
-import org.eclipse.swt.layout.GridData;\r
-import org.eclipse.swt.layout.GridLayout;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Display;\r
-import org.eclipse.swt.widgets.Menu;\r
-import org.eclipse.ui.ISharedImages;\r
-import org.eclipse.ui.IWorkbenchPage;\r
-import org.eclipse.ui.IWorkbenchWindow;\r
-import org.eclipse.ui.PlatformUI;\r
-import org.eclipse.ui.part.ViewPart;\r
-\r
-/** SLC generic JCR Result tree view. */\r
-public class JcrResultTreeView extends ViewPart {\r
- public final static String ID = ClientUiPlugin.ID + ".jcrResultTreeView";\r
-\r
- private final static DateFormat dateFormat = new SimpleDateFormat(\r
- SlcUiConstants.DEFAULT_DISPLAY_DATE_TIME_FORMAT);\r
-\r
- // private final static Log log =\r
- // LogFactory.getLog(JcrResultTreeView.class);\r
-\r
- /* DEPENDENCY INJECTION */\r
- private Repository repository;\r
- private Session session;\r
-\r
- // This page widgets\r
- private TreeViewer resultTreeViewer;\r
- private TableViewer propertiesViewer;\r
-\r
- private EventListener myResultsObserver = null;\r
- private EventListener allResultsObserver = null;\r
-\r
- // under My Results\r
- private final static String[] observedNodeTypesUnderMyResult = {\r
- SlcTypes.SLC_TEST_RESULT, SlcTypes.SLC_RESULT_FOLDER,\r
- SlcTypes.SLC_MY_RESULT_ROOT_FOLDER };\r
-\r
- private final static String[] observedNodeTypesUnderAllResults = {\r
- SlcTypes.SLC_TEST_RESULT, NodeType.NT_UNSTRUCTURED };\r
-\r
- private boolean isResultFolder = false;\r
-\r
- /**\r
- * To be overridden to adapt size of form and result frames.\r
- */\r
- protected int[] getWeights() {\r
- return new int[] { 70, 30 };\r
- }\r
-\r
- @Override\r
- public void createPartControl(Composite parent) {\r
- try {\r
- session = repository.login(NodeConstants.HOME_WORKSPACE);\r
- } catch (RepositoryException e1) {\r
- throw new SlcException("Cannot log in to repository");\r
- }\r
-\r
- parent.setLayout(new FillLayout());\r
- // Main layout\r
- SashForm sashForm = new SashForm(parent, SWT.VERTICAL);\r
- sashForm.setSashWidth(4);\r
- sashForm.setLayout(new FillLayout());\r
-\r
- // Create the tree on top of the view\r
- Composite top = new Composite(sashForm, SWT.NONE);\r
- GridLayout gl = new GridLayout(1, false);\r
- top.setLayout(gl);\r
- resultTreeViewer = createResultsTreeViewer(top);\r
-\r
- // Create the property viewer on the bottom\r
- Composite bottom = new Composite(sashForm, SWT.NONE);\r
- bottom.setLayout(new GridLayout(1, false));\r
- propertiesViewer = createPropertiesViewer(bottom);\r
-\r
- sashForm.setWeights(getWeights());\r
-\r
- setOrderedInput(resultTreeViewer);\r
-\r
- // Initialize observer\r
- try {\r
- ObservationManager observationManager = session.getWorkspace()\r
- .getObservationManager();\r
- myResultsObserver = new MyResultsObserver(resultTreeViewer\r
- .getTree().getDisplay());\r
- allResultsObserver = new AllResultsObserver(resultTreeViewer\r
- .getTree().getDisplay());\r
-\r
- // observe tree changes under MyResults\r
- observationManager.addEventListener(myResultsObserver,\r
- Event.NODE_ADDED | Event.NODE_REMOVED,\r
- SlcJcrResultUtils.getMyResultsBasePath(session), true,\r
- null, observedNodeTypesUnderMyResult, false);\r
- // observe tree changes under All results\r
- observationManager.addEventListener(allResultsObserver,\r
- Event.NODE_ADDED | Event.NODE_REMOVED,\r
- SlcJcrResultUtils.getSlcResultsBasePath(session), true,\r
- null, observedNodeTypesUnderAllResults, false);\r
- } catch (RepositoryException e) {\r
- throw new SlcException("Cannot register listeners", e);\r
- }\r
- }\r
-\r
- /**\r
- * Override default behaviour so that default defined order remains\r
- * unchanged on first level of the tree\r
- */\r
- private void setOrderedInput(TreeViewer viewer) {\r
- // Add specific ordering\r
- viewer.setInput(null);\r
- viewer.setComparator(null);\r
- viewer.setInput(initializeResultTree());\r
- viewer.setComparator(new ResultItemsComparator());\r
- }\r
-\r
- // The main tree viewer\r
- protected TreeViewer createResultsTreeViewer(Composite parent) {\r
- int style = SWT.BORDER | SWT.MULTI;\r
-\r
- TreeViewer viewer = new TreeViewer(parent, style);\r
- viewer.getTree().setLayoutData(\r
- new GridData(SWT.FILL, SWT.FILL, true, true));\r
-\r
- viewer.setContentProvider(new ResultTreeContentProvider());\r
-\r
- // Add label provider with label decorator\r
- ResultTreeLabelProvider rtLblProvider = new ResultTreeLabelProvider();\r
- ILabelDecorator decorator = ClientUiPlugin.getDefault().getWorkbench()\r
- .getDecoratorManager().getLabelDecorator();\r
- viewer.setLabelProvider(new DecoratingLabelProvider(rtLblProvider,\r
- decorator));\r
- viewer.addDoubleClickListener(new ViewDoubleClickListener());\r
-\r
- // Override default behaviour to insure that 2 distincts results that\r
- // have the same name will be correctly and distincly returned by\r
- // corresponding TreeViewer.getSelection() method.\r
- viewer.setComparer(new ResultItemsComparer());\r
-\r
- // viewer.setLabelProvider(rtLblProvider);\r
- getSite().setSelectionProvider(viewer);\r
-\r
- // add drag & drop support\r
- int operations = DND.DROP_COPY | DND.DROP_MOVE;\r
- Transfer[] tt = new Transfer[] { TextTransfer.getInstance() };\r
- viewer.addDragSupport(operations, tt, new ViewDragListener());\r
- viewer.addDropSupport(operations, tt, new ViewDropListener(viewer));\r
-\r
- // add context menu\r
- MenuManager menuManager = new MenuManager();\r
- Menu menu = menuManager.createContextMenu(viewer.getTree());\r
- menuManager.addMenuListener(new IMenuListener() {\r
- public void menuAboutToShow(IMenuManager manager) {\r
- contextMenuAboutToShow(manager);\r
- }\r
- });\r
- viewer.getTree().setMenu(menu);\r
- menuManager.setRemoveAllWhenShown(true);\r
-\r
- getSite().registerContextMenu(menuManager, viewer);\r
-\r
- // add change listener to display TestResult information in the property\r
- // viewer\r
- viewer.addSelectionChangedListener(new MySelectionChangedListener());\r
- return viewer;\r
- }\r
-\r
- // Detailed property viewer\r
- protected TableViewer createPropertiesViewer(Composite parent) {\r
- propertiesViewer = new TableViewer(parent);\r
- propertiesViewer.getTable().setLayoutData(\r
- new GridData(SWT.FILL, SWT.FILL, true, true));\r
- propertiesViewer.getTable().setHeaderVisible(true);\r
- propertiesViewer.setContentProvider(new PropertiesContentProvider());\r
- TableViewerColumn col = new TableViewerColumn(propertiesViewer,\r
- SWT.NONE);\r
- col.getColumn().setText("Name");\r
- col.getColumn().setWidth(100);\r
- col.setLabelProvider(new ColumnLabelProvider() {\r
- public String getText(Object element) {\r
- try {\r
- String name = ((Property) element).getName();\r
- String value = null;\r
- if (SlcNames.SLC_TEST_CASE.equals(name))\r
- value = "Test case";\r
- else if (SlcNames.SLC_COMPLETED.equals(name))\r
- value = "Completed on";\r
- else if (SlcNames.SLC_SUCCESS.equals(name))\r
- value = "Status";\r
- else if (SlcNames.SLC_MESSAGE.equals(name))\r
- value = "Message";\r
- else if (SlcNames.SLC_ERROR_MESSAGE.equals(name))\r
- value = "Error";\r
- return value;\r
- } catch (RepositoryException e) {\r
- throw new SlcException(\r
- "Unexpected exception in label provider", e);\r
- }\r
- }\r
- });\r
- col = new TableViewerColumn(propertiesViewer, SWT.NONE);\r
- col.getColumn().setText("Value");\r
- col.getColumn().setWidth(200);\r
- col.setLabelProvider(new ColumnLabelProvider() {\r
- public String getText(Object element) {\r
- try {\r
- Property property = (Property) element;\r
- String name = property.getName();\r
- String value = null;\r
-\r
- if (SlcNames.SLC_TEST_CASE.equals(name)\r
- || SlcNames.SLC_ERROR_MESSAGE.equals(name)\r
- || SlcNames.SLC_MESSAGE.equals(name))\r
- value = property.getValue().getString();\r
- else if (SlcNames.SLC_COMPLETED.equals(name)) {\r
- Calendar date = property.getValue().getDate();\r
- value = dateFormat.format(date.getTime());\r
- } else if (SlcNames.SLC_SUCCESS.equals(name)) {\r
- if (property.getValue().getBoolean())\r
- value = "PASSED";\r
- else {\r
- if (property.getParent().hasProperty(\r
- SlcNames.SLC_ERROR_MESSAGE))\r
- value = "ERROR";\r
- else\r
- value = "FAILED";\r
- }\r
- }\r
- return value;\r
- } catch (RepositoryException e) {\r
- throw new SlcException(\r
- "Unexpected exception in label provider", e);\r
- }\r
- }\r
- });\r
- propertiesViewer.setInput(getViewSite());\r
- return propertiesViewer;\r
- }\r
-\r
- /**\r
- * Override to provide specific behaviour. Typically to enable the display\r
- * of a result file.\r
- * \r
- * @param evt\r
- */\r
- protected void processDoubleClick(DoubleClickEvent evt) {\r
- Object obj = ((IStructuredSelection) evt.getSelection())\r
- .getFirstElement();\r
- try {\r
- if (obj instanceof SingleResultNode) {\r
- SingleResultNode srNode = (SingleResultNode) obj;\r
- Node node = srNode.getNode();\r
- // FIXME: open a default result editor\r
- if (node.isNodeType(SlcTypes.SLC_PROCESS)) {\r
- IWorkbenchPage activePage = PlatformUI.getWorkbench()\r
- .getActiveWorkbenchWindow().getActivePage();\r
- activePage.openEditor(\r
- new ProcessEditorInput(node.getPath()),\r
- ProcessEditor.ID);\r
- }\r
- }\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot open " + obj, e);\r
- }\r
- }\r
-\r
- @Override\r
- public void setFocus() {\r
- }\r
-\r
- /**\r
- * refreshes the passed resultParent and its corresponding subtree. It\r
- * refreshes the whole viewer if null is passed.\r
- * \r
- * @param ResultParent\r
- * \r
- */\r
- public void refresh(ResultParent resultParent) {\r
- if (resultParent == null) {\r
- if (!resultTreeViewer.getTree().isDisposed()) {\r
- TreePath[] tps = resultTreeViewer.getExpandedTreePaths();\r
- setOrderedInput(resultTreeViewer);\r
- resultTreeViewer.setExpandedTreePaths(tps);\r
- } else\r
- setOrderedInput(resultTreeViewer);\r
- } else {\r
- if (resultParent instanceof ParentNodeFolder) {\r
- ParentNodeFolder currFolder = (ParentNodeFolder) resultParent;\r
- jcrRefresh(currFolder.getNode());\r
- currFolder.forceFullRefresh();\r
- }\r
- // FIXME: specific refresh does not work\r
- // resultTreeViewer.refresh(resultParent, true);\r
- refresh(null);\r
- }\r
- }\r
-\r
- /**\r
- * refreshes the passed node and its corresponding subtree.\r
- * \r
- * @param node\r
- * cannot be null\r
- * \r
- */\r
- public boolean jcrRefresh(Node node) {\r
- // if (log.isDebugEnabled())\r
- // log.debug(" JCR refreshing " + node + "...");\r
- // Thread.dumpStack();\r
- boolean isPassed = true;\r
- try {\r
- if (node.isNodeType(SlcTypes.SLC_TEST_RESULT)) {\r
- isPassed = node.getNode(SlcNames.SLC_AGGREGATED_STATUS)\r
- .getProperty(SlcNames.SLC_SUCCESS).getBoolean();\r
- } else if (node.isNodeType(SlcTypes.SLC_RESULT_FOLDER)) {\r
- NodeIterator ni = node.getNodes();\r
- while (ni.hasNext()) {\r
- Node currChild = ni.nextNode();\r
- isPassed = isPassed & jcrRefresh(currChild);\r
- }\r
- if (isPassed != node.getNode(SlcNames.SLC_AGGREGATED_STATUS)\r
- .getProperty(SlcNames.SLC_SUCCESS).getBoolean()) {\r
- node.getNode(SlcNames.SLC_AGGREGATED_STATUS).setProperty(\r
- SlcNames.SLC_SUCCESS, isPassed);\r
- node.getSession().save();\r
- return isPassed;\r
- }\r
- } else\r
- ; // do nothing\r
- } catch (RepositoryException e) {\r
- throw new SlcException("Cannot register listeners", e);\r
- }\r
- return isPassed;\r
- }\r
-\r
- private ResultParent[] initializeResultTree() {\r
- try {\r
- // Force initialization of the tree structure if needed\r
- SlcJcrResultUtils.getSlcResultsParentNode(session);\r
- SlcJcrResultUtils.getMyResultParentNode(session);\r
- // Remove yesterday and last 7 days virtual folders\r
- // ResultParent[] roots = new ResultParent[5];\r
- ResultParent[] roots = new ResultParent[3];\r
-\r
- // My results\r
- roots[0] = new ParentNodeFolder(null,\r
- SlcJcrResultUtils.getMyResultParentNode(session),\r
- SlcUiConstants.DEFAULT_MY_RESULTS_FOLDER_LABEL);\r
-\r
- // today\r
- Calendar cal = Calendar.getInstance();\r
- String relPath = JcrUtils.dateAsPath(cal);\r
- List<String> datePathes = new ArrayList<String>();\r
- datePathes.add(relPath);\r
- roots[1] = new VirtualFolder(null,\r
- ResultParentUtils.getResultsForDates(session, datePathes),\r
- "Today");\r
-\r
- // // Yesterday\r
- // cal = Calendar.getInstance();\r
- // cal.add(Calendar.DAY_OF_YEAR, -1);\r
- // relPath = JcrUtils.dateAsPath(cal);\r
- // datePathes = new ArrayList<String>();\r
- // datePathes.add(relPath);\r
- // roots[2] = new VirtualFolder(null,\r
- // ResultParentUtils.getResultsForDates(session, datePathes),\r
- // "Yesterday");\r
- // // Last 7 days\r
- //\r
- // cal = Calendar.getInstance();\r
- // datePathes = new ArrayList<String>();\r
- //\r
- // for (int i = 0; i < 7; i++) {\r
- // cal.add(Calendar.DAY_OF_YEAR, -i);\r
- // relPath = JcrUtils.dateAsPath(cal);\r
- // datePathes.add(relPath);\r
- // }\r
- // roots[3] = new VirtualFolder(null,\r
- // ResultParentUtils.getResultsForDates(session, datePathes),\r
- // "Last 7 days");\r
-\r
- // All results\r
- Node otherResultsPar = session.getNode(SlcJcrResultUtils\r
- .getSlcResultsBasePath(session));\r
- // roots[4] = new ParentNodeFolder(null, otherResultsPar,\r
- // "All results");\r
- roots[2] = new ParentNodeFolder(null, otherResultsPar,\r
- "All results");\r
- return roots;\r
- } catch (RepositoryException re) {\r
- throw new SlcException(\r
- "Unexpected error while initializing ResultTree.", re);\r
- }\r
- }\r
-\r
- // Manage context menu\r
- /**\r
- * Defines the commands that will pop up in the context menu.\r
- **/\r
- protected void contextMenuAboutToShow(IMenuManager menuManager) {\r
- IWorkbenchWindow window = ClientUiPlugin.getDefault().getWorkbench()\r
- .getActiveWorkbenchWindow();\r
-\r
- IStructuredSelection selection = (IStructuredSelection) resultTreeViewer\r
- .getSelection();\r
- boolean canAddSubfolder = false;\r
- boolean canRenamefolder = false;\r
- boolean isSingleResultNode = false;\r
- boolean isUnderMyResult = false;\r
- boolean validMultipleDelete = false;\r
- try {\r
-\r
- // Building conditions\r
- if (selection.size() == 1) {\r
- Object obj = selection.getFirstElement();\r
- if (obj instanceof SingleResultNode)\r
- isSingleResultNode = true;\r
- else if (obj instanceof ParentNodeFolder) {\r
- Node cNode = ((ParentNodeFolder) obj).getNode();\r
- if (cNode.isNodeType(SlcTypes.SLC_RESULT_FOLDER)) {\r
- canAddSubfolder = true;\r
- canRenamefolder = true;\r
- isUnderMyResult = true;\r
- } else if (cNode\r
- .isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER)) {\r
- canAddSubfolder = true;\r
- }\r
- }\r
- } else {\r
- @SuppressWarnings("rawtypes")\r
- Iterator it = selection.iterator();\r
- multicheck: while (it.hasNext()) {\r
- validMultipleDelete = true;\r
- Object obj = it.next();\r
- if (obj instanceof SingleResultNode)\r
- continue multicheck;\r
- else if (obj instanceof ParentNodeFolder) {\r
- Node cNode = ((ParentNodeFolder) obj).getNode();\r
- if (cNode.isNodeType(SlcTypes.SLC_RESULT_FOLDER))\r
- continue multicheck;\r
- else {\r
- validMultipleDelete = false;\r
- break multicheck;\r
- }\r
- } else {\r
- validMultipleDelete = false;\r
- break multicheck;\r
- }\r
- }\r
- }\r
- } catch (RepositoryException re) {\r
- throw new SlcException(\r
- "unexpected error while building condition for context menu",\r
- re);\r
- }\r
-\r
- // Effective Refresh\r
- CommandUtils.refreshCommand(menuManager, window,\r
- RefreshJcrResultTreeView.ID,\r
- RefreshJcrResultTreeView.DEFAULT_LABEL,\r
- RefreshJcrResultTreeView.DEFAULT_IMG_DESCRIPTOR, true);\r
-\r
- CommandUtils.refreshCommand(menuManager, window, DeleteItems.ID,\r
- DeleteItems.DEFAULT_LABEL, DeleteItems.DEFAULT_IMG_DESCRIPTOR,\r
- isUnderMyResult || isSingleResultNode || validMultipleDelete);\r
-\r
- CommandUtils.refreshCommand(menuManager, window, AddResultFolder.ID,\r
- AddResultFolder.DEFAULT_LABEL,\r
- ClientUiPlugin.getDefault().getWorkbench().getSharedImages()\r
- .getImageDescriptor(ISharedImages.IMG_OBJ_ADD),\r
- canAddSubfolder);\r
-\r
- CommandUtils.refreshCommand(menuManager, window, RenameResultFolder.ID,\r
- RenameResultFolder.DEFAULT_LABEL,\r
- RenameResultFolder.DEFAULT_IMG_DESCRIPTOR, canRenamefolder);\r
-\r
- // Command removed for the time being.\r
- CommandUtils.refreshCommand(menuManager, window, RenameResultNode.ID,\r
- RenameResultNode.DEFAULT_LABEL,\r
- RenameResultNode.DEFAULT_IMG_DESCRIPTOR, false);\r
-\r
- // Test to be removed\r
- // If you use this pattern, do not forget to call\r
- // menuManager.setRemoveAllWhenShown(true);\r
- // when creating the menuManager\r
-\r
- // menuManager.add(new Action("Test") {\r
- // public void run() {\r
- // log.debug("do something");\r
- // }\r
- // });\r
- }\r
-\r
- /* INNER CLASSES */\r
- class ViewDragListener implements DragSourceListener {\r
-\r
- public void dragStart(DragSourceEvent event) {\r
- // Check if the drag action should start.\r
- IStructuredSelection selection = (IStructuredSelection) resultTreeViewer\r
- .getSelection();\r
- boolean doIt = false;\r
-\r
- // FIXME clean this code.\r
- try {\r
- if (selection.size() == 1) {\r
- Object obj = selection.getFirstElement();\r
- if (obj instanceof ResultFolder) {\r
- Node tNode = ((ResultFolder) obj).getNode();\r
- if (tNode.getPrimaryNodeType().isNodeType(\r
- SlcTypes.SLC_RESULT_FOLDER)) {\r
- doIt = true;\r
- isResultFolder = true;\r
- }\r
- } else\r
- isResultFolder = false;\r
- } else\r
- isResultFolder = false;\r
-\r
- if (!isResultFolder) {\r
- @SuppressWarnings("rawtypes")\r
- Iterator it = selection.iterator();\r
- while (it.hasNext()) {\r
- Object obj = it.next();\r
- if (obj instanceof SingleResultNode) {\r
- Node tNode = ((SingleResultNode) obj).getNode();\r
- if (tNode.getPrimaryNodeType().isNodeType(\r
- SlcTypes.SLC_TEST_RESULT)) {\r
- doIt = true;\r
- }\r
- }\r
- }\r
- }\r
-\r
- } catch (RepositoryException re) {\r
- throw new SlcException(\r
- "unexpected error while validating drag source", re);\r
- }\r
- event.doit = doIt;\r
- }\r
-\r
- public void dragSetData(DragSourceEvent event) {\r
- IStructuredSelection selection = (IStructuredSelection) resultTreeViewer\r
- .getSelection();\r
-\r
- try {\r
- // specific case of a result folder\r
- if (isResultFolder) {\r
- Object obj = selection.getFirstElement();\r
- event.data = ((ResultFolder) obj).getNode().getIdentifier();\r
- } else {\r
- @SuppressWarnings("rawtypes")\r
- Iterator it = selection.iterator();\r
- StringBuilder nodes = new StringBuilder();\r
- while (it.hasNext()) {\r
- Object obj = it.next();\r
- if (obj instanceof SingleResultNode) {\r
- Node tNode = ((SingleResultNode) obj).getNode();\r
- if (tNode.getPrimaryNodeType().isNodeType(\r
- SlcTypes.SLC_TEST_RESULT)) {\r
- nodes.append(tNode.getIdentifier()).append(";");\r
- }\r
- }\r
- }\r
- event.data = nodes.toString();\r
- }\r
- } catch (RepositoryException re) {\r
- throw new SlcException("unexpected error while setting data",\r
- re);\r
- }\r
- }\r
-\r
- public void dragFinished(DragSourceEvent event) {\r
- // refresh is done via observer\r
- }\r
- }\r
-\r
- // Implementation of the Drop Listener\r
- protected class ViewDropListener extends ViewerDropAdapter {\r
- private Node targetParentNode = null;\r
-\r
- public ViewDropListener(Viewer viewer) {\r
- super(viewer);\r
- }\r
-\r
- @Override\r
- public boolean validateDrop(Object target, int operation,\r
- TransferData transferType) {\r
- boolean validDrop = false;\r
- try {\r
- // We can only drop under myResults\r
- Node tpNode = null;\r
- if (target instanceof SingleResultNode) {\r
- Node currNode = ((SingleResultNode) target).getNode();\r
- String pPath = currNode.getParent().getPath();\r
- if (pPath.startsWith(SlcJcrResultUtils\r
- .getMyResultsBasePath(session)))\r
- tpNode = currNode.getParent();\r
- } else if (target instanceof ResultFolder) {\r
- tpNode = ((ResultFolder) target).getNode();\r
- } else if (target instanceof ParentNodeFolder) {\r
- Node node = ((ParentNodeFolder) target).getNode();\r
- if (node.isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER))\r
- tpNode = ((ParentNodeFolder) target).getNode();\r
- }\r
-\r
- if (tpNode != null) {\r
- targetParentNode = tpNode;\r
- validDrop = true;\r
- }\r
- } catch (RepositoryException re) {\r
- throw new SlcException(\r
- "unexpected error while validating drop target", re);\r
- }\r
- return validDrop;\r
- }\r
-\r
- @Override\r
- public boolean performDrop(Object data) {\r
- // clear selection to prevent unwanted scrolling of the UI\r
- resultTreeViewer.setSelection(null);\r
- try {\r
- if (isResultFolder) {\r
- // Sanity check : we cannot move a folder to one of its sub\r
- // folder or neither move an object in the same parent\r
- // folder\r
- Node source = session.getNodeByIdentifier((String) data);\r
- if (targetParentNode.getPath().startsWith(source.getPath())\r
- || source.getParent().getPath()\r
- .equals(targetParentNode.getPath()))\r
- return false;\r
-\r
- // Move\r
- String sourcePath = source.getPath();\r
- String destPath = targetParentNode.getPath() + "/"\r
- + source.getName();\r
- session.move(sourcePath, destPath);\r
- // Update passed status of the parent source Node\r
- ResultParentUtils.updatePassedStatus(\r
- session.getNode(JcrUtils.parentPath(sourcePath)),\r
- true);\r
- // Node target = session.getNode(destPath);\r
- session.save();\r
- return true;\r
- }\r
-\r
- String[] datas = ((String) data).split(";");\r
- nodesToCopy: for (String id : datas) {\r
-\r
- Node source = session.getNodeByIdentifier(id);\r
- String name;\r
- if (source.hasProperty(Property.JCR_TITLE))\r
- name = source.getProperty(Property.JCR_TITLE)\r
- .getString();\r
- else if (source.hasProperty(SlcNames.SLC_TEST_CASE))\r
- name = source.getProperty(SlcNames.SLC_TEST_CASE)\r
- .getString();\r
- else\r
- name = source.getName();\r
-\r
- // Check if another copy of the same test instance already\r
- // exists at target\r
- NodeIterator ni = targetParentNode.getNodes();\r
- String slcUid = source.getProperty(SlcNames.SLC_UUID)\r
- .getString();\r
- while (ni.hasNext()) {\r
- Node curr = ni.nextNode();\r
- if (curr.hasProperty(SlcNames.SLC_UUID)\r
- && slcUid.equals(curr.getProperty(\r
- SlcNames.SLC_UUID).getString())) {\r
- MessageDialog\r
- .openWarning(\r
- PlatformUI.getWorkbench()\r
- .getDisplay()\r
- .getActiveShell(),\r
- "Duplicated instance.",\r
- "An instance of the same test case ("\r
- + name\r
- + ") exists at destination.\n "\r
- + "This item will not be neither copied nor moved.");\r
- continue nodesToCopy;\r
-\r
- }\r
- }\r
-\r
- Node target;\r
- boolean passedStatus = false;\r
- if (source.hasNode(SlcNames.SLC_AGGREGATED_STATUS))\r
- passedStatus = source\r
- .getNode(SlcNames.SLC_AGGREGATED_STATUS)\r
- .getProperty(SlcNames.SLC_SUCCESS).getBoolean();\r
-\r
- boolean isActionUnderMyResult = source.getPath()\r
- .startsWith(\r
- SlcJcrResultUtils\r
- .getMyResultsBasePath(session));\r
-\r
- if (!isActionUnderMyResult) {// Copy\r
- target = targetParentNode.addNode(source.getName(),\r
- source.getPrimaryNodeType().getName());\r
- JcrUtils.copy(source, target);\r
- } else {// move\r
- String sourcePath = source.getPath();\r
- String destPath = targetParentNode.getPath() + "/"\r
- + name;\r
- session.move(sourcePath, destPath);\r
- // Update passed status of the parent source Node\r
- ResultParentUtils\r
- .updatePassedStatus(session.getNode(JcrUtils\r
- .parentPath(sourcePath)), true);\r
- target = session.getNode(destPath);\r
-\r
- }\r
- if (!target.isNodeType(NodeType.MIX_TITLE))\r
- target.addMixin(NodeType.MIX_TITLE);\r
- target.setProperty(Property.JCR_TITLE, name);\r
- ResultParentUtils.updatePassedStatus(target.getParent(),\r
- passedStatus);\r
- session.save();\r
- }\r
- } catch (RepositoryException re) {\r
- throw new SlcException(\r
- "unexpected error while copying dropped node", re);\r
-\r
- }\r
- return true;\r
- }\r
- }\r
-\r
- class MyResultsObserver extends AsyncUiEventListener {\r
-\r
- public MyResultsObserver(Display display) {\r
- super(display);\r
- }\r
-\r
- @Override\r
- protected Boolean willProcessInUiThread(List<Event> events)\r
- throws RepositoryException {\r
- // unfiltered for the time being\r
- return true;\r
- }\r
-\r
- protected void onEventInUiThread(List<Event> events)\r
- throws RepositoryException {\r
- List<Node> nodesToRefresh = new ArrayList<Node>();\r
-\r
- for (Event event : events) {\r
- String parPath = JcrUtils.parentPath(event.getPath());\r
- if (session.nodeExists(parPath)) {\r
- Node node = session.getNode(parPath);\r
- if (!nodesToRefresh.contains(node)) {\r
- nodesToRefresh.add(node);\r
- }\r
- }\r
- }\r
-\r
- // Update check nodes\r
- for (Node node : nodesToRefresh)\r
- jcrRefresh(node);\r
- refresh(null);\r
- }\r
- }\r
-\r
- class AllResultsObserver extends AsyncUiEventListener {\r
-\r
- public AllResultsObserver(Display display) {\r
- super(display);\r
- }\r
-\r
- @Override\r
- protected Boolean willProcessInUiThread(List<Event> events)\r
- throws RepositoryException {\r
- // unfiltered for the time being\r
- return true;\r
- }\r
-\r
- protected void onEventInUiThread(List<Event> events)\r
- throws RepositoryException {\r
- refresh(null);\r
- // if (lastSelectedSourceElementParent != null)\r
- // refresh(lastSelectedSourceElementParent);\r
- }\r
- }\r
-\r
- class PropertiesContentProvider implements IStructuredContentProvider {\r
-\r
- public void dispose() {\r
- }\r
-\r
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {\r
- }\r
-\r
- public Object[] getElements(Object inputElement) {\r
- try {\r
- if (inputElement instanceof Node) {\r
- Node node = (Node) inputElement;\r
- if (node.isNodeType(SlcTypes.SLC_TEST_RESULT)) {\r
- List<Property> props = new ArrayList<Property>();\r
- if (node.hasProperty(SlcNames.SLC_TEST_CASE))\r
- props.add(node.getProperty(SlcNames.SLC_TEST_CASE));\r
- if (node.hasProperty(SlcNames.SLC_COMPLETED))\r
- props.add(node.getProperty(SlcNames.SLC_COMPLETED));\r
- if (node.hasNode(SlcNames.SLC_AGGREGATED_STATUS)) {\r
- Node status = node\r
- .getNode(SlcNames.SLC_AGGREGATED_STATUS);\r
- props.add(status.getProperty(SlcNames.SLC_SUCCESS));\r
- if (status.hasProperty(SlcNames.SLC_MESSAGE))\r
- props.add(status\r
- .getProperty(SlcNames.SLC_MESSAGE));\r
- if (status.hasProperty(SlcNames.SLC_ERROR_MESSAGE))\r
- props.add(status\r
- .getProperty(SlcNames.SLC_ERROR_MESSAGE));\r
- }\r
- return props.toArray();\r
- }\r
- }\r
- return new Object[] {};\r
-\r
- } catch (RepositoryException e) {\r
- throw new SlcException("Cannot get element for "\r
- + inputElement, e);\r
- }\r
- }\r
- }\r
-\r
- class MySelectionChangedListener implements ISelectionChangedListener {\r
-\r
- public void selectionChanged(SelectionChangedEvent event) {\r
- if (!event.getSelection().isEmpty()) {\r
- IStructuredSelection sel = (IStructuredSelection) event\r
- .getSelection();\r
- ResultParent firstItem = (ResultParent) sel.getFirstElement();\r
- if (firstItem instanceof SingleResultNode)\r
- propertiesViewer.setInput(((SingleResultNode) firstItem)\r
- .getNode());\r
- else\r
- propertiesViewer.setInput(null);\r
- // update cache for Drag & drop\r
- // lastSelectedTargetElement = firstItem;\r
- // lastSelectedSourceElement = firstItem;\r
- // lastSelectedSourceElementParent = (ResultParent) firstItem\r
- // .getParent();\r
- // String pPath = "";\r
- // try {\r
- //\r
- // if (firstItem instanceof ParentNodeFolder)\r
- // pPath = ((ParentNodeFolder) firstItem).getNode()\r
- // .getPath();\r
- // else if (firstItem instanceof SingleResultNode)\r
- // pPath = ((SingleResultNode) firstItem).getNode()\r
- // .getPath();\r
- // } catch (RepositoryException e) {\r
- // throw new SlcException(\r
- // "Unexpected error while checking parent UI tree", e);\r
- // }\r
- // if ((pPath.startsWith(SlcJcrResultUtils\r
- // .getMyResultsBasePath(session))))\r
- // isActionUnderMyResult = true;\r
- // else\r
- // isActionUnderMyResult = false;\r
- }\r
- }\r
- }\r
-\r
- class ViewDoubleClickListener implements IDoubleClickListener {\r
- public void doubleClick(DoubleClickEvent evt) {\r
- processDoubleClick(evt);\r
- }\r
-\r
- }\r
-\r
- /* DEPENDENCY INJECTION */\r
- public void dispose() {\r
- // JcrUtils.unregisterQuietly(session.getWorkspace(), resultsObserver);\r
- JcrUtils.logoutQuietly(session);\r
- super.dispose();\r
- }\r
-\r
- public void setRepository(Repository repository) {\r
- this.repository = repository;\r
- }\r
-}
\ No newline at end of file
+package org.argeo.slc.client.ui.views;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Property;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventListener;
+import javax.jcr.observation.ObservationManager;
+
+import org.argeo.api.NodeConstants;
+import org.argeo.cms.ui.workbench.util.CommandUtils;
+import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.SlcNames;
+import org.argeo.slc.SlcTypes;
+import org.argeo.slc.client.ui.ClientUiPlugin;
+import org.argeo.slc.client.ui.SlcUiConstants;
+import org.argeo.slc.client.ui.commands.AddResultFolder;
+import org.argeo.slc.client.ui.commands.DeleteItems;
+import org.argeo.slc.client.ui.commands.RefreshJcrResultTreeView;
+import org.argeo.slc.client.ui.commands.RenameResultFolder;
+import org.argeo.slc.client.ui.commands.RenameResultNode;
+import org.argeo.slc.client.ui.editors.ProcessEditor;
+import org.argeo.slc.client.ui.editors.ProcessEditorInput;
+import org.argeo.slc.client.ui.model.ParentNodeFolder;
+import org.argeo.slc.client.ui.model.ResultFolder;
+import org.argeo.slc.client.ui.model.ResultItemsComparator;
+import org.argeo.slc.client.ui.model.ResultItemsComparer;
+import org.argeo.slc.client.ui.model.ResultParent;
+import org.argeo.slc.client.ui.model.ResultParentUtils;
+import org.argeo.slc.client.ui.model.SingleResultNode;
+import org.argeo.slc.client.ui.model.VirtualFolder;
+import org.argeo.slc.client.ui.providers.ResultTreeContentProvider;
+import org.argeo.slc.client.ui.providers.ResultTreeLabelProvider;
+import org.argeo.slc.jcr.SlcJcrResultUtils;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerDropAdapter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+/** SLC generic JCR Result tree view. */
+public class JcrResultTreeView extends ViewPart {
+ public final static String ID = ClientUiPlugin.ID + ".jcrResultTreeView";
+
+ private final static DateFormat dateFormat = new SimpleDateFormat(
+ SlcUiConstants.DEFAULT_DISPLAY_DATE_TIME_FORMAT);
+
+ // private final static Log log =
+ // LogFactory.getLog(JcrResultTreeView.class);
+
+ /* DEPENDENCY INJECTION */
+ private Repository repository;
+ private Session session;
+
+ // This page widgets
+ private TreeViewer resultTreeViewer;
+ private TableViewer propertiesViewer;
+
+ private EventListener myResultsObserver = null;
+ private EventListener allResultsObserver = null;
+
+ // under My Results
+ private final static String[] observedNodeTypesUnderMyResult = {
+ SlcTypes.SLC_TEST_RESULT, SlcTypes.SLC_RESULT_FOLDER,
+ SlcTypes.SLC_MY_RESULT_ROOT_FOLDER };
+
+ private final static String[] observedNodeTypesUnderAllResults = {
+ SlcTypes.SLC_TEST_RESULT, NodeType.NT_UNSTRUCTURED };
+
+ private boolean isResultFolder = false;
+
+ /**
+ * To be overridden to adapt size of form and result frames.
+ */
+ protected int[] getWeights() {
+ return new int[] { 70, 30 };
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ try {
+ session = repository.login(NodeConstants.HOME_WORKSPACE);
+ } catch (RepositoryException e1) {
+ throw new SlcException("Cannot log in to repository");
+ }
+
+ parent.setLayout(new FillLayout());
+ // Main layout
+ SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
+ sashForm.setSashWidth(4);
+ sashForm.setLayout(new FillLayout());
+
+ // Create the tree on top of the view
+ Composite top = new Composite(sashForm, SWT.NONE);
+ GridLayout gl = new GridLayout(1, false);
+ top.setLayout(gl);
+ resultTreeViewer = createResultsTreeViewer(top);
+
+ // Create the property viewer on the bottom
+ Composite bottom = new Composite(sashForm, SWT.NONE);
+ bottom.setLayout(new GridLayout(1, false));
+ propertiesViewer = createPropertiesViewer(bottom);
+
+ sashForm.setWeights(getWeights());
+
+ setOrderedInput(resultTreeViewer);
+
+ // Initialize observer
+ try {
+ ObservationManager observationManager = session.getWorkspace()
+ .getObservationManager();
+ myResultsObserver = new MyResultsObserver(resultTreeViewer
+ .getTree().getDisplay());
+ allResultsObserver = new AllResultsObserver(resultTreeViewer
+ .getTree().getDisplay());
+
+ // observe tree changes under MyResults
+ observationManager.addEventListener(myResultsObserver,
+ Event.NODE_ADDED | Event.NODE_REMOVED,
+ SlcJcrResultUtils.getMyResultsBasePath(session), true,
+ null, observedNodeTypesUnderMyResult, false);
+ // observe tree changes under All results
+ observationManager.addEventListener(allResultsObserver,
+ Event.NODE_ADDED | Event.NODE_REMOVED,
+ SlcJcrResultUtils.getSlcResultsBasePath(session), true,
+ null, observedNodeTypesUnderAllResults, false);
+ } catch (RepositoryException e) {
+ throw new SlcException("Cannot register listeners", e);
+ }
+ }
+
+ /**
+ * Override default behaviour so that default defined order remains
+ * unchanged on first level of the tree
+ */
+ private void setOrderedInput(TreeViewer viewer) {
+ // Add specific ordering
+ viewer.setInput(null);
+ viewer.setComparator(null);
+ viewer.setInput(initializeResultTree());
+ viewer.setComparator(new ResultItemsComparator());
+ }
+
+ // The main tree viewer
+ protected TreeViewer createResultsTreeViewer(Composite parent) {
+ int style = SWT.BORDER | SWT.MULTI;
+
+ TreeViewer viewer = new TreeViewer(parent, style);
+ viewer.getTree().setLayoutData(
+ new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ viewer.setContentProvider(new ResultTreeContentProvider());
+
+ // Add label provider with label decorator
+ ResultTreeLabelProvider rtLblProvider = new ResultTreeLabelProvider();
+ ILabelDecorator decorator = ClientUiPlugin.getDefault().getWorkbench()
+ .getDecoratorManager().getLabelDecorator();
+ viewer.setLabelProvider(new DecoratingLabelProvider(rtLblProvider,
+ decorator));
+ viewer.addDoubleClickListener(new ViewDoubleClickListener());
+
+ // Override default behaviour to insure that 2 distincts results that
+ // have the same name will be correctly and distincly returned by
+ // corresponding TreeViewer.getSelection() method.
+ viewer.setComparer(new ResultItemsComparer());
+
+ // viewer.setLabelProvider(rtLblProvider);
+ getSite().setSelectionProvider(viewer);
+
+ // add drag & drop support
+ int operations = DND.DROP_COPY | DND.DROP_MOVE;
+ Transfer[] tt = new Transfer[] { TextTransfer.getInstance() };
+ viewer.addDragSupport(operations, tt, new ViewDragListener());
+ viewer.addDropSupport(operations, tt, new ViewDropListener(viewer));
+
+ // add context menu
+ MenuManager menuManager = new MenuManager();
+ Menu menu = menuManager.createContextMenu(viewer.getTree());
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ contextMenuAboutToShow(manager);
+ }
+ });
+ viewer.getTree().setMenu(menu);
+ menuManager.setRemoveAllWhenShown(true);
+
+ getSite().registerContextMenu(menuManager, viewer);
+
+ // add change listener to display TestResult information in the property
+ // viewer
+ viewer.addSelectionChangedListener(new MySelectionChangedListener());
+ return viewer;
+ }
+
+ // Detailed property viewer
+ protected TableViewer createPropertiesViewer(Composite parent) {
+ propertiesViewer = new TableViewer(parent);
+ propertiesViewer.getTable().setLayoutData(
+ new GridData(SWT.FILL, SWT.FILL, true, true));
+ propertiesViewer.getTable().setHeaderVisible(true);
+ propertiesViewer.setContentProvider(new PropertiesContentProvider());
+ TableViewerColumn col = new TableViewerColumn(propertiesViewer,
+ SWT.NONE);
+ col.getColumn().setText("Name");
+ col.getColumn().setWidth(100);
+ col.setLabelProvider(new ColumnLabelProvider() {
+ public String getText(Object element) {
+ try {
+ String name = ((Property) element).getName();
+ String value = null;
+ if (SlcNames.SLC_TEST_CASE.equals(name))
+ value = "Test case";
+ else if (SlcNames.SLC_COMPLETED.equals(name))
+ value = "Completed on";
+ else if (SlcNames.SLC_SUCCESS.equals(name))
+ value = "Status";
+ else if (SlcNames.SLC_MESSAGE.equals(name))
+ value = "Message";
+ else if (SlcNames.SLC_ERROR_MESSAGE.equals(name))
+ value = "Error";
+ return value;
+ } catch (RepositoryException e) {
+ throw new SlcException(
+ "Unexpected exception in label provider", e);
+ }
+ }
+ });
+ col = new TableViewerColumn(propertiesViewer, SWT.NONE);
+ col.getColumn().setText("Value");
+ col.getColumn().setWidth(200);
+ col.setLabelProvider(new ColumnLabelProvider() {
+ public String getText(Object element) {
+ try {
+ Property property = (Property) element;
+ String name = property.getName();
+ String value = null;
+
+ if (SlcNames.SLC_TEST_CASE.equals(name)
+ || SlcNames.SLC_ERROR_MESSAGE.equals(name)
+ || SlcNames.SLC_MESSAGE.equals(name))
+ value = property.getValue().getString();
+ else if (SlcNames.SLC_COMPLETED.equals(name)) {
+ Calendar date = property.getValue().getDate();
+ value = dateFormat.format(date.getTime());
+ } else if (SlcNames.SLC_SUCCESS.equals(name)) {
+ if (property.getValue().getBoolean())
+ value = "PASSED";
+ else {
+ if (property.getParent().hasProperty(
+ SlcNames.SLC_ERROR_MESSAGE))
+ value = "ERROR";
+ else
+ value = "FAILED";
+ }
+ }
+ return value;
+ } catch (RepositoryException e) {
+ throw new SlcException(
+ "Unexpected exception in label provider", e);
+ }
+ }
+ });
+ propertiesViewer.setInput(getViewSite());
+ return propertiesViewer;
+ }
+
+ /**
+ * Override to provide specific behaviour. Typically to enable the display
+ * of a result file.
+ *
+ * @param evt
+ */
+ protected void processDoubleClick(DoubleClickEvent evt) {
+ Object obj = ((IStructuredSelection) evt.getSelection())
+ .getFirstElement();
+ try {
+ if (obj instanceof SingleResultNode) {
+ SingleResultNode srNode = (SingleResultNode) obj;
+ Node node = srNode.getNode();
+ // FIXME: open a default result editor
+ if (node.isNodeType(SlcTypes.SLC_PROCESS)) {
+ IWorkbenchPage activePage = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ activePage.openEditor(
+ new ProcessEditorInput(node.getPath()),
+ ProcessEditor.ID);
+ }
+ }
+ } catch (Exception e) {
+ throw new SlcException("Cannot open " + obj, e);
+ }
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+ /**
+ * refreshes the passed resultParent and its corresponding subtree. It
+ * refreshes the whole viewer if null is passed.
+ *
+ * @param ResultParent
+ *
+ */
+ public void refresh(ResultParent resultParent) {
+ if (resultParent == null) {
+ if (!resultTreeViewer.getTree().isDisposed()) {
+ TreePath[] tps = resultTreeViewer.getExpandedTreePaths();
+ setOrderedInput(resultTreeViewer);
+ resultTreeViewer.setExpandedTreePaths(tps);
+ } else
+ setOrderedInput(resultTreeViewer);
+ } else {
+ if (resultParent instanceof ParentNodeFolder) {
+ ParentNodeFolder currFolder = (ParentNodeFolder) resultParent;
+ jcrRefresh(currFolder.getNode());
+ currFolder.forceFullRefresh();
+ }
+ // FIXME: specific refresh does not work
+ // resultTreeViewer.refresh(resultParent, true);
+ refresh(null);
+ }
+ }
+
+ /**
+ * refreshes the passed node and its corresponding subtree.
+ *
+ * @param node
+ * cannot be null
+ *
+ */
+ public boolean jcrRefresh(Node node) {
+ // if (log.isDebugEnabled())
+ // log.debug(" JCR refreshing " + node + "...");
+ // Thread.dumpStack();
+ boolean isPassed = true;
+ try {
+ if (node.isNodeType(SlcTypes.SLC_TEST_RESULT)) {
+ isPassed = node.getNode(SlcNames.SLC_AGGREGATED_STATUS)
+ .getProperty(SlcNames.SLC_SUCCESS).getBoolean();
+ } else if (node.isNodeType(SlcTypes.SLC_RESULT_FOLDER)) {
+ NodeIterator ni = node.getNodes();
+ while (ni.hasNext()) {
+ Node currChild = ni.nextNode();
+ isPassed = isPassed & jcrRefresh(currChild);
+ }
+ if (isPassed != node.getNode(SlcNames.SLC_AGGREGATED_STATUS)
+ .getProperty(SlcNames.SLC_SUCCESS).getBoolean()) {
+ node.getNode(SlcNames.SLC_AGGREGATED_STATUS).setProperty(
+ SlcNames.SLC_SUCCESS, isPassed);
+ node.getSession().save();
+ return isPassed;
+ }
+ } else
+ ; // do nothing
+ } catch (RepositoryException e) {
+ throw new SlcException("Cannot register listeners", e);
+ }
+ return isPassed;
+ }
+
+ private ResultParent[] initializeResultTree() {
+ try {
+ // Force initialization of the tree structure if needed
+ SlcJcrResultUtils.getSlcResultsParentNode(session);
+ SlcJcrResultUtils.getMyResultParentNode(session);
+ // Remove yesterday and last 7 days virtual folders
+ // ResultParent[] roots = new ResultParent[5];
+ ResultParent[] roots = new ResultParent[3];
+
+ // My results
+ roots[0] = new ParentNodeFolder(null,
+ SlcJcrResultUtils.getMyResultParentNode(session),
+ SlcUiConstants.DEFAULT_MY_RESULTS_FOLDER_LABEL);
+
+ // today
+ Calendar cal = Calendar.getInstance();
+ String relPath = JcrUtils.dateAsPath(cal);
+ List<String> datePathes = new ArrayList<String>();
+ datePathes.add(relPath);
+ roots[1] = new VirtualFolder(null,
+ ResultParentUtils.getResultsForDates(session, datePathes),
+ "Today");
+
+ // // Yesterday
+ // cal = Calendar.getInstance();
+ // cal.add(Calendar.DAY_OF_YEAR, -1);
+ // relPath = JcrUtils.dateAsPath(cal);
+ // datePathes = new ArrayList<String>();
+ // datePathes.add(relPath);
+ // roots[2] = new VirtualFolder(null,
+ // ResultParentUtils.getResultsForDates(session, datePathes),
+ // "Yesterday");
+ // // Last 7 days
+ //
+ // cal = Calendar.getInstance();
+ // datePathes = new ArrayList<String>();
+ //
+ // for (int i = 0; i < 7; i++) {
+ // cal.add(Calendar.DAY_OF_YEAR, -i);
+ // relPath = JcrUtils.dateAsPath(cal);
+ // datePathes.add(relPath);
+ // }
+ // roots[3] = new VirtualFolder(null,
+ // ResultParentUtils.getResultsForDates(session, datePathes),
+ // "Last 7 days");
+
+ // All results
+ Node otherResultsPar = session.getNode(SlcJcrResultUtils
+ .getSlcResultsBasePath(session));
+ // roots[4] = new ParentNodeFolder(null, otherResultsPar,
+ // "All results");
+ roots[2] = new ParentNodeFolder(null, otherResultsPar,
+ "All results");
+ return roots;
+ } catch (RepositoryException re) {
+ throw new SlcException(
+ "Unexpected error while initializing ResultTree.", re);
+ }
+ }
+
+ // Manage context menu
+ /**
+ * Defines the commands that will pop up in the context menu.
+ **/
+ protected void contextMenuAboutToShow(IMenuManager menuManager) {
+ IWorkbenchWindow window = ClientUiPlugin.getDefault().getWorkbench()
+ .getActiveWorkbenchWindow();
+
+ IStructuredSelection selection = (IStructuredSelection) resultTreeViewer
+ .getSelection();
+ boolean canAddSubfolder = false;
+ boolean canRenamefolder = false;
+ boolean isSingleResultNode = false;
+ boolean isUnderMyResult = false;
+ boolean validMultipleDelete = false;
+ try {
+
+ // Building conditions
+ if (selection.size() == 1) {
+ Object obj = selection.getFirstElement();
+ if (obj instanceof SingleResultNode)
+ isSingleResultNode = true;
+ else if (obj instanceof ParentNodeFolder) {
+ Node cNode = ((ParentNodeFolder) obj).getNode();
+ if (cNode.isNodeType(SlcTypes.SLC_RESULT_FOLDER)) {
+ canAddSubfolder = true;
+ canRenamefolder = true;
+ isUnderMyResult = true;
+ } else if (cNode
+ .isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER)) {
+ canAddSubfolder = true;
+ }
+ }
+ } else {
+ @SuppressWarnings("rawtypes")
+ Iterator it = selection.iterator();
+ multicheck: while (it.hasNext()) {
+ validMultipleDelete = true;
+ Object obj = it.next();
+ if (obj instanceof SingleResultNode)
+ continue multicheck;
+ else if (obj instanceof ParentNodeFolder) {
+ Node cNode = ((ParentNodeFolder) obj).getNode();
+ if (cNode.isNodeType(SlcTypes.SLC_RESULT_FOLDER))
+ continue multicheck;
+ else {
+ validMultipleDelete = false;
+ break multicheck;
+ }
+ } else {
+ validMultipleDelete = false;
+ break multicheck;
+ }
+ }
+ }
+ } catch (RepositoryException re) {
+ throw new SlcException(
+ "unexpected error while building condition for context menu",
+ re);
+ }
+
+ // Effective Refresh
+ CommandUtils.refreshCommand(menuManager, window,
+ RefreshJcrResultTreeView.ID,
+ RefreshJcrResultTreeView.DEFAULT_LABEL,
+ RefreshJcrResultTreeView.DEFAULT_IMG_DESCRIPTOR, true);
+
+ CommandUtils.refreshCommand(menuManager, window, DeleteItems.ID,
+ DeleteItems.DEFAULT_LABEL, DeleteItems.DEFAULT_IMG_DESCRIPTOR,
+ isUnderMyResult || isSingleResultNode || validMultipleDelete);
+
+ CommandUtils.refreshCommand(menuManager, window, AddResultFolder.ID,
+ AddResultFolder.DEFAULT_LABEL,
+ ClientUiPlugin.getDefault().getWorkbench().getSharedImages()
+ .getImageDescriptor(ISharedImages.IMG_OBJ_ADD),
+ canAddSubfolder);
+
+ CommandUtils.refreshCommand(menuManager, window, RenameResultFolder.ID,
+ RenameResultFolder.DEFAULT_LABEL,
+ RenameResultFolder.DEFAULT_IMG_DESCRIPTOR, canRenamefolder);
+
+ // Command removed for the time being.
+ CommandUtils.refreshCommand(menuManager, window, RenameResultNode.ID,
+ RenameResultNode.DEFAULT_LABEL,
+ RenameResultNode.DEFAULT_IMG_DESCRIPTOR, false);
+
+ // Test to be removed
+ // If you use this pattern, do not forget to call
+ // menuManager.setRemoveAllWhenShown(true);
+ // when creating the menuManager
+
+ // menuManager.add(new Action("Test") {
+ // public void run() {
+ // log.debug("do something");
+ // }
+ // });
+ }
+
+ /* INNER CLASSES */
+ class ViewDragListener implements DragSourceListener {
+
+ public void dragStart(DragSourceEvent event) {
+ // Check if the drag action should start.
+ IStructuredSelection selection = (IStructuredSelection) resultTreeViewer
+ .getSelection();
+ boolean doIt = false;
+
+ // FIXME clean this code.
+ try {
+ if (selection.size() == 1) {
+ Object obj = selection.getFirstElement();
+ if (obj instanceof ResultFolder) {
+ Node tNode = ((ResultFolder) obj).getNode();
+ if (tNode.getPrimaryNodeType().isNodeType(
+ SlcTypes.SLC_RESULT_FOLDER)) {
+ doIt = true;
+ isResultFolder = true;
+ }
+ } else
+ isResultFolder = false;
+ } else
+ isResultFolder = false;
+
+ if (!isResultFolder) {
+ @SuppressWarnings("rawtypes")
+ Iterator it = selection.iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof SingleResultNode) {
+ Node tNode = ((SingleResultNode) obj).getNode();
+ if (tNode.getPrimaryNodeType().isNodeType(
+ SlcTypes.SLC_TEST_RESULT)) {
+ doIt = true;
+ }
+ }
+ }
+ }
+
+ } catch (RepositoryException re) {
+ throw new SlcException(
+ "unexpected error while validating drag source", re);
+ }
+ event.doit = doIt;
+ }
+
+ public void dragSetData(DragSourceEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) resultTreeViewer
+ .getSelection();
+
+ try {
+ // specific case of a result folder
+ if (isResultFolder) {
+ Object obj = selection.getFirstElement();
+ event.data = ((ResultFolder) obj).getNode().getIdentifier();
+ } else {
+ @SuppressWarnings("rawtypes")
+ Iterator it = selection.iterator();
+ StringBuilder nodes = new StringBuilder();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof SingleResultNode) {
+ Node tNode = ((SingleResultNode) obj).getNode();
+ if (tNode.getPrimaryNodeType().isNodeType(
+ SlcTypes.SLC_TEST_RESULT)) {
+ nodes.append(tNode.getIdentifier()).append(";");
+ }
+ }
+ }
+ event.data = nodes.toString();
+ }
+ } catch (RepositoryException re) {
+ throw new SlcException("unexpected error while setting data",
+ re);
+ }
+ }
+
+ public void dragFinished(DragSourceEvent event) {
+ // refresh is done via observer
+ }
+ }
+
+ // Implementation of the Drop Listener
+ protected class ViewDropListener extends ViewerDropAdapter {
+ private Node targetParentNode = null;
+
+ public ViewDropListener(Viewer viewer) {
+ super(viewer);
+ }
+
+ @Override
+ public boolean validateDrop(Object target, int operation,
+ TransferData transferType) {
+ boolean validDrop = false;
+ try {
+ // We can only drop under myResults
+ Node tpNode = null;
+ if (target instanceof SingleResultNode) {
+ Node currNode = ((SingleResultNode) target).getNode();
+ String pPath = currNode.getParent().getPath();
+ if (pPath.startsWith(SlcJcrResultUtils
+ .getMyResultsBasePath(session)))
+ tpNode = currNode.getParent();
+ } else if (target instanceof ResultFolder) {
+ tpNode = ((ResultFolder) target).getNode();
+ } else if (target instanceof ParentNodeFolder) {
+ Node node = ((ParentNodeFolder) target).getNode();
+ if (node.isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER))
+ tpNode = ((ParentNodeFolder) target).getNode();
+ }
+
+ if (tpNode != null) {
+ targetParentNode = tpNode;
+ validDrop = true;
+ }
+ } catch (RepositoryException re) {
+ throw new SlcException(
+ "unexpected error while validating drop target", re);
+ }
+ return validDrop;
+ }
+
+ @Override
+ public boolean performDrop(Object data) {
+ // clear selection to prevent unwanted scrolling of the UI
+ resultTreeViewer.setSelection(null);
+ try {
+ if (isResultFolder) {
+ // Sanity check : we cannot move a folder to one of its sub
+ // folder or neither move an object in the same parent
+ // folder
+ Node source = session.getNodeByIdentifier((String) data);
+ if (targetParentNode.getPath().startsWith(source.getPath())
+ || source.getParent().getPath()
+ .equals(targetParentNode.getPath()))
+ return false;
+
+ // Move
+ String sourcePath = source.getPath();
+ String destPath = targetParentNode.getPath() + "/"
+ + source.getName();
+ session.move(sourcePath, destPath);
+ // Update passed status of the parent source Node
+ ResultParentUtils.updatePassedStatus(
+ session.getNode(JcrUtils.parentPath(sourcePath)),
+ true);
+ // Node target = session.getNode(destPath);
+ session.save();
+ return true;
+ }
+
+ String[] datas = ((String) data).split(";");
+ nodesToCopy: for (String id : datas) {
+
+ Node source = session.getNodeByIdentifier(id);
+ String name;
+ if (source.hasProperty(Property.JCR_TITLE))
+ name = source.getProperty(Property.JCR_TITLE)
+ .getString();
+ else if (source.hasProperty(SlcNames.SLC_TEST_CASE))
+ name = source.getProperty(SlcNames.SLC_TEST_CASE)
+ .getString();
+ else
+ name = source.getName();
+
+ // Check if another copy of the same test instance already
+ // exists at target
+ NodeIterator ni = targetParentNode.getNodes();
+ String slcUid = source.getProperty(SlcNames.SLC_UUID)
+ .getString();
+ while (ni.hasNext()) {
+ Node curr = ni.nextNode();
+ if (curr.hasProperty(SlcNames.SLC_UUID)
+ && slcUid.equals(curr.getProperty(
+ SlcNames.SLC_UUID).getString())) {
+ MessageDialog
+ .openWarning(
+ PlatformUI.getWorkbench()
+ .getDisplay()
+ .getActiveShell(),
+ "Duplicated instance.",
+ "An instance of the same test case ("
+ + name
+ + ") exists at destination.\n "
+ + "This item will not be neither copied nor moved.");
+ continue nodesToCopy;
+
+ }
+ }
+
+ Node target;
+ boolean passedStatus = false;
+ if (source.hasNode(SlcNames.SLC_AGGREGATED_STATUS))
+ passedStatus = source
+ .getNode(SlcNames.SLC_AGGREGATED_STATUS)
+ .getProperty(SlcNames.SLC_SUCCESS).getBoolean();
+
+ boolean isActionUnderMyResult = source.getPath()
+ .startsWith(
+ SlcJcrResultUtils
+ .getMyResultsBasePath(session));
+
+ if (!isActionUnderMyResult) {// Copy
+ target = targetParentNode.addNode(source.getName(),
+ source.getPrimaryNodeType().getName());
+ JcrUtils.copy(source, target);
+ } else {// move
+ String sourcePath = source.getPath();
+ String destPath = targetParentNode.getPath() + "/"
+ + name;
+ session.move(sourcePath, destPath);
+ // Update passed status of the parent source Node
+ ResultParentUtils
+ .updatePassedStatus(session.getNode(JcrUtils
+ .parentPath(sourcePath)), true);
+ target = session.getNode(destPath);
+
+ }
+ if (!target.isNodeType(NodeType.MIX_TITLE))
+ target.addMixin(NodeType.MIX_TITLE);
+ target.setProperty(Property.JCR_TITLE, name);
+ ResultParentUtils.updatePassedStatus(target.getParent(),
+ passedStatus);
+ session.save();
+ }
+ } catch (RepositoryException re) {
+ throw new SlcException(
+ "unexpected error while copying dropped node", re);
+
+ }
+ return true;
+ }
+ }
+
+ class MyResultsObserver extends AsyncUiEventListener {
+
+ public MyResultsObserver(Display display) {
+ super(display);
+ }
+
+ @Override
+ protected Boolean willProcessInUiThread(List<Event> events)
+ throws RepositoryException {
+ // unfiltered for the time being
+ return true;
+ }
+
+ protected void onEventInUiThread(List<Event> events)
+ throws RepositoryException {
+ List<Node> nodesToRefresh = new ArrayList<Node>();
+
+ for (Event event : events) {
+ String parPath = JcrUtils.parentPath(event.getPath());
+ if (session.nodeExists(parPath)) {
+ Node node = session.getNode(parPath);
+ if (!nodesToRefresh.contains(node)) {
+ nodesToRefresh.add(node);
+ }
+ }
+ }
+
+ // Update check nodes
+ for (Node node : nodesToRefresh)
+ jcrRefresh(node);
+ refresh(null);
+ }
+ }
+
+ class AllResultsObserver extends AsyncUiEventListener {
+
+ public AllResultsObserver(Display display) {
+ super(display);
+ }
+
+ @Override
+ protected Boolean willProcessInUiThread(List<Event> events)
+ throws RepositoryException {
+ // unfiltered for the time being
+ return true;
+ }
+
+ protected void onEventInUiThread(List<Event> events)
+ throws RepositoryException {
+ refresh(null);
+ // if (lastSelectedSourceElementParent != null)
+ // refresh(lastSelectedSourceElementParent);
+ }
+ }
+
+ class PropertiesContentProvider implements IStructuredContentProvider {
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public Object[] getElements(Object inputElement) {
+ try {
+ if (inputElement instanceof Node) {
+ Node node = (Node) inputElement;
+ if (node.isNodeType(SlcTypes.SLC_TEST_RESULT)) {
+ List<Property> props = new ArrayList<Property>();
+ if (node.hasProperty(SlcNames.SLC_TEST_CASE))
+ props.add(node.getProperty(SlcNames.SLC_TEST_CASE));
+ if (node.hasProperty(SlcNames.SLC_COMPLETED))
+ props.add(node.getProperty(SlcNames.SLC_COMPLETED));
+ if (node.hasNode(SlcNames.SLC_AGGREGATED_STATUS)) {
+ Node status = node
+ .getNode(SlcNames.SLC_AGGREGATED_STATUS);
+ props.add(status.getProperty(SlcNames.SLC_SUCCESS));
+ if (status.hasProperty(SlcNames.SLC_MESSAGE))
+ props.add(status
+ .getProperty(SlcNames.SLC_MESSAGE));
+ if (status.hasProperty(SlcNames.SLC_ERROR_MESSAGE))
+ props.add(status
+ .getProperty(SlcNames.SLC_ERROR_MESSAGE));
+ }
+ return props.toArray();
+ }
+ }
+ return new Object[] {};
+
+ } catch (RepositoryException e) {
+ throw new SlcException("Cannot get element for "
+ + inputElement, e);
+ }
+ }
+ }
+
+ class MySelectionChangedListener implements ISelectionChangedListener {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (!event.getSelection().isEmpty()) {
+ IStructuredSelection sel = (IStructuredSelection) event
+ .getSelection();
+ ResultParent firstItem = (ResultParent) sel.getFirstElement();
+ if (firstItem instanceof SingleResultNode)
+ propertiesViewer.setInput(((SingleResultNode) firstItem)
+ .getNode());
+ else
+ propertiesViewer.setInput(null);
+ // update cache for Drag & drop
+ // lastSelectedTargetElement = firstItem;
+ // lastSelectedSourceElement = firstItem;
+ // lastSelectedSourceElementParent = (ResultParent) firstItem
+ // .getParent();
+ // String pPath = "";
+ // try {
+ //
+ // if (firstItem instanceof ParentNodeFolder)
+ // pPath = ((ParentNodeFolder) firstItem).getNode()
+ // .getPath();
+ // else if (firstItem instanceof SingleResultNode)
+ // pPath = ((SingleResultNode) firstItem).getNode()
+ // .getPath();
+ // } catch (RepositoryException e) {
+ // throw new SlcException(
+ // "Unexpected error while checking parent UI tree", e);
+ // }
+ // if ((pPath.startsWith(SlcJcrResultUtils
+ // .getMyResultsBasePath(session))))
+ // isActionUnderMyResult = true;
+ // else
+ // isActionUnderMyResult = false;
+ }
+ }
+ }
+
+ class ViewDoubleClickListener implements IDoubleClickListener {
+ public void doubleClick(DoubleClickEvent evt) {
+ processDoubleClick(evt);
+ }
+
+ }
+
+ /* DEPENDENCY INJECTION */
+ public void dispose() {
+ // JcrUtils.unregisterQuietly(session.getWorkspace(), resultsObserver);
+ JcrUtils.logoutQuietly(session);
+ super.dispose();
+ }
+
+ public void setRepository(Repository repository) {
+ this.repository = repository;
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.client.ui.wizards;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.e4;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.e4.parts;
import java.util.Arrays;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.rpmfactory;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.rpmfactory;
import org.argeo.jcr.proxy.ResourceProxy;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.rpmfactory.core;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.rpmfactory.core;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.rpmfactory.core;
import java.util.HashSet;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.rpmfactory.core;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr;
import java.util.HashMap;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr;
import java.util.Date;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr;
import org.argeo.slc.SlcNames;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr;
import java.util.Calendar;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr.execution;
import java.net.InetAddress;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr.execution;
import java.util.Arrays;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jcr.execution;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.cli;
import java.io.File;
package org.argeo.slc.repo.internal;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
import junit.framework.TestCase;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import java.io.ByteArrayInputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import org.argeo.jcr.proxy.ResourceProxy;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import javax.jcr.Node;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import javax.jcr.Binary;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
/** SLC repository constants */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import java.io.InputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo;
import java.io.ByteArrayOutputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.core;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.util.regex.Pattern;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.util.Comparator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.maven;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.osgi;
import java.io.ByteArrayInputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.osgi;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.osgi;
public class ObrWrapper {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.repo.osgi;
import java.io.InputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.util.Map;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.io.UnsupportedEncodingException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.util.HashMap;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.security.AccessControlContext;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime;\r
-\r
-import java.util.Stack;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.execution.ExecutionFlow;\r
-import org.argeo.slc.execution.ExecutionSpecAttribute;\r
-import org.argeo.slc.execution.RefSpecAttribute;\r
-import org.argeo.slc.primitive.PrimitiveSpecAttribute;\r
-import org.argeo.slc.primitive.PrimitiveUtils;\r
-\r
-/** Manage parameters that need to be set during the instantiation of a flow */\r
-public class InstantiationManager {\r
-\r
- private final static Log log = LogFactory\r
- .getLog(InstantiationManager.class);\r
-\r
- private ThreadLocal<Stack<ExecutionFlow>> flowStack = new ThreadLocal<Stack<ExecutionFlow>>();\r
-\r
- public Object createRef(String name) {\r
-\r
- if ((flowStack.get() == null) || flowStack.get().empty()) {\r
- throw new SlcException("No flow is currently initializing."\r
- + " Declare ParameterRef as inner beans or prototypes.");\r
- }\r
-\r
- return getInitializingFlowParameter(name);\r
- }\r
-\r
- public void flowInitializationStarted(ExecutionFlow flow, String flowName) {\r
- // set the flow name if it is DefaultExecutionFlow\r
- if (flow instanceof DefaultExecutionFlow) {\r
- ((DefaultExecutionFlow) flow).setName(flowName);\r
- }\r
-\r
- if (log.isTraceEnabled())\r
- log.trace("Start initialization of " + flow.hashCode() + " ("\r
- + flow + " - " + flow.getClass() + ")");\r
-\r
- // log.info("# flowInitializationStarted " + flowName);\r
- // create a stack for this thread if there is none\r
- if (flowStack.get() == null) {\r
- flowStack.set(new Stack<ExecutionFlow>());\r
- }\r
- flowStack.get().push(flow);\r
- }\r
-\r
- public void flowInitializationFinished(ExecutionFlow flow, String flowName) {\r
- if (log.isTraceEnabled())\r
- log.trace("Finish initialization of " + flow.hashCode() + " ("\r
- + flow + " - " + flow.getClass() + ")");\r
-\r
- if (flowStack.get() != null) {\r
- ExecutionFlow registeredFlow = flowStack.get().pop();\r
- if (registeredFlow != null) {\r
- if (!flow.getName().equals(registeredFlow.getName()))\r
- throw new SlcException("Current flow is " + flow);\r
- // log.info("# flowInitializationFinished " + flowName);\r
- // initializingFlow.set(null);\r
- }\r
- } else {\r
- // happens for flows imported as services\r
- log.warn("flowInitializationFinished - Flow Stack is null");\r
- }\r
- }\r
-\r
- protected ExecutionFlow findInitializingFlowWithParameter(String key) {\r
- if ((flowStack.get() == null) || flowStack.get().empty())\r
- throw new SlcException("No initializing flow available.");\r
-\r
- // first look in the outer flow (that may override parameters)\r
- for (int i = 0; i < flowStack.get().size(); i++) {\r
- if (flowStack.get().elementAt(i).isSetAsParameter(key)) {\r
- return flowStack.get().elementAt(i);\r
- }\r
- }\r
- throw new SlcException("Key " + key + " is not set as parameter in "\r
- + flowStack.get().firstElement().toString() + " (stack size="\r
- + flowStack.get().size() + ")");\r
-\r
- }\r
-\r
- public Object getInitializingFlowParameter(String key) {\r
- return findInitializingFlowWithParameter(key).getParameter(key);\r
- }\r
-\r
- public Class<?> getInitializingFlowParameterClass(String key) {\r
- ExecutionSpecAttribute attr = findInitializingFlowWithParameter(key)\r
- .getExecutionSpec().getAttributes().get(key);\r
- if (attr instanceof RefSpecAttribute)\r
- return ((RefSpecAttribute) attr).getTargetClass();\r
- else if (attr instanceof PrimitiveSpecAttribute) {\r
- String type = ((PrimitiveSpecAttribute) attr).getType();\r
- Class<?> clss = PrimitiveUtils.typeAsClass(type);\r
- if (clss == null)\r
- throw new SlcException("Cannot convert type " + type\r
- + " to class.");\r
- return clss;\r
- } else\r
- return null;\r
- }\r
-\r
- public Boolean isInFlowInitialization() {\r
- return (flowStack.get() != null) && !flowStack.get().empty();\r
- }\r
-}\r
+package org.argeo.slc.runtime;
+
+import java.util.Stack;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.execution.ExecutionSpecAttribute;
+import org.argeo.slc.execution.RefSpecAttribute;
+import org.argeo.slc.primitive.PrimitiveSpecAttribute;
+import org.argeo.slc.primitive.PrimitiveUtils;
+
+/** Manage parameters that need to be set during the instantiation of a flow */
+public class InstantiationManager {
+
+ private final static Log log = LogFactory
+ .getLog(InstantiationManager.class);
+
+ private ThreadLocal<Stack<ExecutionFlow>> flowStack = new ThreadLocal<Stack<ExecutionFlow>>();
+
+ public Object createRef(String name) {
+
+ if ((flowStack.get() == null) || flowStack.get().empty()) {
+ throw new SlcException("No flow is currently initializing."
+ + " Declare ParameterRef as inner beans or prototypes.");
+ }
+
+ return getInitializingFlowParameter(name);
+ }
+
+ public void flowInitializationStarted(ExecutionFlow flow, String flowName) {
+ // set the flow name if it is DefaultExecutionFlow
+ if (flow instanceof DefaultExecutionFlow) {
+ ((DefaultExecutionFlow) flow).setName(flowName);
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("Start initialization of " + flow.hashCode() + " ("
+ + flow + " - " + flow.getClass() + ")");
+
+ // log.info("# flowInitializationStarted " + flowName);
+ // create a stack for this thread if there is none
+ if (flowStack.get() == null) {
+ flowStack.set(new Stack<ExecutionFlow>());
+ }
+ flowStack.get().push(flow);
+ }
+
+ public void flowInitializationFinished(ExecutionFlow flow, String flowName) {
+ if (log.isTraceEnabled())
+ log.trace("Finish initialization of " + flow.hashCode() + " ("
+ + flow + " - " + flow.getClass() + ")");
+
+ if (flowStack.get() != null) {
+ ExecutionFlow registeredFlow = flowStack.get().pop();
+ if (registeredFlow != null) {
+ if (!flow.getName().equals(registeredFlow.getName()))
+ throw new SlcException("Current flow is " + flow);
+ // log.info("# flowInitializationFinished " + flowName);
+ // initializingFlow.set(null);
+ }
+ } else {
+ // happens for flows imported as services
+ log.warn("flowInitializationFinished - Flow Stack is null");
+ }
+ }
+
+ protected ExecutionFlow findInitializingFlowWithParameter(String key) {
+ if ((flowStack.get() == null) || flowStack.get().empty())
+ throw new SlcException("No initializing flow available.");
+
+ // first look in the outer flow (that may override parameters)
+ for (int i = 0; i < flowStack.get().size(); i++) {
+ if (flowStack.get().elementAt(i).isSetAsParameter(key)) {
+ return flowStack.get().elementAt(i);
+ }
+ }
+ throw new SlcException("Key " + key + " is not set as parameter in "
+ + flowStack.get().firstElement().toString() + " (stack size="
+ + flowStack.get().size() + ")");
+
+ }
+
+ public Object getInitializingFlowParameter(String key) {
+ return findInitializingFlowWithParameter(key).getParameter(key);
+ }
+
+ public Class<?> getInitializingFlowParameterClass(String key) {
+ ExecutionSpecAttribute attr = findInitializingFlowWithParameter(key)
+ .getExecutionSpec().getAttributes().get(key);
+ if (attr instanceof RefSpecAttribute)
+ return ((RefSpecAttribute) attr).getTargetClass();
+ else if (attr instanceof PrimitiveSpecAttribute) {
+ String type = ((PrimitiveSpecAttribute) attr).getType();
+ Class<?> clss = PrimitiveUtils.typeAsClass(type);
+ if (clss == null)
+ throw new SlcException("Cannot convert type " + type
+ + " to class.");
+ return clss;
+ } else
+ return null;
+ }
+
+ public Boolean isInFlowInitialization() {
+ return (flowStack.get() != null) && !flowStack.get().empty();
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.security.AccessControlContext;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime;
import java.util.concurrent.ArrayBlockingQueue;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.tasks;
import org.argeo.slc.test.TestResult;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.tasks;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.tasks;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.tasks;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.tasks;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.tasks;
public interface SystemCallOutputListener {
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import org.argeo.slc.test.TestData;\r
-\r
-public class BasicTestData implements TestData {\r
- private Object expected;\r
- private Object reached;\r
-\r
- public Object getExpected() {\r
- return expected;\r
- }\r
-\r
- public void setExpected(Object expected) {\r
- this.expected = expected;\r
- }\r
-\r
- public Object getReached() {\r
- return reached;\r
- }\r
-\r
- public void setReached(Object reached) {\r
- this.reached = reached;\r
- }\r
-\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import org.argeo.slc.test.TestData;
+
+public class BasicTestData implements TestData {
+ private Object expected;
+ private Object reached;
+
+ public Object getExpected() {
+ return expected;
+ }
+
+ public void setExpected(Object expected) {
+ this.expected = expected;
+ }
+
+ public Object getReached() {
+ return reached;
+ }
+
+ public void setReached(Object reached) {
+ this.reached = reached;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.test.IncompatibleTestDataException;\r
-import org.argeo.slc.test.TestData;\r
-import org.argeo.slc.test.TestDefinition;\r
-import org.argeo.slc.test.TestResult;\r
-import org.argeo.slc.test.TestRun;\r
-import org.argeo.slc.test.TestStatus;\r
-import org.argeo.slc.test.context.ContextAware;\r
-\r
-/** Understands basic test data and context aware test data. */\r
-public class BasicTestDefinition implements TestDefinition {\r
-\r
- public void execute(TestRun testRun) {\r
- if (testRun.<TestData> getTestData() instanceof BasicTestData) {\r
- BasicTestData testData = testRun.getTestData();\r
- TestResult result = testRun.getTestResult();\r
-\r
- if (result == null)\r
- throw new SlcException("No test result defined.");\r
-\r
- try {\r
- if (testData.getExpected().equals(testData.getReached())) {\r
- result.addResultPart(new SimpleResultPart(\r
- TestStatus.PASSED, "Reached and expected equals"));\r
- } else {\r
- result.addResultPart(new SimpleResultPart(\r
- TestStatus.FAILED, "Expected "\r
- + testData.getExpected() + " but reached "\r
- + testData.getReached()));\r
- }\r
- } catch (Exception e) {\r
- result.addResultPart(new SimpleResultPart(TestStatus.ERROR,\r
- "Could not compare", e));\r
- }\r
- } else if (testRun.<TestData> getTestData() instanceof ContextAware) {\r
- TestData testData = testRun.getTestData();\r
- ContextUtils.compareReachedExpected((ContextAware) testData,\r
- testRun.getTestResult());\r
- } else {\r
- throw new IncompatibleTestDataException(testRun);\r
- }\r
- }\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.test.IncompatibleTestDataException;
+import org.argeo.slc.test.TestData;
+import org.argeo.slc.test.TestDefinition;
+import org.argeo.slc.test.TestResult;
+import org.argeo.slc.test.TestRun;
+import org.argeo.slc.test.TestStatus;
+import org.argeo.slc.test.context.ContextAware;
+
+/** Understands basic test data and context aware test data. */
+public class BasicTestDefinition implements TestDefinition {
+
+ public void execute(TestRun testRun) {
+ if (testRun.<TestData> getTestData() instanceof BasicTestData) {
+ BasicTestData testData = testRun.getTestData();
+ TestResult result = testRun.getTestResult();
+
+ if (result == null)
+ throw new SlcException("No test result defined.");
+
+ try {
+ if (testData.getExpected().equals(testData.getReached())) {
+ result.addResultPart(new SimpleResultPart(
+ TestStatus.PASSED, "Reached and expected equals"));
+ } else {
+ result.addResultPart(new SimpleResultPart(
+ TestStatus.FAILED, "Expected "
+ + testData.getExpected() + " but reached "
+ + testData.getReached()));
+ }
+ } catch (Exception e) {
+ result.addResultPart(new SimpleResultPart(TestStatus.ERROR,
+ "Could not compare", e));
+ }
+ } else if (testRun.<TestData> getTestData() instanceof ContextAware) {
+ TestData testData = testRun.getTestData();
+ ContextUtils.compareReachedExpected((ContextAware) testData,
+ testRun.getTestResult());
+ } else {
+ throw new IncompatibleTestDataException(testRun);
+ }
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import java.util.Map;\r
-import java.util.TreeMap;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.test.TestResult;\r
-import org.argeo.slc.test.TestStatus;\r
-import org.argeo.slc.test.context.ContextAware;\r
-import org.argeo.slc.test.context.ParentContextAware;\r
-\r
-/** Utilities for comparing and synchronising contexts. */\r
-public class ContextUtils {\r
- private final static Log log = LogFactory.getLog(ContextUtils.class);\r
-\r
- public static void compareReachedExpected(ContextAware contextAware,\r
- TestResult testResult) {\r
- for (String key : contextAware.getExpectedValues().keySet()) {\r
-\r
- // Compare expected values with reached ones\r
- Object expectedValue = contextAware.getExpectedValues().get(key);\r
-\r
- if (expectedValue.toString().equals(\r
- contextAware.getContextSkipFlag())) {\r
- if (log.isDebugEnabled())\r
- log.debug("Skipped check for key '" + key + "'");\r
- continue;\r
- }\r
-\r
- if (contextAware.getValues().containsKey(key)) {\r
- Object reachedValue = contextAware.getValues().get(key);\r
-\r
- if (expectedValue.equals(contextAware.getContextAnyFlag())) {\r
- testResult.addResultPart(new SimpleResultPart(\r
- TestStatus.PASSED, "Expected any value for key '"\r
- + key + "'"));\r
- } else if (expectedValue.equals(reachedValue)) {\r
- testResult.addResultPart(new SimpleResultPart(\r
- TestStatus.PASSED, "Values matched for key '" + key\r
- + "'"));\r
- } else {\r
- testResult.addResultPart(new SimpleResultPart(\r
- TestStatus.FAILED, "Mismatch for key '" + key\r
- + "': expected '" + expectedValue\r
- + "' but reached '" + reachedValue + "'"));\r
- }\r
- } else {\r
- testResult.addResultPart(new SimpleResultPart(\r
- TestStatus.FAILED, "No value reached for key '" + key\r
- + "'"));\r
- }\r
- }\r
- }\r
-\r
- /**\r
- * Makes sure that all children and sub-children of parent share the same\r
- * maps for values and expected values.\r
- */\r
- public static void synchronize(ParentContextAware parent) {\r
- Map<String, Object> expectedValuesCommon = new TreeMap<String, Object>(\r
- parent.getExpectedValues());\r
- synchronize(parent, expectedValuesCommon);\r
- if (log.isDebugEnabled())\r
- log.debug("Synchronized context " + parent);\r
-\r
- }\r
-\r
- private static void synchronize(ParentContextAware parent,\r
- Map<String, Object> expectedValuesCommon) {\r
- for (ContextAware child : parent.getChildContexts()) {\r
- // Values\r
- putNotContained(parent.getValues(), child.getValues());\r
- child.setValues(parent.getValues());\r
-\r
- // Expected Values\r
- // Expected values reference is not overridden: each child has its\r
- // own expected values map.\r
- overrideContained(expectedValuesCommon, child.getExpectedValues());\r
-\r
- // Creates a new Map in order not to disturb other context using the\r
- // same keys\r
- Map<String, Object> expectedValuesCommonChild = new TreeMap<String, Object>(\r
- expectedValuesCommon);\r
- putNotContained(expectedValuesCommonChild,\r
- child.getExpectedValues());\r
-\r
- if (child instanceof ParentContextAware) {\r
- // Recursive sync\r
- synchronize((ParentContextAware) child,\r
- expectedValuesCommonChild);\r
- }\r
- }\r
-\r
- }\r
-\r
- /**\r
- * Put into common map the values from child map which are not already\r
- * defined in common map.\r
- */\r
- public static void putNotContained(Map<String, Object> commonMap,\r
- Map<String, Object> childMap) {\r
- for (String key : childMap.keySet()) {\r
- if (!commonMap.containsKey(key)) {\r
- commonMap.put(key, childMap.get(key));\r
- }\r
- }\r
- }\r
-\r
- /** Overrides child map values with the values already set in common map */\r
- public static void overrideContained(Map<String, Object> commonMap,\r
- Map<String, Object> childMap) {\r
- for (String key : childMap.keySet()) {\r
- if (commonMap.containsKey(key)) {\r
- childMap.put(key, commonMap.get(key));\r
- }\r
- }\r
- }\r
-\r
- /** Makes sure this cannot be instantiated. */\r
- private ContextUtils() {\r
-\r
- }\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.test.TestResult;
+import org.argeo.slc.test.TestStatus;
+import org.argeo.slc.test.context.ContextAware;
+import org.argeo.slc.test.context.ParentContextAware;
+
+/** Utilities for comparing and synchronising contexts. */
+public class ContextUtils {
+ private final static Log log = LogFactory.getLog(ContextUtils.class);
+
+ public static void compareReachedExpected(ContextAware contextAware,
+ TestResult testResult) {
+ for (String key : contextAware.getExpectedValues().keySet()) {
+
+ // Compare expected values with reached ones
+ Object expectedValue = contextAware.getExpectedValues().get(key);
+
+ if (expectedValue.toString().equals(
+ contextAware.getContextSkipFlag())) {
+ if (log.isDebugEnabled())
+ log.debug("Skipped check for key '" + key + "'");
+ continue;
+ }
+
+ if (contextAware.getValues().containsKey(key)) {
+ Object reachedValue = contextAware.getValues().get(key);
+
+ if (expectedValue.equals(contextAware.getContextAnyFlag())) {
+ testResult.addResultPart(new SimpleResultPart(
+ TestStatus.PASSED, "Expected any value for key '"
+ + key + "'"));
+ } else if (expectedValue.equals(reachedValue)) {
+ testResult.addResultPart(new SimpleResultPart(
+ TestStatus.PASSED, "Values matched for key '" + key
+ + "'"));
+ } else {
+ testResult.addResultPart(new SimpleResultPart(
+ TestStatus.FAILED, "Mismatch for key '" + key
+ + "': expected '" + expectedValue
+ + "' but reached '" + reachedValue + "'"));
+ }
+ } else {
+ testResult.addResultPart(new SimpleResultPart(
+ TestStatus.FAILED, "No value reached for key '" + key
+ + "'"));
+ }
+ }
+ }
+
+ /**
+ * Makes sure that all children and sub-children of parent share the same
+ * maps for values and expected values.
+ */
+ public static void synchronize(ParentContextAware parent) {
+ Map<String, Object> expectedValuesCommon = new TreeMap<String, Object>(
+ parent.getExpectedValues());
+ synchronize(parent, expectedValuesCommon);
+ if (log.isDebugEnabled())
+ log.debug("Synchronized context " + parent);
+
+ }
+
+ private static void synchronize(ParentContextAware parent,
+ Map<String, Object> expectedValuesCommon) {
+ for (ContextAware child : parent.getChildContexts()) {
+ // Values
+ putNotContained(parent.getValues(), child.getValues());
+ child.setValues(parent.getValues());
+
+ // Expected Values
+ // Expected values reference is not overridden: each child has its
+ // own expected values map.
+ overrideContained(expectedValuesCommon, child.getExpectedValues());
+
+ // Creates a new Map in order not to disturb other context using the
+ // same keys
+ Map<String, Object> expectedValuesCommonChild = new TreeMap<String, Object>(
+ expectedValuesCommon);
+ putNotContained(expectedValuesCommonChild,
+ child.getExpectedValues());
+
+ if (child instanceof ParentContextAware) {
+ // Recursive sync
+ synchronize((ParentContextAware) child,
+ expectedValuesCommonChild);
+ }
+ }
+
+ }
+
+ /**
+ * Put into common map the values from child map which are not already
+ * defined in common map.
+ */
+ public static void putNotContained(Map<String, Object> commonMap,
+ Map<String, Object> childMap) {
+ for (String key : childMap.keySet()) {
+ if (!commonMap.containsKey(key)) {
+ commonMap.put(key, childMap.get(key));
+ }
+ }
+ }
+
+ /** Overrides child map values with the values already set in common map */
+ public static void overrideContained(Map<String, Object> commonMap,
+ Map<String, Object> childMap) {
+ for (String key : childMap.keySet()) {
+ if (commonMap.containsKey(key)) {
+ childMap.put(key, commonMap.get(key));
+ }
+ }
+ }
+
+ /** Makes sure this cannot be instantiated. */
+ private ContextUtils() {
+
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import java.io.Serializable;\r
-\r
-import org.argeo.slc.test.TestResultPart;\r
-import org.argeo.slc.test.TestRun;\r
-import org.argeo.slc.test.TestRunAware;\r
-import org.argeo.slc.test.TestStatus;\r
-\r
-/**\r
- * <p>\r
- * Basic implementation of a result part, implementing the standard three status\r
- * approach for test results.\r
- * </p>\r
- * \r
- * @see TestStatus\r
- */\r
-public class SimpleResultPart implements TestResultPart, TestStatus,\r
- TestRunAware, Serializable {\r
- private static final long serialVersionUID = 6669675957685071901L;\r
-\r
- private Long tid;\r
-\r
- private String testRunUuid;\r
-\r
- /** The status. Default to ERROR since it should always be explicitely set. */\r
- private Integer status = ERROR;\r
- private String message;\r
- private String exceptionMessage;\r
-\r
- public SimpleResultPart() {\r
- }\r
-\r
- public SimpleResultPart(Integer status, String message) {\r
- this(status, message, null);\r
- }\r
-\r
- public SimpleResultPart(Integer status, String message, Exception exception) {\r
- this.status = status;\r
- this.message = message;\r
- setException(exception);\r
- }\r
-\r
- public String getMessage() {\r
- return message;\r
- }\r
-\r
- public void setMessage(String message) {\r
- this.message = message;\r
- }\r
-\r
- public void setStatus(Integer status) {\r
- this.status = status;\r
- }\r
-\r
- public Integer getStatus() {\r
- return status;\r
- }\r
-\r
- public String getExceptionMessage() {\r
- return exceptionMessage;\r
- }\r
-\r
- public void setException(Exception exception) {\r
- if (exception == null)\r
- return;\r
-\r
- StringBuffer buf = new StringBuffer("");\r
- buf.append(exception.toString());\r
- buf.append('\n');\r
- for (StackTraceElement elem : exception.getStackTrace()) {\r
- buf.append('\t').append(elem.toString()).append('\n');\r
- }\r
-\r
- if (exception.getCause() != null)\r
- addRootCause(buf, exception.getCause());\r
-\r
- this.exceptionMessage = buf.toString();\r
- }\r
-\r
- protected void addRootCause(StringBuffer buf, Throwable cause) {\r
- if (cause == null)\r
- return;\r
-\r
- buf.append("Caused by: " + cause.getMessage());\r
- for (StackTraceElement elem : cause.getStackTrace()) {\r
- buf.append('\t').append(elem.toString()).append('\n');\r
- }\r
-\r
- if (cause.getCause() != null) {\r
- addRootCause(buf, cause.getCause());\r
- }\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuffer buf = new StringBuffer("");\r
- buf.append(SlcTestUtils.statusToString(status));\r
- if (status == PASSED || status == FAILED) {\r
- buf.append(' ');\r
- } else if (status == ERROR) {\r
- buf.append(" ");\r
- }\r
- buf.append(message);\r
- return buf.toString();\r
- }\r
-\r
- /** @deprecated */\r
- Long getTid() {\r
- return tid;\r
- }\r
-\r
- /** @deprecated */\r
- void setTid(Long tid) {\r
- this.tid = tid;\r
- }\r
-\r
- public String getTestRunUuid() {\r
- return testRunUuid;\r
- }\r
-\r
- /** For ORM */\r
- public void setTestRunUuid(String testRunUuid) {\r
- this.testRunUuid = testRunUuid;\r
- }\r
-\r
- public void notifyTestRun(TestRun testRun) {\r
- testRunUuid = testRun.getUuid();\r
- }\r
-\r
- public void setExceptionMessage(String exceptionMessage) {\r
- this.exceptionMessage = exceptionMessage;\r
- }\r
-\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import java.io.Serializable;
+
+import org.argeo.slc.test.TestResultPart;
+import org.argeo.slc.test.TestRun;
+import org.argeo.slc.test.TestRunAware;
+import org.argeo.slc.test.TestStatus;
+
+/**
+ * <p>
+ * Basic implementation of a result part, implementing the standard three status
+ * approach for test results.
+ * </p>
+ *
+ * @see TestStatus
+ */
+public class SimpleResultPart implements TestResultPart, TestStatus,
+ TestRunAware, Serializable {
+ private static final long serialVersionUID = 6669675957685071901L;
+
+ private Long tid;
+
+ private String testRunUuid;
+
+ /** The status. Default to ERROR since it should always be explicitely set. */
+ private Integer status = ERROR;
+ private String message;
+ private String exceptionMessage;
+
+ public SimpleResultPart() {
+ }
+
+ public SimpleResultPart(Integer status, String message) {
+ this(status, message, null);
+ }
+
+ public SimpleResultPart(Integer status, String message, Exception exception) {
+ this.status = status;
+ this.message = message;
+ setException(exception);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public String getExceptionMessage() {
+ return exceptionMessage;
+ }
+
+ public void setException(Exception exception) {
+ if (exception == null)
+ return;
+
+ StringBuffer buf = new StringBuffer("");
+ buf.append(exception.toString());
+ buf.append('\n');
+ for (StackTraceElement elem : exception.getStackTrace()) {
+ buf.append('\t').append(elem.toString()).append('\n');
+ }
+
+ if (exception.getCause() != null)
+ addRootCause(buf, exception.getCause());
+
+ this.exceptionMessage = buf.toString();
+ }
+
+ protected void addRootCause(StringBuffer buf, Throwable cause) {
+ if (cause == null)
+ return;
+
+ buf.append("Caused by: " + cause.getMessage());
+ for (StackTraceElement elem : cause.getStackTrace()) {
+ buf.append('\t').append(elem.toString()).append('\n');
+ }
+
+ if (cause.getCause() != null) {
+ addRootCause(buf, cause.getCause());
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer("");
+ buf.append(SlcTestUtils.statusToString(status));
+ if (status == PASSED || status == FAILED) {
+ buf.append(' ');
+ } else if (status == ERROR) {
+ buf.append(" ");
+ }
+ buf.append(message);
+ return buf.toString();
+ }
+
+ /** @deprecated */
+ Long getTid() {
+ return tid;
+ }
+
+ /** @deprecated */
+ void setTid(Long tid) {
+ this.tid = tid;
+ }
+
+ public String getTestRunUuid() {
+ return testRunUuid;
+ }
+
+ /** For ORM */
+ public void setTestRunUuid(String testRunUuid) {
+ this.testRunUuid = testRunUuid;
+ }
+
+ public void notifyTestRun(TestRun testRun) {
+ testRunUuid = testRun.getUuid();
+ }
+
+ public void setExceptionMessage(String exceptionMessage) {
+ this.exceptionMessage = exceptionMessage;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import java.util.Date;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.TreeMap;\r
-import java.util.UUID;\r
-import java.util.Vector;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.test.TestResult;\r
-import org.argeo.slc.test.TestResultPart;\r
-import org.argeo.slc.test.TestRun;\r
-\r
-/**\r
- * Basic implementation of a test result containing only a list of result parts.\r
- */\r
-public class SimpleTestResult implements TestResult {\r
- private static Log log = LogFactory.getLog(SimpleTestResult.class);\r
-\r
- private String uuid;\r
- private String currentTestRunUuid;\r
-\r
- private Boolean throwError = true;\r
-\r
- private Date closeDate;\r
- private List<TestResultPart> parts = new Vector<TestResultPart>();\r
-\r
- private Map<String, String> attributes = new TreeMap<String, String>();\r
-\r
- public void addResultPart(TestResultPart part) {\r
- if (throwError && part.getStatus() == ERROR) {\r
- throw new SlcException(\r
- "There was an error in the underlying test: "\r
- + part.getExceptionMessage());\r
- }\r
- parts.add(part);\r
- if (log.isDebugEnabled())\r
- log.debug(part);\r
- }\r
-\r
- public void close() {\r
- parts.clear();\r
- closeDate = new Date();\r
- }\r
-\r
- public List<TestResultPart> getParts() {\r
- return parts;\r
- }\r
-\r
- public Date getCloseDate() {\r
- return closeDate;\r
- }\r
-\r
- public void setThrowError(Boolean throwError) {\r
- this.throwError = throwError;\r
- }\r
-\r
- public void notifyTestRun(TestRun testRun) {\r
- currentTestRunUuid = testRun.getUuid();\r
- }\r
-\r
- public String getUuid() {\r
- if (uuid == null) {\r
- uuid = UUID.randomUUID().toString();\r
- }\r
- return uuid;\r
- }\r
-\r
- public void setUuid(String uuid) {\r
- this.uuid = uuid;\r
- }\r
-\r
- public String getCurrentTestRunUuid() {\r
- return currentTestRunUuid;\r
- }\r
-\r
- public Map<String, String> getAttributes() {\r
- return attributes;\r
- }\r
-\r
- public void setAttributes(Map<String, String> attributes) {\r
- this.attributes = attributes;\r
- }\r
-\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.UUID;
+import java.util.Vector;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.test.TestResult;
+import org.argeo.slc.test.TestResultPart;
+import org.argeo.slc.test.TestRun;
+
+/**
+ * Basic implementation of a test result containing only a list of result parts.
+ */
+public class SimpleTestResult implements TestResult {
+ private static Log log = LogFactory.getLog(SimpleTestResult.class);
+
+ private String uuid;
+ private String currentTestRunUuid;
+
+ private Boolean throwError = true;
+
+ private Date closeDate;
+ private List<TestResultPart> parts = new Vector<TestResultPart>();
+
+ private Map<String, String> attributes = new TreeMap<String, String>();
+
+ public void addResultPart(TestResultPart part) {
+ if (throwError && part.getStatus() == ERROR) {
+ throw new SlcException(
+ "There was an error in the underlying test: "
+ + part.getExceptionMessage());
+ }
+ parts.add(part);
+ if (log.isDebugEnabled())
+ log.debug(part);
+ }
+
+ public void close() {
+ parts.clear();
+ closeDate = new Date();
+ }
+
+ public List<TestResultPart> getParts() {
+ return parts;
+ }
+
+ public Date getCloseDate() {
+ return closeDate;
+ }
+
+ public void setThrowError(Boolean throwError) {
+ this.throwError = throwError;
+ }
+
+ public void notifyTestRun(TestRun testRun) {
+ currentTestRunUuid = testRun.getUuid();
+ }
+
+ public String getUuid() {
+ if (uuid == null) {
+ uuid = UUID.randomUUID().toString();
+ }
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getCurrentTestRunUuid() {
+ return currentTestRunUuid;
+ }
+
+ public Map<String, String> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, String> attributes) {
+ this.attributes = attributes;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import java.util.UUID;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-import org.argeo.slc.test.ExecutableTestRun;\r
-import org.argeo.slc.test.TestData;\r
-import org.argeo.slc.test.TestDefinition;\r
-import org.argeo.slc.test.TestResult;\r
-import org.argeo.slc.test.WritableTestRun;\r
-\r
-/**\r
- * A basic bean implementation of a <code>WritableTestRun</code>, holding\r
- * references to the various parts of a test run.\r
- */\r
-public class SimpleTestRun implements WritableTestRun, ExecutableTestRun {\r
- private String uuid;\r
-\r
- // private String slcExecutionUuid;\r
- // private String slcExecutionStepUuid;\r
-\r
- private DeployedSystem deployedSystem;\r
- private TestData testData;\r
- private TestDefinition testDefinition;\r
- private TestResult testResult;\r
-\r
- /** Executes the underlying test definition. */\r
- public void run() {\r
- uuid = UUID.randomUUID().toString();\r
- if (testResult != null)\r
- testResult.notifyTestRun(this);\r
-\r
- testDefinition.execute(this);\r
- }\r
-\r
- @SuppressWarnings("unchecked")\r
- public <T extends DeployedSystem> T getDeployedSystem() {\r
- return (T) deployedSystem;\r
- }\r
-\r
- public void setDeployedSystem(DeployedSystem deployedSystem) {\r
- this.deployedSystem = deployedSystem;\r
- }\r
-\r
- @SuppressWarnings("unchecked")\r
- public <T extends TestData> T getTestData() {\r
- return (T) testData;\r
- }\r
-\r
- public void setTestData(TestData testData) {\r
- this.testData = testData;\r
- }\r
-\r
- @SuppressWarnings("unchecked")\r
- public <T extends TestDefinition> T getTestDefinition() {\r
- return (T) testDefinition;\r
- }\r
-\r
- public void setTestDefinition(TestDefinition testDefinition) {\r
- this.testDefinition = testDefinition;\r
- }\r
-\r
- @SuppressWarnings("unchecked")\r
- public <T extends TestResult> T getTestResult() {\r
- return (T) testResult;\r
- }\r
-\r
- public void setTestResult(TestResult testResult) {\r
- this.testResult = testResult;\r
- }\r
-\r
- public String getUuid() {\r
- return uuid;\r
- }\r
-\r
- public void setUuid(String uuid) {\r
- this.uuid = uuid;\r
- }\r
-\r
- // public String getSlcExecutionUuid() {\r
- // return slcExecutionUuid;\r
- // }\r
- //\r
- // public void setSlcExecutionUuid(String slcExecutionUuid) {\r
- // this.slcExecutionUuid = slcExecutionUuid;\r
- // }\r
- //\r
- // public String getSlcExecutionStepUuid() {\r
- // return slcExecutionStepUuid;\r
- // }\r
- //\r
- // public void setSlcExecutionStepUuid(String slcExecutionStepUuid) {\r
- // this.slcExecutionStepUuid = slcExecutionStepUuid;\r
- // }\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import java.util.UUID;
+
+import org.argeo.slc.deploy.DeployedSystem;
+import org.argeo.slc.test.ExecutableTestRun;
+import org.argeo.slc.test.TestData;
+import org.argeo.slc.test.TestDefinition;
+import org.argeo.slc.test.TestResult;
+import org.argeo.slc.test.WritableTestRun;
+
+/**
+ * A basic bean implementation of a <code>WritableTestRun</code>, holding
+ * references to the various parts of a test run.
+ */
+public class SimpleTestRun implements WritableTestRun, ExecutableTestRun {
+ private String uuid;
+
+ // private String slcExecutionUuid;
+ // private String slcExecutionStepUuid;
+
+ private DeployedSystem deployedSystem;
+ private TestData testData;
+ private TestDefinition testDefinition;
+ private TestResult testResult;
+
+ /** Executes the underlying test definition. */
+ public void run() {
+ uuid = UUID.randomUUID().toString();
+ if (testResult != null)
+ testResult.notifyTestRun(this);
+
+ testDefinition.execute(this);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends DeployedSystem> T getDeployedSystem() {
+ return (T) deployedSystem;
+ }
+
+ public void setDeployedSystem(DeployedSystem deployedSystem) {
+ this.deployedSystem = deployedSystem;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends TestData> T getTestData() {
+ return (T) testData;
+ }
+
+ public void setTestData(TestData testData) {
+ this.testData = testData;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends TestDefinition> T getTestDefinition() {
+ return (T) testDefinition;
+ }
+
+ public void setTestDefinition(TestDefinition testDefinition) {
+ this.testDefinition = testDefinition;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends TestResult> T getTestResult() {
+ return (T) testResult;
+ }
+
+ public void setTestResult(TestResult testResult) {
+ this.testResult = testResult;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ // public String getSlcExecutionUuid() {
+ // return slcExecutionUuid;
+ // }
+ //
+ // public void setSlcExecutionUuid(String slcExecutionUuid) {
+ // this.slcExecutionUuid = slcExecutionUuid;
+ // }
+ //
+ // public String getSlcExecutionStepUuid() {
+ // return slcExecutionStepUuid;
+ // }
+ //
+ // public void setSlcExecutionStepUuid(String slcExecutionStepUuid) {
+ // this.slcExecutionStepUuid = slcExecutionStepUuid;
+ // }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.runtime.test;
import org.argeo.slc.SlcException;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import org.argeo.slc.UnsupportedException;\r
-import org.argeo.slc.test.TestData;\r
-import org.argeo.slc.test.TestDataProvider;\r
-\r
-/** Utilities for dealing with test datas. */\r
-public class TestDataUtils {\r
- /** Extracts the test data from the given provider. */\r
- public static <T extends TestData> T getFromProvider(Object obj,\r
- Class<T> clss, String key) {\r
- if (obj instanceof TestDataProvider) {\r
- TestDataProvider testDataProvider = (TestDataProvider) obj;\r
- return testDataProvider.getTestData(clss, key);\r
- } else {\r
- throw new UnsupportedException("test data provider", obj);\r
- }\r
- }\r
-\r
- /**\r
- * Extracts the test data from the given provider using <code>null</code>\r
- * as key.\r
- */\r
- public static <T extends TestData> T getFromProvider(Object obj,\r
- Class<T> clss) {\r
- return getFromProvider(obj, clss, null);\r
- }\r
-\r
- /**\r
- * Returns it self after making the proper checks. Used for test data being\r
- * their own data providers.\r
- */\r
- @SuppressWarnings("unchecked")\r
- public static <T extends TestData> T getItSelf(Class<T> clss,\r
- TestData testDataObject) {\r
- if (clss.isAssignableFrom(testDataObject.getClass())) {\r
- return (T) testDataObject;\r
- } else {\r
- throw new UnsupportedException("test data", testDataObject);\r
- }\r
-\r
- }\r
-\r
- /** Makes sure this is an utility class. */\r
- private TestDataUtils() {\r
-\r
- }\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import org.argeo.slc.UnsupportedException;
+import org.argeo.slc.test.TestData;
+import org.argeo.slc.test.TestDataProvider;
+
+/** Utilities for dealing with test datas. */
+public class TestDataUtils {
+ /** Extracts the test data from the given provider. */
+ public static <T extends TestData> T getFromProvider(Object obj,
+ Class<T> clss, String key) {
+ if (obj instanceof TestDataProvider) {
+ TestDataProvider testDataProvider = (TestDataProvider) obj;
+ return testDataProvider.getTestData(clss, key);
+ } else {
+ throw new UnsupportedException("test data provider", obj);
+ }
+ }
+
+ /**
+ * Extracts the test data from the given provider using <code>null</code>
+ * as key.
+ */
+ public static <T extends TestData> T getFromProvider(Object obj,
+ Class<T> clss) {
+ return getFromProvider(obj, clss, null);
+ }
+
+ /**
+ * Returns it self after making the proper checks. Used for test data being
+ * their own data providers.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends TestData> T getItSelf(Class<T> clss,
+ TestData testDataObject) {
+ if (clss.isAssignableFrom(testDataObject.getClass())) {
+ return (T) testDataObject;
+ } else {
+ throw new UnsupportedException("test data", testDataObject);
+ }
+
+ }
+
+ /** Makes sure this is an utility class. */
+ private TestDataUtils() {
+
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.util.Map;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution;\r
-\r
-import junit.framework.TestCase;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.execution.ExecutionContext;\r
-import org.argeo.slc.execution.ExecutionFlow;\r
-import org.argeo.slc.runtime.test.SimpleTestResult;\r
-import org.argeo.slc.test.TestResultPart;\r
-import org.argeo.slc.test.TestStatus;\r
-import org.springframework.context.ConfigurableApplicationContext;\r
-import org.springframework.context.support.ClassPathXmlApplicationContext;\r
-\r
-public abstract class AbstractExecutionFlowTestCase extends TestCase {\r
-\r
- protected final Log log = LogFactory.getLog(getClass());\r
-\r
- protected void logException(Throwable ex) {\r
- log.info("Got Exception of class " + ex.getClass().toString()\r
- + " with message '" + ex.getMessage() + "'.");\r
- }\r
-\r
- protected void validateTestResult(SimpleTestResult testResult) {\r
- validateTestResult(testResult, TestStatus.PASSED);\r
- }\r
-\r
- protected void validateTestResult(SimpleTestResult testResult,\r
- int expectedStatus) {\r
- for (TestResultPart part : testResult.getParts()) {\r
- if (part.getStatus() != expectedStatus) {\r
- fail("Error found in TestResult: " + part.getMessage());\r
- }\r
- }\r
- }\r
-\r
- protected ConfigurableApplicationContext createApplicationContext(\r
- String applicationContextSuffix) {\r
- ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(\r
- inPackage(applicationContextSuffix));\r
- // applicationContext.start();\r
- return applicationContext;\r
- }\r
-\r
- protected void configureAndExecuteSlcFlow(String applicationContextSuffix,\r
- String beanName) {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext(applicationContextSuffix);\r
- ExecutionContext executionContext = (ExecutionContext) applicationContext\r
- .getBean("executionContext");\r
- ExecutionFlow executionFlow = (ExecutionFlow) applicationContext\r
- .getBean(beanName);\r
- if (executionFlow instanceof DefaultExecutionFlow)\r
- ((DefaultExecutionFlow) executionFlow)\r
- .setExecutionContext(executionContext);\r
- try {\r
- executionContext.beforeFlow(executionFlow);\r
- executionFlow.run();\r
- } finally {\r
- executionContext.afterFlow(executionFlow);\r
- }\r
- applicationContext.close();\r
- }\r
-\r
- protected String inPackage(String suffix) {\r
- String prefix = getClass().getPackage().getName().replace('.', '/');\r
- return prefix + '/' + suffix;\r
- }\r
-}\r
+package org.argeo.slc.core.execution;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.execution.ExecutionContext;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.runtime.test.SimpleTestResult;
+import org.argeo.slc.test.TestResultPart;
+import org.argeo.slc.test.TestStatus;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public abstract class AbstractExecutionFlowTestCase extends TestCase {
+
+ protected final Log log = LogFactory.getLog(getClass());
+
+ protected void logException(Throwable ex) {
+ log.info("Got Exception of class " + ex.getClass().toString()
+ + " with message '" + ex.getMessage() + "'.");
+ }
+
+ protected void validateTestResult(SimpleTestResult testResult) {
+ validateTestResult(testResult, TestStatus.PASSED);
+ }
+
+ protected void validateTestResult(SimpleTestResult testResult,
+ int expectedStatus) {
+ for (TestResultPart part : testResult.getParts()) {
+ if (part.getStatus() != expectedStatus) {
+ fail("Error found in TestResult: " + part.getMessage());
+ }
+ }
+ }
+
+ protected ConfigurableApplicationContext createApplicationContext(
+ String applicationContextSuffix) {
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ inPackage(applicationContextSuffix));
+ // applicationContext.start();
+ return applicationContext;
+ }
+
+ protected void configureAndExecuteSlcFlow(String applicationContextSuffix,
+ String beanName) {
+ ConfigurableApplicationContext applicationContext = createApplicationContext(applicationContextSuffix);
+ ExecutionContext executionContext = (ExecutionContext) applicationContext
+ .getBean("executionContext");
+ ExecutionFlow executionFlow = (ExecutionFlow) applicationContext
+ .getBean(beanName);
+ if (executionFlow instanceof DefaultExecutionFlow)
+ ((DefaultExecutionFlow) executionFlow)
+ .setExecutionContext(executionContext);
+ try {
+ executionContext.beforeFlow(executionFlow);
+ executionFlow.run();
+ } finally {
+ executionContext.afterFlow(executionFlow);
+ }
+ applicationContext.close();
+ }
+
+ protected String inPackage(String suffix) {
+ String prefix = getClass().getPackage().getName().replace('.', '/');
+ return prefix + '/' + suffix;
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.argeo.slc.execution.ExecutionContext;\r
-import org.argeo.slc.execution.ExecutionFlow;\r
-import org.argeo.slc.runtime.test.SimpleTestResult;\r
-import org.argeo.slc.test.TestStatus;\r
-import org.springframework.beans.factory.BeanCreationException;\r
-import org.springframework.context.ConfigurableApplicationContext;\r
-\r
-public class BasicExecutionFlowTest extends AbstractExecutionFlowTestCase {\r
- // TO TEST\r
- // - post-processing for @{} replacement in beans with complex properties\r
- // - bean of scope other than execution are not resolved at execution\r
-\r
- // public void testMyTest() throws Exception {\r
- // ConfigurableApplicationContext applicationContext =\r
- // createApplicationContext("test.xml");\r
- // log.info("Start Execution");\r
- // ((ExecutionFlow) applicationContext.getBean("flow1")).execute();\r
- // applicationContext.close();\r
- // }\r
-\r
- public void XXXtestSpecOverriding() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("specOverriding.xml");\r
- ((ExecutionFlow) applicationContext.getBean("flow2")).run();\r
- SimpleTestResult res = (SimpleTestResult) applicationContext\r
- .getBean("myTestResult");\r
- validateTestResult(res);\r
- }\r
-\r
- public void testMultipleFlows() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("multipleFlow.xml");\r
- ((ExecutionFlow) applicationContext.getBean("flow1")).run();\r
- SimpleTestResult res = (SimpleTestResult) applicationContext\r
- .getBean("myTestResult");\r
- validateTestResult(res);\r
- res.getParts().clear();\r
- ((ExecutionFlow) applicationContext.getBean("flow2")).run();\r
- validateTestResult(res, TestStatus.FAILED);\r
- applicationContext.close();\r
- }\r
-\r
- /**\r
- * Test placeholder resolution in a context without scope execution or proxy\r
- * and with cascading flows (the flow A contains the flow B)\r
- * \r
- * @throws Exception\r
- */\r
- public void testPlaceHolders() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("placeHolders.cascading.xml");\r
- ((ExecutionFlow) applicationContext.getBean("flowA")).run();\r
- validateTestResult((SimpleTestResult) applicationContext\r
- .getBean("myTestResult"));\r
- applicationContext.close();\r
- }\r
-\r
- /**\r
- * Test placeholder resolution in a context without scope execution or proxy\r
- * and with cascading flows (the flow A contains the flow B) setting\r
- * execution values (should have no effect)\r
- * \r
- * @throws Exception\r
- */\r
- public void testPlaceHoldersWithExecutionValues() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("placeHolders.cascading.xml");\r
-\r
- ExecutionContext executionContext = (ExecutionContext) applicationContext\r
- .getBean("executionContext");\r
- Map<String, String> executionParameters = new HashMap<String, String>();\r
- executionParameters.put("p1", "e1");\r
- executionParameters.put("p2", "e2");\r
- executionParameters.put("p3", "e3");\r
- executionParameters.put("p4", "e4");\r
- executionParameters.put("p5", "e5");\r
- executionParameters.put("p6", "e6");\r
- executionParameters.put("p7", "e7");\r
- executionParameters.put("p8", "e8");\r
- addVariables(executionContext, executionParameters);\r
-\r
- ((ExecutionFlow) applicationContext.getBean("flowA")).run();\r
- validateTestResult((SimpleTestResult) applicationContext\r
- .getBean("myTestResult"));\r
- applicationContext.close();\r
- }\r
-\r
- public void XXXtestPlaceHoldersExec() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("placeHolders.cascading.exec.xml");\r
-\r
- ExecutionContext executionContext = (ExecutionContext) applicationContext\r
- .getBean("executionContext");\r
- Map<String, String> executionParameters = new HashMap<String, String>();\r
- executionParameters.put("p1", "e1");\r
- executionParameters.put("p2", "e2");\r
- executionParameters.put("p3", "e3");\r
- executionParameters.put("p4", "e4");\r
- executionParameters.put("p5", "e5");\r
- executionParameters.put("p6", "e6");\r
- addVariables(executionContext, executionParameters);\r
-\r
- ((ExecutionFlow) applicationContext.getBean("flowA")).run();\r
- validateTestResult((SimpleTestResult) applicationContext\r
- .getBean("myTestResult"));\r
- applicationContext.close();\r
- }\r
-\r
- public void testCanonicFlowParameters() throws Exception {\r
- configureAndExecuteSlcFlow("canonic-001.xml", "canonic.001");\r
- }\r
-\r
- public void testCanonicDefaultValues() throws Exception {\r
- configureAndExecuteSlcFlow("canonic-002.xml", "canonic.002");\r
- }\r
-\r
- public void testCanonicMissingValues() throws Exception {\r
- try {\r
- configureAndExecuteSlcFlow("canonic-003.error.xml", "canonic.003");\r
- fail("Parameter not set - should be rejected.");\r
- } catch (BeanCreationException e) {\r
- // exception expected\r
- logException(e);\r
- }\r
- }\r
-\r
- public void testCanonicUnknownParameter() throws Exception {\r
- try {\r
- configureAndExecuteSlcFlow("canonic-004.error.xml", "canonic.004");\r
- fail("Unknown parameter set - should be rejected.");\r
- } catch (BeanCreationException e) {\r
- // exception expected\r
- logException(e);\r
- }\r
- }\r
-\r
- public void testListSetMap() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("listSetMap.xml");\r
- ExecutionFlow executionFlow = (ExecutionFlow) applicationContext\r
- .getBean("myFlow");\r
- executionFlow.run();\r
-\r
- validateTestResult((SimpleTestResult) applicationContext\r
- .getBean("myTestResult"));\r
-\r
- // BasicTestData res = (BasicTestData)\r
- // applicationContext.getBean("cascadingComplex.testData");\r
- // log.info("res=" + res.getReached().toString());\r
-\r
- applicationContext.close();\r
- }\r
-\r
- public void testListSetMapMultipleFlows() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("listSetMapMultipleFlow.xml");\r
- ((ExecutionFlow) applicationContext.getBean("flow1")).run();\r
- SimpleTestResult res = (SimpleTestResult) applicationContext\r
- .getBean("myTestResult");\r
- validateTestResult(res);\r
- res.getParts().clear();\r
- ((ExecutionFlow) applicationContext.getBean("flow2")).run();\r
- validateTestResult(res, TestStatus.FAILED);\r
- applicationContext.close();\r
- }\r
-\r
- protected void addVariables(ExecutionContext executionContext,\r
- Map<String, String> vars) {\r
- for (String key : vars.keySet())\r
- executionContext.setVariable(key, vars.get(key));\r
- }\r
-}\r
+package org.argeo.slc.core.execution;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.argeo.slc.execution.ExecutionContext;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.runtime.test.SimpleTestResult;
+import org.argeo.slc.test.TestStatus;
+import org.springframework.beans.factory.BeanCreationException;
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class BasicExecutionFlowTest extends AbstractExecutionFlowTestCase {
+ // TO TEST
+ // - post-processing for @{} replacement in beans with complex properties
+ // - bean of scope other than execution are not resolved at execution
+
+ // public void testMyTest() throws Exception {
+ // ConfigurableApplicationContext applicationContext =
+ // createApplicationContext("test.xml");
+ // log.info("Start Execution");
+ // ((ExecutionFlow) applicationContext.getBean("flow1")).execute();
+ // applicationContext.close();
+ // }
+
+ public void XXXtestSpecOverriding() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("specOverriding.xml");
+ ((ExecutionFlow) applicationContext.getBean("flow2")).run();
+ SimpleTestResult res = (SimpleTestResult) applicationContext
+ .getBean("myTestResult");
+ validateTestResult(res);
+ }
+
+ public void testMultipleFlows() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("multipleFlow.xml");
+ ((ExecutionFlow) applicationContext.getBean("flow1")).run();
+ SimpleTestResult res = (SimpleTestResult) applicationContext
+ .getBean("myTestResult");
+ validateTestResult(res);
+ res.getParts().clear();
+ ((ExecutionFlow) applicationContext.getBean("flow2")).run();
+ validateTestResult(res, TestStatus.FAILED);
+ applicationContext.close();
+ }
+
+ /**
+ * Test placeholder resolution in a context without scope execution or proxy
+ * and with cascading flows (the flow A contains the flow B)
+ *
+ * @throws Exception
+ */
+ public void testPlaceHolders() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("placeHolders.cascading.xml");
+ ((ExecutionFlow) applicationContext.getBean("flowA")).run();
+ validateTestResult((SimpleTestResult) applicationContext
+ .getBean("myTestResult"));
+ applicationContext.close();
+ }
+
+ /**
+ * Test placeholder resolution in a context without scope execution or proxy
+ * and with cascading flows (the flow A contains the flow B) setting
+ * execution values (should have no effect)
+ *
+ * @throws Exception
+ */
+ public void testPlaceHoldersWithExecutionValues() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("placeHolders.cascading.xml");
+
+ ExecutionContext executionContext = (ExecutionContext) applicationContext
+ .getBean("executionContext");
+ Map<String, String> executionParameters = new HashMap<String, String>();
+ executionParameters.put("p1", "e1");
+ executionParameters.put("p2", "e2");
+ executionParameters.put("p3", "e3");
+ executionParameters.put("p4", "e4");
+ executionParameters.put("p5", "e5");
+ executionParameters.put("p6", "e6");
+ executionParameters.put("p7", "e7");
+ executionParameters.put("p8", "e8");
+ addVariables(executionContext, executionParameters);
+
+ ((ExecutionFlow) applicationContext.getBean("flowA")).run();
+ validateTestResult((SimpleTestResult) applicationContext
+ .getBean("myTestResult"));
+ applicationContext.close();
+ }
+
+ public void XXXtestPlaceHoldersExec() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("placeHolders.cascading.exec.xml");
+
+ ExecutionContext executionContext = (ExecutionContext) applicationContext
+ .getBean("executionContext");
+ Map<String, String> executionParameters = new HashMap<String, String>();
+ executionParameters.put("p1", "e1");
+ executionParameters.put("p2", "e2");
+ executionParameters.put("p3", "e3");
+ executionParameters.put("p4", "e4");
+ executionParameters.put("p5", "e5");
+ executionParameters.put("p6", "e6");
+ addVariables(executionContext, executionParameters);
+
+ ((ExecutionFlow) applicationContext.getBean("flowA")).run();
+ validateTestResult((SimpleTestResult) applicationContext
+ .getBean("myTestResult"));
+ applicationContext.close();
+ }
+
+ public void testCanonicFlowParameters() throws Exception {
+ configureAndExecuteSlcFlow("canonic-001.xml", "canonic.001");
+ }
+
+ public void testCanonicDefaultValues() throws Exception {
+ configureAndExecuteSlcFlow("canonic-002.xml", "canonic.002");
+ }
+
+ public void testCanonicMissingValues() throws Exception {
+ try {
+ configureAndExecuteSlcFlow("canonic-003.error.xml", "canonic.003");
+ fail("Parameter not set - should be rejected.");
+ } catch (BeanCreationException e) {
+ // exception expected
+ logException(e);
+ }
+ }
+
+ public void testCanonicUnknownParameter() throws Exception {
+ try {
+ configureAndExecuteSlcFlow("canonic-004.error.xml", "canonic.004");
+ fail("Unknown parameter set - should be rejected.");
+ } catch (BeanCreationException e) {
+ // exception expected
+ logException(e);
+ }
+ }
+
+ public void testListSetMap() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("listSetMap.xml");
+ ExecutionFlow executionFlow = (ExecutionFlow) applicationContext
+ .getBean("myFlow");
+ executionFlow.run();
+
+ validateTestResult((SimpleTestResult) applicationContext
+ .getBean("myTestResult"));
+
+ // BasicTestData res = (BasicTestData)
+ // applicationContext.getBean("cascadingComplex.testData");
+ // log.info("res=" + res.getReached().toString());
+
+ applicationContext.close();
+ }
+
+ public void testListSetMapMultipleFlows() throws Exception {
+ ConfigurableApplicationContext applicationContext = createApplicationContext("listSetMapMultipleFlow.xml");
+ ((ExecutionFlow) applicationContext.getBean("flow1")).run();
+ SimpleTestResult res = (SimpleTestResult) applicationContext
+ .getBean("myTestResult");
+ validateTestResult(res);
+ res.getParts().clear();
+ ((ExecutionFlow) applicationContext.getBean("flow2")).run();
+ validateTestResult(res, TestStatus.FAILED);
+ applicationContext.close();
+ }
+
+ protected void addVariables(ExecutionContext executionContext,
+ Map<String, String> vars) {
+ for (String key : vars.keySet())
+ executionContext.setVariable(key, vars.get(key));
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.argeo.slc.execution.ExecutionFlow;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import org.argeo.slc.core.execution.AbstractExecutionFlowTestCase;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.test.context;\r
-\r
-import java.util.Map;\r
-\r
-import junit.framework.TestCase;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.springframework.beans.factory.BeanFactoryUtils;\r
-import org.springframework.beans.factory.ListableBeanFactory;\r
-import org.springframework.context.ConfigurableApplicationContext;\r
-import org.springframework.context.support.ClassPathXmlApplicationContext;\r
-\r
-/** Helper for tests using a Spring application context. */\r
-public abstract class AbstractInternalSpringTestCase extends TestCase {\r
- protected final Log log = LogFactory.getLog(getClass());\r
- private ConfigurableApplicationContext context;\r
-\r
- /**\r
- * Gets (and create if necessary) the application context to use. Default\r
- * implementation uses a class path xml application context and calls\r
- * {@link #getApplicationContextLocation()}.\r
- */\r
- protected ConfigurableApplicationContext getContext() {\r
- if (context == null) {\r
- context = new ClassPathXmlApplicationContext(\r
- getApplicationContextLocation());\r
- }\r
- return context;\r
- }\r
-\r
- /** Returns a bean from the underlying context */\r
- @SuppressWarnings(value = { "unchecked" })\r
- protected <T> T getBean(String beanId) {\r
- return (T) getContext().getBean(beanId);\r
- }\r
-\r
- protected <T> T getBean(Class<? extends T> clss) {\r
- T bean = loadSingleFromContext(getContext(), clss);\r
- if (bean == null) {\r
- throw new SlcException("Cannot retrieve a unique bean of type "\r
- + clss);\r
- } else {\r
- return bean;\r
- }\r
- }\r
-\r
- /**\r
- * Th location of the application to load. The default implementation\r
- * returns <i>applicationContext.xml</i> found in the same package as the\r
- * test.\r
- */\r
- protected String getApplicationContextLocation() {\r
- return inPackage("applicationContext.xml");\r
- }\r
-\r
- /**\r
- * Prefixes the package of the class after converting the '.' to '/' in\r
- * order to have a resource path.\r
- */\r
- protected String inPackage(String suffix) {\r
- String prefix = getClass().getPackage().getName().replace('.', '/');\r
- return prefix + '/' + suffix;\r
- }\r
-\r
- @SuppressWarnings(value = { "unchecked" })\r
- protected <T> T loadSingleFromContext(ListableBeanFactory context,\r
- Class<T> clss) {\r
- Map<String, T> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(\r
- context, clss, false, false);\r
- if (beans.size() == 1) {\r
- return beans.values().iterator().next();\r
- } else if (beans.size() > 1) {\r
- if (log.isDebugEnabled()) {\r
- log\r
- .debug(("Found more that on bean for type " + clss\r
- + ": " + beans.keySet()));\r
- }\r
- return null;\r
- } else {\r
- return null;\r
- }\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.test.context;
+
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.springframework.beans.factory.BeanFactoryUtils;
+import org.springframework.beans.factory.ListableBeanFactory;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/** Helper for tests using a Spring application context. */
+public abstract class AbstractInternalSpringTestCase extends TestCase {
+ protected final Log log = LogFactory.getLog(getClass());
+ private ConfigurableApplicationContext context;
+
+ /**
+ * Gets (and create if necessary) the application context to use. Default
+ * implementation uses a class path xml application context and calls
+ * {@link #getApplicationContextLocation()}.
+ */
+ protected ConfigurableApplicationContext getContext() {
+ if (context == null) {
+ context = new ClassPathXmlApplicationContext(
+ getApplicationContextLocation());
+ }
+ return context;
+ }
+
+ /** Returns a bean from the underlying context */
+ @SuppressWarnings(value = { "unchecked" })
+ protected <T> T getBean(String beanId) {
+ return (T) getContext().getBean(beanId);
+ }
+
+ protected <T> T getBean(Class<? extends T> clss) {
+ T bean = loadSingleFromContext(getContext(), clss);
+ if (bean == null) {
+ throw new SlcException("Cannot retrieve a unique bean of type "
+ + clss);
+ } else {
+ return bean;
+ }
+ }
+
+ /**
+ * Th location of the application to load. The default implementation
+ * returns <i>applicationContext.xml</i> found in the same package as the
+ * test.
+ */
+ protected String getApplicationContextLocation() {
+ return inPackage("applicationContext.xml");
+ }
+
+ /**
+ * Prefixes the package of the class after converting the '.' to '/' in
+ * order to have a resource path.
+ */
+ protected String inPackage(String suffix) {
+ String prefix = getClass().getPackage().getName().replace('.', '/');
+ return prefix + '/' + suffix;
+ }
+
+ @SuppressWarnings(value = { "unchecked" })
+ protected <T> T loadSingleFromContext(ListableBeanFactory context,
+ Class<T> clss) {
+ Map<String, T> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
+ context, clss, false, false);
+ if (beans.size() == 1) {
+ return beans.values().iterator().next();
+ } else if (beans.size() > 1) {
+ if (log.isDebugEnabled()) {
+ log
+ .debug(("Found more that on bean for type " + clss
+ + ": " + beans.keySet()));
+ }
+ return null;
+ } else {
+ return null;
+ }
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.test.context;\r
-\r
-import java.util.List;\r
-\r
-import org.argeo.slc.runtime.test.ContextUtils;\r
-import org.argeo.slc.runtime.test.SimpleTestResult;\r
-import org.argeo.slc.test.TestResultPart;\r
-import org.argeo.slc.test.TestStatus;\r
-import org.argeo.slc.test.context.ContextAware;\r
-\r
-public class ContextTest extends AbstractInternalSpringTestCase {\r
-\r
- public void testComplexContext() {\r
- SimpleTestResult testResult = new SimpleTestResult();\r
- ContextUtils.compareReachedExpected(\r
- (ContextAware) getBean("context.c1"), testResult);\r
- ContextUtils.compareReachedExpected(\r
- (ContextAware) getBean("context.c2"), testResult);\r
- ContextUtils.compareReachedExpected(\r
- (ContextAware) getBean("context.c3"), testResult);\r
-\r
- List<TestResultPart> parts = testResult.getParts();\r
- assertEquals(6, parts.size());\r
- assertEquals(TestStatus.PASSED, parts.get(0).getStatus());\r
- assertEquals(TestStatus.PASSED, parts.get(1).getStatus());\r
- assertEquals(TestStatus.PASSED, parts.get(2).getStatus());\r
- assertEquals(TestStatus.FAILED, parts.get(3).getStatus());\r
- assertEquals(TestStatus.PASSED, parts.get(4).getStatus());\r
- assertEquals(TestStatus.PASSED, parts.get(5).getStatus());\r
- }\r
-}\r
+package org.argeo.slc.core.test.context;
+
+import java.util.List;
+
+import org.argeo.slc.runtime.test.ContextUtils;
+import org.argeo.slc.runtime.test.SimpleTestResult;
+import org.argeo.slc.test.TestResultPart;
+import org.argeo.slc.test.TestStatus;
+import org.argeo.slc.test.context.ContextAware;
+
+public class ContextTest extends AbstractInternalSpringTestCase {
+
+ public void testComplexContext() {
+ SimpleTestResult testResult = new SimpleTestResult();
+ ContextUtils.compareReachedExpected(
+ (ContextAware) getBean("context.c1"), testResult);
+ ContextUtils.compareReachedExpected(
+ (ContextAware) getBean("context.c2"), testResult);
+ ContextUtils.compareReachedExpected(
+ (ContextAware) getBean("context.c3"), testResult);
+
+ List<TestResultPart> parts = testResult.getParts();
+ assertEquals(6, parts.size());
+ assertEquals(TestStatus.PASSED, parts.get(0).getStatus());
+ assertEquals(TestStatus.PASSED, parts.get(1).getStatus());
+ assertEquals(TestStatus.PASSED, parts.get(2).getStatus());
+ assertEquals(TestStatus.FAILED, parts.get(3).getStatus());
+ assertEquals(TestStatus.PASSED, parts.get(4).getStatus());
+ assertEquals(TestStatus.PASSED, parts.get(5).getStatus());
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.ant;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.ant;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.attachment;
import org.argeo.slc.attachment.Attachment;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.attachment;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.attachment;
import java.io.Serializable;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.build;
import java.io.IOException;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.build;\r
-\r
-import java.util.StringTokenizer;\r
-\r
-/**\r
- * <p>\r
- * An implementation of the distribution id using the standard\r
- * Major.Minor.Release notation. And additional arbitrary string can also be\r
- * added.\r
- * </p>\r
- * \r
- * <p>\r
- * <b>Examples:</b><br>\r
- * 0.2.6<br>\r
- * 2.4.12.RC1\r
- * </p>\r
- */\r
-public class VersionDistributionId {\r
-\r
- private Integer major;\r
- private Integer minor;\r
- private Integer release;\r
- private String additional;\r
-\r
- /** Parse the provided string in order to set the various components. */\r
- public void setVersionString(String str) {\r
- StringTokenizer st = new StringTokenizer(str, ".");\r
- if (st.hasMoreTokens())\r
- major = Integer.parseInt(st.nextToken());\r
- if (st.hasMoreTokens())\r
- minor = Integer.parseInt(st.nextToken());\r
- if (st.hasMoreTokens())\r
- release = Integer.parseInt(st.nextToken());\r
- if (st.hasMoreTokens())\r
- additional = st.nextToken();\r
- }\r
-\r
- public Integer getMajor() {\r
- return major;\r
- }\r
-\r
- public void setMajor(Integer major) {\r
- this.major = major;\r
- }\r
-\r
- public Integer getMinor() {\r
- return minor;\r
- }\r
-\r
- public void setMinor(Integer minor) {\r
- this.minor = minor;\r
- }\r
-\r
- public Integer getRelease() {\r
- return release;\r
- }\r
-\r
- public void setRelease(Integer release) {\r
- this.release = release;\r
- }\r
-\r
- public String getAdditional() {\r
- return additional;\r
- }\r
-\r
- public void setAdditional(String additional) {\r
- this.additional = additional;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- // TODO Auto-generated method stub\r
- return super.equals(obj);\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return major + "." + minor + "." + release\r
- + (additional != null ? "." + additional : "");\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.build;
+
+import java.util.StringTokenizer;
+
+/**
+ * <p>
+ * An implementation of the distribution id using the standard
+ * Major.Minor.Release notation. And additional arbitrary string can also be
+ * added.
+ * </p>
+ *
+ * <p>
+ * <b>Examples:</b><br>
+ * 0.2.6<br>
+ * 2.4.12.RC1
+ * </p>
+ */
+public class VersionDistributionId {
+
+ private Integer major;
+ private Integer minor;
+ private Integer release;
+ private String additional;
+
+ /** Parse the provided string in order to set the various components. */
+ public void setVersionString(String str) {
+ StringTokenizer st = new StringTokenizer(str, ".");
+ if (st.hasMoreTokens())
+ major = Integer.parseInt(st.nextToken());
+ if (st.hasMoreTokens())
+ minor = Integer.parseInt(st.nextToken());
+ if (st.hasMoreTokens())
+ release = Integer.parseInt(st.nextToken());
+ if (st.hasMoreTokens())
+ additional = st.nextToken();
+ }
+
+ public Integer getMajor() {
+ return major;
+ }
+
+ public void setMajor(Integer major) {
+ this.major = major;
+ }
+
+ public Integer getMinor() {
+ return minor;
+ }
+
+ public void setMinor(Integer minor) {
+ this.minor = minor;
+ }
+
+ public Integer getRelease() {
+ return release;
+ }
+
+ public void setRelease(Integer release) {
+ this.release = release;
+ }
+
+ public String getAdditional() {
+ return additional;
+ }
+
+ public void setAdditional(String additional) {
+ this.additional = additional;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ // TODO Auto-generated method stub
+ return super.equals(obj);
+ }
+
+ @Override
+ public String toString() {
+ return major + "." + minor + "." + release
+ + (additional != null ? "." + additional : "");
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.build;
import org.argeo.slc.NameVersion;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.util.Map;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.deploy;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.argeo.slc.execution.ExecutionModule;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
/** Implements the base methods of an SLC agent. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.util.Map;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.util.Comparator;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.apache.commons.logging.Log;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution;\r
-\r
-import java.beans.PropertyDescriptor;\r
-import java.util.HashSet;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.execution.ExecutionContext;\r
-import org.argeo.slc.execution.ExecutionFlow;\r
-import org.argeo.slc.runtime.InstantiationManager;\r
-import org.springframework.beans.BeansException;\r
-import org.springframework.beans.MutablePropertyValues;\r
-import org.springframework.beans.PropertyValue;\r
-import org.springframework.beans.PropertyValues;\r
-import org.springframework.beans.factory.BeanDefinitionStoreException;\r
-import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;\r
-import org.springframework.beans.factory.config.TypedStringValue;\r
-import org.springframework.beans.factory.support.ManagedList;\r
-import org.springframework.beans.factory.support.ManagedMap;\r
-import org.springframework.beans.factory.support.ManagedSet;\r
-import org.springframework.util.ObjectUtils;\r
-import org.springframework.util.StringUtils;\r
-\r
-/**\r
- * Spring post processor which ensures that execution parameters are properly\r
- * set. It is used at two levels: first during instantiation for instantiation\r
- * parameters which allow to implement templates, then at runtime in order to\r
- * interpret @{} placeholders when object of scope execution are instantiated.\r
- */\r
-public class ExecutionParameterPostProcessor extends\r
- InstantiationAwareBeanPostProcessorAdapter {\r
-\r
- private final static Log log = LogFactory\r
- .getLog(ExecutionParameterPostProcessor.class);\r
-\r
- private ExecutionContext executionContext;\r
- private InstantiationManager instantiationManager;\r
-\r
- private String placeholderPrefix = "@{";\r
- private String placeholderSuffix = "}";\r
- private String nullValue;\r
-\r
- @Override\r
- public PropertyValues postProcessPropertyValues(PropertyValues pvs,\r
- PropertyDescriptor[] pds, Object bean, String beanName)\r
- throws BeansException {\r
-\r
- // TODO: resolve at execution only if scope is execution\r
- // TODO: deal with placeholders in RuntimeBeanReference and\r
- // RuntimeBeanNameReference\r
-\r
- MutablePropertyValues newPvs = new MutablePropertyValues();\r
-\r
- boolean changesOccured = false;\r
-\r
- for (PropertyValue pv : pvs.getPropertyValues()) {\r
- Object convertedValue = resolveValue(beanName, bean, pv.getValue());\r
- newPvs.addPropertyValue(new PropertyValue(pv, convertedValue));\r
- if (convertedValue != pv.getValue()) {\r
- changesOccured = true;\r
- }\r
- }\r
-\r
- return changesOccured ? newPvs : pvs;\r
- }\r
-\r
- @Override\r
- public boolean postProcessAfterInstantiation(Object bean, String beanName)\r
- throws BeansException {\r
- if (bean instanceof ExecutionFlow)\r
- instantiationManager.flowInitializationStarted(\r
- (ExecutionFlow) bean, beanName);\r
- return true;\r
- }\r
-\r
- @Override\r
- public Object postProcessAfterInitialization(Object bean, String beanName)\r
- throws BeansException {\r
- if (bean instanceof ExecutionFlow)\r
- instantiationManager.flowInitializationFinished(\r
- (ExecutionFlow) bean, beanName);\r
- return bean;\r
- }\r
-\r
- protected String resolvePlaceholder(Object bean, String placeholder) {\r
- if (instantiationManager.isInFlowInitialization())\r
- return instantiationManager.getInitializingFlowParameter(\r
- placeholder).toString();\r
-\r
- else {// execution\r
- // next call fail if no execution context available\r
- Object obj = executionContext.getVariable(placeholder);\r
- if (obj != null) {\r
- return obj.toString();\r
- }\r
- }\r
-\r
- return null;\r
- }\r
-\r
- public Object resolveValue(String beanName, Object bean, Object value) {\r
- if (value instanceof TypedStringValue) {\r
- TypedStringValue tsv = (TypedStringValue) value;\r
- String originalValue = tsv.getValue();\r
-\r
- String convertedValue = resolveString(beanName, bean, originalValue);\r
- if (convertedValue == null)\r
- return null;\r
- return convertedValue.equals(originalValue) ? value\r
- : new TypedStringValue(convertedValue);\r
- } else if (value instanceof String) {\r
- String originalValue = value.toString();\r
- String convertedValue = resolveString(beanName, bean, originalValue);\r
- if (convertedValue == null)\r
- return null;\r
- return convertedValue.equals(originalValue) ? value\r
- : convertedValue;\r
- } else if (value instanceof ManagedMap) {\r
- Map<?, ?> mapVal = (Map<?, ?>) value;\r
-\r
- Map<Object, Object> newContent = new ManagedMap<Object, Object>();\r
- boolean entriesModified = false;\r
- for (Iterator<?> it = mapVal.entrySet().iterator(); it.hasNext();) {\r
- Map.Entry<?, ?> entry = (Map.Entry<?, ?>) it.next();\r
- Object key = entry.getKey();\r
- int keyHash = (key != null ? key.hashCode() : 0);\r
- Object newKey = resolveValue(beanName, bean, key);\r
- int newKeyHash = (newKey != null ? newKey.hashCode() : 0);\r
- Object val = entry.getValue();\r
- Object newVal = resolveValue(beanName, bean, val);\r
- newContent.put(newKey, newVal);\r
- entriesModified = entriesModified\r
- || (newVal != val || newKey != key || newKeyHash != keyHash);\r
- }\r
-\r
- return entriesModified ? newContent : value;\r
- } else if (value instanceof ManagedList) {\r
- List<?> listVal = (List<?>) value;\r
- List<Object> newContent = new ManagedList<Object>();\r
- boolean valueModified = false;\r
-\r
- for (int i = 0; i < listVal.size(); i++) {\r
- Object elem = listVal.get(i);\r
- Object newVal = resolveValue(beanName, bean, elem);\r
- newContent.add(newVal);\r
- if (!ObjectUtils.nullSafeEquals(newVal, elem)) {\r
- valueModified = true;\r
- }\r
- }\r
- return valueModified ? newContent : value;\r
- } else if (value instanceof ManagedSet) {\r
- Set<?> setVal = (Set<?>) value;\r
- Set<Object> newContent = new ManagedSet<Object>();\r
- boolean entriesModified = false;\r
- for (Iterator<?> it = setVal.iterator(); it.hasNext();) {\r
- Object elem = it.next();\r
- int elemHash = (elem != null ? elem.hashCode() : 0);\r
- Object newVal = resolveValue(beanName, bean, elem);\r
- int newValHash = (newVal != null ? newVal.hashCode() : 0);\r
- newContent.add(newVal);\r
- entriesModified = entriesModified\r
- || (newVal != elem || newValHash != elemHash);\r
- }\r
- return entriesModified ? newContent : value;\r
- } else {\r
- // log.debug(beanName + ": " + value.getClass() + " : " + value);\r
- return value;\r
- }\r
-\r
- }\r
-\r
- private String resolveString(String beanName, Object bean, String strVal) {\r
- // in case <null/> is passed\r
- if (strVal == null)\r
- return null;\r
-\r
- String value = parseStringValue(bean, strVal, new HashSet<String>());\r
-\r
- if (value == null)\r
- throw new SlcException("Could not resolve placeholder '" + strVal\r
- + "' in bean '" + beanName + "'");\r
-\r
- return (value.equals(nullValue) ? null : value);\r
- }\r
-\r
- public void setPlaceholderPrefix(String placeholderPrefix) {\r
- this.placeholderPrefix = placeholderPrefix;\r
- }\r
-\r
- public void setPlaceholderSuffix(String placeholderSuffix) {\r
- this.placeholderSuffix = placeholderSuffix;\r
- }\r
-\r
- public void setNullValue(String nullValue) {\r
- this.nullValue = nullValue;\r
- }\r
-\r
- public void setInstantiationManager(\r
- InstantiationManager instantiationManager) {\r
- this.instantiationManager = instantiationManager;\r
- }\r
-\r
- public void setExecutionContext(ExecutionContext executionContext) {\r
- this.executionContext = executionContext;\r
- }\r
-\r
- //\r
- // Following methods hacked from the internals of\r
- // PropertyPlaceholderConfigurer\r
- //\r
-\r
- protected String parseStringValue(Object bean, String strVal,\r
- Set<String> visitedPlaceholders)\r
- throws BeanDefinitionStoreException {\r
-\r
- // in case <null/> is passed\r
- if (strVal == null)\r
- return null;\r
-\r
- StringBuffer buf = new StringBuffer(strVal);\r
-\r
- int startIndex = strVal.indexOf(placeholderPrefix);\r
- while (startIndex != -1) {\r
- int endIndex = findPlaceholderEndIndex(buf, startIndex);\r
- if (endIndex != -1) {\r
- String placeholder = buf.substring(startIndex\r
- + placeholderPrefix.length(), endIndex);\r
- if (!visitedPlaceholders.add(placeholder)) {\r
- throw new BeanDefinitionStoreException(\r
- "Circular placeholder reference '" + placeholder\r
- + "' in property definitions");\r
- }\r
- // Recursive invocation, parsing placeholders contained in\r
- // the placeholder key.\r
- placeholder = parseStringValue(bean, placeholder,\r
- visitedPlaceholders);\r
- // Now obtain the value for the fully resolved key...\r
- String propVal = resolvePlaceholder(bean, placeholder);\r
- if (propVal != null) {\r
- // Recursive invocation, parsing placeholders contained\r
- // in the\r
- // previously resolved placeholder value.\r
- propVal = parseStringValue(bean, propVal,\r
- visitedPlaceholders);\r
- buf.replace(startIndex,\r
- endIndex + placeholderSuffix.length(), propVal);\r
- if (log.isTraceEnabled()) {\r
- log.trace("Resolved placeholder '" + placeholder + "'");\r
- }\r
- startIndex = buf.indexOf(placeholderPrefix, startIndex\r
- + propVal.length());\r
- } else {\r
- throw new BeanDefinitionStoreException(\r
- "Could not resolve placeholder '" + placeholder\r
- + "'");\r
- }\r
- visitedPlaceholders.remove(placeholder);\r
- } else {\r
- startIndex = -1;\r
- }\r
- }\r
-\r
- return buf.toString();\r
- }\r
-\r
- private int findPlaceholderEndIndex(CharSequence buf, int startIndex) {\r
- int index = startIndex + placeholderPrefix.length();\r
- int withinNestedPlaceholder = 0;\r
- while (index < buf.length()) {\r
- if (StringUtils.substringMatch(buf, index, placeholderSuffix)) {\r
- if (withinNestedPlaceholder > 0) {\r
- withinNestedPlaceholder--;\r
- index = index + placeholderSuffix.length();\r
- } else {\r
- return index;\r
- }\r
- } else if (StringUtils\r
- .substringMatch(buf, index, placeholderPrefix)) {\r
- withinNestedPlaceholder++;\r
- index = index + placeholderPrefix.length();\r
- } else {\r
- index++;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.execution;
+
+import java.beans.PropertyDescriptor;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.execution.ExecutionContext;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.runtime.InstantiationManager;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.PropertyValues;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
+import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
+import org.springframework.beans.factory.config.TypedStringValue;
+import org.springframework.beans.factory.support.ManagedList;
+import org.springframework.beans.factory.support.ManagedMap;
+import org.springframework.beans.factory.support.ManagedSet;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+/**
+ * Spring post processor which ensures that execution parameters are properly
+ * set. It is used at two levels: first during instantiation for instantiation
+ * parameters which allow to implement templates, then at runtime in order to
+ * interpret @{} placeholders when object of scope execution are instantiated.
+ */
+public class ExecutionParameterPostProcessor extends
+ InstantiationAwareBeanPostProcessorAdapter {
+
+ private final static Log log = LogFactory
+ .getLog(ExecutionParameterPostProcessor.class);
+
+ private ExecutionContext executionContext;
+ private InstantiationManager instantiationManager;
+
+ private String placeholderPrefix = "@{";
+ private String placeholderSuffix = "}";
+ private String nullValue;
+
+ @Override
+ public PropertyValues postProcessPropertyValues(PropertyValues pvs,
+ PropertyDescriptor[] pds, Object bean, String beanName)
+ throws BeansException {
+
+ // TODO: resolve at execution only if scope is execution
+ // TODO: deal with placeholders in RuntimeBeanReference and
+ // RuntimeBeanNameReference
+
+ MutablePropertyValues newPvs = new MutablePropertyValues();
+
+ boolean changesOccured = false;
+
+ for (PropertyValue pv : pvs.getPropertyValues()) {
+ Object convertedValue = resolveValue(beanName, bean, pv.getValue());
+ newPvs.addPropertyValue(new PropertyValue(pv, convertedValue));
+ if (convertedValue != pv.getValue()) {
+ changesOccured = true;
+ }
+ }
+
+ return changesOccured ? newPvs : pvs;
+ }
+
+ @Override
+ public boolean postProcessAfterInstantiation(Object bean, String beanName)
+ throws BeansException {
+ if (bean instanceof ExecutionFlow)
+ instantiationManager.flowInitializationStarted(
+ (ExecutionFlow) bean, beanName);
+ return true;
+ }
+
+ @Override
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
+ if (bean instanceof ExecutionFlow)
+ instantiationManager.flowInitializationFinished(
+ (ExecutionFlow) bean, beanName);
+ return bean;
+ }
+
+ protected String resolvePlaceholder(Object bean, String placeholder) {
+ if (instantiationManager.isInFlowInitialization())
+ return instantiationManager.getInitializingFlowParameter(
+ placeholder).toString();
+
+ else {// execution
+ // next call fail if no execution context available
+ Object obj = executionContext.getVariable(placeholder);
+ if (obj != null) {
+ return obj.toString();
+ }
+ }
+
+ return null;
+ }
+
+ public Object resolveValue(String beanName, Object bean, Object value) {
+ if (value instanceof TypedStringValue) {
+ TypedStringValue tsv = (TypedStringValue) value;
+ String originalValue = tsv.getValue();
+
+ String convertedValue = resolveString(beanName, bean, originalValue);
+ if (convertedValue == null)
+ return null;
+ return convertedValue.equals(originalValue) ? value
+ : new TypedStringValue(convertedValue);
+ } else if (value instanceof String) {
+ String originalValue = value.toString();
+ String convertedValue = resolveString(beanName, bean, originalValue);
+ if (convertedValue == null)
+ return null;
+ return convertedValue.equals(originalValue) ? value
+ : convertedValue;
+ } else if (value instanceof ManagedMap) {
+ Map<?, ?> mapVal = (Map<?, ?>) value;
+
+ Map<Object, Object> newContent = new ManagedMap<Object, Object>();
+ boolean entriesModified = false;
+ for (Iterator<?> it = mapVal.entrySet().iterator(); it.hasNext();) {
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) it.next();
+ Object key = entry.getKey();
+ int keyHash = (key != null ? key.hashCode() : 0);
+ Object newKey = resolveValue(beanName, bean, key);
+ int newKeyHash = (newKey != null ? newKey.hashCode() : 0);
+ Object val = entry.getValue();
+ Object newVal = resolveValue(beanName, bean, val);
+ newContent.put(newKey, newVal);
+ entriesModified = entriesModified
+ || (newVal != val || newKey != key || newKeyHash != keyHash);
+ }
+
+ return entriesModified ? newContent : value;
+ } else if (value instanceof ManagedList) {
+ List<?> listVal = (List<?>) value;
+ List<Object> newContent = new ManagedList<Object>();
+ boolean valueModified = false;
+
+ for (int i = 0; i < listVal.size(); i++) {
+ Object elem = listVal.get(i);
+ Object newVal = resolveValue(beanName, bean, elem);
+ newContent.add(newVal);
+ if (!ObjectUtils.nullSafeEquals(newVal, elem)) {
+ valueModified = true;
+ }
+ }
+ return valueModified ? newContent : value;
+ } else if (value instanceof ManagedSet) {
+ Set<?> setVal = (Set<?>) value;
+ Set<Object> newContent = new ManagedSet<Object>();
+ boolean entriesModified = false;
+ for (Iterator<?> it = setVal.iterator(); it.hasNext();) {
+ Object elem = it.next();
+ int elemHash = (elem != null ? elem.hashCode() : 0);
+ Object newVal = resolveValue(beanName, bean, elem);
+ int newValHash = (newVal != null ? newVal.hashCode() : 0);
+ newContent.add(newVal);
+ entriesModified = entriesModified
+ || (newVal != elem || newValHash != elemHash);
+ }
+ return entriesModified ? newContent : value;
+ } else {
+ // log.debug(beanName + ": " + value.getClass() + " : " + value);
+ return value;
+ }
+
+ }
+
+ private String resolveString(String beanName, Object bean, String strVal) {
+ // in case <null/> is passed
+ if (strVal == null)
+ return null;
+
+ String value = parseStringValue(bean, strVal, new HashSet<String>());
+
+ if (value == null)
+ throw new SlcException("Could not resolve placeholder '" + strVal
+ + "' in bean '" + beanName + "'");
+
+ return (value.equals(nullValue) ? null : value);
+ }
+
+ public void setPlaceholderPrefix(String placeholderPrefix) {
+ this.placeholderPrefix = placeholderPrefix;
+ }
+
+ public void setPlaceholderSuffix(String placeholderSuffix) {
+ this.placeholderSuffix = placeholderSuffix;
+ }
+
+ public void setNullValue(String nullValue) {
+ this.nullValue = nullValue;
+ }
+
+ public void setInstantiationManager(
+ InstantiationManager instantiationManager) {
+ this.instantiationManager = instantiationManager;
+ }
+
+ public void setExecutionContext(ExecutionContext executionContext) {
+ this.executionContext = executionContext;
+ }
+
+ //
+ // Following methods hacked from the internals of
+ // PropertyPlaceholderConfigurer
+ //
+
+ protected String parseStringValue(Object bean, String strVal,
+ Set<String> visitedPlaceholders)
+ throws BeanDefinitionStoreException {
+
+ // in case <null/> is passed
+ if (strVal == null)
+ return null;
+
+ StringBuffer buf = new StringBuffer(strVal);
+
+ int startIndex = strVal.indexOf(placeholderPrefix);
+ while (startIndex != -1) {
+ int endIndex = findPlaceholderEndIndex(buf, startIndex);
+ if (endIndex != -1) {
+ String placeholder = buf.substring(startIndex
+ + placeholderPrefix.length(), endIndex);
+ if (!visitedPlaceholders.add(placeholder)) {
+ throw new BeanDefinitionStoreException(
+ "Circular placeholder reference '" + placeholder
+ + "' in property definitions");
+ }
+ // Recursive invocation, parsing placeholders contained in
+ // the placeholder key.
+ placeholder = parseStringValue(bean, placeholder,
+ visitedPlaceholders);
+ // Now obtain the value for the fully resolved key...
+ String propVal = resolvePlaceholder(bean, placeholder);
+ if (propVal != null) {
+ // Recursive invocation, parsing placeholders contained
+ // in the
+ // previously resolved placeholder value.
+ propVal = parseStringValue(bean, propVal,
+ visitedPlaceholders);
+ buf.replace(startIndex,
+ endIndex + placeholderSuffix.length(), propVal);
+ if (log.isTraceEnabled()) {
+ log.trace("Resolved placeholder '" + placeholder + "'");
+ }
+ startIndex = buf.indexOf(placeholderPrefix, startIndex
+ + propVal.length());
+ } else {
+ throw new BeanDefinitionStoreException(
+ "Could not resolve placeholder '" + placeholder
+ + "'");
+ }
+ visitedPlaceholders.remove(placeholder);
+ } else {
+ startIndex = -1;
+ }
+ }
+
+ return buf.toString();
+ }
+
+ private int findPlaceholderEndIndex(CharSequence buf, int startIndex) {
+ int index = startIndex + placeholderPrefix.length();
+ int withinNestedPlaceholder = 0;
+ while (index < buf.length()) {
+ if (StringUtils.substringMatch(buf, index, placeholderSuffix)) {
+ if (withinNestedPlaceholder > 0) {
+ withinNestedPlaceholder--;
+ index = index + placeholderSuffix.length();
+ } else {
+ return index;
+ }
+ } else if (StringUtils
+ .substringMatch(buf, index, placeholderPrefix)) {
+ withinNestedPlaceholder++;
+ index = index + placeholderPrefix.length();
+ } else {
+ index++;
+ }
+ }
+ return -1;
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.springframework.beans.factory.FactoryBean;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.util.Collections;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.doc;
import org.springframework.beans.MutablePropertyValues;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.doc;
import org.springframework.beans.factory.config.BeanDefinition;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.Map;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;\r
-\r
-/**\r
- * Composite <code>RunnableFactory</code>, redirecting the Runnable \r
- * creation to on of the configured <code>RunnableFactory</code> depending\r
- * on an entry of the data of the <code>RunnableDataNode</code>.\r
- */\r
-public class CompositeRunnableFactory implements RunnableFactory {\r
-\r
- /**\r
- * Key used to access factory ID in the data of the <code>RunnableDataNode</code>\r
- */\r
- private String factoryKey;\r
-\r
- /**\r
- * Maps a factory ID to an ExecutionFlowFactory\r
- */\r
- private Map<String, RunnableFactory> factories;\r
-\r
- public void createAndRegisterRunnable(RunnableDataNode node,\r
- BeanDefinitionRegistry beanDefinitionRegistry) {\r
- findFactory(node).createAndRegisterRunnable(node, beanDefinitionRegistry);\r
- } \r
- \r
- /**\r
- * Finds the <code>RunnableFactory</code> to use for a <code>RunnableDataNode</code>\r
- * @param node\r
- * @return the <code>RunnableFactory</code> to use for the <code>RunnableDataNode</code>\r
- */\r
- private RunnableFactory findFactory(RunnableDataNode node) {\r
- // get the factory ID from the data of the RunnableDescriptor\r
- Map<String, Object> data = node.getData();\r
- if (!data.containsKey(factoryKey)) {\r
- throw new SlcException("No data value for key '" + factoryKey + "'");\r
- }\r
- String factoryId = data.get(factoryKey).toString();\r
- \r
- // see if we have a factory for the factory ID\r
- if ((factories != null) && factories.containsKey(factoryId)) {\r
- return factories.get(factoryId);\r
- }\r
- // if not, look for a bean of name equals to the factory ID\r
- else {\r
- throw new SlcException("Not implemented");\r
- } \r
- }\r
- \r
- public void setFactoryKey(String factoryKey) {\r
- this.factoryKey = factoryKey;\r
- }\r
-\r
- public void setFactories(Map<String, RunnableFactory> factories) {\r
- this.factories = factories;\r
- }\r
-\r
-\r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.Map;
+
+import org.argeo.slc.SlcException;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+
+/**
+ * Composite <code>RunnableFactory</code>, redirecting the Runnable
+ * creation to on of the configured <code>RunnableFactory</code> depending
+ * on an entry of the data of the <code>RunnableDataNode</code>.
+ */
+public class CompositeRunnableFactory implements RunnableFactory {
+
+ /**
+ * Key used to access factory ID in the data of the <code>RunnableDataNode</code>
+ */
+ private String factoryKey;
+
+ /**
+ * Maps a factory ID to an ExecutionFlowFactory
+ */
+ private Map<String, RunnableFactory> factories;
+
+ public void createAndRegisterRunnable(RunnableDataNode node,
+ BeanDefinitionRegistry beanDefinitionRegistry) {
+ findFactory(node).createAndRegisterRunnable(node, beanDefinitionRegistry);
+ }
+
+ /**
+ * Finds the <code>RunnableFactory</code> to use for a <code>RunnableDataNode</code>
+ * @param node
+ * @return the <code>RunnableFactory</code> to use for the <code>RunnableDataNode</code>
+ */
+ private RunnableFactory findFactory(RunnableDataNode node) {
+ // get the factory ID from the data of the RunnableDescriptor
+ Map<String, Object> data = node.getData();
+ if (!data.containsKey(factoryKey)) {
+ throw new SlcException("No data value for key '" + factoryKey + "'");
+ }
+ String factoryId = data.get(factoryKey).toString();
+
+ // see if we have a factory for the factory ID
+ if ((factories != null) && factories.containsKey(factoryId)) {
+ return factories.get(factoryId);
+ }
+ // if not, look for a bean of name equals to the factory ID
+ else {
+ throw new SlcException("Not implemented");
+ }
+ }
+
+ public void setFactoryKey(String factoryKey) {
+ this.factoryKey = factoryKey;
+ }
+
+ public void setFactories(Map<String, RunnableFactory> factories) {
+ this.factories = factories;
+ }
+
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-/**\r
- * Default implementation of <code>RunnableDataNode</code>\r
- *\r
- */\r
-public class DefaultRunnableDataNode implements RunnableDataNode {\r
-\r
- private List<RunnableDataNode> children = new ArrayList<RunnableDataNode>();\r
- \r
- private RunnableDataNode parent;\r
- \r
- /**\r
- * Data of the RunnableDataNode. Does not contain\r
- * parent data.\r
- */\r
- private Map<String, Object> properData = new HashMap<String, Object>();\r
- \r
- private String path;\r
- \r
- private String beanName;\r
-\r
- public boolean isLeaf() {\r
- return children.size() == 0;\r
- }\r
- \r
- public List<RunnableDataNode> getChildren() {\r
- return children;\r
- }\r
-\r
- public void addChild(RunnableDataNode child) {\r
- child.setParent(this);\r
- children.add(child);\r
- }\r
- \r
- public Map<String, Object> getData() {\r
- Map<String, Object> data = new HashMap<String, Object>();\r
- if(parent != null) {\r
- Map<String, Object> parentData = parent.getData();\r
- if(parentData != null) {\r
- data.putAll(parentData);\r
- }\r
- }\r
- // entries defined in parentData can be overridden\r
- // in properData\r
- if(properData != null) {\r
- data.putAll(properData);\r
- }\r
- return data;\r
- }\r
-\r
- public Map<String, Object> getProperData() {\r
- return properData;\r
- }\r
-\r
- public void setProperData(Map<String, Object> properData) {\r
- this.properData = properData;\r
- }\r
-\r
- public String getPath() {\r
- return path;\r
- }\r
-\r
- public void setPath(String path) {\r
- this.path = path;\r
- }\r
-\r
- public String getBeanName() {\r
- return beanName;\r
- }\r
-\r
- public void setBeanName(String beanName) {\r
- this.beanName = beanName;\r
- }\r
-\r
- public void setParent(RunnableDataNode parent) {\r
- this.parent = parent;\r
- }\r
-\r
- public RunnableDataNode getParent() {\r
- return parent;\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Default implementation of <code>RunnableDataNode</code>
+ *
+ */
+public class DefaultRunnableDataNode implements RunnableDataNode {
+
+ private List<RunnableDataNode> children = new ArrayList<RunnableDataNode>();
+
+ private RunnableDataNode parent;
+
+ /**
+ * Data of the RunnableDataNode. Does not contain
+ * parent data.
+ */
+ private Map<String, Object> properData = new HashMap<String, Object>();
+
+ private String path;
+
+ private String beanName;
+
+ public boolean isLeaf() {
+ return children.size() == 0;
+ }
+
+ public List<RunnableDataNode> getChildren() {
+ return children;
+ }
+
+ public void addChild(RunnableDataNode child) {
+ child.setParent(this);
+ children.add(child);
+ }
+
+ public Map<String, Object> getData() {
+ Map<String, Object> data = new HashMap<String, Object>();
+ if(parent != null) {
+ Map<String, Object> parentData = parent.getData();
+ if(parentData != null) {
+ data.putAll(parentData);
+ }
+ }
+ // entries defined in parentData can be overridden
+ // in properData
+ if(properData != null) {
+ data.putAll(properData);
+ }
+ return data;
+ }
+
+ public Map<String, Object> getProperData() {
+ return properData;
+ }
+
+ public void setProperData(Map<String, Object> properData) {
+ this.properData = properData;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+ public void setBeanName(String beanName) {
+ this.beanName = beanName;
+ }
+
+ public void setParent(RunnableDataNode parent) {
+ this.parent = parent;
+ }
+
+ public RunnableDataNode getParent() {
+ return parent;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.HashMap;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.springframework.aop.scope.ScopedProxyUtils;\r
-import org.springframework.beans.BeansException;\r
-import org.springframework.beans.MutablePropertyValues;\r
-import org.springframework.beans.factory.config.BeanDefinitionHolder;\r
-import org.springframework.beans.factory.config.BeanFactoryPostProcessor;\r
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;\r
-import org.springframework.beans.factory.config.RuntimeBeanReference;\r
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;\r
-import org.springframework.beans.factory.support.GenericBeanDefinition;\r
-import org.springframework.core.Ordered;\r
-\r
-/**\r
- * Generates <code>ExecutionFlows</code> and <code>Runnables</code> as\r
- * beans in the Spring Application Context.\r
- * Called by the Application Context as a <code>BeanFactoryPostProcessor</code>.\r
- * Two kinds of beans are generated:\r
- * <code>RunnableCallFlow</code>, calling a list of <code>Runnables</code> from the\r
- * Application Context after configuring the <code>ExecutionContext</code>, \r
- * and outputs of a <code>RunnableFactory</code>.\r
- */\r
-public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,\r
- Ordered {\r
- \r
- private final Log log = LogFactory.getLog(getClass());\r
-\r
- /**\r
- * Source providing a list of <code>RunnableCallFlowDescriptor</code> \r
- * used to create <code>RunnableCallFlow</code> and a list of \r
- * <code>RunnableDataNode</code> used to create any kind of flow via a factory\r
- */\r
- protected ExecutionFlowGeneratorSource source;\r
- \r
- /**\r
- * Factory used to create Runnables in the Application context from\r
- * the <code>RunnableDataNode</code> provided from the source.\r
- */\r
- protected RunnableFactory runnableFactory;\r
- \r
- /**\r
- * Bean name of the <code>ExecutionContext</code>.\r
- * Used to provide the created <code>RunnableCallFlow</code> beans \r
- * with a <code>RuntimeBeanReference</code> to\r
- * the <code>ExecutionContext</code>\r
- */\r
- private String executionContextBeanName = "executionContext";\r
- \r
- /**\r
- * Bean name of the context values Map.\r
- * A bean of class HashMap is created with this name, and a \r
- * <code>RuntimeBeanReference</code> is provided to the created\r
- * <code>RunnableCallFlow</code> beans.\r
- */\r
- private String contextValuesBeanName = "executionFlowGenerator.contextValues";\r
- \r
- /**\r
- * Prefix added to the bean names defined in each \r
- * <code>RunnableCallFlowDescriptor</code>\r
- */\r
- private String flowBeanNamesPrefix = "";\r
- \r
- private int order = Ordered.HIGHEST_PRECEDENCE;\r
- \r
- public void postProcessBeanFactory(\r
- ConfigurableListableBeanFactory beanFactory) throws BeansException {\r
-\r
- // assert that the beanFactory is a BeanDefinitionRegistry\r
- if (!(beanFactory instanceof BeanDefinitionRegistry)) {\r
- throw new SlcException("Can only work on "\r
- + BeanDefinitionRegistry.class);\r
- } \r
- \r
- // add bean for the Context Values Map\r
- createAndRegisterContextValuesBean((BeanDefinitionRegistry) beanFactory);\r
- \r
- // add beans for each RunnableDataNode\r
- for(RunnableDataNode node : source.getRunnableDataNodes()) {\r
- runnableFactory.createAndRegisterRunnable(node, (BeanDefinitionRegistry) beanFactory);\r
- }\r
- \r
- // add beans for each RunnableCallFlowDescriptor of the source to the application context\r
- for (RunnableCallFlowDescriptor descriptor : source\r
- .getRunnableCallFlowDescriptors()) {\r
- createAndRegisterFlowFor(descriptor, (BeanDefinitionRegistry) beanFactory);\r
- }\r
- }\r
-\r
- /**\r
- * Creates a <code>RunnableCallFlow</code> bean\r
- * for a <code>RunnableCallFlowDescriptor</code> and registers \r
- * it in the <code>BeanDefinitionRegistry</code>\r
- * @param flowDescriptor\r
- * @param registry\r
- */\r
- private void createAndRegisterFlowFor(RunnableCallFlowDescriptor flowDescriptor, BeanDefinitionRegistry registry) {\r
- // create the flow bean\r
- GenericBeanDefinition flowBean = new GenericBeanDefinition();\r
- flowBean.setBeanClass(RunnableCallFlow.class);\r
- \r
- String beanName = flowBeanNamesPrefix + flowDescriptor.getBeanName();\r
- \r
- MutablePropertyValues mpv = new MutablePropertyValues(); \r
- mpv.addPropertyValue("runnableCalls", flowDescriptor.getRunnableCalls());\r
- mpv.addPropertyValue("sharedContextValuesMap", new RuntimeBeanReference(contextValuesBeanName));\r
- \r
- mpv.addPropertyValue("name", beanName);\r
- mpv.addPropertyValue("path", flowDescriptor.getPath());\r
-\r
- mpv.addPropertyValue("executionContext", new RuntimeBeanReference(executionContextBeanName));\r
- \r
- flowBean.setPropertyValues(mpv);\r
- \r
- // register it\r
- if(log.isDebugEnabled()) {\r
- log.debug("Registering bean definition for RunnableCallFlow " + beanName);\r
- }\r
- registry.registerBeanDefinition(beanName, flowBean);\r
- }\r
- \r
- /**\r
- * Creates the Context Values bean and register it in the\r
- * <code>BeanDefinitionRegistry</code>\r
- * @param registry\r
- */\r
- private void createAndRegisterContextValuesBean(BeanDefinitionRegistry registry) {\r
- GenericBeanDefinition contextValuesBean = new GenericBeanDefinition();\r
- contextValuesBean.setBeanClass(HashMap.class);\r
- \r
- BeanDefinitionHolder bdh = ScopedProxyUtils.createScopedProxy(new BeanDefinitionHolder(contextValuesBean, contextValuesBeanName), registry, true); \r
- registry.registerBeanDefinition(contextValuesBeanName, bdh.getBeanDefinition()); \r
- }\r
- \r
- public int getOrder() {\r
- return order;\r
- }\r
-\r
- public void setOrder(int order) {\r
- this.order = order;\r
- }\r
-\r
- public void setSource(ExecutionFlowGeneratorSource source) {\r
- this.source = source;\r
- }\r
-\r
- public void setRunnableFactory(RunnableFactory runnableFactory) {\r
- this.runnableFactory = runnableFactory;\r
- }\r
-\r
- public void setExecutionContextBeanName(String executionContextBeanName) {\r
- this.executionContextBeanName = executionContextBeanName;\r
- }\r
-\r
- public void setContextValuesBeanName(String contextValuesBeanName) {\r
- this.contextValuesBeanName = contextValuesBeanName;\r
- }\r
-\r
- public void setFlowBeanNamesPrefix(String flowBeanNamesPrefix) {\r
- this.flowBeanNamesPrefix = flowBeanNamesPrefix;\r
- }\r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.HashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.springframework.aop.scope.ScopedProxyUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.RuntimeBeanReference;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.GenericBeanDefinition;
+import org.springframework.core.Ordered;
+
+/**
+ * Generates <code>ExecutionFlows</code> and <code>Runnables</code> as
+ * beans in the Spring Application Context.
+ * Called by the Application Context as a <code>BeanFactoryPostProcessor</code>.
+ * Two kinds of beans are generated:
+ * <code>RunnableCallFlow</code>, calling a list of <code>Runnables</code> from the
+ * Application Context after configuring the <code>ExecutionContext</code>,
+ * and outputs of a <code>RunnableFactory</code>.
+ */
+public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,
+ Ordered {
+
+ private final Log log = LogFactory.getLog(getClass());
+
+ /**
+ * Source providing a list of <code>RunnableCallFlowDescriptor</code>
+ * used to create <code>RunnableCallFlow</code> and a list of
+ * <code>RunnableDataNode</code> used to create any kind of flow via a factory
+ */
+ protected ExecutionFlowGeneratorSource source;
+
+ /**
+ * Factory used to create Runnables in the Application context from
+ * the <code>RunnableDataNode</code> provided from the source.
+ */
+ protected RunnableFactory runnableFactory;
+
+ /**
+ * Bean name of the <code>ExecutionContext</code>.
+ * Used to provide the created <code>RunnableCallFlow</code> beans
+ * with a <code>RuntimeBeanReference</code> to
+ * the <code>ExecutionContext</code>
+ */
+ private String executionContextBeanName = "executionContext";
+
+ /**
+ * Bean name of the context values Map.
+ * A bean of class HashMap is created with this name, and a
+ * <code>RuntimeBeanReference</code> is provided to the created
+ * <code>RunnableCallFlow</code> beans.
+ */
+ private String contextValuesBeanName = "executionFlowGenerator.contextValues";
+
+ /**
+ * Prefix added to the bean names defined in each
+ * <code>RunnableCallFlowDescriptor</code>
+ */
+ private String flowBeanNamesPrefix = "";
+
+ private int order = Ordered.HIGHEST_PRECEDENCE;
+
+ public void postProcessBeanFactory(
+ ConfigurableListableBeanFactory beanFactory) throws BeansException {
+
+ // assert that the beanFactory is a BeanDefinitionRegistry
+ if (!(beanFactory instanceof BeanDefinitionRegistry)) {
+ throw new SlcException("Can only work on "
+ + BeanDefinitionRegistry.class);
+ }
+
+ // add bean for the Context Values Map
+ createAndRegisterContextValuesBean((BeanDefinitionRegistry) beanFactory);
+
+ // add beans for each RunnableDataNode
+ for(RunnableDataNode node : source.getRunnableDataNodes()) {
+ runnableFactory.createAndRegisterRunnable(node, (BeanDefinitionRegistry) beanFactory);
+ }
+
+ // add beans for each RunnableCallFlowDescriptor of the source to the application context
+ for (RunnableCallFlowDescriptor descriptor : source
+ .getRunnableCallFlowDescriptors()) {
+ createAndRegisterFlowFor(descriptor, (BeanDefinitionRegistry) beanFactory);
+ }
+ }
+
+ /**
+ * Creates a <code>RunnableCallFlow</code> bean
+ * for a <code>RunnableCallFlowDescriptor</code> and registers
+ * it in the <code>BeanDefinitionRegistry</code>
+ * @param flowDescriptor
+ * @param registry
+ */
+ private void createAndRegisterFlowFor(RunnableCallFlowDescriptor flowDescriptor, BeanDefinitionRegistry registry) {
+ // create the flow bean
+ GenericBeanDefinition flowBean = new GenericBeanDefinition();
+ flowBean.setBeanClass(RunnableCallFlow.class);
+
+ String beanName = flowBeanNamesPrefix + flowDescriptor.getBeanName();
+
+ MutablePropertyValues mpv = new MutablePropertyValues();
+ mpv.addPropertyValue("runnableCalls", flowDescriptor.getRunnableCalls());
+ mpv.addPropertyValue("sharedContextValuesMap", new RuntimeBeanReference(contextValuesBeanName));
+
+ mpv.addPropertyValue("name", beanName);
+ mpv.addPropertyValue("path", flowDescriptor.getPath());
+
+ mpv.addPropertyValue("executionContext", new RuntimeBeanReference(executionContextBeanName));
+
+ flowBean.setPropertyValues(mpv);
+
+ // register it
+ if(log.isDebugEnabled()) {
+ log.debug("Registering bean definition for RunnableCallFlow " + beanName);
+ }
+ registry.registerBeanDefinition(beanName, flowBean);
+ }
+
+ /**
+ * Creates the Context Values bean and register it in the
+ * <code>BeanDefinitionRegistry</code>
+ * @param registry
+ */
+ private void createAndRegisterContextValuesBean(BeanDefinitionRegistry registry) {
+ GenericBeanDefinition contextValuesBean = new GenericBeanDefinition();
+ contextValuesBean.setBeanClass(HashMap.class);
+
+ BeanDefinitionHolder bdh = ScopedProxyUtils.createScopedProxy(new BeanDefinitionHolder(contextValuesBean, contextValuesBeanName), registry, true);
+ registry.registerBeanDefinition(contextValuesBeanName, bdh.getBeanDefinition());
+ }
+
+ public int getOrder() {
+ return order;
+ }
+
+ public void setOrder(int order) {
+ this.order = order;
+ }
+
+ public void setSource(ExecutionFlowGeneratorSource source) {
+ this.source = source;
+ }
+
+ public void setRunnableFactory(RunnableFactory runnableFactory) {
+ this.runnableFactory = runnableFactory;
+ }
+
+ public void setExecutionContextBeanName(String executionContextBeanName) {
+ this.executionContextBeanName = executionContextBeanName;
+ }
+
+ public void setContextValuesBeanName(String contextValuesBeanName) {
+ this.contextValuesBeanName = contextValuesBeanName;
+ }
+
+ public void setFlowBeanNamesPrefix(String flowBeanNamesPrefix) {
+ this.flowBeanNamesPrefix = flowBeanNamesPrefix;
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.List;\r
-\r
-/**\r
- * Provides 2 types of information required by an <code>ExecutionFlowGenerator</code>: \r
- * a list of <code>RunnableCallFlowDescriptor</code> used to create <code>RunnableCallFlow</code>\r
- * and a list of <code>RunnableDataNode</code> used to create any kind of flow via a factory.\r
- */\r
-public interface ExecutionFlowGeneratorSource {\r
- \r
- /**\r
- * @return a list of <code>RunnableCallFlowDescriptor</code> used \r
- * by a <code>ExecutionFlowGenerator</code> to create <code>RunnableCallFlow</code>\r
- */\r
- public List<RunnableCallFlowDescriptor> getRunnableCallFlowDescriptors();\r
- \r
- /**\r
- * @return a list of <code>RunnableDataNode</code> used \r
- * by a <code>ExecutionFlowGenerator</code> to create any kind of flow via a factory\r
- */\r
- public List<RunnableDataNode> getRunnableDataNodes();\r
- \r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.List;
+
+/**
+ * Provides 2 types of information required by an <code>ExecutionFlowGenerator</code>:
+ * a list of <code>RunnableCallFlowDescriptor</code> used to create <code>RunnableCallFlow</code>
+ * and a list of <code>RunnableDataNode</code> used to create any kind of flow via a factory.
+ */
+public interface ExecutionFlowGeneratorSource {
+
+ /**
+ * @return a list of <code>RunnableCallFlowDescriptor</code> used
+ * by a <code>ExecutionFlowGenerator</code> to create <code>RunnableCallFlow</code>
+ */
+ public List<RunnableCallFlowDescriptor> getRunnableCallFlowDescriptors();
+
+ /**
+ * @return a list of <code>RunnableDataNode</code> used
+ * by a <code>ExecutionFlowGenerator</code> to create any kind of flow via a factory
+ */
+ public List<RunnableDataNode> getRunnableDataNodes();
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.Map;\r
-\r
-/**\r
- * Storage class for information required to call a flow \r
- * of the Spring execution context: \r
- * bean name of the flow,\r
- * variables to add to the Execution Context before the call \r
- * and variables (context values) to add to a Map \r
- * potentially referenced by the called flow \r
- */\r
-public class RunnableCall {\r
- \r
- /**\r
- * Bean name of the flow to call\r
- */\r
- private String beanName;\r
- \r
- /**\r
- * Variables to add to the execution context before the call\r
- */\r
- private Map<String, Object> executionVariables;\r
- \r
- /**\r
- * Variables to add to the Map potentially referenced by\r
- * the called flow\r
- */\r
- private Map<String, Object> contextValues;\r
-\r
- public String getBeanName() {\r
- return beanName;\r
- }\r
-\r
- public void setBeanName(String beanName) {\r
- this.beanName = beanName;\r
- }\r
-\r
- public Map<String, Object> getExecutionVariables() {\r
- return executionVariables;\r
- }\r
-\r
- public void setExecutionVariables(Map<String, Object> executionVariables) {\r
- this.executionVariables = executionVariables;\r
- }\r
-\r
- public Map<String, Object> getContextValues() {\r
- return contextValues;\r
- }\r
-\r
- public void setContextValues(Map<String, Object> contextValues) {\r
- this.contextValues = contextValues;\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.Map;
+
+/**
+ * Storage class for information required to call a flow
+ * of the Spring execution context:
+ * bean name of the flow,
+ * variables to add to the Execution Context before the call
+ * and variables (context values) to add to a Map
+ * potentially referenced by the called flow
+ */
+public class RunnableCall {
+
+ /**
+ * Bean name of the flow to call
+ */
+ private String beanName;
+
+ /**
+ * Variables to add to the execution context before the call
+ */
+ private Map<String, Object> executionVariables;
+
+ /**
+ * Variables to add to the Map potentially referenced by
+ * the called flow
+ */
+ private Map<String, Object> contextValues;
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+ public void setBeanName(String beanName) {
+ this.beanName = beanName;
+ }
+
+ public Map<String, Object> getExecutionVariables() {
+ return executionVariables;
+ }
+
+ public void setExecutionVariables(Map<String, Object> executionVariables) {
+ this.executionVariables = executionVariables;
+ }
+
+ public Map<String, Object> getContextValues() {
+ return contextValues;
+ }
+
+ public void setContextValues(Map<String, Object> contextValues) {
+ this.contextValues = contextValues;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.core.execution.DefaultExecutionSpec;\r
-import org.argeo.slc.execution.ExecutionContext;\r
-import org.argeo.slc.execution.ExecutionFlow;\r
-import org.argeo.slc.execution.ExecutionSpec;\r
-import org.springframework.context.ApplicationContext;\r
-import org.springframework.context.ApplicationContextAware;\r
-\r
-/**\r
- * Execution Flow calling a list of <code>Runnable</code> (identified by their\r
- * bean name in the Spring Application Context) after configuring the Execution\r
- * context and a Map potentially shared by the called <code>Runnable</code>\r
- * \r
- */\r
-public class RunnableCallFlow implements ExecutionFlow, ApplicationContextAware {\r
-\r
- private final static Log log = LogFactory.getLog(RunnableCallFlow.class);\r
-\r
- /**\r
- * Key in the execution context for the index of the call (e.g. 0 for the\r
- * first runnable called, ...)\r
- */\r
- public final static String VAR_CALL_INDEX = "slcVar.runnableCallFlow.callIndex";\r
-\r
- /**\r
- * Name of the flow. Also bean name\r
- */\r
- private String name;\r
-\r
- /**\r
- * Path of the flow\r
- */\r
- private String path;\r
-\r
- /**\r
- * Whether an exception in a <code>Runnable</code> shall stop the execution\r
- * of the flow\r
- */\r
- private Boolean failOnError = true;\r
-\r
- /**\r
- * List of <code>Runnable</code> to call, with bean name, execution\r
- * variables and context values\r
- */\r
- private List<RunnableCall> runnableCalls;\r
-\r
- /**\r
- * Map potentially referenced by called flows. Updated with the context\r
- * values of a Runnable before calling it.\r
- */\r
- private Map<String, Object> sharedContextValuesMap;\r
-\r
- /**\r
- * ExecutionSpec of the flow. Does not contain any attribute.\r
- */\r
- private ExecutionSpec executionSpec = new DefaultExecutionSpec();\r
-\r
- /**\r
- * Reference to the ExecutionContext\r
- */\r
- private ExecutionContext executionContext;\r
-\r
- /**\r
- * Reference to the Spring <code>ApplicationContext</code>. Set via\r
- * <code>setApplicationContext</code>, the class implementing\r
- * <code>ApplicationContextAware</code>\r
- */\r
- private ApplicationContext applicationContext;\r
-\r
- /**\r
- * Runs a <code>Runnable</code> after configuring the Execution Context and\r
- * <code>sharedContextValuesMap</code>\r
- * \r
- * @param runnable\r
- * the <code>Runnable</code> to call\r
- * @param executionVariables\r
- * the variables to add to the <code>ExecutionContext</code>\r
- * @param contextValues\r
- * the variables to add to <code>sharedContextValuesMap</code>\r
- * @param callIndex\r
- * index of the call (0 for the first called\r
- * <code>Runnable</code>) set as variable of the\r
- * <code>ExecutionContext</code>\r
- */\r
- private void run(Runnable runnable, Map<String, Object> executionVariables,\r
- Map<String, Object> contextValues, int callIndex) {\r
- // add all variables to the Execution Context\r
- for (Map.Entry<String, Object> entry : executionVariables.entrySet()) {\r
- executionContext.setVariable(entry.getKey(), entry.getValue());\r
- }\r
-\r
- // add call Index Variable\r
- executionContext.setVariable(VAR_CALL_INDEX, callIndex);\r
-\r
- // clear sharedContextValues and add all values of contextValues\r
- if (sharedContextValuesMap != null) {\r
- sharedContextValuesMap.clear();\r
- sharedContextValuesMap.putAll(contextValues);\r
- }\r
-\r
- // then run the runnable\r
- doExecuteRunnable(runnable);\r
- }\r
-\r
- public void doExecuteRunnable(Runnable runnable) {\r
- runnable.run();\r
- }\r
-\r
- /**\r
- * Executes the flow. For each <code>RunnableCall</code>, the corresponding\r
- * flow is retrieved from the Spring Application Context, the\r
- * <code>ExecutionContext</code> and <code>sharedContextValuesMap</code> are\r
- * configured and the <code>Runnable</code> is called.\r
- */\r
- public void run() {\r
- if (applicationContext == null) {\r
- throw new SlcException("No ApplicationContext defined");\r
- }\r
-\r
- try {\r
- for (int callIndex = 0; callIndex < runnableCalls.size(); ++callIndex) {\r
- RunnableCall runnableCall = runnableCalls.get(callIndex);\r
- Object bean = applicationContext.getBean(\r
- runnableCall.getBeanName(), Runnable.class);\r
- if (log.isDebugEnabled())\r
- log.debug("Running flow '" + runnableCall.getBeanName()\r
- + "'");\r
- run((Runnable) bean, runnableCall.getExecutionVariables(),\r
- runnableCall.getContextValues(), callIndex);\r
- }\r
- } catch (RuntimeException e) {\r
- if (failOnError)\r
- throw e;\r
- else {\r
- log.error("Execution flow failed,"\r
- + " but process did not fail"\r
- + " because failOnError property"\r
- + " is set to false: " + e);\r
- if (log.isTraceEnabled())\r
- e.printStackTrace();\r
- }\r
- }\r
- }\r
-\r
- public Iterator<Runnable> runnables() {\r
- List<Runnable> runnables = new ArrayList<Runnable>();\r
- for (int callIndex = 0; callIndex < runnableCalls.size(); ++callIndex) {\r
- RunnableCall runnableCall = runnableCalls.get(callIndex);\r
- Object bean = applicationContext.getBean(\r
- runnableCall.getBeanName(), Runnable.class);\r
- runnables.add((Runnable) bean);\r
- }\r
- return runnables.iterator();\r
- }\r
-\r
- public Runnable getRunnable() {\r
- if (runnableCalls.size() == 1)\r
- return runnables().next();\r
- else\r
- throw new SlcException("There are " + runnableCalls.size()\r
- + " runnables in flow " + getName());\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return new StringBuffer("RunnableCallFlow ").append(name).toString();\r
- }\r
-\r
- public ExecutionSpec getExecutionSpec() {\r
- return executionSpec;\r
- }\r
-\r
- public String getName() {\r
- return name;\r
- }\r
-\r
- public Object getParameter(String key) {\r
- throw new SlcException("RunnableCallFlow have no parameters");\r
- }\r
-\r
- public String getPath() {\r
- return path;\r
- }\r
-\r
- public Boolean isSetAsParameter(String key) {\r
- // The ExecutionSpec having no attribute,\r
- // always return false\r
- return false;\r
- }\r
-\r
- public void setName(String name) {\r
- this.name = name;\r
- }\r
-\r
- public void setPath(String path) {\r
- this.path = path;\r
- }\r
-\r
- public void setExecutionContext(ExecutionContext executionContext) {\r
- this.executionContext = executionContext;\r
- }\r
-\r
- public void setRunnableCalls(List<RunnableCall> runnableCalls) {\r
- this.runnableCalls = runnableCalls;\r
- }\r
-\r
- public void setApplicationContext(ApplicationContext applicationContext) {\r
- this.applicationContext = applicationContext;\r
- }\r
-\r
- public void setSharedContextValuesMap(Map<String, Object> contextValues) {\r
- this.sharedContextValuesMap = contextValues;\r
- }\r
-\r
- public void setFailOnError(Boolean failOnError) {\r
- this.failOnError = failOnError;\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.core.execution.DefaultExecutionSpec;
+import org.argeo.slc.execution.ExecutionContext;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.execution.ExecutionSpec;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+/**
+ * Execution Flow calling a list of <code>Runnable</code> (identified by their
+ * bean name in the Spring Application Context) after configuring the Execution
+ * context and a Map potentially shared by the called <code>Runnable</code>
+ *
+ */
+public class RunnableCallFlow implements ExecutionFlow, ApplicationContextAware {
+
+ private final static Log log = LogFactory.getLog(RunnableCallFlow.class);
+
+ /**
+ * Key in the execution context for the index of the call (e.g. 0 for the
+ * first runnable called, ...)
+ */
+ public final static String VAR_CALL_INDEX = "slcVar.runnableCallFlow.callIndex";
+
+ /**
+ * Name of the flow. Also bean name
+ */
+ private String name;
+
+ /**
+ * Path of the flow
+ */
+ private String path;
+
+ /**
+ * Whether an exception in a <code>Runnable</code> shall stop the execution
+ * of the flow
+ */
+ private Boolean failOnError = true;
+
+ /**
+ * List of <code>Runnable</code> to call, with bean name, execution
+ * variables and context values
+ */
+ private List<RunnableCall> runnableCalls;
+
+ /**
+ * Map potentially referenced by called flows. Updated with the context
+ * values of a Runnable before calling it.
+ */
+ private Map<String, Object> sharedContextValuesMap;
+
+ /**
+ * ExecutionSpec of the flow. Does not contain any attribute.
+ */
+ private ExecutionSpec executionSpec = new DefaultExecutionSpec();
+
+ /**
+ * Reference to the ExecutionContext
+ */
+ private ExecutionContext executionContext;
+
+ /**
+ * Reference to the Spring <code>ApplicationContext</code>. Set via
+ * <code>setApplicationContext</code>, the class implementing
+ * <code>ApplicationContextAware</code>
+ */
+ private ApplicationContext applicationContext;
+
+ /**
+ * Runs a <code>Runnable</code> after configuring the Execution Context and
+ * <code>sharedContextValuesMap</code>
+ *
+ * @param runnable
+ * the <code>Runnable</code> to call
+ * @param executionVariables
+ * the variables to add to the <code>ExecutionContext</code>
+ * @param contextValues
+ * the variables to add to <code>sharedContextValuesMap</code>
+ * @param callIndex
+ * index of the call (0 for the first called
+ * <code>Runnable</code>) set as variable of the
+ * <code>ExecutionContext</code>
+ */
+ private void run(Runnable runnable, Map<String, Object> executionVariables,
+ Map<String, Object> contextValues, int callIndex) {
+ // add all variables to the Execution Context
+ for (Map.Entry<String, Object> entry : executionVariables.entrySet()) {
+ executionContext.setVariable(entry.getKey(), entry.getValue());
+ }
+
+ // add call Index Variable
+ executionContext.setVariable(VAR_CALL_INDEX, callIndex);
+
+ // clear sharedContextValues and add all values of contextValues
+ if (sharedContextValuesMap != null) {
+ sharedContextValuesMap.clear();
+ sharedContextValuesMap.putAll(contextValues);
+ }
+
+ // then run the runnable
+ doExecuteRunnable(runnable);
+ }
+
+ public void doExecuteRunnable(Runnable runnable) {
+ runnable.run();
+ }
+
+ /**
+ * Executes the flow. For each <code>RunnableCall</code>, the corresponding
+ * flow is retrieved from the Spring Application Context, the
+ * <code>ExecutionContext</code> and <code>sharedContextValuesMap</code> are
+ * configured and the <code>Runnable</code> is called.
+ */
+ public void run() {
+ if (applicationContext == null) {
+ throw new SlcException("No ApplicationContext defined");
+ }
+
+ try {
+ for (int callIndex = 0; callIndex < runnableCalls.size(); ++callIndex) {
+ RunnableCall runnableCall = runnableCalls.get(callIndex);
+ Object bean = applicationContext.getBean(
+ runnableCall.getBeanName(), Runnable.class);
+ if (log.isDebugEnabled())
+ log.debug("Running flow '" + runnableCall.getBeanName()
+ + "'");
+ run((Runnable) bean, runnableCall.getExecutionVariables(),
+ runnableCall.getContextValues(), callIndex);
+ }
+ } catch (RuntimeException e) {
+ if (failOnError)
+ throw e;
+ else {
+ log.error("Execution flow failed,"
+ + " but process did not fail"
+ + " because failOnError property"
+ + " is set to false: " + e);
+ if (log.isTraceEnabled())
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public Iterator<Runnable> runnables() {
+ List<Runnable> runnables = new ArrayList<Runnable>();
+ for (int callIndex = 0; callIndex < runnableCalls.size(); ++callIndex) {
+ RunnableCall runnableCall = runnableCalls.get(callIndex);
+ Object bean = applicationContext.getBean(
+ runnableCall.getBeanName(), Runnable.class);
+ runnables.add((Runnable) bean);
+ }
+ return runnables.iterator();
+ }
+
+ public Runnable getRunnable() {
+ if (runnableCalls.size() == 1)
+ return runnables().next();
+ else
+ throw new SlcException("There are " + runnableCalls.size()
+ + " runnables in flow " + getName());
+ }
+
+ @Override
+ public String toString() {
+ return new StringBuffer("RunnableCallFlow ").append(name).toString();
+ }
+
+ public ExecutionSpec getExecutionSpec() {
+ return executionSpec;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Object getParameter(String key) {
+ throw new SlcException("RunnableCallFlow have no parameters");
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public Boolean isSetAsParameter(String key) {
+ // The ExecutionSpec having no attribute,
+ // always return false
+ return false;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public void setExecutionContext(ExecutionContext executionContext) {
+ this.executionContext = executionContext;
+ }
+
+ public void setRunnableCalls(List<RunnableCall> runnableCalls) {
+ this.runnableCalls = runnableCalls;
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+
+ public void setSharedContextValuesMap(Map<String, Object> contextValues) {
+ this.sharedContextValuesMap = contextValues;
+ }
+
+ public void setFailOnError(Boolean failOnError) {
+ this.failOnError = failOnError;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-/**\r
- * Storage Class for information required to\r
- * instantiate a <code>RunnableCallFlow</code>:\r
- * bean name of the flow, \r
- * path of the flow \r
- * and list of <code>RunnableCall</code>. \r
- *\r
- */\r
-public class RunnableCallFlowDescriptor {\r
- \r
- /**\r
- * Bean name of the flow to instantiate\r
- */\r
- private String beanName;\r
- \r
- /**\r
- * Path of the flow to instantiate\r
- */\r
- private String path;\r
- \r
- /**\r
- * List of <code>RunnableCall</code> \r
- */\r
- private List<RunnableCall> runnableCalls = new ArrayList<RunnableCall>();\r
-\r
- public String getBeanName() {\r
- return beanName;\r
- }\r
-\r
- public void setBeanName(String beanName) {\r
- this.beanName = beanName;\r
- }\r
-\r
- public String getPath() {\r
- return path;\r
- }\r
-\r
- public void setPath(String path) {\r
- this.path = path;\r
- }\r
-\r
- public List<RunnableCall> getRunnableCalls() {\r
- return runnableCalls;\r
- }\r
-\r
- public void setRunnableCalls(List<RunnableCall> runnableCalls) {\r
- this.runnableCalls = runnableCalls;\r
- }\r
- \r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Storage Class for information required to
+ * instantiate a <code>RunnableCallFlow</code>:
+ * bean name of the flow,
+ * path of the flow
+ * and list of <code>RunnableCall</code>.
+ *
+ */
+public class RunnableCallFlowDescriptor {
+
+ /**
+ * Bean name of the flow to instantiate
+ */
+ private String beanName;
+
+ /**
+ * Path of the flow to instantiate
+ */
+ private String path;
+
+ /**
+ * List of <code>RunnableCall</code>
+ */
+ private List<RunnableCall> runnableCalls = new ArrayList<RunnableCall>();
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+ public void setBeanName(String beanName) {
+ this.beanName = beanName;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public List<RunnableCall> getRunnableCalls() {
+ return runnableCalls;
+ }
+
+ public void setRunnableCalls(List<RunnableCall> runnableCalls) {
+ this.runnableCalls = runnableCalls;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-/**\r
- * Stores information relative to a Runnable.\r
- * Allows to structure the information as a tree, each node\r
- * storing data as a Map.\r
- */\r
-public interface RunnableDataNode {\r
-\r
- /**\r
- * @return a Map containing the data associated with this node.\r
- * Data associated with parent nodes are expected\r
- * to be contained in the returned Map\r
- */\r
- public Map<String, Object> getData(); \r
-\r
- /**\r
- * @return the name of the bean to create.\r
- * Can be null if no bean shall be created for the \r
- * <code>RunnableDataNode</code> (e.g. is is a sub-node)\r
- */\r
- public String getBeanName();\r
- \r
- /**\r
- * @return the path of the flow bean to create.\r
- * Can be null if the bean to created is not an\r
- * <code>ExecutionFlow</code> or if no bean shall be created for the \r
- * <code>RunnableDataNode</code> (e.g. is is a sub-node)\r
- */\r
- public String getPath();\r
- \r
- /**\r
- * @return whether the <code>RunnableDataNode</code> has\r
- * children or not.\r
- * Expected to be equivalent to <code>getChildren().empty()</code>\r
- */\r
- public boolean isLeaf();\r
-\r
- /**\r
- * @return the list of <code>RunnableDataNode</code> children.\r
- * Can be empty. Shall not be null.\r
- */\r
- public List<RunnableDataNode> getChildren();\r
- \r
- /**\r
- * @return the <code>RunnableDataNode</code> parent.\r
- * Can be null if no parent is defined (top node).\r
- */\r
- public RunnableDataNode getParent();\r
- \r
- /**\r
- * Sets the <code>RunnableDataNode</code> parent\r
- * @param parent\r
- */\r
- public void setParent(RunnableDataNode parent); \r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Stores information relative to a Runnable.
+ * Allows to structure the information as a tree, each node
+ * storing data as a Map.
+ */
+public interface RunnableDataNode {
+
+ /**
+ * @return a Map containing the data associated with this node.
+ * Data associated with parent nodes are expected
+ * to be contained in the returned Map
+ */
+ public Map<String, Object> getData();
+
+ /**
+ * @return the name of the bean to create.
+ * Can be null if no bean shall be created for the
+ * <code>RunnableDataNode</code> (e.g. is is a sub-node)
+ */
+ public String getBeanName();
+
+ /**
+ * @return the path of the flow bean to create.
+ * Can be null if the bean to created is not an
+ * <code>ExecutionFlow</code> or if no bean shall be created for the
+ * <code>RunnableDataNode</code> (e.g. is is a sub-node)
+ */
+ public String getPath();
+
+ /**
+ * @return whether the <code>RunnableDataNode</code> has
+ * children or not.
+ * Expected to be equivalent to <code>getChildren().empty()</code>
+ */
+ public boolean isLeaf();
+
+ /**
+ * @return the list of <code>RunnableDataNode</code> children.
+ * Can be empty. Shall not be null.
+ */
+ public List<RunnableDataNode> getChildren();
+
+ /**
+ * @return the <code>RunnableDataNode</code> parent.
+ * Can be null if no parent is defined (top node).
+ */
+ public RunnableDataNode getParent();
+
+ /**
+ * Sets the <code>RunnableDataNode</code> parent
+ * @param parent
+ */
+ public void setParent(RunnableDataNode parent);
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.generator;\r
-\r
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;\r
-\r
-/**\r
- * Interprets a <code>RunnableDataNode</code> by creating corresponding\r
- * beans and registering them in a <code>BeanDefinitionRegistry</code>\r
- *\r
- */\r
-public interface RunnableFactory {\r
-\r
- public void createAndRegisterRunnable(RunnableDataNode node,\r
- BeanDefinitionRegistry beanDefinitionRegistry);\r
-}\r
+package org.argeo.slc.core.execution.generator;
+
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+
+/**
+ * Interprets a <code>RunnableDataNode</code> by creating corresponding
+ * beans and registering them in a <code>BeanDefinitionRegistry</code>
+ *
+ */
+public interface RunnableFactory {
+
+ public void createAndRegisterRunnable(RunnableDataNode node,
+ BeanDefinitionRegistry beanDefinitionRegistry);
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import org.argeo.slc.test.TestResult;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import java.lang.reflect.Method;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.tasks;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.core.test.context.SimpleContextAware;\r
-import org.argeo.slc.test.context.ContextAware;\r
-\r
-/**\r
- * Overrides Values and Expected values of a target \r
- * <code>SimpleContextAware</code> with the corresponding\r
- * values and expected values of a source <code>ContextAware</code>\r
- *\r
- */\r
-public class OverrideContextAware implements Runnable {\r
-\r
- private ContextAware source;\r
-\r
- private SimpleContextAware target;\r
- \r
- /**\r
- * Whether an exception shall be thrown if a value\r
- * or expected value of the source is not defined\r
- * in the target\r
- */\r
- private Boolean failIfUndefinedInSource = true;\r
- \r
- public void run() {\r
- // override values\r
- if(source.getValues() != null)\r
- for(String key : source.getValues().keySet()) {\r
- if(failIfUndefinedInSource && !target.getValues().containsKey(key)) {\r
- throw new SlcException("No entry in target values for key '" + key + "'");\r
- }\r
- target.getValues().put(key, source.getValues().get(key));\r
- }\r
- \r
- // override expected values\r
- if(source.getExpectedValues() != null)\r
- for(String key : source.getExpectedValues().keySet()) {\r
- if(failIfUndefinedInSource && !target.getExpectedValues().containsKey(key)) {\r
- throw new SlcException("No entry in target expected values for key '" + key + "'");\r
- }\r
- target.getExpectedValues().put(key, source.getExpectedValues().get(key));\r
- } \r
- } \r
- \r
- public void setSource(ContextAware source) {\r
- this.source = source;\r
- }\r
-\r
- public void setTarget(SimpleContextAware target) {\r
- this.target = target;\r
- }\r
-\r
- public void setFailIfUndefinedInSource(Boolean failIfUndefinedInSource) {\r
- this.failIfUndefinedInSource = failIfUndefinedInSource;\r
- } \r
-}\r
+package org.argeo.slc.core.execution.tasks;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.core.test.context.SimpleContextAware;
+import org.argeo.slc.test.context.ContextAware;
+
+/**
+ * Overrides Values and Expected values of a target
+ * <code>SimpleContextAware</code> with the corresponding
+ * values and expected values of a source <code>ContextAware</code>
+ *
+ */
+public class OverrideContextAware implements Runnable {
+
+ private ContextAware source;
+
+ private SimpleContextAware target;
+
+ /**
+ * Whether an exception shall be thrown if a value
+ * or expected value of the source is not defined
+ * in the target
+ */
+ private Boolean failIfUndefinedInSource = true;
+
+ public void run() {
+ // override values
+ if(source.getValues() != null)
+ for(String key : source.getValues().keySet()) {
+ if(failIfUndefinedInSource && !target.getValues().containsKey(key)) {
+ throw new SlcException("No entry in target values for key '" + key + "'");
+ }
+ target.getValues().put(key, source.getValues().get(key));
+ }
+
+ // override expected values
+ if(source.getExpectedValues() != null)
+ for(String key : source.getExpectedValues().keySet()) {
+ if(failIfUndefinedInSource && !target.getExpectedValues().containsKey(key)) {
+ throw new SlcException("No entry in target expected values for key '" + key + "'");
+ }
+ target.getExpectedValues().put(key, source.getExpectedValues().get(key));
+ }
+ }
+
+ public void setSource(ContextAware source) {
+ this.source = source;
+ }
+
+ public void setTarget(SimpleContextAware target) {
+ this.target = target;
+ }
+
+ public void setFailIfUndefinedInSource(Boolean failIfUndefinedInSource) {
+ this.failIfUndefinedInSource = failIfUndefinedInSource;
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
public interface SystemCallOutputListener {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.tasks;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import org.apache.commons.logging.Log;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.xml;\r
-\r
-import org.springframework.aop.scope.ScopedProxyUtils;\r
-import org.springframework.beans.factory.config.BeanDefinitionHolder;\r
-import org.springframework.beans.factory.parsing.BeanComponentDefinition;\r
-import org.springframework.beans.factory.xml.BeanDefinitionDecorator;\r
-import org.springframework.beans.factory.xml.ParserContext;\r
-import org.w3c.dom.Element;\r
-import org.w3c.dom.Node;\r
-\r
-/**\r
- * Inspired by org.springframework.aop.config.ScopedProxyBeanDefinitionDecorator\r
- */\r
-public class ExecutionScopeDecorator implements BeanDefinitionDecorator { \r
- private static final String PROXY_TARGET_CLASS = "proxy-target-class"; \r
- \r
- public BeanDefinitionHolder decorate(Node node,\r
- BeanDefinitionHolder definition, ParserContext parserContext) {\r
- \r
- definition.getBeanDefinition().setScope("execution");\r
- \r
- // Default: CGLib not used\r
- boolean proxyTargetClass = false;\r
- if (node instanceof Element) {\r
- Element ele = (Element) node;\r
- if (ele.hasAttribute(PROXY_TARGET_CLASS)) {\r
- proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS)).booleanValue();\r
- }\r
- }\r
- \r
- // Register the original bean definition as it will be referenced by the scoped proxy and is relevant for tooling (validation, navigation).\r
- String targetBeanName = ScopedProxyUtils.getTargetBeanName(definition.getBeanName());\r
- parserContext.getReaderContext().fireComponentRegistered(new BeanComponentDefinition(definition.getBeanDefinition(), targetBeanName));\r
- \r
- return ScopedProxyUtils.createScopedProxy(definition, parserContext.getRegistry(), proxyTargetClass); \r
- }\r
-}\r
+package org.argeo.slc.core.execution.xml;
+
+import org.springframework.aop.scope.ScopedProxyUtils;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.beans.factory.parsing.BeanComponentDefinition;
+import org.springframework.beans.factory.xml.BeanDefinitionDecorator;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Inspired by org.springframework.aop.config.ScopedProxyBeanDefinitionDecorator
+ */
+public class ExecutionScopeDecorator implements BeanDefinitionDecorator {
+ private static final String PROXY_TARGET_CLASS = "proxy-target-class";
+
+ public BeanDefinitionHolder decorate(Node node,
+ BeanDefinitionHolder definition, ParserContext parserContext) {
+
+ definition.getBeanDefinition().setScope("execution");
+
+ // Default: CGLib not used
+ boolean proxyTargetClass = false;
+ if (node instanceof Element) {
+ Element ele = (Element) node;
+ if (ele.hasAttribute(PROXY_TARGET_CLASS)) {
+ proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS)).booleanValue();
+ }
+ }
+
+ // Register the original bean definition as it will be referenced by the scoped proxy and is relevant for tooling (validation, navigation).
+ String targetBeanName = ScopedProxyUtils.getTargetBeanName(definition.getBeanName());
+ parserContext.getReaderContext().fireComponentRegistered(new BeanComponentDefinition(definition.getBeanDefinition(), targetBeanName));
+
+ return ScopedProxyUtils.createScopedProxy(definition, parserContext.getRegistry(), proxyTargetClass);
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import org.argeo.slc.core.execution.ParameterRef;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.core.execution.xml;
import java.util.List;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.test.context;\r
-\r
-import org.argeo.slc.runtime.test.TestDataUtils;\r
-import org.argeo.slc.test.TestData;\r
-import org.argeo.slc.test.TestDataProvider;\r
-\r
-public class DefaultContextTestData extends SimpleContextAware implements\r
- TestData, TestDataProvider {\r
-\r
- public <T extends TestData> T getTestData(Class<T> clss, String key) {\r
- return TestDataUtils.getItSelf(clss, this);\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.test.context;
+
+import org.argeo.slc.runtime.test.TestDataUtils;
+import org.argeo.slc.test.TestData;
+import org.argeo.slc.test.TestDataProvider;
+
+public class DefaultContextTestData extends SimpleContextAware implements
+ TestData, TestDataProvider {
+
+ public <T extends TestData> T getTestData(Class<T> clss, String key) {
+ return TestDataUtils.getItSelf(clss, this);
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.test.context;\r
-\r
-import java.util.Map;\r
-import java.util.TreeMap;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.runtime.test.ContextUtils;\r
-import org.argeo.slc.test.context.ContextAware;\r
-import org.argeo.slc.test.context.ParentContextAware;\r
-import org.springframework.beans.factory.InitializingBean;\r
-\r
-public class SimpleContextAware implements ContextAware, InitializingBean {\r
- private ParentContextAware parentContext;\r
-\r
- private Map<String, Object> values = new TreeMap<String, Object>();\r
- private Map<String, Object> expectedValues = new TreeMap<String, Object>();\r
-\r
- private String contextSkipFlag = DEFAULT_SKIP_FLAG;\r
- private String contextAnyFlag = DEFAULT_ANY_FLAG;\r
-\r
- public Map<String, Object> getValues() {\r
- return values;\r
- }\r
-\r
- public void setValues(Map<String, Object> values) {\r
- this.values = values;\r
- }\r
-\r
- public Map<String, Object> getExpectedValues() {\r
- return expectedValues;\r
- }\r
-\r
- public void setExpectedValues(Map<String, Object> expectedValues) {\r
- this.expectedValues = expectedValues;\r
- }\r
-\r
- /** Used to add this context as a child by setting a property. */\r
- public void setParentContext(ParentContextAware parentContextAware) {\r
- if (parentContext != null)\r
- throw new SlcException("Parent context already set");\r
- this.parentContext = parentContextAware;\r
- this.parentContext.addChildContext(this);\r
- }\r
-\r
- protected ParentContextAware getParentContext() {\r
- return parentContext;\r
- }\r
-\r
- public void afterPropertiesSet() throws Exception {\r
- if (parentContext != null) {\r
- ContextUtils.synchronize(parentContext);\r
- }\r
- }\r
-\r
- public String getContextSkipFlag() {\r
- return contextSkipFlag;\r
- }\r
-\r
- public void setContextSkipFlag(String contextSkipFlag) {\r
- this.contextSkipFlag = contextSkipFlag;\r
- }\r
-\r
- public String getContextAnyFlag() {\r
- return contextAnyFlag;\r
- }\r
-\r
- public void setContextAnyFlag(String contextAnyFlag) {\r
- this.contextAnyFlag = contextAnyFlag;\r
- }\r
-\r
-}\r
+package org.argeo.slc.core.test.context;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.runtime.test.ContextUtils;
+import org.argeo.slc.test.context.ContextAware;
+import org.argeo.slc.test.context.ParentContextAware;
+import org.springframework.beans.factory.InitializingBean;
+
+public class SimpleContextAware implements ContextAware, InitializingBean {
+ private ParentContextAware parentContext;
+
+ private Map<String, Object> values = new TreeMap<String, Object>();
+ private Map<String, Object> expectedValues = new TreeMap<String, Object>();
+
+ private String contextSkipFlag = DEFAULT_SKIP_FLAG;
+ private String contextAnyFlag = DEFAULT_ANY_FLAG;
+
+ public Map<String, Object> getValues() {
+ return values;
+ }
+
+ public void setValues(Map<String, Object> values) {
+ this.values = values;
+ }
+
+ public Map<String, Object> getExpectedValues() {
+ return expectedValues;
+ }
+
+ public void setExpectedValues(Map<String, Object> expectedValues) {
+ this.expectedValues = expectedValues;
+ }
+
+ /** Used to add this context as a child by setting a property. */
+ public void setParentContext(ParentContextAware parentContextAware) {
+ if (parentContext != null)
+ throw new SlcException("Parent context already set");
+ this.parentContext = parentContextAware;
+ this.parentContext.addChildContext(this);
+ }
+
+ protected ParentContextAware getParentContext() {
+ return parentContext;
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ if (parentContext != null) {
+ ContextUtils.synchronize(parentContext);
+ }
+ }
+
+ public String getContextSkipFlag() {
+ return contextSkipFlag;
+ }
+
+ public void setContextSkipFlag(String contextSkipFlag) {
+ this.contextSkipFlag = contextSkipFlag;
+ }
+
+ public String getContextAnyFlag() {
+ return contextAnyFlag;
+ }
+
+ public void setContextAnyFlag(String contextAnyFlag) {
+ this.contextAnyFlag = contextAnyFlag;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.test.context;\r
-\r
-import java.util.Collection;\r
-import java.util.List;\r
-import java.util.Vector;\r
-\r
-import org.argeo.slc.runtime.test.ContextUtils;\r
-import org.argeo.slc.test.context.ContextAware;\r
-import org.argeo.slc.test.context.ParentContextAware;\r
-import org.springframework.beans.factory.InitializingBean;\r
-\r
-public class SimpleParentContextAware extends SimpleContextAware implements\r
- ParentContextAware, InitializingBean {\r
- private List<ContextAware> children = new Vector<ContextAware>();\r
-\r
- public Collection<ContextAware> getChildContexts() {\r
- return children;\r
- }\r
-\r
- public void addChildContext(ContextAware contextAware) {\r
- children.add(contextAware);\r
- }\r
-\r
- @Override\r
- public void afterPropertiesSet() throws Exception {\r
- if (getParentContext() != null) {\r
- // If has a parent, sync it.\r
- super.afterPropertiesSet();\r
- } else {\r
- if (children.size() > 0) {\r
- // No need to synchronize if no children\r
- ContextUtils.synchronize(this);\r
- }\r
- }\r
- }\r
-}\r
+package org.argeo.slc.core.test.context;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Vector;
+
+import org.argeo.slc.runtime.test.ContextUtils;
+import org.argeo.slc.test.context.ContextAware;
+import org.argeo.slc.test.context.ParentContextAware;
+import org.springframework.beans.factory.InitializingBean;
+
+public class SimpleParentContextAware extends SimpleContextAware implements
+ ParentContextAware, InitializingBean {
+ private List<ContextAware> children = new Vector<ContextAware>();
+
+ public Collection<ContextAware> getChildContexts() {
+ return children;
+ }
+
+ public void addChildContext(ContextAware contextAware) {
+ children.add(contextAware);
+ }
+
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ if (getParentContext() != null) {
+ // If has a parent, sync it.
+ super.afterPropertiesSet();
+ } else {
+ if (children.size() > 0) {
+ // No need to synchronize if no children
+ ContextUtils.synchronize(this);
+ }
+ }
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
/** <b>Experimental</b> A structured set of OSGi bundles. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import java.util.Collection;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import org.argeo.slc.DefaultNameVersion;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import java.lang.management.ManagementFactory;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.build;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.build;
import java.net.URL;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.build;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.build;
public class EclipseUpdateSiteCategory {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.build;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.build;
import java.net.URL;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.osgi.deploy;
import org.argeo.slc.core.deploy.DefaultResourceSet;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring;
import javax.security.auth.Subject;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring;
import java.security.AccessController;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring.auth;
import javax.security.auth.Subject;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring.auth;
import java.security.AccessController;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring.unit;
import org.argeo.slc.execution.ExecutionFlow;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring.unit;
import java.util.ArrayList;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.spring.unit;\r
-\r
-import java.util.Map;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.springframework.beans.factory.BeanFactoryUtils;\r
-import org.springframework.beans.factory.ListableBeanFactory;\r
-import org.springframework.context.ConfigurableApplicationContext;\r
-import org.springframework.context.support.ClassPathXmlApplicationContext;\r
-\r
-import junit.framework.TestCase;\r
-\r
-/** Helper for tests using a Spring application co,text. */\r
-public abstract class AbstractSpringTestCase extends TestCase {\r
- protected final Log log = LogFactory.getLog(getClass());\r
- private ConfigurableApplicationContext context;\r
-\r
- /**\r
- * Gets (and create if necessary) the application context to use. Default\r
- * implementation uses a class path xml application context and calls\r
- * {@link #getApplicationContextLocation()}.\r
- */\r
- protected ConfigurableApplicationContext getContext() {\r
- if (context == null) {\r
- context = new ClassPathXmlApplicationContext(\r
- getApplicationContextLocation());\r
- if (getIsStartContext())\r
- context.start();\r
- }\r
- return context;\r
- }\r
-\r
- @Override\r
- protected void tearDown() throws Exception {\r
- if (context != null && context.isActive())\r
- context.close();\r
- super.tearDown();\r
- }\r
-\r
- /** Whether the context should be started after being created. */\r
- protected Boolean getIsStartContext() {\r
- return false;\r
- }\r
-\r
- /** Returns a bean from the underlying context */\r
- @SuppressWarnings(value = { "unchecked" })\r
- protected <T> T getBean(String beanId) {\r
- return (T) getContext().getBean(beanId);\r
- }\r
-\r
- protected <T> T getBean(Class<? extends T> clss) {\r
- T bean = loadSingleFromContext(getContext(), clss);\r
- if (bean == null) {\r
- throw new SlcException("Cannot retrieve a unique bean of type "\r
- + clss);\r
- } else {\r
- return bean;\r
- }\r
- }\r
-\r
- /**\r
- * Th location of the application to load. The default implementation\r
- * returns <i>applicationContext.xml</i> found in the same package as the\r
- * test.\r
- */\r
- protected String getApplicationContextLocation() {\r
- return inPackage("applicationContext.xml");\r
- }\r
-\r
- /**\r
- * Prefixes the package of the class after converting the '.' to '/' in\r
- * order to have a resource path.\r
- */\r
- protected String inPackage(String suffix) {\r
- String prefix = getClass().getPackage().getName().replace('.', '/');\r
- return prefix + '/' + suffix;\r
- }\r
-\r
- @SuppressWarnings(value = { "unchecked" })\r
- protected <T> T loadSingleFromContext(ListableBeanFactory context,\r
- Class<T> clss) {\r
- Map<String, T> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(\r
- context, clss, false, false);\r
- if (beans.size() == 1) {\r
- return beans.values().iterator().next();\r
- } else if (beans.size() > 1) {\r
- if (log.isDebugEnabled()) {\r
- log\r
- .debug(("Found more that on bean for type " + clss\r
- + ": " + beans.keySet()));\r
- }\r
- return null;\r
- } else {\r
- return null;\r
- }\r
- }\r
-\r
-}\r
+package org.argeo.slc.spring.unit;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.springframework.beans.factory.BeanFactoryUtils;
+import org.springframework.beans.factory.ListableBeanFactory;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import junit.framework.TestCase;
+
+/** Helper for tests using a Spring application co,text. */
+public abstract class AbstractSpringTestCase extends TestCase {
+ protected final Log log = LogFactory.getLog(getClass());
+ private ConfigurableApplicationContext context;
+
+ /**
+ * Gets (and create if necessary) the application context to use. Default
+ * implementation uses a class path xml application context and calls
+ * {@link #getApplicationContextLocation()}.
+ */
+ protected ConfigurableApplicationContext getContext() {
+ if (context == null) {
+ context = new ClassPathXmlApplicationContext(
+ getApplicationContextLocation());
+ if (getIsStartContext())
+ context.start();
+ }
+ return context;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if (context != null && context.isActive())
+ context.close();
+ super.tearDown();
+ }
+
+ /** Whether the context should be started after being created. */
+ protected Boolean getIsStartContext() {
+ return false;
+ }
+
+ /** Returns a bean from the underlying context */
+ @SuppressWarnings(value = { "unchecked" })
+ protected <T> T getBean(String beanId) {
+ return (T) getContext().getBean(beanId);
+ }
+
+ protected <T> T getBean(Class<? extends T> clss) {
+ T bean = loadSingleFromContext(getContext(), clss);
+ if (bean == null) {
+ throw new SlcException("Cannot retrieve a unique bean of type "
+ + clss);
+ } else {
+ return bean;
+ }
+ }
+
+ /**
+ * Th location of the application to load. The default implementation
+ * returns <i>applicationContext.xml</i> found in the same package as the
+ * test.
+ */
+ protected String getApplicationContextLocation() {
+ return inPackage("applicationContext.xml");
+ }
+
+ /**
+ * Prefixes the package of the class after converting the '.' to '/' in
+ * order to have a resource path.
+ */
+ protected String inPackage(String suffix) {
+ String prefix = getClass().getPackage().getName().replace('.', '/');
+ return prefix + '/' + suffix;
+ }
+
+ @SuppressWarnings(value = { "unchecked" })
+ protected <T> T loadSingleFromContext(ListableBeanFactory context,
+ Class<T> clss) {
+ Map<String, T> beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
+ context, clss, false, false);
+ if (beans.size() == 1) {
+ return beans.values().iterator().next();
+ } else if (beans.size() > 1) {
+ if (log.isDebugEnabled()) {
+ log
+ .debug(("Found more that on bean for type " + clss
+ + ": " + beans.keySet()));
+ }
+ return null;
+ } else {
+ return null;
+ }
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.spring.unit;
import java.util.ArrayList;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.spring.unit;\r
-\r
-import static junit.framework.Assert.assertEquals;\r
-import static junit.framework.Assert.assertNotNull;\r
-import static junit.framework.Assert.assertNull;\r
-\r
-import java.util.Calendar;\r
-import java.util.Date;\r
-import java.util.GregorianCalendar;\r
-\r
-public abstract class UnitUtils {\r
- public static void assertDateSec(Date expected, Date reached) {\r
- if (expected == null) {\r
- assertNull(reached);\r
- return;\r
- } else {\r
- assertNotNull(reached);\r
- }\r
-\r
- Calendar expectedCal = new GregorianCalendar();\r
- expectedCal.setTime(expected);\r
- Calendar reachedCal = new GregorianCalendar();\r
- reachedCal.setTime(reached);\r
- assertEquals(expectedCal.get(Calendar.YEAR), reachedCal\r
- .get(Calendar.YEAR));\r
- assertEquals(expectedCal.get(Calendar.MONTH), reachedCal\r
- .get(Calendar.MONTH));\r
- assertEquals(expectedCal.get(Calendar.DATE), reachedCal\r
- .get(Calendar.DATE));\r
- assertEquals(expectedCal.get(Calendar.HOUR_OF_DAY), reachedCal\r
- .get(Calendar.HOUR_OF_DAY));\r
- assertEquals(expectedCal.get(Calendar.MINUTE), reachedCal\r
- .get(Calendar.MINUTE));\r
- assertEquals(expectedCal.get(Calendar.SECOND), reachedCal\r
- .get(Calendar.SECOND));\r
- }\r
-\r
- private UnitUtils() {\r
-\r
- }\r
-\r
-}\r
+package org.argeo.slc.spring.unit;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+public abstract class UnitUtils {
+ public static void assertDateSec(Date expected, Date reached) {
+ if (expected == null) {
+ assertNull(reached);
+ return;
+ } else {
+ assertNotNull(reached);
+ }
+
+ Calendar expectedCal = new GregorianCalendar();
+ expectedCal.setTime(expected);
+ Calendar reachedCal = new GregorianCalendar();
+ reachedCal.setTime(reached);
+ assertEquals(expectedCal.get(Calendar.YEAR), reachedCal
+ .get(Calendar.YEAR));
+ assertEquals(expectedCal.get(Calendar.MONTH), reachedCal
+ .get(Calendar.MONTH));
+ assertEquals(expectedCal.get(Calendar.DATE), reachedCal
+ .get(Calendar.DATE));
+ assertEquals(expectedCal.get(Calendar.HOUR_OF_DAY), reachedCal
+ .get(Calendar.HOUR_OF_DAY));
+ assertEquals(expectedCal.get(Calendar.MINUTE), reachedCal
+ .get(Calendar.MINUTE));
+ assertEquals(expectedCal.get(Calendar.SECOND), reachedCal
+ .get(Calendar.SECOND));
+ }
+
+ private UnitUtils() {
+
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
import org.apache.maven.cli.MavenCli;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
/*******************************************************************************
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
import java.io.File;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.maven;\r
-\r
-import org.argeo.slc.build.Distribution;\r
-import org.argeo.slc.deploy.DeploymentData;\r
-\r
-public class MavenFile implements Distribution, DeploymentData {\r
- private String groupId;\r
- private String artifactId;\r
- private String version;\r
- private String type;\r
- private String classifier;\r
- private String scope;\r
-\r
- public String getScope() {\r
- return scope;\r
- }\r
-\r
- public void setScope(String scope) {\r
- this.scope = scope;\r
- }\r
-\r
- private String distributionId;\r
-\r
- public String getDistributionId() {\r
- return distributionId;\r
- }\r
-\r
- public void setDistributionId(String distributionId) {\r
- this.distributionId = distributionId;\r
- }\r
-\r
- public String getGroupId() {\r
- return groupId;\r
- }\r
-\r
- public void setGroupId(String groupId) {\r
- this.groupId = groupId;\r
- }\r
-\r
- public String getArtifactId() {\r
- return artifactId;\r
- }\r
-\r
- public void setArtifactId(String artifactId) {\r
- this.artifactId = artifactId;\r
- }\r
-\r
- public String getVersion() {\r
- return version;\r
- }\r
-\r
- public void setVersion(String version) {\r
- this.version = version;\r
- }\r
-\r
- public String getType() {\r
- return type;\r
- }\r
-\r
- public void setType(String type) {\r
- this.type = type;\r
- }\r
-\r
- public String getClassifier() {\r
- return classifier;\r
- }\r
-\r
- public void setClassifier(String classifier) {\r
- this.classifier = classifier;\r
- }\r
-\r
-}\r
+package org.argeo.slc.maven;
+
+import org.argeo.slc.build.Distribution;
+import org.argeo.slc.deploy.DeploymentData;
+
+public class MavenFile implements Distribution, DeploymentData {
+ private String groupId;
+ private String artifactId;
+ private String version;
+ private String type;
+ private String classifier;
+ private String scope;
+
+ public String getScope() {
+ return scope;
+ }
+
+ public void setScope(String scope) {
+ this.scope = scope;
+ }
+
+ private String distributionId;
+
+ public String getDistributionId() {
+ return distributionId;
+ }
+
+ public void setDistributionId(String distributionId) {
+ this.distributionId = distributionId;
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ public void setArtifactId(String artifactId) {
+ this.artifactId = artifactId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getClassifier() {
+ return classifier;
+ }
+
+ public void setClassifier(String classifier) {
+ this.classifier = classifier;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.maven;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.apache.maven.repository.internal.MavenRepositorySystemUtils;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.aether.AetherUtils;\r
-import org.argeo.slc.aether.ConsoleRepositoryListener;\r
-import org.argeo.slc.aether.ConsoleTransferListener;\r
-import org.codehaus.plexus.PlexusContainer;\r
-import org.eclipse.aether.DefaultRepositorySystemSession;\r
-import org.eclipse.aether.RepositorySystem;\r
-import org.eclipse.aether.RepositorySystemSession;\r
-import org.eclipse.aether.artifact.Artifact;\r
-import org.eclipse.aether.artifact.DefaultArtifact;\r
-import org.eclipse.aether.collection.CollectRequest;\r
-import org.eclipse.aether.graph.Dependency;\r
-import org.eclipse.aether.graph.DependencyNode;\r
-import org.eclipse.aether.impl.DefaultServiceLocator;\r
-import org.eclipse.aether.repository.LocalRepository;\r
-import org.eclipse.aether.repository.RemoteRepository;\r
-import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator;\r
-\r
-public class MavenManager {\r
- private final static Log log = LogFactory.getLog(MavenManager.class);\r
-\r
- public void init() {\r
- try {\r
- testMaven();\r
- testAether();\r
- // List<ComponentDescriptor<?>> lst = plexusContainer\r
- // .discoverComponents(plexusContainer.getContainerRealm());\r
- // for (ComponentDescriptor<?> cd : lst) {\r
- // log.debug(cd);\r
- // }\r
- // ArtifactHandler artifactHandler = plexusContainer\r
- // .lookup(ArtifactHandler.class);\r
- // ArtifactRepository localRepository = new\r
- // DefaultArtifactRepositoryFactory().createArtifactRepository("local",\r
- // , layoutId, snapshots, releases);\r
- // Maven maven = mavenCli.getContainer().lookup(Maven.class);\r
- // Artifact artifact = new DefaultArtifact("org.argeo.slc.dist",\r
- // "org.argeo.slc.sdk", "0.13.1-SNAPSHOT", "compile", "pom",\r
- // null, artifactHandler);\r
- // ArtifactResolutionRequest req = new ArtifactResolutionRequest();\r
- // req.setLocalRepository(localRepository);\r
- // req.setResolveTransitively(true);\r
- // req.setArtifact(artifact);\r
- // ArtifactResolver artifactResolver = plexusContainer\r
- // .lookup(ArtifactResolver.class);\r
- // ArtifactResolutionResult res = artifactResolver.resolve(req);\r
- // Set<Artifact> artifacts = res.getArtifacts();\r
- // for (Artifact art : artifacts) {\r
- // log.debug(art);\r
- // }\r
- } catch (Exception e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- }\r
- }\r
-\r
- public void testMaven() {\r
- Thread.currentThread().setContextClassLoader(\r
- getClass().getClassLoader());\r
- String[] goals = { "-o", "-e", "-f",\r
- "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk/pom.xml",\r
- "dependency:tree" };\r
-\r
- // String m2Home = "/opt/apache-maven-3.0.1";\r
- // System.setProperty("classworlds.conf", m2Home + "/bin/m2.conf");\r
- // System.setProperty("maven.home", m2Home);\r
- //\r
- // Launcher.main(goals);\r
-\r
- CustomCli mavenCli = new CustomCli();\r
- mavenCli.doMain(goals,\r
- "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk",\r
- System.out, System.err);\r
-\r
- PlexusContainer plexusContainer = mavenCli.getContainer();\r
- log.debug(plexusContainer.getContext().getContextData());\r
- plexusContainer.dispose();\r
- }\r
-\r
- public void testAether() {\r
- try {\r
- RepositorySystem repoSystem = createRepositorySystem();\r
-\r
- RepositorySystemSession session = createRepositorySystemSession(repoSystem);\r
-\r
- Dependency dependency = new Dependency(new DefaultArtifact(\r
- "org.argeo.slc.dep:org.argeo.slc.dep.sdk:0.13.1-SNAPSHOT"),\r
- "compile");\r
-// RemoteRepository argeo = new RemoteRepository("argeo", "default",\r
-// "http://maven.argeo.org/argeo/");\r
-// RemoteRepository argeoSnapshots = new RemoteRepository(\r
-// "argeo-snapshots", "default",\r
-// "http://dev.argeo.org/maven/argeo-snapshots/");\r
- RemoteRepository argeo =null;\r
- RemoteRepository argeoSnapshots =null;\r
-\r
- CollectRequest collectRequest = new CollectRequest();\r
- collectRequest.setRoot(dependency);\r
- collectRequest.addRepository(argeo);\r
- collectRequest.addRepository(argeoSnapshots);\r
- DependencyNode node = repoSystem.collectDependencies(session,\r
- collectRequest).getRoot();\r
-\r
-// repoSystem.resolveDependencies(session, node, null);\r
-\r
- PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();\r
- node.accept(nlg);\r
-\r
- for (Artifact artifact : nlg.getArtifacts(true)) {\r
- log.debug(artifact);\r
- }\r
-\r
- AetherUtils.logDependencyNode(0, node);\r
- // System.out.println(nlg.getClassPath());\r
-\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot resolve", e);\r
- }\r
-\r
- }\r
-\r
- /** Creates a Maven {@link RepositorySystem}. */\r
- public static RepositorySystem createRepositorySystem() {\r
- try {\r
- DefaultServiceLocator locator = new DefaultServiceLocator();\r
-\r
-// locator.setServices(WagonProvider.class, new ManualWagonProvider());\r
-// locator.addService(RepositoryConnectorFactory.class,\r
-// WagonRepositoryConnectorFactory.class);\r
-\r
- return locator.getService(RepositorySystem.class);\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot lookup repository system", e);\r
- }\r
- }\r
-\r
- public static RepositorySystemSession createRepositorySystemSession(\r
- RepositorySystem system) {\r
-// MavenRepositorySystemSession session = new MavenRepositorySystemSession();\r
- DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();\r
- \r
- LocalRepository localRepo = new LocalRepository(\r
- System.getProperty("user.home") + "/.m2/repository");\r
- session.setLocalRepositoryManager( system.newLocalRepositoryManager( session, localRepo ) );\r
-// session.setLocalRepositoryManager(system\r
-// .newLocalRepositoryManager(localRepo));\r
- session.setTransferListener(new ConsoleTransferListener(System.out));\r
- session.setRepositoryListener(new ConsoleRepositoryListener());\r
- return session;\r
- }\r
-\r
- public static void main(String[] args) {\r
- new MavenManager().init();\r
- }\r
-\r
-}\r
+package org.argeo.slc.maven;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.aether.AetherUtils;
+import org.argeo.slc.aether.ConsoleRepositoryListener;
+import org.argeo.slc.aether.ConsoleTransferListener;
+import org.codehaus.plexus.PlexusContainer;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.impl.DefaultServiceLocator;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator;
+
+public class MavenManager {
+ private final static Log log = LogFactory.getLog(MavenManager.class);
+
+ public void init() {
+ try {
+ testMaven();
+ testAether();
+ // List<ComponentDescriptor<?>> lst = plexusContainer
+ // .discoverComponents(plexusContainer.getContainerRealm());
+ // for (ComponentDescriptor<?> cd : lst) {
+ // log.debug(cd);
+ // }
+ // ArtifactHandler artifactHandler = plexusContainer
+ // .lookup(ArtifactHandler.class);
+ // ArtifactRepository localRepository = new
+ // DefaultArtifactRepositoryFactory().createArtifactRepository("local",
+ // , layoutId, snapshots, releases);
+ // Maven maven = mavenCli.getContainer().lookup(Maven.class);
+ // Artifact artifact = new DefaultArtifact("org.argeo.slc.dist",
+ // "org.argeo.slc.sdk", "0.13.1-SNAPSHOT", "compile", "pom",
+ // null, artifactHandler);
+ // ArtifactResolutionRequest req = new ArtifactResolutionRequest();
+ // req.setLocalRepository(localRepository);
+ // req.setResolveTransitively(true);
+ // req.setArtifact(artifact);
+ // ArtifactResolver artifactResolver = plexusContainer
+ // .lookup(ArtifactResolver.class);
+ // ArtifactResolutionResult res = artifactResolver.resolve(req);
+ // Set<Artifact> artifacts = res.getArtifacts();
+ // for (Artifact art : artifacts) {
+ // log.debug(art);
+ // }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void testMaven() {
+ Thread.currentThread().setContextClassLoader(
+ getClass().getClassLoader());
+ String[] goals = { "-o", "-e", "-f",
+ "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk/pom.xml",
+ "dependency:tree" };
+
+ // String m2Home = "/opt/apache-maven-3.0.1";
+ // System.setProperty("classworlds.conf", m2Home + "/bin/m2.conf");
+ // System.setProperty("maven.home", m2Home);
+ //
+ // Launcher.main(goals);
+
+ CustomCli mavenCli = new CustomCli();
+ mavenCli.doMain(goals,
+ "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk",
+ System.out, System.err);
+
+ PlexusContainer plexusContainer = mavenCli.getContainer();
+ log.debug(plexusContainer.getContext().getContextData());
+ plexusContainer.dispose();
+ }
+
+ public void testAether() {
+ try {
+ RepositorySystem repoSystem = createRepositorySystem();
+
+ RepositorySystemSession session = createRepositorySystemSession(repoSystem);
+
+ Dependency dependency = new Dependency(new DefaultArtifact(
+ "org.argeo.slc.dep:org.argeo.slc.dep.sdk:0.13.1-SNAPSHOT"),
+ "compile");
+// RemoteRepository argeo = new RemoteRepository("argeo", "default",
+// "http://maven.argeo.org/argeo/");
+// RemoteRepository argeoSnapshots = new RemoteRepository(
+// "argeo-snapshots", "default",
+// "http://dev.argeo.org/maven/argeo-snapshots/");
+ RemoteRepository argeo =null;
+ RemoteRepository argeoSnapshots =null;
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot(dependency);
+ collectRequest.addRepository(argeo);
+ collectRequest.addRepository(argeoSnapshots);
+ DependencyNode node = repoSystem.collectDependencies(session,
+ collectRequest).getRoot();
+
+// repoSystem.resolveDependencies(session, node, null);
+
+ PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
+ node.accept(nlg);
+
+ for (Artifact artifact : nlg.getArtifacts(true)) {
+ log.debug(artifact);
+ }
+
+ AetherUtils.logDependencyNode(0, node);
+ // System.out.println(nlg.getClassPath());
+
+ } catch (Exception e) {
+ throw new SlcException("Cannot resolve", e);
+ }
+
+ }
+
+ /** Creates a Maven {@link RepositorySystem}. */
+ public static RepositorySystem createRepositorySystem() {
+ try {
+ DefaultServiceLocator locator = new DefaultServiceLocator();
+
+// locator.setServices(WagonProvider.class, new ManualWagonProvider());
+// locator.addService(RepositoryConnectorFactory.class,
+// WagonRepositoryConnectorFactory.class);
+
+ return locator.getService(RepositorySystem.class);
+ } catch (Exception e) {
+ throw new SlcException("Cannot lookup repository system", e);
+ }
+ }
+
+ public static RepositorySystemSession createRepositorySystemSession(
+ RepositorySystem system) {
+// MavenRepositorySystemSession session = new MavenRepositorySystemSession();
+ DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
+
+ LocalRepository localRepo = new LocalRepository(
+ System.getProperty("user.home") + "/.m2/repository");
+ session.setLocalRepositoryManager( system.newLocalRepositoryManager( session, localRepo ) );
+// session.setLocalRepositoryManager(system
+// .newLocalRepositoryManager(localRepo));
+ session.setTransferListener(new ConsoleTransferListener(System.out));
+ session.setRepositoryListener(new ConsoleRepositoryListener());
+ return session;
+ }
+
+ public static void main(String[] args) {
+ new MavenManager().init();
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.maven;
public class RemoteRepo {
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.diff;
import java.util.List;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/**\r
- * Converts data into a format better adapted for comparison. It is typically\r
- * used to convert <code>String</code> into typed format such as\r
- * <code>BigDecimal</code>\r
- */\r
-public interface DataInterpreter {\r
- /**\r
- * Converts data\r
- * \r
- * @param key\r
- * any object used to differentiate the type of data (e.g.\r
- * column, path)\r
- * @param value\r
- * the data to convert\r
- * @return the converted object\r
- */\r
- public Object convert(Object key, Object value);\r
-}\r
+package org.argeo.slc.diff;
+
+/**
+ * Converts data into a format better adapted for comparison. It is typically
+ * used to convert <code>String</code> into typed format such as
+ * <code>BigDecimal</code>
+ */
+public interface DataInterpreter {
+ /**
+ * Converts data
+ *
+ * @param key
+ * any object used to differentiate the type of data (e.g.
+ * column, path)
+ * @param value
+ * the data to convert
+ * @return the converted object
+ */
+ public Object convert(Object key, Object value);
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-import org.springframework.core.io.Resource;\r
-\r
-/** A comparator providing structured information about the differences found. */\r
-public interface Diff {\r
- /** Performs the comparison. */\r
- public void compare(Resource expected, Resource reached,\r
- DiffResult diffResult);\r
-}\r
+package org.argeo.slc.diff;
+
+import org.springframework.core.io.Resource;
+
+/** A comparator providing structured information about the differences found. */
+public interface Diff {
+ /** Performs the comparison. */
+ public void compare(Resource expected, Resource reached,
+ DiffResult diffResult);
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/** The root class for issues which happened during a diff. */\r
-public abstract class DiffIssue implements Comparable<DiffIssue> {\r
- /** The position of this issue. */\r
- // Was final and is not anymore in order to persist in hibernate\r
- protected DiffPosition position;\r
-\r
- // hibernate\r
- private long id;\r
-\r
- /** Constructor */\r
- public DiffIssue(DiffPosition position) {\r
- super();\r
- this.position = position;\r
- }\r
-\r
- public int compareTo(DiffIssue o) {\r
- return position.compareTo(o.position);\r
- }\r
-\r
- /** The position of this issue within the test file */\r
- public DiffPosition getPosition() {\r
- return position;\r
- }\r
-\r
- // Hibernate\r
- @SuppressWarnings("unused")\r
- private void setId(long id) {\r
- this.id = id;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private long getId() {\r
- return id;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setPosition(DiffPosition position) {\r
- this.position = position;\r
- }\r
-\r
-}\r
+package org.argeo.slc.diff;
+
+/** The root class for issues which happened during a diff. */
+public abstract class DiffIssue implements Comparable<DiffIssue> {
+ /** The position of this issue. */
+ // Was final and is not anymore in order to persist in hibernate
+ protected DiffPosition position;
+
+ // hibernate
+ private long id;
+
+ /** Constructor */
+ public DiffIssue(DiffPosition position) {
+ super();
+ this.position = position;
+ }
+
+ public int compareTo(DiffIssue o) {
+ return position.compareTo(o.position);
+ }
+
+ /** The position of this issue within the test file */
+ public DiffPosition getPosition() {
+ return position;
+ }
+
+ // Hibernate
+ @SuppressWarnings("unused")
+ private void setId(long id) {
+ this.id = id;
+ }
+
+ @SuppressWarnings("unused")
+ private long getId() {
+ return id;
+ }
+
+ @SuppressWarnings("unused")
+ private void setPosition(DiffPosition position) {
+ this.position = position;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/** Intermediate class that can hold the key to be displayed. */\r
-public abstract class DiffIssueKey extends DiffIssue {\r
- /** The position of this issue. */\r
- protected DiffKey key;\r
-\r
- /** Constructor without key */\r
- public DiffIssueKey(DiffPosition position) {\r
- super(position);\r
- }\r
-\r
- /** Constructor with key */\r
- public DiffIssueKey(DiffPosition position, DiffKey key) {\r
- super(position);\r
- this.key = key;\r
- }\r
-\r
- public Object getKey() {\r
- return key;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- if (key != null) {\r
- return key.toString();\r
- } else {\r
- return "";\r
- }\r
- }\r
-\r
- // Hibernate\r
- @SuppressWarnings("unused")\r
- private void setKey(DiffKey key) {\r
- this.key = key;\r
- }\r
-}\r
+package org.argeo.slc.diff;
+
+/** Intermediate class that can hold the key to be displayed. */
+public abstract class DiffIssueKey extends DiffIssue {
+ /** The position of this issue. */
+ protected DiffKey key;
+
+ /** Constructor without key */
+ public DiffIssueKey(DiffPosition position) {
+ super(position);
+ }
+
+ /** Constructor with key */
+ public DiffIssueKey(DiffPosition position, DiffKey key) {
+ super(position);
+ this.key = key;
+ }
+
+ public Object getKey() {
+ return key;
+ }
+
+ @Override
+ public String toString() {
+ if (key != null) {
+ return key.toString();
+ } else {
+ return "";
+ }
+ }
+
+ // Hibernate
+ @SuppressWarnings("unused")
+ private void setKey(DiffKey key) {
+ this.key = key;
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/**\r
- * Object able to uniquely identify an atomic diff part. Used to identify\r
- * missings and left-overs.\r
- */\r
-public interface DiffKey {\r
- public String toString();\r
-}\r
+package org.argeo.slc.diff;
+
+/**
+ * Object able to uniquely identify an atomic diff part. Used to identify
+ * missings and left-overs.
+ */
+public interface DiffKey {
+ public String toString();
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/**\r
- * A value missing in one of the file. If its position is related to expected,\r
- * this means it is a left over in the reached, if its position is related to\r
- * the reached it means that it is missing from the reached. If the value is\r
- * null it means that the entire line is missing.\r
- */\r
-public class DiffMissing extends DiffIssueKey {\r
-\r
- public DiffMissing(DiffPosition position, DiffKey key) {\r
- super(position);\r
- super.key = key;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- if (position.relatedFile == RelatedFile.EXPECTED) {\r
- return position + ": left over " + super.toString();\r
- } else if (position.relatedFile == RelatedFile.REACHED) {\r
- return position + ": missing " + super.toString();\r
- }\r
- return super.toString();\r
- }\r
-\r
-}\r
+package org.argeo.slc.diff;
+
+/**
+ * A value missing in one of the file. If its position is related to expected,
+ * this means it is a left over in the reached, if its position is related to
+ * the reached it means that it is missing from the reached. If the value is
+ * null it means that the entire line is missing.
+ */
+public class DiffMissing extends DiffIssueKey {
+
+ public DiffMissing(DiffPosition position, DiffKey key) {
+ super(position);
+ super.key = key;
+ }
+
+ @Override
+ public String toString() {
+ if (position.relatedFile == RelatedFile.EXPECTED) {
+ return position + ": left over " + super.toString();
+ } else if (position.relatedFile == RelatedFile.REACHED) {
+ return position + ": missing " + super.toString();
+ }
+ return super.toString();
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/**\r
- * <code>DiffMissing</code> using the XPath of the position as\r
- * <code>DiffKey</code>\r
- */\r
-public class DiffMissingXml extends DiffMissing {\r
-\r
- public DiffMissingXml(XPathDiffPosition position) {\r
- super(position, new DiffKeyXml(position.getXPath()));\r
- }\r
-\r
- /** Implementation of <code>DiffKey</code> based on an XPath string. */\r
- protected static class DiffKeyXml implements DiffKey {\r
- private final String xPath;\r
-\r
- public DiffKeyXml(String xPath) {\r
- this.xPath = xPath;\r
- }\r
-\r
- public String getXPath() {\r
- return xPath;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return xPath;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (!(obj instanceof DiffKeyXml))\r
- return false;\r
- return xPath.equals(((DiffKeyXml) obj).xPath);\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- return xPath.hashCode();\r
- }\r
-\r
- }\r
-}\r
+package org.argeo.slc.diff;
+
+/**
+ * <code>DiffMissing</code> using the XPath of the position as
+ * <code>DiffKey</code>
+ */
+public class DiffMissingXml extends DiffMissing {
+
+ public DiffMissingXml(XPathDiffPosition position) {
+ super(position, new DiffKeyXml(position.getXPath()));
+ }
+
+ /** Implementation of <code>DiffKey</code> based on an XPath string. */
+ protected static class DiffKeyXml implements DiffKey {
+ private final String xPath;
+
+ public DiffKeyXml(String xPath) {
+ this.xPath = xPath;
+ }
+
+ public String getXPath() {
+ return xPath;
+ }
+
+ @Override
+ public String toString() {
+ return xPath;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof DiffKeyXml))
+ return false;
+ return xPath.equals(((DiffKeyXml) obj).xPath);
+ }
+
+ @Override
+ public int hashCode() {
+ return xPath.hashCode();
+ }
+
+ }
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-import org.argeo.slc.SlcException;\r
-\r
-/** Diff issue where reached and expected values are different. */\r
-public class DiffNotMatched extends DiffIssueKey {\r
-\r
- // To enable hibernate persistance, these object cannot be final\r
- // private final Object expected;\r
- // private final Object reached;\r
-\r
- private Object expected;\r
- private Object reached;\r
-\r
- public DiffNotMatched(DiffPosition position, Object expected, Object reached) {\r
- super(position);\r
- this.expected = expected;\r
- this.reached = reached;\r
- }\r
-\r
- public DiffNotMatched(DiffPosition position, Object expected,\r
- Object reached, DiffKey key) {\r
- super(position, key);\r
- this.expected = expected;\r
- this.reached = reached;\r
- }\r
-\r
- public Object getExpected() {\r
- return expected;\r
- }\r
-\r
- public Object getReached() {\r
- return reached;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- String result = position + ": not matched " + expected + " <> "\r
- + reached;\r
- if (super.key != null) {\r
- result = result + " - Key: " + super.toString();\r
- }\r
-\r
- return result;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private String getExpectedStr() {\r
- if (expected instanceof String)\r
- return (String) expected;\r
- else\r
- throw new SlcException(\r
- "Object 'expected' is of wrong type. Must be a String");\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private String getReachedStr() {\r
- if (reached instanceof String)\r
- return (String) reached;\r
- else\r
- throw new SlcException(\r
- "Object 'reached' is of wrong type. Must be a String");\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setReachedStr(String reachedStr) {\r
- this.reached = reachedStr;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setExpectedStr(String expectedStr) {\r
- this.expected = expectedStr;\r
- }\r
-\r
-}\r
+package org.argeo.slc.diff;
+
+import org.argeo.slc.SlcException;
+
+/** Diff issue where reached and expected values are different. */
+public class DiffNotMatched extends DiffIssueKey {
+
+ // To enable hibernate persistance, these object cannot be final
+ // private final Object expected;
+ // private final Object reached;
+
+ private Object expected;
+ private Object reached;
+
+ public DiffNotMatched(DiffPosition position, Object expected, Object reached) {
+ super(position);
+ this.expected = expected;
+ this.reached = reached;
+ }
+
+ public DiffNotMatched(DiffPosition position, Object expected,
+ Object reached, DiffKey key) {
+ super(position, key);
+ this.expected = expected;
+ this.reached = reached;
+ }
+
+ public Object getExpected() {
+ return expected;
+ }
+
+ public Object getReached() {
+ return reached;
+ }
+
+ @Override
+ public String toString() {
+ String result = position + ": not matched " + expected + " <> "
+ + reached;
+ if (super.key != null) {
+ result = result + " - Key: " + super.toString();
+ }
+
+ return result;
+ }
+
+ @SuppressWarnings("unused")
+ private String getExpectedStr() {
+ if (expected instanceof String)
+ return (String) expected;
+ else
+ throw new SlcException(
+ "Object 'expected' is of wrong type. Must be a String");
+ }
+
+ @SuppressWarnings("unused")
+ private String getReachedStr() {
+ if (reached instanceof String)
+ return (String) reached;
+ else
+ throw new SlcException(
+ "Object 'reached' is of wrong type. Must be a String");
+ }
+
+ @SuppressWarnings("unused")
+ private void setReachedStr(String reachedStr) {
+ this.reached = reachedStr;
+ }
+
+ @SuppressWarnings("unused")
+ private void setExpectedStr(String expectedStr) {
+ this.expected = expectedStr;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/** The position of a diff issue within the test resource. */\r
-public abstract class DiffPosition implements Comparable<DiffPosition> {\r
- protected RelatedFile relatedFile;\r
-\r
- public DiffPosition(RelatedFile relatedFile) {\r
- super();\r
- this.relatedFile = relatedFile;\r
- }\r
-\r
- // For Hibernate\r
- DiffPosition() {\r
- }\r
-\r
- public RelatedFile getRelatedFile() {\r
- return relatedFile;\r
- }\r
-\r
- // Added to enable the new data model for persisting TabularDiffTestResult\r
- @SuppressWarnings("unused")\r
- private Boolean getIsReached() {\r
- return relatedFile.equals(RelatedFile.REACHED);\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setIsReached(Boolean isReached) {\r
- this.relatedFile = (isReached ? RelatedFile.REACHED\r
- : RelatedFile.EXPECTED);\r
- }\r
-\r
-}\r
+package org.argeo.slc.diff;
+
+/** The position of a diff issue within the test resource. */
+public abstract class DiffPosition implements Comparable<DiffPosition> {
+ protected RelatedFile relatedFile;
+
+ public DiffPosition(RelatedFile relatedFile) {
+ super();
+ this.relatedFile = relatedFile;
+ }
+
+ // For Hibernate
+ DiffPosition() {
+ }
+
+ public RelatedFile getRelatedFile() {
+ return relatedFile;
+ }
+
+ // Added to enable the new data model for persisting TabularDiffTestResult
+ @SuppressWarnings("unused")
+ private Boolean getIsReached() {
+ return relatedFile.equals(RelatedFile.REACHED);
+ }
+
+ @SuppressWarnings("unused")
+ private void setIsReached(Boolean isReached) {
+ this.relatedFile = (isReached ? RelatedFile.REACHED
+ : RelatedFile.EXPECTED);
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.diff;
/**
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.diff;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.diff;
import java.util.ArrayList;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/** Enumeration of the types of resource tested. */\r
-public enum RelatedFile {\r
- /** The expected resource */\r
- EXPECTED,\r
- /** The reached resource */\r
- REACHED\r
-}\r
+package org.argeo.slc.diff;
+
+/** Enumeration of the types of resource tested. */
+public enum RelatedFile {
+ /** The expected resource */
+ EXPECTED,
+ /** The reached resource */
+ REACHED
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-import org.argeo.slc.UnsupportedException;\r
-\r
-/**\r
- * A diff position within a table structure such a CSV file or an SQL result\r
- * set.\r
- */\r
-public class TableDiffPosition extends DiffPosition {\r
- private Integer line;\r
- /** Can be null */\r
- private Integer column;\r
- /** Can be null */\r
- private String columnName;\r
-\r
- public TableDiffPosition(RelatedFile relatedFile, Integer line,\r
- Integer column, String columnName) {\r
- super(relatedFile);\r
- this.line = line;\r
- this.column = column;\r
- this.columnName = columnName;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private TableDiffPosition() {\r
- }\r
-\r
- public Integer getLine() {\r
- return line;\r
- }\r
-\r
- public Integer getColumn() {\r
- return column;\r
- }\r
-\r
- public String getColumnName() {\r
- return columnName;\r
- }\r
-\r
- public int compareTo(DiffPosition dp) {\r
- if (!(dp instanceof TableDiffPosition))\r
- throw new UnsupportedException("position", dp);\r
-\r
- TableDiffPosition o = (TableDiffPosition) dp;\r
- if (relatedFile.equals(o.relatedFile)) {\r
- if (line == o.line) {\r
- return column.compareTo(o.column);\r
- } else {\r
- return line.compareTo(o.line);\r
- }\r
- } else {\r
- return relatedFile.compareTo(o.relatedFile);\r
- }\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuffer buf = new StringBuffer("");\r
- buf.append(relatedFile).append('[').append(line);\r
- if (column != null) {\r
- buf.append(',').append(column);\r
- if (columnName != null) {\r
- buf.append('-').append(columnName);\r
- }\r
- }\r
- buf.append(']');\r
- return buf.toString();\r
- }\r
-\r
- // Hibernate\r
- @SuppressWarnings("unused")\r
- private void setLine(Integer line) {\r
- this.line = line;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setColumn(Integer column) {\r
- this.column = column;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setColumnName(String columnName) {\r
- this.columnName = columnName;\r
- }\r
-\r
-}\r
+package org.argeo.slc.diff;
+
+import org.argeo.slc.UnsupportedException;
+
+/**
+ * A diff position within a table structure such a CSV file or an SQL result
+ * set.
+ */
+public class TableDiffPosition extends DiffPosition {
+ private Integer line;
+ /** Can be null */
+ private Integer column;
+ /** Can be null */
+ private String columnName;
+
+ public TableDiffPosition(RelatedFile relatedFile, Integer line,
+ Integer column, String columnName) {
+ super(relatedFile);
+ this.line = line;
+ this.column = column;
+ this.columnName = columnName;
+ }
+
+ @SuppressWarnings("unused")
+ private TableDiffPosition() {
+ }
+
+ public Integer getLine() {
+ return line;
+ }
+
+ public Integer getColumn() {
+ return column;
+ }
+
+ public String getColumnName() {
+ return columnName;
+ }
+
+ public int compareTo(DiffPosition dp) {
+ if (!(dp instanceof TableDiffPosition))
+ throw new UnsupportedException("position", dp);
+
+ TableDiffPosition o = (TableDiffPosition) dp;
+ if (relatedFile.equals(o.relatedFile)) {
+ if (line == o.line) {
+ return column.compareTo(o.column);
+ } else {
+ return line.compareTo(o.line);
+ }
+ } else {
+ return relatedFile.compareTo(o.relatedFile);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer("");
+ buf.append(relatedFile).append('[').append(line);
+ if (column != null) {
+ buf.append(',').append(column);
+ if (columnName != null) {
+ buf.append('-').append(columnName);
+ }
+ }
+ buf.append(']');
+ return buf.toString();
+ }
+
+ // Hibernate
+ @SuppressWarnings("unused")
+ private void setLine(Integer line) {
+ this.line = line;
+ }
+
+ @SuppressWarnings("unused")
+ private void setColumn(Integer column) {
+ this.column = column;
+ }
+
+ @SuppressWarnings("unused")
+ private void setColumnName(String columnName) {
+ this.columnName = columnName;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-/** Compares objects, eventually using tolerance mechanisms. */\r
-public interface Tolerance {\r
- /**\r
- * Compares objects\r
- * \r
- * @param key\r
- * any object used to differentiate the type of data (e.g.\r
- * column, path)\r
- * @param expected\r
- * the expected value\r
- * @param reached\r
- * the reached value\r
- * @return the converted object\r
- */\r
- public Boolean compare(Object key, Object expected, Object reached);\r
-}\r
+package org.argeo.slc.diff;
+
+/** Compares objects, eventually using tolerance mechanisms. */
+public interface Tolerance {
+ /**
+ * Compares objects
+ *
+ * @param key
+ * any object used to differentiate the type of data (e.g.
+ * column, path)
+ * @param expected
+ * the expected value
+ * @param reached
+ * the reached value
+ * @return the converted object
+ */
+ public Boolean compare(Object key, Object expected, Object reached);
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.diff;
import java.util.Map;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-import org.argeo.slc.UnsupportedException;\r
-\r
-/** A diff position within an Xml file. <b>NOT YET IMPLEMENTED</b>. */\r
-public class XPathDiffPosition extends DiffPosition {\r
-\r
- private String xPath;\r
-\r
- public XPathDiffPosition(RelatedFile relatedFile, String path) {\r
- super(relatedFile);\r
- xPath = path;\r
- }\r
-\r
- public int compareTo(DiffPosition dp) {\r
- if (!(dp instanceof XPathDiffPosition))\r
- throw new UnsupportedException("position", dp);\r
-\r
- XPathDiffPosition o = (XPathDiffPosition) dp;\r
- if (relatedFile.equals(o.relatedFile)) {\r
- return xPath.compareTo(o.xPath);\r
- } else {\r
- return relatedFile.compareTo(o.relatedFile);\r
- }\r
- }\r
-\r
- public String getXPath() {\r
- return xPath;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return xPath;\r
- }\r
-}\r
+package org.argeo.slc.diff;
+
+import org.argeo.slc.UnsupportedException;
+
+/** A diff position within an Xml file. <b>NOT YET IMPLEMENTED</b>. */
+public class XPathDiffPosition extends DiffPosition {
+
+ private String xPath;
+
+ public XPathDiffPosition(RelatedFile relatedFile, String path) {
+ super(relatedFile);
+ xPath = path;
+ }
+
+ public int compareTo(DiffPosition dp) {
+ if (!(dp instanceof XPathDiffPosition))
+ throw new UnsupportedException("position", dp);
+
+ XPathDiffPosition o = (XPathDiffPosition) dp;
+ if (relatedFile.equals(o.relatedFile)) {
+ return xPath.compareTo(o.xPath);
+ } else {
+ return relatedFile.compareTo(o.relatedFile);
+ }
+ }
+
+ public String getXPath() {
+ return xPath;
+ }
+
+ @Override
+ public String toString() {
+ return xPath;
+ }
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import javax.security.auth.callback.Callback;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import org.apache.commons.logging.Log;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.BufferedReader;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.ByteArrayInputStream;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.util.ArrayList;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.BufferedReader;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.jsch;
import java.awt.Container;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.jcr;
import java.util.UUID;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import org.argeo.slc.core.deploy.MultiResourceSet;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import org.argeo.slc.core.deploy.ResourceSet;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import org.argeo.slc.SlcException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import java.util.List;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux;
import org.argeo.slc.build.Distribution;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux.rpmfactory;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux.rpmfactory;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux.rpmfactory;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux.rpmfactory;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.linux.rpmfactory;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.vbox;
import org.argeo.slc.UnsupportedException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.vbox;
import java.io.IOException;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.vbox;
import java.util.Map;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.lib.vbox;
/** The mapping of one port. */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.log4j;
import java.util.Date;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.mail;
import java.util.HashMap;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.File;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.build.Distribution;\r
-import org.argeo.slc.deploy.DeployEnvironment;\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-import org.argeo.slc.deploy.Deployment;\r
-import org.argeo.slc.deploy.DeploymentData;\r
-import org.argeo.slc.deploy.TargetData;\r
-\r
-public class HttpdApplicationDeployment implements Deployment {\r
- private static final Log log = LogFactory\r
- .getLog(HttpdApplicationDeployment.class);\r
-\r
- private HttpdApplicationTargetData targetData;\r
- private DeploymentData deploymentData;\r
- private SimpleHttpdApplication deployedSystem;\r
- private Distribution distribution;\r
-\r
- private DeployEnvironment deployEnvironment;\r
-\r
- public void run() {\r
- try {\r
- deployEnvironment.unpackTo(distribution, targetData\r
- .getTargetRootLocation(), null);\r
-\r
- // FIXME: make it generic\r
- String deployDataPath = targetData.getTargetRootLocation()\r
- .getCanonicalPath();\r
-\r
- deployEnvironment.unpackTo(deploymentData,\r
- new File(deployDataPath), null);\r
- deployedSystem = new SimpleHttpdApplication();\r
- deployedSystem.setTargetData(targetData);\r
-\r
- log.info("Deployed " + distribution + " to " + targetData);\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot deploy " + distribution + " to "\r
- + targetData, e);\r
- }\r
-\r
- }\r
-\r
- public void setTargetData(TargetData targetData) {\r
- this.targetData = (HttpdApplicationTargetData) targetData;\r
- }\r
-\r
- public void setDeploymentData(DeploymentData deploymentData) {\r
- this.deploymentData = deploymentData;\r
- }\r
-\r
- public DeployedSystem getDeployedSystem() {\r
- return deployedSystem;\r
- }\r
-\r
- public void setDistribution(Distribution distribution) {\r
- this.distribution = distribution;\r
- }\r
-\r
- public void setDeployEnvironment(DeployEnvironment deployEnvironment) {\r
- this.deployEnvironment = deployEnvironment;\r
- }\r
-\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.io.File;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.build.Distribution;
+import org.argeo.slc.deploy.DeployEnvironment;
+import org.argeo.slc.deploy.DeployedSystem;
+import org.argeo.slc.deploy.Deployment;
+import org.argeo.slc.deploy.DeploymentData;
+import org.argeo.slc.deploy.TargetData;
+
+public class HttpdApplicationDeployment implements Deployment {
+ private static final Log log = LogFactory
+ .getLog(HttpdApplicationDeployment.class);
+
+ private HttpdApplicationTargetData targetData;
+ private DeploymentData deploymentData;
+ private SimpleHttpdApplication deployedSystem;
+ private Distribution distribution;
+
+ private DeployEnvironment deployEnvironment;
+
+ public void run() {
+ try {
+ deployEnvironment.unpackTo(distribution, targetData
+ .getTargetRootLocation(), null);
+
+ // FIXME: make it generic
+ String deployDataPath = targetData.getTargetRootLocation()
+ .getCanonicalPath();
+
+ deployEnvironment.unpackTo(deploymentData,
+ new File(deployDataPath), null);
+ deployedSystem = new SimpleHttpdApplication();
+ deployedSystem.setTargetData(targetData);
+
+ log.info("Deployed " + distribution + " to " + targetData);
+ } catch (Exception e) {
+ throw new SlcException("Cannot deploy " + distribution + " to "
+ + targetData, e);
+ }
+
+ }
+
+ public void setTargetData(TargetData targetData) {
+ this.targetData = (HttpdApplicationTargetData) targetData;
+ }
+
+ public void setDeploymentData(DeploymentData deploymentData) {
+ this.deploymentData = deploymentData;
+ }
+
+ public DeployedSystem getDeployedSystem() {
+ return deployedSystem;
+ }
+
+ public void setDistribution(Distribution distribution) {
+ this.distribution = distribution;
+ }
+
+ public void setDeployEnvironment(DeployEnvironment deployEnvironment) {
+ this.deployEnvironment = deployEnvironment;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.File;\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.deploy.TargetData;\r
-\r
-public class HttpdApplicationTargetData implements TargetData {\r
- private HttpdServer webServer;\r
- private String relativePath;\r
- private String targetRootPath;\r
-\r
- public HttpdServer getWebServer() {\r
- return webServer;\r
- }\r
-\r
- public void setWebServer(HttpdServer webServer) {\r
- this.webServer = webServer;\r
- }\r
-\r
- public String getRelativePath() {\r
- return relativePath;\r
- }\r
-\r
- /**\r
- * If targetRootLocation not set, used to build the targetRootLocation,\r
- * relative to the webserver base.\r
- */\r
- public void setRelativePath(String relativePath) {\r
- this.relativePath = relativePath;\r
- }\r
-\r
- public String getTargetRootPath() {\r
- return targetRootPath;\r
- }\r
-\r
- public void setTargetRootPath(String targetRootPath) {\r
- this.targetRootPath = targetRootPath;\r
- }\r
-\r
- public URL getTargetBaseUrl() {\r
- try {\r
- URL wsUrl = getWebServer().getBaseUrl();\r
- // TODO: use URI\r
- return new URL(wsUrl, wsUrl.getFile() + '/' + relativePath);\r
- } catch (MalformedURLException e) {\r
- throw new SlcException("Cannot get base url for " + relativePath, e);\r
- }\r
- }\r
-\r
- public File getTargetRootLocation() {\r
- if (targetRootPath != null && !targetRootPath.equals("")) {\r
- return new File(targetRootPath);\r
- } else {\r
- HttpdServerTargetData targetData = (HttpdServerTargetData) getWebServer()\r
- .getTargetData();\r
- String path = targetData.getServerRoot() + File.separator\r
- + getRelativePath();\r
- return new File(path);\r
- }\r
- }\r
-\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.deploy.TargetData;
+
+public class HttpdApplicationTargetData implements TargetData {
+ private HttpdServer webServer;
+ private String relativePath;
+ private String targetRootPath;
+
+ public HttpdServer getWebServer() {
+ return webServer;
+ }
+
+ public void setWebServer(HttpdServer webServer) {
+ this.webServer = webServer;
+ }
+
+ public String getRelativePath() {
+ return relativePath;
+ }
+
+ /**
+ * If targetRootLocation not set, used to build the targetRootLocation,
+ * relative to the webserver base.
+ */
+ public void setRelativePath(String relativePath) {
+ this.relativePath = relativePath;
+ }
+
+ public String getTargetRootPath() {
+ return targetRootPath;
+ }
+
+ public void setTargetRootPath(String targetRootPath) {
+ this.targetRootPath = targetRootPath;
+ }
+
+ public URL getTargetBaseUrl() {
+ try {
+ URL wsUrl = getWebServer().getBaseUrl();
+ // TODO: use URI
+ return new URL(wsUrl, wsUrl.getFile() + '/' + relativePath);
+ } catch (MalformedURLException e) {
+ throw new SlcException("Cannot get base url for " + relativePath, e);
+ }
+ }
+
+ public File getTargetRootLocation() {
+ if (targetRootPath != null && !targetRootPath.equals("")) {
+ return new File(targetRootPath);
+ } else {
+ HttpdServerTargetData targetData = (HttpdServerTargetData) getWebServer()
+ .getTargetData();
+ String path = targetData.getServerRoot() + File.separator
+ + getRelativePath();
+ return new File(path);
+ }
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.IOException;\r
-import java.net.URL;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.build.Distribution;\r
-import org.argeo.slc.deploy.DeploymentData;\r
-import org.argeo.slc.deploy.TargetData;\r
-\r
-public class HttpdServer implements WebServer {\r
- private HttpdServerTargetData targetData;\r
- private HttpdServerDeploymentData deploymentData;\r
-\r
- public URL getBaseUrl() {\r
- try {\r
- return new URL("http://localhost:" + targetData.getPort());\r
- } catch (IOException e) {\r
- throw new SlcException("Cannot get url for Httpd server "\r
- + getDeployedSystemId(), e);\r
- }\r
- }\r
-\r
- public String getDeployedSystemId() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
- public Distribution getDistribution() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
- public DeploymentData getDeploymentData() {\r
- return deploymentData;\r
- }\r
-\r
- public TargetData getTargetData() {\r
- return targetData;\r
- }\r
-\r
- public void setTargetData(TargetData targetData) {\r
- this.targetData = (HttpdServerTargetData)targetData;\r
- }\r
-\r
- public void setDeploymentData(DeploymentData deploymentData) {\r
- this.deploymentData = (HttpdServerDeploymentData)deploymentData;\r
- }\r
-\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.build.Distribution;
+import org.argeo.slc.deploy.DeploymentData;
+import org.argeo.slc.deploy.TargetData;
+
+public class HttpdServer implements WebServer {
+ private HttpdServerTargetData targetData;
+ private HttpdServerDeploymentData deploymentData;
+
+ public URL getBaseUrl() {
+ try {
+ return new URL("http://localhost:" + targetData.getPort());
+ } catch (IOException e) {
+ throw new SlcException("Cannot get url for Httpd server "
+ + getDeployedSystemId(), e);
+ }
+ }
+
+ public String getDeployedSystemId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Distribution getDistribution() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public DeploymentData getDeploymentData() {
+ return deploymentData;
+ }
+
+ public TargetData getTargetData() {
+ return targetData;
+ }
+
+ public void setTargetData(TargetData targetData) {
+ this.targetData = (HttpdServerTargetData)targetData;
+ }
+
+ public void setDeploymentData(DeploymentData deploymentData) {
+ this.deploymentData = (HttpdServerDeploymentData)deploymentData;
+ }
+
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy;
import org.argeo.slc.build.Distribution;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy;
import org.argeo.slc.deploy.DeploymentData;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy;
import java.io.BufferedReader;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy;
import org.argeo.slc.deploy.InstalledExecutables;
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.File;\r
-import java.net.URL;\r
-\r
-import org.argeo.slc.build.Distribution;\r
-import org.argeo.slc.deploy.DeploymentData;\r
-\r
-public class SimpleHttpdApplication implements WebApplication {\r
- private HttpdApplicationTargetData targetData;\r
- private Distribution distribution;\r
-\r
- public void setDistribution(Distribution distribution) {\r
- this.distribution = distribution;\r
- }\r
-\r
- public URL getBaseUrl() {\r
- return targetData.getTargetBaseUrl();\r
- }\r
-\r
- public File getRootLocation() {\r
- return targetData.getTargetRootLocation();\r
- }\r
-\r
- public String getDeployedSystemId() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
- public HttpdApplicationTargetData getTargetData() {\r
- return targetData;\r
- }\r
-\r
- public void setTargetData(HttpdApplicationTargetData targetData) {\r
- this.targetData = targetData;\r
- }\r
-\r
- public Distribution getDistribution() {\r
- return distribution;\r
- }\r
-\r
- public DeploymentData getDeploymentData() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.io.File;
+import java.net.URL;
+
+import org.argeo.slc.build.Distribution;
+import org.argeo.slc.deploy.DeploymentData;
+
+public class SimpleHttpdApplication implements WebApplication {
+ private HttpdApplicationTargetData targetData;
+ private Distribution distribution;
+
+ public void setDistribution(Distribution distribution) {
+ this.distribution = distribution;
+ }
+
+ public URL getBaseUrl() {
+ return targetData.getTargetBaseUrl();
+ }
+
+ public File getRootLocation() {
+ return targetData.getTargetRootLocation();
+ }
+
+ public String getDeployedSystemId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public HttpdApplicationTargetData getTargetData() {
+ return targetData;
+ }
+
+ public void setTargetData(HttpdApplicationTargetData targetData) {
+ this.targetData = targetData;
+ }
+
+ public Distribution getDistribution() {
+ return distribution;
+ }
+
+ public DeploymentData getDeploymentData() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.File;\r
-import java.net.URL;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-\r
-public interface WebApplication extends DeployedSystem {\r
- public URL getBaseUrl();\r
-\r
- public File getRootLocation();\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.io.File;
+import java.net.URL;
+
+import org.argeo.slc.deploy.DeployedSystem;
+
+public interface WebApplication extends DeployedSystem {
+ public URL getBaseUrl();
+
+ public File getRootLocation();
+}
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.net.URL;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-\r
-public interface WebServer extends DeployedSystem {\r
- public URL getBaseUrl();\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.net.URL;
+
+import org.argeo.slc.deploy.DeployedSystem;
+
+public interface WebServer extends DeployedSystem {
+ public URL getBaseUrl();
+}
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy.db;
import java.sql.Connection;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy.db;
import javax.sql.DataSource;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.support.deploy.db;
import javax.sql.DataSource;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.vfs;
import java.io.File;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.vfs;
import org.apache.commons.vfs2.CacheStrategy;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.slc.vfs;
import java.util.HashMap;
<developerConnection>scm:git:https://code.argeo.org/git/lgpl/argeo-slc.git</developerConnection>
<tag>HEAD</tag>
</scm>
+ <organization>
+ <name>Argeo GmbH</name>
+ </organization>
<inceptionYear>2007</inceptionYear>
<licenses>
<license>
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.eclipse.ui.specific;
/** RCP specific {@link NLS} to be extended */
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.eclipse.ui.specific;
import org.eclipse.jface.viewers.ColumnViewer;
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
package org.argeo.eclipse.ui.specific;
import static org.argeo.eclipse.ui.util.SingleSourcingConstants.FILE_SCHEME;