Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
WARNING: commit may change (sed migration)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jun 25, 2015
1 parent 51fae17 commit 56456f7
Show file tree
Hide file tree
Showing 304 changed files with 2,078 additions and 2,488 deletions.
Expand Up @@ -85,7 +85,7 @@ public String getKey() {
}

@NotNull
@Type(type = "text")
@javax.persistence.Lob
@Column(name = "config_value", nullable = false)
public String getValue() {
return value;
Expand Down
1 change: 0 additions & 1 deletion zanata-model/src/main/java/org/zanata/model/HDocument.java
Expand Up @@ -57,7 +57,6 @@
import org.hibernate.annotations.Where;
import org.hibernate.validator.constraints.NotEmpty;
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.security.management.JpaIdentityStore;
import org.zanata.common.ContentType;
Expand Down
Expand Up @@ -71,7 +71,7 @@ public Map<HLocale, HGlossaryTerm> getGlossaryTerms() {
return glossaryTerms;
}

@Type(type = "text")
@javax.persistence.Lob
public String getSourceRef() {
return sourceRef;
}
Expand Down
Expand Up @@ -80,7 +80,7 @@ public HGlossaryTerm(String content) {
}

@NotNull
@Type(type = "text")
@javax.persistence.Lob
@Field(analyzer = @Analyzer(impl = StandardAnalyzer.class))
public String getContent() {
return content;
Expand Down
6 changes: 4 additions & 2 deletions zanata-model/src/main/java/org/zanata/model/HProject.java
Expand Up @@ -63,7 +63,9 @@
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.validator.constraints.NotEmpty;
import org.jboss.seam.annotations.security.Restrict;
import org.zanata.security.CheckLoggedIn;
import org.zanata.security.CheckPermission;
import org.zanata.security.CheckRole;
import org.zanata.annotation.EntityRestrict;
import org.zanata.common.EntityStatus;
import org.zanata.common.LocaleId;
Expand Down Expand Up @@ -112,7 +114,7 @@ public class HProject extends SlugEntityBase implements Serializable,
@Field(analyzer = @Analyzer(impl = CaseInsensitiveWhitespaceAnalyzer.class))
private String description;

@Type(type = "text")
@javax.persistence.Lob
private String homeContent;

@Url(canEndInSlash = true)
Expand Down
Expand Up @@ -62,7 +62,9 @@
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.FieldBridge;
import org.hibernate.search.annotations.Indexed;
import org.jboss.seam.annotations.security.Restrict;
import org.zanata.security.CheckLoggedIn;
import org.zanata.security.CheckPermission;
import org.zanata.security.CheckRole;
import org.zanata.annotation.EntityRestrict;
import org.zanata.common.EntityStatus;
import org.zanata.common.LocaleId;
Expand Down
Expand Up @@ -76,7 +76,7 @@ protected void setId(Long id) {
}

@NotNull
@Type(type = "text")
@javax.persistence.Lob
public String getComment() {
return comment;
}
Expand Down
Expand Up @@ -74,7 +74,7 @@ protected void setId(Long id) {
}

@NotNull
@Type(type = "text")
@javax.persistence.Lob
public String getComment() {
return comment;
}
Expand Down
Expand Up @@ -100,7 +100,7 @@ public void setTextFlow(HTextFlow textFlow) {
}

@NotEmpty
@Type(type = "text")
@javax.persistence.Lob
@AccessType("field")
@ElementCollection(fetch = FetchType.EAGER)
@JoinTable(name = "HTextFlowContentHistory", joinColumns = @JoinColumn(
Expand Down
Expand Up @@ -163,7 +163,7 @@ public void setVersionNum(Integer versionNum) {
}

@Override
@Type(type = "text")
@javax.persistence.Lob
@AccessType("field")
@ElementCollection(fetch = FetchType.EAGER)
@JoinTable(name = "HTextFlowTargetContentHistory",
Expand Down
Expand Up @@ -69,7 +69,7 @@ public class HTextFlowTargetReviewComment extends ModelEntityBase {
private HTextFlowTarget textFlowTarget;

@NotEmpty
@Type(type = "text")
@javax.persistence.Lob
@Getter
private String comment;

Expand Down
Expand Up @@ -118,7 +118,7 @@ public void setReferences(String references) {
* Gettext message references, delimited by ',' (comma)
*/
@Column(name = "refs")
@Type(type = "text")
@javax.persistence.Lob
public String getReferences() {
return references;
}
Expand Down
Expand Up @@ -59,7 +59,7 @@ public HSimpleComment getComment() {
}

// see PoUtility.stringToHeaderEntries
@Type(type = "text")
@javax.persistence.Lob
public String getEntries() {
return entries;
}
Expand Down
Expand Up @@ -10,8 +10,8 @@

import lombok.extern.slf4j.Slf4j;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.security.RunAsOperation;
import org.zanata.common.LocaleId;
Expand All @@ -30,14 +30,14 @@
* href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
*/
@Path("/test/data/sample")
@Name("sampleProjectResourceImpl")
@Named("sampleProjectResourceImpl")
@Slf4j
public class SampleDataResourceImpl implements SampleDataResource {

@In(create = true)
@Inject
private SampleProjectProfile sampleProjectProfile;

@In
@Inject
private EntityManager entityManager;

@Override
Expand Down
Expand Up @@ -6,11 +6,8 @@

import org.hibernate.search.jpa.FullTextEntityManager;
import org.hibernate.search.jpa.Search;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.annotations.Transactional;
import org.zanata.common.ContentType;
import org.zanata.common.LocaleId;
Expand Down Expand Up @@ -58,16 +55,16 @@
* href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
*/
@Slf4j
@Name("sampleProjectProfile")
@Scope(ScopeType.APPLICATION)
@AutoCreate
@Named("sampleProjectProfile")
@javax.enterprise.context.ApplicationScoped

@Transactional
public class SampleProjectProfile {

@In
@Inject
private EntityManager entityManager;

@In
@Inject
private EntityManagerFactory entityManagerFactory;

private HLocale enUSLocale;
Expand Down
24 changes: 11 additions & 13 deletions zanata-war/src/main/java/org/zanata/ApplicationConfiguration.java
Expand Up @@ -38,12 +38,10 @@
import lombok.Setter;

import org.apache.log4j.Level;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.Synchronized;
import org.jboss.seam.web.ServletContexts;
Expand All @@ -62,9 +60,9 @@
import com.google.common.collect.Sets;
import org.zanata.security.OpenIdLoginModule;

@Name("applicationConfiguration")
@Scope(ScopeType.APPLICATION)
@Startup
@Named("applicationConfiguration")
@javax.enterprise.context.ApplicationScoped
/* TODO [CDI] Remove @PostConstruct from startup method and make it accept (@Observes @Initialized ServletContext context) */
@Synchronized(timeout = ServerConstants.DEFAULT_TIMEOUT)
@Slf4j
public class ApplicationConfiguration implements Serializable {
Expand All @@ -76,13 +74,13 @@ public class ApplicationConfiguration implements Serializable {
@Getter
private static final int defaultMaxFilesPerUpload = 100;

@In
@Inject
private DatabaseBackedConfig databaseBackedConfig;
@In
@Inject
private JndiBackedConfig jndiBackedConfig;
@In
@Inject
private JaasConfig jaasConfig;
@In
@Inject
private Messages msgs;

private static final ZanataSMTPAppender smtpAppenderInstance =
Expand Down Expand Up @@ -118,7 +116,7 @@ public class ApplicationConfiguration implements Serializable {

private String defaultServerPath;

@Create
@PostConstruct
public void load() {
log.info("Reloading configuration");
this.loadLoginModuleNames();
Expand Down
13 changes: 5 additions & 8 deletions zanata-war/src/main/java/org/zanata/WebAssetsConfiguration.java
Expand Up @@ -22,11 +22,8 @@
package org.zanata;

import org.apache.commons.lang.StringUtils;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import javax.annotation.PostConstruct;
import javax.inject.Named;

import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
Expand All @@ -45,9 +42,9 @@
*
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a>
*/
@AutoCreate
@Name("assets")
@Scope(ScopeType.APPLICATION)

@Named("assets")
@javax.enterprise.context.ApplicationScoped
public class WebAssetsConfiguration extends AbstractMap<String, String> {

/**
Expand Down
16 changes: 7 additions & 9 deletions zanata-war/src/main/java/org/zanata/ZanataInit.java
Expand Up @@ -57,17 +57,15 @@
import org.apache.commons.io.FileUtils;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.mail.MailSession;
import org.zanata.events.ServerStarted;
import org.zanata.exception.ZanataInitializationException;
import org.zanata.rest.dto.VersionInfo;
import org.zanata.util.Event;
import javax.enterprise.event.Event;
import org.zanata.util.VersionUtility;

/**
Expand All @@ -79,8 +77,8 @@
* @author Christian Bauer
* @author Sean Flanigan <a href="mailto:sflaniga@redhat.com">sflaniga@redhat.com</a>
*/
@Name("zanataInit")
@Scope(ScopeType.STATELESS)
@Named("zanataInit")
@javax.enterprise.context.Dependent
@Slf4j
public class ZanataInit {
private static final DefaultArtifactVersion MIN_EAP_VERSION =
Expand All @@ -101,10 +99,10 @@ public class ZanataInit {
Level.SEVERE);
}

@In
@Inject
private ApplicationConfiguration applicationConfiguration;

@In("event")
@Inject
private Event<ServerStarted> startupEvent;

@Observer("org.jboss.seam.postInitialization")
Expand Down
Expand Up @@ -4,7 +4,7 @@
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.jboss.seam.annotations.In;
import javax.inject.Inject;
import org.jboss.seam.security.management.JpaIdentityStore;
import org.zanata.dao.AccountDAO;
import org.zanata.dao.PersonDAO;
Expand All @@ -24,19 +24,19 @@ public abstract class AbstractProfileAction {
protected boolean valid;
private String activationKey;

@In
@Inject
ZanataIdentity identity;

@In("jsfMessages")
@Inject
private FacesMessages facesMessages;

@In(required = false, value = JpaIdentityStore.AUTHENTICATED_USER)
@Inject /* TODO [CDI] check this: migrated from @In(required = false, value = JpaIdentityStore.AUTHENTICATED_USER) */
HAccount authenticatedAccount;

@In
@Inject
PersonDAO personDAO;

@In
@Inject
AccountDAO accountDAO;

protected void validateEmail(String email) {
Expand Down

0 comments on commit 56456f7

Please sign in to comment.