`
wangjavablog
  • 浏览: 23457 次
  • 性别: Icon_minigender_1
  • 来自: 长春
社区版块
存档分类
最新评论

jackrabbit 中的两种节点

阅读更多






import javax.jcr.Session;
import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
import java.io.FileInputStream;

public class CustomNodeTypeExample {
    public static void RegisterCustomNodeTypes(Session session, String cndFileName)
        throws Exception {

        // Get the JackrabbitNodeTypeManager from the Workspace.
        // Note that it must be cast from the generic JCR NodeTypeManager to the
        // Jackrabbit-specific implementation.
        JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
               session.getWorkspace().getNodeTypeManager();
        // Register the custom node types defined in the CND file
        manager.registerNodeTypes(new FileInputStream(cndFileName),
               JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
    }
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics