Package jp.co.nskint.uq.pd.signage.model

Examples of jp.co.nskint.uq.pd.signage.model.Manager


    public void update_error_TargetUserIsNotAdministrator() throws Exception {

        // ログインユーザが管理者以外の場合
        tester.request.getSession(true).setAttribute(
            AdminPage.SESS_KEY_LOGIN_USER,
            new Manager());

        tester.param("name", NAME);
        tester.param("mail", MAIL);

        Administrator admin = new Administrator();
View Full Code Here


        final String address = "架空の住所";
        Transaction tx = Datastore.beginTransaction();
        User user = service.put(tx, uid, name, mail, phone, zipcode, address);
        assertThat(user, is(notNullValue()));
        assertThat(user, instanceOf(Manager.class));
        Manager manager = (Manager)user;
        assertThat(manager.getName(), is(name));
        assertThat(manager.getMail().getEmail(), is(mail));
        assertThat(manager.getPhone().getNumber(), is(phone));
        assertThat(manager.getZipcode(), is(zipcode));
        assertThat(manager.getAddress().getAddress(), is(address));

        assertNotNull(user.getInitialKey());
        assertThat(user.getInitialKey(), not(""));

        Manager stored = Datastore.getOrNull(Manager.class, user.getUid());
        assertThat(stored, is(nullValue()));

        tx.commit();
        stored = Datastore.getOrNull(Manager.class, user.getUid());
        assertThat(stored, instanceOf(Manager.class));
        manager = (Manager)stored;
        assertThat(manager.getName(), is(name));
        assertThat(manager.getMail().getEmail(), is(mail));
        assertThat(manager.getPhone().getNumber(), is(phone));
        assertThat(manager.getZipcode(), is(zipcode));
        assertThat(manager.getAddress().getAddress(), is(address));
        assertThat(stored.getRegisteredDate(), is(stored.getUpdatedDate()));

    }
View Full Code Here

    public Navigation edit(@Var("uid") String uid) {
        putEnteringLog();
        try {
            User user = service.get(uid);
            if (roleCheck(user) && user instanceof Manager) {
                Manager manager = (Manager) user;
                request.setAttribute("uid", manager.getUid().getName());
                request.setAttribute("name", manager.getName());
                request.setAttribute("mail", manager.getMail());
                request.setAttribute("phone", manager.getPhone());
                request.setAttribute("zipcode", manager.getZipcode());
                request.setAttribute("address", manager.getAddress());
                request.setAttribute(
                    "title",
                    ApplicationMessage.get("title.manager.regist"));

                // 登録画面を表示
View Full Code Here

                .getManagerRef()
                .getModel()
                .equals(getLoginUser())) {
            if (user instanceof Manager) {
                // 代表者の場合は、付随する情報も削除する。
                Manager man = (Manager) user;


                    // レイアウト情報を削除
                    List<Layout> layouts =
                        man.getLayoutListRef().getModelList();
                    for (Layout layout : layouts) {
                        Datastore.delete(layout.getId());
                    }

                    List<TimeLine> timelines =
                        man.getTimelineRef().getModelList();
                    for (TimeLine timeline : timelines) {
                        // タイムライン情報を削除
                        Datastore.delete(timeline.getId());
                    }

                // 編集者情報を削除
                List<Editor> editors = man.getEditorListRef().getModelList();
                for (Iterator<Editor> iterator = editors.iterator(); iterator
                    .hasNext();) {
                    Editor editor = iterator.next();
                    Datastore.delete(editor.getUid());
                }
View Full Code Here

            if(mid == null || mid.isEmpty()) {
                errors.put("page", "マネージャIDが指定されていません。");
                return forward("/error.jsp");
            }

            Manager manager = (Manager)mService.get(mid);

            if(manager == null) {
                errors.put("page", "指定されたマネージャは存在しません。");
                return forward("/error.jsp");
            }

            List<TimeLine> timelineList = manager.getTimelineRef().getModelList();

            List<Layout> layoutList = manager.getLayoutListRef().getModelList();

            request.setAttribute("timelineList", timelineList);
            request.setAttribute("manager", manager);
            request.setAttribute("layoutList", layoutList);
View Full Code Here

                Thread.currentThread().getStackTrace()[1].getMethodName();
        logger.entering(this.getClass().getName(), methodName);

        logger.fine("add " + name);

        Manager manager = (Manager) mService.get(mid);
        if (manager == null) {
            errors.put("page", "指定されたマネージャは存在しません。");
            return forward("/error.jsp");
        }
View Full Code Here

        final String methodName =
            Thread.currentThread().getStackTrace()[1].getMethodName();
        logger.entering(this.getClass().getName(), methodName);

        try {
            Manager manager = (Manager)mService.get(mid);
            if(manager == null) {
                errors.put("page", "指定されたマネージャは存在しません。");
                return forward("/error.jsp");
            }

            TimeLine timeline = tlService.get(tlid);
            if(timeline == null) {
                errors.put("page", "指定されたタイムラインは存在しません。");
                return forward("/error.jsp");
            }

            // タイムラインXML情報を取得
            TimeLineXml timelineXml = timeline.getXmlModel();

            List<Layout> layoutList = manager.getLayoutListRef().getModelList();
            this.request.setAttribute("layoutList", layoutList);

//            String defaultLayoutId = timeline.getLayoutId();
//            this.request.setAttribute("defaultLayoutId", defaultLayoutId);
View Full Code Here

        final String methodName =
            Thread.currentThread().getStackTrace()[1].getMethodName();
        logger.entering(this.getClass().getName(), methodName);

        try {
            Manager manager = (Manager)mService.get(mid);
            if(manager == null) {
                errors.put("page", "指定されたマネージャは存在しません。");
                return forward("/error.jsp");
            }
View Full Code Here

        final String methodName =
            Thread.currentThread().getStackTrace()[1].getMethodName();
        logger.entering(this.getClass().getName(), methodName);

        try {
            Manager manager = (Manager)mService.get(mid);
            if(manager == null) {
                errors.put("page", "指定されたマネージャは存在しません。");
                return forward("/error.jsp");
            }
View Full Code Here

    public void menu() throws Exception {

        // ログインユーザが代表者である場合
        tester.request.getSession(true).setAttribute(
            FrontPage.SESS_KEY_LOGIN_USER,
            new Manager());
        tester.start("/menu");
        assertThat(tester.getPage(), is(instanceOf(FrontPage.class)));
        assertThat(tester.getActionMethodName(), is("menu"));
        assertThat(tester.isRedirect(), is(true));
        assertThat(tester.getDestinationPath(), is("/board/"));
View Full Code Here

TOP

Related Classes of jp.co.nskint.uq.pd.signage.model.Manager

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.