Examples of updateStringProperty()


Examples of org.drools.repository.AssetItem.updateStringProperty()

    @Restrict("#{identity.loggedIn}")
    public void clearAllDiscussionsForAsset(final String assetId) {
        checkIfADMIN();
        RulesRepository repo = getRulesRepository();
        AssetItem asset = repo.loadAssetByUUID( assetId );
        asset.updateStringProperty( "",
                                    "discussion" );
        repo.save();

        push( "discussion",
              assetId );
View Full Code Here

Examples of org.drools.repository.AssetItem.updateStringProperty()

        AssetItem asset = repo.loadAssetByUUID( assetId );
        Discussion dp = new Discussion();
        List<DiscussionRecord> discussion = dp.fromString( asset.getStringProperty( Discussion.DISCUSSION_PROPERTY_KEY ) );
        discussion.add( new DiscussionRecord( repo.getSession().getUserID(),
                                              comment ) );
        asset.updateStringProperty( dp.toString( discussion ),
                                    Discussion.DISCUSSION_PROPERTY_KEY,
                                    false );
        repo.save();

        push( "discussion",
View Full Code Here

Examples of org.drools.repository.AssetItem.updateStringProperty()

        RulesRepository repo = getRulesRepository();
        AssetItem asset = repo.loadAssetByUUID( assetId );
        Discussion dp = new Discussion();
        List<DiscussionRecord> discussion = dp.fromString( asset.getStringProperty( Discussion.DISCUSSION_PROPERTY_KEY ) );
        discussion.add( new DiscussionRecord( repo.getSession().getUserID(), StringEscapeUtils.escapeXml( comment ) ) );
        asset.updateStringProperty( dp.toString( discussion ), Discussion.DISCUSSION_PROPERTY_KEY, false );
        repo.save();

        push( "discussion", assetId );

        MailboxService.getInstance().recordItemUpdated( asset );
View Full Code Here

Examples of org.drools.repository.AssetItem.updateStringProperty()

    @Restrict("#{identity.loggedIn}")
    public void clearAllDiscussionsForAsset(final String assetId) {
        checkIfADMIN();
        RulesRepository repo = getRulesRepository();
        AssetItem asset = repo.loadAssetByUUID( assetId );
        asset.updateStringProperty( "", "discussion" );
        repo.save();

        push( "discussion", assetId );

    }
View Full Code Here

Examples of org.drools.repository.ModuleItem.updateStringProperty()

            String[] a = fileName.split("\\.");
            if (a[1].equals("package")) {
                //new package
                ModuleItem pkg = rulesRepository.createModule(bits[1], "<added remotely>");
                pkg.updateCheckinComment(comment);
                pkg.updateStringProperty(readContent(in), ModuleItem.HEADER_PROPERTY_NAME);
                rulesRepository.save();
            } else {
                //new asset
                ModuleItem pkg = rulesRepository.loadModule(bits[1]);
                AssetItem asset;
View Full Code Here

Examples of org.drools.repository.ModuleItem.updateStringProperty()

            if (a[1].equals("package")) {
                //updating package header
                if (lastModified != null && pkg.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The package was modified by: " + pkg.getLastContributor() + ", unable to write changes.");
                }
                pkg.updateStringProperty(readContent(in), ModuleItem.HEADER_PROPERTY_NAME);
                pkg.checkin(comment);
                rulesRepository.save();
            } else {
                AssetItem as = pkg.loadAsset(a[0]);
                if (lastModified != null && as.getLastModified().after(lastModified)) {
View Full Code Here

Examples of org.drools.repository.ModuleItem.updateStringProperty()

            if (a[1].equals("package")) {
                //updating package header
                if (lastModified != null && pkg.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The package was modified by: " + pkg.getLastContributor() + ", unable to write changes.");
                }
                pkg.updateStringProperty(readContent(in), ModuleItem.HEADER_PROPERTY_NAME);
                pkg.checkin(comment);
                repo.save();
            } else {
                AssetItem as = pkg.loadAsset(a[0]);
                if (lastModified != null && as.getLastModified().after(lastModified)) {
View Full Code Here

Examples of org.drools.repository.ModuleItem.updateStringProperty()

            String[] a = fileName.split("\\.");
            if (a[1].equals("package")) {
                //new package
                ModuleItem pkg = repo.createModule(bits[1], "<added remotely>");
                pkg.updateCheckinComment(comment);
                pkg.updateStringProperty(readContent(in), ModuleItem.HEADER_PROPERTY_NAME);
                repo.save();
            } else {
                //new asset
                ModuleItem pkg = repo.loadModule(bits[1]);
                AssetItem asset;
View Full Code Here

Examples of org.drools.repository.ModuleItem.updateStringProperty()

    @Test
    public void testDelete() throws Exception {
        RulesRepository repo = RepositorySessionUtil.getRepository();
        ModuleItem pkg = repo.createModule("testRestDelete", "", ModuleItem.MODULE_FORMAT);
        pkg.updateStringProperty("This is some header", ModuleItem.HEADER_PROPERTY_NAME);
        repo.save();

        AssetItem asset1 = pkg.addAsset("asset1", "");
        asset1.updateContent("this is content");
        asset1.updateFormat("drl");
View Full Code Here

Examples of org.drools.repository.ModuleItem.updateStringProperty()

        sess.save();

        MigrateDroolsPackage mig = new MigrateDroolsPackage();

        ModuleItem pkg = repo.createModule("testMigratePackage", "");
        pkg.updateStringProperty("some header", ModuleItem.HEADER_PROPERTY_NAME);
        sess.save();

        repo.createModuleSnapshot("testMigratePackage", "SNAP1");
        repo.createModuleSnapshot("testMigratePackage", "SNAP2");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.