首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Modeshape工作区创建

Modeshape工作区创建
EN

Stack Overflow用户
提问于 2015-02-04 08:58:30
回答 2查看 653关注 0票数 1

我们正在利用这个平台:

JBoss 6.1.0.GA

Modeshape 3.6.0

我只需要创建一个新的工作区,并将我们正在开发的webapp所需的图像、javascripts和其他文件放入其中。

我试图通过webdav连接到modeshape存储库,并在其中创建一个新的测试目录,但我总是收到这个异常:

代码语言:javascript
复制
2015-02-03 16:47 WARN  [org.modeshape.web.jcr.webdav.ModeShapeWebdavStore] (http-/0.0.0.0:8021-1) Cannot obtain a session for the repository 'repository': The workspace test was not found

我查看了堆栈溢出和模式的官方指南,但我仍然无法理解如何完成这一“容易”的任务。

似乎没有说明如何在存储库中手动创建新工作区的文档。

我从standalone.xml中添加了用于缓存的配置:

代码语言:javascript
复制
        <subsystem xmlns="urn:jboss:domain:infinispan:1.4">
        <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">
            <local-cache name="entity">
                <transaction mode="NON_XA"/>
                <eviction strategy="LRU" max-entries="10000"/>
                <expiration max-idle="100000"/>
            </local-cache>
            <local-cache name="local-query">
                <transaction mode="NONE"/>
                <eviction strategy="LRU" max-entries="10000"/>
                <expiration max-idle="100000"/>
            </local-cache>
            <local-cache name="timestamps">
                <transaction mode="NONE"/>
                <eviction strategy="NONE"/>
            </local-cache>
        </cache-container>
        <cache-container name="modeshape" default-cache="repository" module="org.modeshape">
            <local-cache name="repository">
                <transaction mode="NON_XA"/>
                <string-keyed-jdbc-store datasource="java:/jdbc/blablablaDatasource" shared="true" passivation="false" purge="false">
                    <property name="databaseType">
                        oracle
                    </property>
                    <property name="createTableOnStart">
                        true
                    </property>
                    <string-keyed-table prefix="CONTENT_REPO_STRING">
                        <id-column name="id_column" type="VARCHAR2(255)"/>
                        <data-column name="data_column" type="BLOB"/>
                        <timestamp-column name="timestamp_column" type="NUMBER(20)"/>
                    </string-keyed-table>
                </string-keyed-jdbc-store>
            </local-cache>
        </cache-container>
        <cache-container name="binary_cache_container" default-cache="binary_fs">
            <local-cache name="binary_fs">
                <transaction mode="NON_XA"/>
                <string-keyed-jdbc-store datasource="java:/jdbc/blablablaDatasource" shared="true" preload="false" passivation="false" purge="false">
                    <write-behind flush-lock-timeout="1" modification-queue-size="1024" shutdown-timeout="25000" thread-pool-size="1"/>
                    <property name="databaseType">
                        oracle
                    </property>
                    <string-keyed-table prefix="CONTENT_REPO">
                        <id-column name="id_column" type="VARCHAR(255)"/>
                        <data-column name="data_column" type="BLOB"/>
                        <timestamp-column name="timestamp_column" type="NUMBER(20)"/>
                    </string-keyed-table>
                </string-keyed-jdbc-store>
            </local-cache>
            <local-cache name="binary_fs_meta">
                <transaction mode="NON_XA"/>
                <string-keyed-jdbc-store datasource="java:/jdbc/blablablaDatasource" shared="true" preload="false" passivation="false" purge="false">
                    <write-behind flush-lock-timeout="1" modification-queue-size="1024" shutdown-timeout="25000" thread-pool-size="1"/>
                    <property name="databaseType">
                        oracle
                    </property>
                    <string-keyed-table prefix="CONTENT_REPO">
                        <id-column name="id_column" type="VARCHAR(255)"/>
                        <data-column name="data_column" type="BLOB"/>
                        <timestamp-column name="timestamp_column" type="NUMBER(20)"/>
                    </string-keyed-table>
                </string-keyed-jdbc-store>
            </local-cache>
        </cache-container>
    </subsystem>

同时也适用于现代公寓:

代码语言:javascript
复制
<subsystem xmlns="urn:jboss:domain:modeshape:1.0">
        <repository name="repository" security-domain="modeshape-internal-security">
            <workspaces default-workspace="default" allow-workspace-creation="true">
                <workspace name="ops">
                    <initial-content>
                        initial-content-default.xml
                    </initial-content>
                </workspace>
        <workspace name="other"/>
        <workspace name="extra">
            <initial-content>
                        initial-content-default.xml
                    </initial-content>
                </workspace>    
        <workspace name="default"/>
            </workspaces>
            <indexing rebuild-upon-startup="ALWAYS"/>
            <cache-binary-storage data-cache-name="binary_fs" metadata-cache-name="binary_fs_meta" cache-container="binary_cache_container"/>
            <sequencers>
                <sequencer name="fixed-width-text-sequencer" classname="org.modeshape.sequencer.text.FixedWidthTextSequencer" module="org.modeshape.sequencer.text" commentMarker="#" path-expression="/files(//*.txt[*])/jcr:content[@jcr:data] => /derived/text/fixedWidth/$1"/>
                <sequencer name="xml-sequencer" classname="xml" module="org.modeshape.sequencer.xml" path-expression="/files(//)*.xml[*]/jcr:content[@jcr:data] => /derived/xml/$1"/>
                <sequencer name="image-sequencer" classname="image" module="org.modeshape.sequencer.image" path-expression="/files(//*.(png|jpg|gif)[*])/jcr:content[@jcr:data] => /derived/image/$1"/>
            </sequencers>
            <text-extractors>
                <text-extractor name="tika-extractor" classname="tika" module="org.modeshape.extractor.tika"/>
            </text-extractors>
        </repository>
    </subsystem>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-02-04 16:56:40

我设法使它工作,只将配置更改为这个配置:

JBoss 6.3.0.GA

3.8.1

票数 0
EN

Stack Overflow用户

发布于 2015-02-04 15:05:12

可以使用标准JCR以编程方式创建新工作区(请参阅这个StackOverflow问题,但也可以在ModeShape配置文件中定义工作区。

由于要将ModeShape部署到JBoss EAP,所以可以在安装的standalone-modeshape.xml文件中的ModeShape子系统配置中配置新的工作区。下面是一个示例(实际上在该配置文件中),它在启动时定义了3个名为defaultotherextra的工作区,为名为default的工作区定义了一些初始内容,并允许对工作区进行编程创建。

代码语言:javascript
复制
<repository name="artifacts">
  <!-- ... -->
  <!-- Define 3 workspaces to exist upon startup -->
  <workspaces default-workspace="default" allow-workspace-creation="false">
    <workspace name="default">
      <initial-content>initial-content-default.xml</initial-content>
    </workspace>
    <workspace name="other"/>
    <workspace name="extra"/>
  </workspaces>
  <!-- ... -->
<repository name="artifacts">

此XML片段的结构由您的EAP安装中的0.xsd文件(或Wildfly安装中的0.xsd文件)指定。

对于那些没有在ModeShape EAP中部署JBoss (或者Wildfly 4.x)的人,您可以在ModeShape的文件中做同样的事情。例如,这定义了上面描述的完全相同的工作区:

代码语言:javascript
复制
"workspaces" : {
    "predefined" : ["other", "extra"],
    "default" : "default",
    "allowCreation" : true,
    "initialContent" : {
        "default" : "initial-content-default.xml"
    }
},

有关更多细节和选项,请参见ModeShape的JSON模式

此外,请确保当您登录到Session时,您正确地指定了工作区名称。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28317231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档