Package open.dolphin.infomodel

Examples of open.dolphin.infomodel.PublishedTreeModel


                if (sdl.isNoError() && result != null) {
                    // DBから取得が成功したらGUIコンポーネントを生成する
                    initComponent();
                    if (importedTreeList != null && importedTreeList.size() > 0) {
                        for (Iterator iter = result.iterator(); iter.hasNext();) {
                            PublishedTreeModel model = (PublishedTreeModel) iter.next();
                            for (Long id : importedTreeList) {
                                if (id.longValue() == model.getId()) {
                                    model.setImported(true);
                                    break;
                                }
                            }
                        }
                    }
View Full Code Here


        PropertyChangeListener pl = new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent e) {
                Object[] selected = (Object[]) e.getNewValue();
                if (selected != null && selected.length > 0) {
                    PublishedTreeModel model = (PublishedTreeModel) selected[0];
                    if (model.isImported()) {
                        importBtn.setEnabled(false);
                        deleteBtn.setEnabled(true);
                    } else {
                        importBtn.setEnabled(true);
                        deleteBtn.setEnabled(false);
View Full Code Here

        if (objects == null || objects.length == 0) {
            return;
        }
        // テーブルはシングルセレクションである
        // TODO ブラウズ時にbyte[]を取得している...
        final PublishedTreeModel importTree = (PublishedTreeModel) objects[0];
        try {
            importTree.setTreeXml(new String(importTree.getTreeBytes(), "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace(System.err);
        }
        //importTree.setTreeBytes(null);
        // サブスクライブリストに追加する
        SubscribedTreeModel sm = new SubscribedTreeModel();
        sm.setUser(Project.getUserModel());
        sm.setTreeId(importTree.getId());
        final List<SubscribedTreeModel> subscribeList = new ArrayList<SubscribedTreeModel>(1);
        subscribeList.add(sm);
       
        // デリゲータを生成する
        sdl = new StampDelegater();
       
        // Worker, Timer を実行する
        int delay = 200;
        int maxEstimation = 60*1000;
        String mmsg = "公開スタンプをインポートしています...";
        String message = "スタンプ取り込み";
        Component c = frame;
       
        Task task = new Task<Boolean>(c, message, mmsg, maxEstimation) {

            @Override
            protected Boolean doInBackground() {
                sdl.subscribeTrees(subscribeList);
                return sdl.isNoError();
            }
           
            @Override
            protected void succeeded(Boolean result) {
                if (result.booleanValue()) {
                    // スタンプボックスへインポートする
                    stampBox.importPublishedTree(importTree);
                    // Browser表示をインポート済みにする
                    importTree.setImported(true);
                    browseTable.getTableModel().fireTableDataChanged();

                } else {
                    JOptionPane.showMessageDialog(frame,
                            sdl.getErrorMessage(),
View Full Code Here

        if (objects == null || objects.length == 0) {
            return;
        }
       
        // 削除するTreeを取得する
        final PublishedTreeModel removeTree = (PublishedTreeModel) objects[0];
        SubscribedTreeModel sm = new SubscribedTreeModel();
        sm.setTreeId(removeTree.getId());
        sm.setUser(Project.getUserModel());
        final List<SubscribedTreeModel> list = new ArrayList<SubscribedTreeModel>(1);
        list.add(sm);
       
        // DeleteTaskを実行する
        sdl = new StampDelegater();
       
        // Unsubscribeタスクを実行する
        int delay = 200;
        int maxEstimation = 60*1000;
        String mmsg = "インポート済みスタンプを削除しています...";
        String message = "スタンプ取り込み";
        Component c = frame;
       
        Task task = new Task<Boolean>(c, message, mmsg, maxEstimation) {
 
            @Override
            protected Boolean doInBackground() throws Exception {
                sdl.unsubscribeTrees(list);
                return sdl.isNoError();
            }
           
            @Override
            protected void succeeded(Boolean result) {
                if (result.booleanValue()) {
                    // スタンプボックスから削除する
                    stampBox.removeImportedTree(removeTree.getId());
                    // ブラウザ表示を変更する
                    removeTree.setImported(false);
                    browseTable.getTableModel().fireTableDataChanged();

                } else {
                    JOptionPane.showMessageDialog(frame,
                            sdl.getErrorMessage(),
View Full Code Here

       
        //
        // 公開用StampTreeModelを生成し値をコピーする
        // 公開Treeのid=個人用TreeのId
        //
        PublishedTreeModel publishedModel = new PublishedTreeModel();
        publishedModel.setId(model.getId());
        publishedModel.setUser(model.getUser());
        publishedModel.setName(model.getName());
        publishedModel.setPublishType(model.getPublishType());
        publishedModel.setCategory(model.getCategory());
        publishedModel.setPartyName(model.getPartyName());
        publishedModel.setUrl(model.getUrl());
        publishedModel.setDescription(model.getDescription());
        publishedModel.setPublishedDate(model.getPublishedDate());
        publishedModel.setLastUpdated(model.getLastUpdated());
        publishedModel.setTreeBytes(publishBytes);
       
        //
        // 公開Treeを保存する
        //
        em.persist(publishedModel);
View Full Code Here

        em.merge(model);
       
        //
        // 公開用Treeへコピーする
        //
        PublishedTreeModel publishedModel = new PublishedTreeModel();
        publishedModel.setId(model.getId());
        publishedModel.setUser(model.getUser());
        publishedModel.setName(model.getName());
        publishedModel.setPublishType(model.getPublishType());
        publishedModel.setCategory(model.getCategory());
        publishedModel.setPartyName(model.getPartyName());
        publishedModel.setUrl(model.getUrl());
        publishedModel.setDescription(model.getDescription());
        publishedModel.setPublishedDate(model.getPublishedDate());
        publishedModel.setLastUpdated(model.getLastUpdated());
        publishedModel.setTreeBytes(publishBytes);
       
        //
        // 公開Treeを更新する
        // 検索し値を設定するほうがいいのではないか?
        //
View Full Code Here

        em.merge(model);
       
        //
        // 公開Treeを削除する
        //
        PublishedTreeModel exist = (PublishedTreeModel) em.find(PublishedTreeModel.class, model.getId());
        em.remove(exist);
       
        return 1;
    }
View Full Code Here

            //
            // 公開Treeが削除されている場合
            // サブスクライブTreeも削除する
            //
            try {
                PublishedTreeModel published = (PublishedTreeModel) em.find(PublishedTreeModel.class, sm.getTreeId());
               
                if (published == null) {
                    //
                    // 公開Treeが削除されている場合
                    // サブスクライブリストレコードを削除する
View Full Code Here

       
        //
        // 公開用Treeモデルを生成し値をコピーする
        // 公開Treeのid=個人用TreeのId
        //
        PublishedTreeModel publishedModel = new PublishedTreeModel();
        publishedModel.setId(model.getId());
        publishedModel.setUser(model.getUser());
        publishedModel.setName(model.getName());
        publishedModel.setPublishType(model.getPublishType());
        publishedModel.setCategory(model.getCategory());
        publishedModel.setPartyName(model.getPartyName());
        publishedModel.setUrl(model.getUrl());
        publishedModel.setDescription(model.getDescription());
        publishedModel.setPublishedDate(model.getPublishedDate());
        publishedModel.setLastUpdated(model.getLastUpdated());
        publishedModel.setTreeBytes(publishBytes);
       
        //
        // 公開Treeを保存する
        //
        em.persist(publishedModel);
View Full Code Here

TOP

Related Classes of open.dolphin.infomodel.PublishedTreeModel

Copyright © 2018 www.massapicom. 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.