Author: sascharodekamp
Date: Fri Sep 2 11:01:19 2011 New Revision: 1164472 URL: http://svn.apache.org/viewvc?rev=1164472&view=rev Log: Update: First approach of multilingual nodes using the ocm. Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java (with props) ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java (with props) Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-ocm.jar ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/ContentWriter.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/RepositoryAccess.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/RepositoryAccessJackrabbit.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java (original) +++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java Fri Sep 2 11:01:19 2011 @@ -8,6 +8,7 @@ import java.util.GregorianCalendar; import java.util.List; import java.util.Map; +import javax.jcr.ItemExistsException; import javax.jcr.RepositoryException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -32,6 +33,8 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericValue; import org.ofbiz.jcr.access.RepositoryAccess; import org.ofbiz.jcr.access.jackrabbit.RepositoryAccessJackrabbit; +import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle; +import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitLocalizedContent; import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFile; import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFolder; import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitNews; @@ -57,16 +60,20 @@ public class JackrabbitEvents { Calendar pubDate = new GregorianCalendar(); // TODO String content = request.getParameter("message"); - OfbizRepositoryMappingJackrabbitNews orm = new OfbizRepositoryMappingJackrabbitNews(nodePath, language, title, pubDate, content); + OfbizRepositoryMappingJackrabbitArticle ormArticle = new OfbizRepositoryMappingJackrabbitArticle(nodePath, language, title, content); RepositoryAccess repositoryAccess = null; try { repositoryAccess = new RepositoryAccessJackrabbit(userLogin); - repositoryAccess.storeContentObject(orm); + repositoryAccess.storeContentObject(ormArticle); } catch (ObjectContentManagerException ocme) { Debug.logError(ocme, module); request.setAttribute("_ERROR_MESSAGE_", ocme.toString()); return "error"; + } catch (ItemExistsException e) { + Debug.logError(e, module); + request.setAttribute("_ERROR_MESSAGE_", e.toString()); + return "error"; } finally { repositoryAccess.closeAccess(); } @@ -113,16 +120,15 @@ public class JackrabbitEvents { } RepositoryAccess repositoryAccess = new RepositoryAccessJackrabbit(userLogin); - OfbizRepositoryMappingJackrabbitNews news = (OfbizRepositoryMappingJackrabbitNews) repositoryAccess.getContentObject(node); + OfbizRepositoryMappingJackrabbitArticle ormArticle = (OfbizRepositoryMappingJackrabbitArticle) repositoryAccess.getContentObject(node); - request.setAttribute("contentObject", news); - request.setAttribute("path", news.getPath()); - request.setAttribute("language", news.getLanguage()); - request.setAttribute("pubDate", news.getPubDate()); - request.setAttribute("title", news.getTitle()); - request.setAttribute("version", news.getVersion()); - request.setAttribute("createDate", news.getCreationDate()); - request.setAttribute("content", news.getContent()); + request.setAttribute("contentObject", ormArticle); + request.setAttribute("path", ormArticle.getPath()); + request.setAttribute("language", ormArticle.getLanguage()); + request.setAttribute("title", ormArticle.getTitle()); + request.setAttribute("version", ormArticle.getVersion()); + request.setAttribute("createDate", ormArticle.getCreationDate()); + request.setAttribute("content", ormArticle.getContent()); return "success"; } @@ -139,15 +145,15 @@ public class JackrabbitEvents { String path = request.getParameter("path"); RepositoryAccess repositoryAccess = new RepositoryAccessJackrabbit(userLogin); - OfbizRepositoryMappingJackrabbitNews news = (OfbizRepositoryMappingJackrabbitNews) repositoryAccess.getContentObject(path); + OfbizRepositoryMappingJackrabbitArticle ormArticle = (OfbizRepositoryMappingJackrabbitArticle) repositoryAccess.getContentObject(path); - news.setLanguage(request.getParameter("language")); - news.setTitle(request.getParameter("title")); - news.setContent(request.getParameter("content")); + // news.setLanguage(request.getParameter("language")); + ormArticle.setTitle(request.getParameter("title")); + ormArticle.setContent(request.getParameter("content")); // request.getParameter("pubDate") // request.getParameter("createDate") - repositoryAccess.updateContentObject(news); + repositoryAccess.updateContentObject(ormArticle); repositoryAccess.closeAccess(); return "success"; @@ -233,7 +239,15 @@ public class JackrabbitEvents { ormFolder.setPath(passedParams.get("path")); RepositoryAccess repositoryAcces = new RepositoryAccessJackrabbit(userLogin); - repositoryAcces.storeContentObject(ormFolder); + try { + repositoryAcces.storeContentObject(ormFolder); + } catch (ObjectContentManagerException e) { + Debug.logError(e, module); + request.setAttribute("_ERROR_MESSAGE_", e.toString()); + } catch (ItemExistsException e) { + Debug.logError(e, module); + request.setAttribute("_ERROR_MESSAGE_", e.toString()); + } return "success"; } Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/ContentWriter.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/ContentWriter.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/ContentWriter.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/ContentWriter.java Fri Sep 2 11:01:19 2011 @@ -1,5 +1,7 @@ package org.ofbiz.jcr.access; +import javax.jcr.ItemExistsException; + import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException; import org.ofbiz.jcr.orm.OfbizRepositoryMapping; @@ -10,8 +12,9 @@ public interface ContentWriter { * * @param orm * @throws ObjectContentManagerException + * @throws ItemExistsException */ - public void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException; + public void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException, ItemExistsException; /** * Update the OfbizRepositoryMapping Class in the content repository. Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/RepositoryAccess.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/RepositoryAccess.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/RepositoryAccess.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/RepositoryAccess.java Fri Sep 2 11:01:19 2011 @@ -1,5 +1,6 @@ package org.ofbiz.jcr.access; +import javax.jcr.ItemExistsException; import javax.jcr.RepositoryException; import net.sf.json.JSONArray; @@ -28,8 +29,9 @@ public interface RepositoryAccess { * * @param orm * @throws ObjectContentManagerException + * @throws ItemExistsException */ - void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException; + void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException, ItemExistsException; /** * Update the passed content object. Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/ContentWriterJackrabbit.java Fri Sep 2 11:01:19 2011 @@ -1,5 +1,6 @@ package org.ofbiz.jcr.access.jackrabbit; +import javax.jcr.ItemExistsException; import javax.jcr.Node; import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; @@ -27,14 +28,30 @@ public class ContentWriterJackrabbit imp /* * (non-Javadoc) - * @see org.ofbiz.jcr.access.ContentWriter#storeContentObject(org.ofbiz.jcr.orm.OfbizRepositoryMapping) + * + * @see + * org.ofbiz.jcr.access.ContentWriter#storeContentObject(org.ofbiz.jcr.orm + * .OfbizRepositoryMapping) */ @Override - public void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException { + public void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException, ItemExistsException { if (orm == null) { return; } + // we want to avoid same name sibling (SnS) for each node Type + try { + if (this.ocm.getSession().itemExists(orm.getPath())) { + // we could either throw an exception or call the update method + throw new ItemExistsException("There already exists an object stored at " + orm.getPath() + ". Please use update if you want to change it."); + } + } catch (ItemExistsException e) { + throw (e); + } catch (RepositoryException e) { + Debug.logError(e, module); + return; + } + // We have to check if the node structure (the sub nodes of the passed // ORM Object) exist, otherwise they will be created. String path = orm.getPath(); @@ -93,7 +110,10 @@ public class ContentWriterJackrabbit imp /* * (non-Javadoc) - * @see org.ofbiz.jcr.access.ContentWriter#updateContentObject(org.ofbiz.jcr.orm.OfbizRepositoryMapping) + * + * @see + * org.ofbiz.jcr.access.ContentWriter#updateContentObject(org.ofbiz.jcr. + * orm.OfbizRepositoryMapping) */ @Override public void updateContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException { @@ -103,7 +123,9 @@ public class ContentWriterJackrabbit imp /* * (non-Javadoc) - * @see org.ofbiz.jcr.access.ContentWriter#removeContentObject(java.lang.String) + * + * @see + * org.ofbiz.jcr.access.ContentWriter#removeContentObject(java.lang.String) */ @Override public void removeContentObject(String nodePath) throws ObjectContentManagerException { Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/RepositoryAccessJackrabbit.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/RepositoryAccessJackrabbit.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/RepositoryAccessJackrabbit.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/access/jackrabbit/RepositoryAccessJackrabbit.java Fri Sep 2 11:01:19 2011 @@ -3,6 +3,7 @@ package org.ofbiz.jcr.access.jackrabbit; import java.util.ArrayList; import java.util.List; +import javax.jcr.ItemExistsException; import javax.jcr.RepositoryException; import javax.jcr.Session; @@ -19,6 +20,8 @@ import org.ofbiz.jcr.access.ContentWrite import org.ofbiz.jcr.access.RepositoryAccess; import org.ofbiz.jcr.loader.JCRFactoryUtil; import org.ofbiz.jcr.orm.OfbizRepositoryMapping; +import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle; +import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitLocalizedContent; import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFile; import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFolder; import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitHierarchyNode; @@ -65,6 +68,8 @@ public class RepositoryAccessJackrabbit classes.add(OfbizRepositoryMappingJackrabbitFile.class); classes.add(OfbizRepositoryMappingJackrabbitFolder.class); classes.add(OfbizRepositoryMappingJackrabbitResource.class); + classes.add(OfbizRepositoryMappingJackrabbitLocalizedContent.class); + classes.add(OfbizRepositoryMappingJackrabbitArticle.class); Mapper mapper = new AnnotationMapperImpl(classes); this.ocm = new ObjectContentManagerImpl(session, mapper); @@ -105,7 +110,7 @@ public class RepositoryAccessJackrabbit * .OfbizRepositoryMapping) */ @Override - public void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException { + public void storeContentObject(OfbizRepositoryMapping orm) throws ObjectContentManagerException, ItemExistsException { ContentWriter contentWriter = new ContentWriterJackrabbit(this.ocm); contentWriter.storeContentObject(orm); Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java?rev=1164472&view=auto ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java (added) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java Fri Sep 2 11:01:19 2011 @@ -0,0 +1,48 @@ +package org.ofbiz.jcr.orm.jackrabbit; + +import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field; +import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; + +@Node(extend = OfbizRepositoryMappingJackrabbitLocalizedContent.class) +public class OfbizRepositoryMappingJackrabbitArticle extends OfbizRepositoryMappingJackrabbitLocalizedContent { + + @Field(id = true) + String title = null; + @Field + String content = null; + + /** + * + * @param nodePath + * @param language + * @param title + * @param content + */ + public OfbizRepositoryMappingJackrabbitArticle(String nodePath, String language, String title, String content) { + super(nodePath, language); + + this.title = title; + this.content = content; + } + + public OfbizRepositoryMappingJackrabbitArticle() { + super(); + // create an empty object + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java?rev=1164472&view=auto ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java (added) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java Fri Sep 2 11:01:19 2011 @@ -0,0 +1,73 @@ +package org.ofbiz.jcr.orm.jackrabbit; + +import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field; +import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; + +@Node(isAbstract = true, extend = OfbizRepositoryMappingJackrabbitUnstructured.class) +public abstract class OfbizRepositoryMappingJackrabbitLocalizedContent extends OfbizRepositoryMappingJackrabbitUnstructured { + + @Field + private String language; + + public OfbizRepositoryMappingJackrabbitLocalizedContent() { + super(); + super.setLocalized(true); + // create an empty localized object + } + + /** + * + * @param nodePath + * @param language + */ + public OfbizRepositoryMappingJackrabbitLocalizedContent(String nodePath, String language) { + this.language = language; + setLocalizedPath(nodePath); + + // define this node as a localized node + super.setLocalized(true); + } + + /** + * The path of a localized node is always a combination of path and language + */ + private void setLocalizedPath(String path) { + // determine a default language + if (UtilValidate.isEmpty(language)) { + language = determindeTheDefaultLanguage(); + } + + path = path + "/" + language; + super.setPath(path); + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + + // if the language is set after the path make sure the new language fits to the path + if (!super.getPath().endsWith(language) || !super.getPath().endsWith(language + "/")) { + String newPath = super.getPath(); + if (newPath.endsWith("/")) { + // cut a trailing slash / + newPath = newPath.substring(0, newPath.lastIndexOf("/")); + } + + // cut the old trailing language + newPath = newPath.substring(0, newPath.lastIndexOf("/")); + // write the new path + setLocalizedPath(newPath); + } + + } + + private String determindeTheDefaultLanguage() { + return language = UtilProperties.getPropertyValue("general", "locale.properties.fallback"); + } + +} Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java Fri Sep 2 11:01:19 2011 @@ -6,7 +6,7 @@ import org.apache.jackrabbit.ocm.mapper. import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; @Node(extend = OfbizRepositoryMappingJackrabbitUnstructured.class) -public class OfbizRepositoryMappingJackrabbitNews extends OfbizRepositoryMappingJackrabbitUnstructured { +public class OfbizRepositoryMappingJackrabbitNews extends OfbizRepositoryMappingJackrabbitLocalizedContent { @Field(id = true) String title = null; @Field(jcrType = "Date") Calendar pubDate = null; Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java?rev=1164472&r1=1164471&r2=1164472&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java Fri Sep 2 11:01:19 2011 @@ -5,8 +5,6 @@ import java.util.GregorianCalendar; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; -import org.ofbiz.base.util.UtilProperties; -import org.ofbiz.base.util.UtilValidate; import org.ofbiz.jcr.access.jackrabbit.ConstantsJackrabbit; import org.ofbiz.jcr.orm.OfbizRepositoryMapping; @@ -15,26 +13,19 @@ public abstract class OfbizRepositoryMap protected static String module = OfbizRepositoryMappingJackrabbitUnstructured.class.getName(); - @Field(path = true) - private String path; - @Field - private String language; - @Field - private String version; - @Field(jcrName = "jcr:created") - private Calendar creationDate; + @Field(path = true) private String path; + @Field private String version; + @Field(jcrName = "jcr:created") private Calendar creationDate; + @Field private boolean localized; protected OfbizRepositoryMappingJackrabbitUnstructured() { // create an empty object } - protected OfbizRepositoryMappingJackrabbitUnstructured(String nodePath, String language) { + protected OfbizRepositoryMappingJackrabbitUnstructured(String nodePath) { this.setPath(nodePath); this.creationDate = new GregorianCalendar(); - if (UtilValidate.isEmpty(language)) { - language = UtilProperties.getPropertyValue("general", "locale.properties.fallback"); - } - this.language = language; + this.localized = false; } public String getPath() { @@ -58,14 +49,6 @@ public abstract class OfbizRepositoryMap this.path = nodePath; } - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - public String getVersion() { return version; } @@ -73,4 +56,13 @@ public abstract class OfbizRepositoryMap public void setVersion(String version) { this.version = version; } + + public boolean getLocalized() { + return localized; + } + + public void setLocalized(boolean isLocalized) { + this.localized = isLocalized; + } + } |
Free forum by Nabble | Edit this page |